[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kde-build-metadata] tools: tools: Allow user to force list_dependencies to believe their spelling.
From:       Michael Pyne <null () kde ! org>
Date:       2017-07-01 2:20:15
Message-ID: E1dR819-0001sV-5c () code ! kde ! org
[Download RAW message or body]

Git commit 476a10df03ee883b9ba614ee3637da9742f138c6 by Michael Pyne.
Committed on 01/07/2017 at 01:41.
Pushed by mpyne into branch 'master'.

tools: Allow user to force list_dependencies to believe their spelling.

The current behavior of checking that a module exists was meant to be
helpful by catching misspellings, but the check is naive and doesn't use
logical-module-structure, so some modules without direct dependencies of
their own (because they only depend on ECM, for instance) can't be
handled by this tool.

M  +8    -2    tools/list_dependencies

https://commits.kde.org/kde-build-metadata/476a10df03ee883b9ba614ee3637da9742f138c6

diff --git a/tools/list_dependencies b/tools/list_dependencies
index d524cc8..d63bc4d 100755
--- a/tools/list_dependencies
+++ b/tools/list_dependencies
@@ -293,7 +293,7 @@ class KDEDependencies:
     def allModules(self):
         return self.dependencies.keys()
 
-def addPathIfMissing(deps, modules):
+def addPathIfMissing(deps, modules, ignore_missing=False):
     good = []
     bad = []
     for m in modules:
@@ -308,6 +308,10 @@ def addPathIfMissing(deps, modules):
                     break
             if not found:
                 bad.append(m)
+        elif ignore_missing:
+            # Some modules may be logically present without any directly-listed
+            # dependencies, so we can't always assume this is an error.
+            good.append(m)
         else:
             bad.append(m)
 
@@ -335,6 +339,8 @@ if __name__ == '__main__':
     arg_parser.add_argument("-m", "--metadata-path",
             default="../",
             help="Path to kde-build-metadata *directory*")
+    arg_parser.add_argument("-f", "--assume-present", action='store_true',
+            help="If set, assume all input modules are present, and list implicit dependencies")
     arg_parser.add_argument("-v", "--version",
             action='version', version=('%(prog)s ' + str(version)))
     args = arg_parser.parse_args()
@@ -342,7 +348,7 @@ if __name__ == '__main__':
     deps = KDEDependencies("%s/dependency-data-%s" % (args.metadata_path, args.branch_group))
     deps.setShowDirectOnly(args.direct_dependencies)
 
-    (modules, mistake_modules) = addPathIfMissing(deps, args.module_path)
+    (modules, mistake_modules) = addPathIfMissing(deps, args.module_path, args.assume_present)
     if len(mistake_modules) > 0:
         print "Error: Couldn't find the following modules:"
         for module in mistake_modules:

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic