Adding version number to the package
in the remove list
Change-Id: I0ad197ba62ab9a9f08b49a7aa377003cf6315405
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/6499
Tested-by: gerrit-photon <photon-checkins@vmware.com>
Reviewed-by: Anish Swaminathan <anishs@vmware.com>
| ... | ... |
@@ -8,6 +8,7 @@ from jsonwrapper import JsonWrapper |
| 8 | 8 |
from menu import Menu |
| 9 | 9 |
from window import Window |
| 10 | 10 |
from actionresult import ActionResult |
| 11 |
+import re |
|
| 11 | 12 |
|
| 12 | 13 |
class PackageSelector(object): |
| 13 | 14 |
def __init__(self, maxy, maxx, install_config, options_file): |
| ... | ... |
@@ -41,7 +42,11 @@ class PackageSelector(object): |
| 41 | 41 |
|
| 42 | 42 |
if "remove" in install_option[1]: |
| 43 | 43 |
for package in install_option[1]["remove"]: |
| 44 |
- package_list.remove(package) |
|
| 44 |
+ regex = re.compile(r'^'+str(package)+'-[0-9]') |
|
| 45 |
+ pkgs = [x for x in package_list if regex.search(x)] |
|
| 46 |
+ for p in pkgs: |
|
| 47 |
+ pkg = p.encode('utf-8')
|
|
| 48 |
+ package_list.remove(pkg) |
|
| 45 | 49 |
|
| 46 | 50 |
break |
| 47 | 51 |
return package_list |