for section in script_sections:
code = ""
# If %section is a one line script such as: "%post -p /sbin/ldconfig"
- if "-p" in section:
+ if " -p " in section:
# Remove the package name if present to only keep the command
- section_split = section.split("-p")[1].split("-n")
+ section_split = section.split(" -p ")[1].split(" -n ")
code = " " + section_split[0].strip()
else:
code = self.__create_script_file_section_code(section)
# Set the package name
package_name = "${PN}"
# If the package name is not the project name
- if "-n" in section:
+ if " -n " in section:
# Remove the command if any to only keep the package name
- section_split = section.split("-n")[1].split("-p")
+ section_split = section.split(" -n ")[1].split(" -p ")
package_name = section_split[0].strip()
self.__create_script_file_write(file_d, code, script_name, package_name)