Browse code

Fixed the SpecDeps options that diplay dependency tree on console.

Harish Udaiya Kumar authored on 2015/08/18 07:22:10
Showing 2 changed files
... ...
@@ -108,7 +108,7 @@ class SerializedSpecObjects(object):
108 108
 			if (packageFound == True):
109 109
 				self.findTotalRequires(allDeps, depQue, parent, displayOption)
110 110
 			else:
111
-				print "No spec file builds a package named",pkgName
111
+				print "No spec file builds a package named",inputValue
112 112
   	  			return
113 113
 		elif (inputType == "json"):
114 114
 			filePath = self.inputDataDir +"/"+ inputValue
... ...
@@ -41,18 +41,17 @@ def main():
41 41
 	dir_name = os.path.dirname(abs_path)
42 42
 	os.chdir(dir_name)
43 43
 	
44
-	if(options.input_type == "pkg" or options.input_type == "who-needs"):
44
+	if(options.input_type == "pkg" or options.input_type == "who-needs"): # To display/print package dependencies on console
45 45
 		targetName = options.pkg
46
+		specDeps.readSpecsAndConvertToSerializableObjects(options.spec_dir, options.input_type, targetName, displayOption)
46 47
 	elif(options.input_type == "json"):
47
-		targetName = options.json_file
48
-
49
-	 # Generate the package dependencies based on package_list_file
50
-	json_wrapper_option_list = JsonWrapper(options.json_file)
51
-	option_list_json = json_wrapper_option_list.read()
52
-	options_sorted = option_list_json.items()
53
-	for install_option in options_sorted:
54
-		if install_option[1]["file"] != "iso":
55
-			specDeps.readSpecsAndConvertToSerializableObjects(options.spec_dir, options.input_type, install_option[1]["file"], displayOption)
48
+		 # Generate the expanded package dependencies json file based on package_list_file 
49
+		json_wrapper_option_list = JsonWrapper(options.json_file)
50
+		option_list_json = json_wrapper_option_list.read()
51
+		options_sorted = option_list_json.items()
52
+		for install_option in options_sorted:
53
+			if install_option[1]["file"] != "iso":
54
+				specDeps.readSpecsAndConvertToSerializableObjects(options.spec_dir, options.input_type, install_option[1]["file"], displayOption)
56 55
 	
57 56
 	sys.exit(0)
58 57