Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
"RPG is tool, that guides people through"
"the creation of a RPM package. RPG makes packaging much easier"
"due to the automatic analysis of packaged files. Beginners can"
"get familiar with packaging process or the advanced users can"
"use our tool for a quick creation of a package.")
self.base.spec.URL = "https://github.com/rh-lab-q/rpg"
self.base.target_arch = "x86_64"
self.base.target_distro = "fedora-22"
self.base.spec.Requires.update(['makedepend', 'mock'])
self.base.spec.BuildRequires.update(['makedepend',
'mock',
'python3-nose'])
self.base.fetch_repos(self.base.target_distro, self.base.target_arch)
self.base.run_extracted_source_analysis()
self.base.run_patched_source_analysis()
self.base.spec.check = Command(["make test-unit"])
self.base.build_project()
self.base.run_compiled_source_analysis()
self.base.install_project()
self.base.run_installed_source_analysis()
self.base.build_srpm()
self.assertTrue(self.base.srpm_path.exists())
self.base.build_rpm_recover(
self.base.target_distro, self.base.target_arch)
self.assertTrue(self.base.rpm_path)
def md5Tar(self, t):
mdsum = Command(
"tar --list -f " + path_to_str(t) + " 2>/dev/null | "
"awk -F/ '{ if($NF != \"\") print $NF }' | "
r'sed -e "s/.*\///gm" | sort | md5sum'
).execute()
self.assertNotEqual(self.FNF_MD5, mdsum)
return mdsum
def test_new_line(self):
cmd = Command("a\nb\n")
self.assertEqual("a\nb", str(cmd))
def build_srpm(spec_file, tarball, output_dir):
""" Builds source rpm from spec and tarball and moves it to the
output directory """
Command("rpmdev-setuptree").execute()
Command("cp " + path_to_str(tarball) +
' $(rpm --eval "%{_topdir}")/SOURCES').execute()
output = Command("rpmbuild -bs " + path_to_str(spec_file)).execute()
Command("mv " + path_to_str(output.split()[-1]) +
" " + path_to_str(output_dir)).execute()
def validatePage(self):
self.base.spec.install = Command(self.installEdit.toPlainText())
self.base.spec.pretrans = Command(self.pretransEdit.toPlainText())
self.base.spec.pre = Command(self.preEdit.toPlainText())
self.base.spec.post = Command(self.postEdit.toPlainText())
self.base.install_project()
self.base.run_installed_source_analysis()
return True
self.package = "" #: initial value: ""
self.description = "" #: initial value: ""
self.BuildRequires = set() #: initial value: set()
self.Requires = set() #: initial value: set()
self.Provides = set() #: initial value: set()
self.files = set() #: initial value: []
self.changelog = [] #: initial value: []
self.prep = Command() #: initial value: Command()
self.build = Command() #: initial value: Command()
self.pre = Command() #: initial value: Command()
self.install = Command() #: initial value: Command()
self.check = Command() #: initial value: Command()
self.post = Command() #: initial value: Command()
self.preun = Command() #: initial value: Command()
self.postun = Command() #: initial value: Command()
self.pretrans = Command() #: initial value: Command()
self.posttrans = Command() #: initial value: Command()
self.clean = Command() #: initial value: Command()
# list of generated translation files
self.files_translations = []
# (Build)Required file list that will be traslated into packages
self.build_required_files = set()
self.required_files = set()
self.Vendor = "" #: initial value: ""
self.Packager = "" #: initial value: ""
self.package = "" #: initial value: ""
self.description = "" #: initial value: ""
self.BuildRequires = set() #: initial value: set()
self.Requires = set() #: initial value: set()
self.Provides = set() #: initial value: set()
self.files = set() #: initial value: []
self.changelog = [] #: initial value: []
self.prep = Command() #: initial value: Command()
self.build = Command() #: initial value: Command()
self.pre = Command() #: initial value: Command()
self.install = Command() #: initial value: Command()
self.check = Command() #: initial value: Command()
self.post = Command() #: initial value: Command()
self.preun = Command() #: initial value: Command()
self.postun = Command() #: initial value: Command()
self.pretrans = Command() #: initial value: Command()
self.posttrans = Command() #: initial value: Command()
self.clean = Command() #: initial value: Command()
# list of generated translation files
self.files_translations = []
# (Build)Required file list that will be traslated into packages
self.build_required_files = set()
self.required_files = set()
def validatePage(self):
self.base.spec.postun = Command(self.postunEdit.toPlainText())
self.base.spec.preun = Command(self.preunEdit.toPlainText())
self.base.spec.posttrans = Command(self.posttransEdit.toPlainText())
self.base.write_spec()
return True
self.Obsoletes = "" #: initial value: ""
self.Conflicts = "" #: initial value: ""
self.Vendor = "" #: initial value: ""
self.Packager = "" #: initial value: ""
self.package = "" #: initial value: ""
self.description = "" #: initial value: ""
self.BuildRequires = set() #: initial value: set()
self.Requires = set() #: initial value: set()
self.Provides = set() #: initial value: set()
self.files = set() #: initial value: []
self.changelog = [] #: initial value: []
self.prep = Command() #: initial value: Command()
self.build = Command() #: initial value: Command()
self.pre = Command() #: initial value: Command()
self.install = Command() #: initial value: Command()
self.check = Command() #: initial value: Command()
self.post = Command() #: initial value: Command()
self.preun = Command() #: initial value: Command()
self.postun = Command() #: initial value: Command()
self.pretrans = Command() #: initial value: Command()
self.posttrans = Command() #: initial value: Command()
self.clean = Command() #: initial value: Command()
# list of generated translation files
self.files_translations = []
# (Build)Required file list that will be traslated into packages
self.build_required_files = set()
self.required_files = set()