Commit 72eba0ca authored by Olivier Stasse's avatar Olivier Stasse
Browse files

[robotpkg_helpers] Find SYSTEM_PKG for Ubuntu and Debian.

parent 16011bcc
......@@ -85,11 +85,11 @@ class RobotpkgGenerateDockerFile:
self.dict_os_pkgs.append(pkg_name)
else:
print("\n**********************\nFound pkg " + pkg_name + " in robotpkg")
self.robotpkg_src_intro.package_dict[pkg_name].read_makefile()
self.robotpkg_src_intro.package_dict[pkg_name].read_package_info()
if len(self.robotpkg_src_intro.package_dict[pkg_name].master_repository)==0 :
print("\n The package does not have a master repository")
print("The package does not have a master repository")
if not len(self.robotpkg_src_intro.package_dict[pkg_name].version)==0 :
print("\n The package can only provide version :" + self.robotpkg_src_intro.package_dict[pkg_name].version[0])
print("The package can only provide version :" + self.robotpkg_src_intro.package_dict[pkg_name].version[0])
self.dict_robot_pkgs = new_dict_robot_pkgs
......@@ -122,7 +122,10 @@ class RobotpkgGenerateDockerFile:
with open(filename,"w") as f:
f.write("FROM ubuntu:16.04\n")
f.write("RUN apt-get update\n")
f.write("RUN apt-get install -y python3 git g++ make\n")
f.write("RUN apt-get install -y python3 git g++ make bzip2 libbz2-dev ccache zlib1g zlib1g-dev libssl-dev libncurses-dev pax tar\n")
f.write("RUN apt-get install -y assimp-utils libassimp-dev libboost-dev libboost-date-time-dev libboost-filesystem-dev\n")
f.write("RUN apt-get install -y libboost-system-dev libboost-thread-dev cmake\n")
f.write("RUN apt-get install -y libeigen3-dev pkg-config apt-utils\n")
for an_os_pkg in self.dict_os_pkgs:
f.write('RUN apt-get install -y '+an_os_pkg+'\n')
f.write("RUN mkdir -p /workdir\n")
......
......@@ -16,7 +16,7 @@ class RobotpkgPackage:
def analyze_makefile(self,make_content):
""" Parse the content of a CMakeLists.txt """
# Search for NAME
self.rpkg_name = re.findall("PKGNAME\s*=\s*([azA-Z-]+)",make_content)
self.rpkg_name = re.findall("PKGNAME\s*=\s*([0-9azA-Z-]+)",make_content)
print("analyze_makefile for " + self.name)
if not len(self.rpkg_name)==0 :
print("analyze_makefile: " + self.rpkg_name[0])
......@@ -41,8 +41,12 @@ class RobotpkgPackage:
if not len(self.version)==0:
print("analyze_makefile version: " + self.version[0])
# Search for include
self.includes_depend = re.findall("include\s*../../([0-9a-zA-Z-]+)/([0-9a-zA-Z-]+)/depend.mk",make_content)
# Search for mk
self.includes_mk = re.findall("include\s*../../mk/([0-9a-zA-Z-]+)/([0-9a-zA-Z-]+).mk",make_content)
def read_makefile(self):
# Keep current directory.
current_path=os.getcwd()
......@@ -55,3 +59,29 @@ class RobotpkgPackage:
# Going back to where we were
os.chdir(current_path)
def analyze_depend_mk(self,depend_mk_content):
# Search for SYSTEM_PKG
self.depend_mk_system_pkg = re.findall("SYSTEM_PKG\.Ubuntu\.([0-9a-zA-Z\-]+)\s*=([0-9a-zA-Z\-]+)",depend_mk_content)
if len(self.depend_mk_system_pkg)==0:
self.depend_mk_system_pkg = re.findall("SYSTEM_PKG\.Debian\.([0-9a-zA-Z\-]+)\s*=\s*([0-9a-zA-Z\-]+)",depend_mk_content)
print(self.depend_mk_system_pkg)
def read_depend_mk(self):
# Keep current directory.
current_path=os.getcwd()
# Reading Makefile
os.chdir(self.path)
with open("depend.mk","r") as f_depend_mk:
depend_mk_content = f_depend_mk.read()
self.analyze_depend_mk(depend_mk_content)
# Going back to where we were
os.chdir(current_path)
def read_package_info(self):
self.read_makefile()
self.read_depend_mk()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment