res_file_list.append( section_key )
return res_file_list
- #pkg_preinst, pkg_postinst, pkg_prerm, and pkg_postrm
- #self.__post_flag = "%post"
- #self.__preun_flag = "%preun"
- #self.__postun_flag = "%postun"
- #self.__pre_flag = "%pre"
-
- def get_script_section_key( self, __flag ):
+ def get_script_section_key(self, __flag):
'''
return the list of file section of the spec file.
'''
def __create_script_file_section( self, spec_section):
'''
Returns the command executed in one of the %pre, %post, %preun
- or %postun section of a spec file with the necessary Yocto
- prefix "${D}".
+ or %postun section of a spec file.
'''
-
code = self.__spec_parser.get_script_section_key(spec_section)
command_list = code.split("\n")
formated_code = ""
for line in command_list:
if line != "":
formated_code += " " + line + "\n"
- formated_code = formated_code.replace(" /usr", " ${D}/usr")
- formated_code = formated_code.replace(" /bin", " ${D}/bin")
- formated_code = formated_code.replace(" /lib", " ${D}/lib")
- formated_code = formated_code.replace(" /sbin", " ${D}/sbin")
return formated_code
'''
Writes the pre/post (un)install sections of the recipe.
'''
-
file_d.write("%s() {\n" % recipe_section)
file_d.write(" #!/bin/sh -e\n")
file_d.write("%s\n" % code)
Add the pre/post install/uninstall sections of a spec file to
the recipe.
'''
-
- #pkg_preinst, pkg_postinst, pkg_prerm, and pkg_postrm
-
code = self.__create_script_file_section("%pre")
if code != "":
self.__create_script_file_write(file_d, code, "pkg_preinst_${PN}")