Browse code

build.py: Fix Utility print-upward-deps and who-needs

Change-Id: I431a19e6858213f9465aea637837d4f056b407b6
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/11627
Reviewed-by: Ankit Jain <ankitja@vmware.com>
Tested-by: Anish Swaminathan <anishs@vmware.com>

Piyush Gupta authored on 2020/11/02 16:28:07
Showing 1 changed files
... ...
@@ -204,11 +204,12 @@ class Utilities:
204 204
         if not os.path.isdir(Build_Config.generatedDataPath):
205 205
             cmdUtils.runCommandInShell("mkdir -p " + Build_Config.generatedDataPath)
206 206
 
207
-        if configdict["targetName"] in ["pkgtree", "who-needs", "print-upward-deps"] and "pkg" not in os.environ:
208
-            raise Exception("pkg not present in os.environ")
209
-        elif configdict["targetName"] in ["pkgtree", "who-needs", "print-upward-deps"]:
210
-            self.pkg = os.environ["pkg"]
211
-            self.display_option = "tree"
207
+        if configdict["targetName"] in ["pkgtree", "who_needs", "print_upward_deps"]:
208
+            if "pkg" not in os.environ:
209
+                raise Exception("Please provide environment variable pkg as make <target> pkg=<pkg-name>")
210
+            else:
211
+                self.pkg = os.environ["pkg"]
212
+                self.display_option = "tree"
212 213
 
213 214
         if configdict["targetName"] == "imgtree" and "img" not in os.environ:
214 215
             raise Exception("img not present in os.environ")