build_dep_ko=[]
for pkg in build_pkg:
if "KO" in build_pkg[pkg]:
- build_dep_ko.append(pkg)
+ build_dep_ko.append(pkg)
if build_dep_ko:
- # the product is not installed : display message and return error status
- msg="Please install them with %s before compiling salome" % check_cmd[0]
- print("\nmissing compile time dependencies : ")
- for md in build_dep_ko:
- print(md)
- print(msg)
- return False
- else:
- return True
+ # the product is not installed : display message and return error status
+ msg="Please install them with %s before compiling salome" % check_cmd[0]
+ print(build_pkg)
+ print("\nmissing compile time dependencies : ")
+ for md in build_dep_ko:
+ print(md)
+ print(msg)
+ return False
+ return True
install_dir = product_info.install_dir
if src.product.product_is_fixed(product_info):
if "rpm_dev" in additional_sysinfo:
for pkg in additional_sysinfo.rpm_dev:
build_dep[pkg]=src.system.check_system_pkg(check_cmd,pkg)
- if check_cmd[0]=="apt":
+ #if check_cmd[0]=="apt" or check_cmd[0]=="dpkg-query":
+ else:
if "apt" in sysinfo:
for pkg in sysinfo.apt:
runtime_dep[pkg]=src.system.check_system_pkg(check_cmd,pkg)
# 1- search for an installed package manager (rpm on rh, apt on db)
cmd_which_rpm=["which", "rpm"]
- cmd_which_apt=["which", "apt"]
+ # cmd_which_apt=["which", "apt"]
+ cmd_which_apt=["which", "dpkg-query"]
with open(os.devnull, 'w') as devnull:
# 1) we search for apt (debian based systems)
completed=SP.call(cmd_which_apt,stdout=devnull, stderr=SP.STDOUT)
if completed==0 and linux=="DB":
- cmd_is_package_installed=["apt", "list", "--installed"]
+ # cmd_is_package_installed=["apt", "list", "--installed"]
+ cmd_is_package_installed=["dpkg-query", "--no-pager", "-l"]
else:
# 2) if apt not found search for rpm (redhat)
completed=SP.call(cmd_which_rpm,stdout=devnull, stderr=SP.STDOUT) # only 3.8! ,capture_output=True)
except:
msg_status=src.printcolors.printcError("KO")
msg_status+=" (package is not installed!)\n"
+ elif check_cmd[0]=="dpkg-query":
+ # special treatment for dpkg-query
+ # some debian packages have version numbers in their name, we need to add a *
+ # also dpkg-query do not return status, we need to use grep
+ # and dpkg-query output is too messy for being used
+ cmd_is_package_installed[-1] = cmd_is_package_installed[-1] + "*" # we don't specify in pyconf the exact name because of version numbers
+ p=SP.Popen(cmd_is_package_installed, stdout=SP.PIPE, stderr=FNULL)
+ try:
+ output = SP.check_output(['grep', "^ii"], stdin=p.stdout)
+ msg_status=src.printcolors.printcSuccess("OK")
+ except SP.CalledProcessError:
+ msg_status=src.printcolors.printcError("KO")
+ msg_status+=" (package is not installed!)\n"
else:
p=SP.Popen(cmd_is_package_installed, stdout=SP.PIPE, stderr=FNULL)
output, err = p.communicate()