{
    "mode": "perldoc",
    "parameter": "Dpkg::Deps",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/Dpkg%3A%3ADeps/json",
    "generated": "2026-06-17T13:41:44Z",
    "sections": {
        "NAME": {
            "content": "Dpkg::Deps - parse and manipulate dependencies of Debian packages\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "The Dpkg::Deps module provides classes implementing various types of dependencies.\n\nThe most important function is depsparse(), it turns a dependency line in a set of\nDpkg::Deps::{Simple,AND,OR,Union} objects depending on the case.\n",
            "subsections": []
        },
        "FUNCTIONS": {
            "content": "All the deps* functions are exported by default.\n",
            "subsections": [
                {
                    "name": "deps_eval_implication",
                    "content": "($relp, $vp) and ($relq, $vq) express two dependencies as (relation, version). The\nrelation variable can have the following values that are exported by Dpkg::Version: RELEQ,\nRELLT, RELLE, RELGT, RELGT.\n\nThis functions returns 1 if the \"p\" dependency implies the \"q\" dependency. It returns 0 if\nthe \"p\" dependency implies that \"q\" is not satisfied. It returns undef when there's no\nimplication.\n\nThe $vp and $vq parameter should be Dpkg::Version objects.\n\n$dep = depsconcat(@deplist)\nThis function concatenates multiple dependency lines into a single line, joining them with\n\", \" if appropriate, and always returning a valid string.\n\n$dep = depsparse($line, %options)\nThis function parses the dependency line and returns an object, either a Dpkg::Deps::AND or\na Dpkg::Deps::Union. Various options can alter the behaviour of that function.\n\nusearch (defaults to 1)\nTake into account the architecture restriction part of the dependencies. Set to 0 to\ncompletely ignore that information.\n\nhostarch (defaults to the current architecture)\nDefine the host architecture. By default it uses Dpkg::Arch::gethostarch() to identify\nthe proper architecture.\n\nbuildarch (defaults to the current architecture)\nDefine the build architecture. By default it uses Dpkg::Arch::getbuildarch() to\nidentify the proper architecture.\n\nreducearch (defaults to 0)\nIf set to 1, ignore dependencies that do not concern the current host architecture. This\nimplicitly strips off the architecture restriction list so that the resulting\ndependencies are directly applicable to the current architecture.\n\nuseprofiles (defaults to 1)\nTake into account the profile restriction part of the dependencies. Set to 0 to\ncompletely ignore that information.\n\nbuildprofiles (defaults to no profile)\nDefine the active build profiles. By default no profile is defined.\n\nreduceprofiles (defaults to 0)\nIf set to 1, ignore dependencies that do not concern the current build profile. This\nimplicitly strips off the profile restriction formula so that the resulting dependencies\nare directly applicable to the current profiles.\n\nreducerestrictions (defaults to 0)\nIf set to 1, ignore dependencies that do not concern the current set of restrictions.\nThis implicitly strips off any architecture restriction list or restriction formula so\nthat the resulting dependencies are directly applicable to the current restriction. This\ncurrently implies \"reducearch\" and \"reduceprofiles\", and overrides them if set.\n\nunion (defaults to 0)\nIf set to 1, returns a Dpkg::Deps::Union instead of a Dpkg::Deps::AND. Use this when\nparsing non-dependency fields like Conflicts.\n\nvirtual (defaults to 0)\nIf set to 1, allow only virtual package version relations, that is none, or “=”. This\nshould be set whenever working with Provides fields.\n\nbuilddep (defaults to 0)\nIf set to 1, allow build-dep only arch qualifiers, that is “:native”. This should be set\nwhenever working with build-deps.\n\ntestsdep (defaults to 0)\nIf set to 1, allow tests-specific package names in dependencies, that is \"@\" and\n\"@builddeps@\" (since dpkg 1.18.7). This should be set whenever working with dependency\nfields from debian/tests/control.\n\n$bool = depsiterate($deps, $callbackfunc)\nThis function visits all elements of the dependency object, calling the callback function\nfor each element.\n\nThe callback function is expected to return true when everything is fine, or false if\nsomething went wrong, in which case the iteration will stop.\n\nReturn the same value as the callback function.\n"
                },
                {
                    "name": "deps_compare",
                    "content": "Implements a comparison operator between two dependency objects. This function is mainly\nused to implement the sort() method.\n\nCLASSES - Dpkg::Deps::*\nThere are several kind of dependencies. A Dpkg::Deps::Simple dependency represents a single\ndependency statement (it relates to one package only). Dpkg::Deps::Multiple dependencies are\nbuilt on top of this class and combine several dependencies in different manners.\nDpkg::Deps::AND represents the logical \"AND\" between dependencies while Dpkg::Deps::OR\nrepresents the logical \"OR\". Dpkg::Deps::Multiple objects can contain Dpkg::Deps::Simple object\nas well as other Dpkg::Deps::Multiple objects.\n\nIn practice, the code is only meant to handle the realistic cases which, given Debian's\ndependencies structure, imply those restrictions: AND can contain Simple or OR objects, OR can\nonly contain Simple objects.\n\nDpkg::Deps::KnownFacts is a special class that is used while evaluating dependencies and while\ntrying to simplify them. It represents a set of installed packages along with the virtual\npackages that they might provide.\n"
                }
            ]
        },
        "CHANGES": {
            "content": "Version 1.07 (dpkg 1.20.0)\nNew option: Add virtual option to Dpkg::Deps::depsparse().\n\nVersion 1.06 (dpkg 1.18.7; module version bumped on dpkg 1.18.24)\nNew option: Add testsdep option to Dpkg::Deps::depsparse().\n\nVersion 1.05 (dpkg 1.17.14)\nNew function: Dpkg::Deps::depsiterate().\n\nVersion 1.04 (dpkg 1.17.10)\nNew options: Add useprofiles, buildprofiles, reduceprofiles and reducerestrictions to\nDpkg::Deps::depsparse().\n\nVersion 1.03 (dpkg 1.17.0)\nNew option: Add buildarch option to Dpkg::Deps::depsparse().\n\nVersion 1.02 (dpkg 1.17.0)\nNew function: Dpkg::Deps::depsconcat()\n\nVersion 1.01 (dpkg 1.16.1)\n<Used to document changes to Dpkg::Deps::* modules before they were split.>\n\nVersion 1.00 (dpkg 1.15.6)\nMark the module as public.\n",
            "subsections": []
        }
    },
    "summary": "Dpkg::Deps - parse and manipulate dependencies of Debian packages",
    "flags": [],
    "examples": [],
    "see_also": []
}