summaryrefslogtreecommitdiffstats
path: root/linhes/linhes-dev/mp.py
diff options
context:
space:
mode:
Diffstat (limited to 'linhes/linhes-dev/mp.py')
-rwxr-xr-xlinhes/linhes-dev/mp.py73
1 files changed, 6 insertions, 67 deletions
diff --git a/linhes/linhes-dev/mp.py b/linhes/linhes-dev/mp.py
index b1bdfa7..25f7cc0 100755
--- a/linhes/linhes-dev/mp.py
+++ b/linhes/linhes-dev/mp.py
@@ -41,13 +41,12 @@ def commandline(makepkg_cmd):
clparser.add_option("-b", "--bump", action="store_true", default=False, help="Increase package release one unit.")
clparser.add_option("--pkglist", action="store", help="List of packages to compile")
clparser.add_option("--config", action="store", help="Use an alternate config file instead of the /etc/makepkg.conf default.")
- clparser.add_option("-g", "--geninteg", action="store_true", default=False, help="For each source file in the source array of PKGBUILD, download the file if required and generate integrity checks.")
clparser.add_option("--rmold", action="store_true", default=False, help="BETA: Remove old src and software packages from repos. Use with caution. False positives may occur (i.e. nvidia pkgs)!")
(options, args) = clparser.parse_args()
options1 = ['config', 'pkglist']
- options2 = ['bump', 'geninteg', 'rmold']
+ options2 = ['bump', 'rmold']
for o in options1:
cmd1 = eval('options.'+o)
@@ -74,10 +73,6 @@ def commandline(makepkg_cmd):
# Remove rmold option from makepkg command if it exists
if "--rmold" in makepkg_cmd:
makepkg_cmd.remove("--rmold")
- # Remove "--geninteg" option (if it exists) from makepkg command.
- # Checking for *sums is done automaticly by mp.py
- if "--geninteg" in makepkg_cmd:
- makepkg_cmd.remove("--geninteg")
#print("Makepkg Command:",makepkg_cmd)
return makepkg_cmd, cli_list, cli_dict
@@ -135,7 +130,6 @@ class Packagefile(object):
self.SRCPKG = self.pkgbase + "-" + self.epoch + self.pkgver + "-" + self.pkgrel + ".src.tar.gz"
else:
self.SRCPKG = self.pkglist[0] + "-" + self.epoch + self.pkgver + "-" + self.pkgrel + ".src.tar.gz"
- #print "Changed " + self.pkgname + " release to " + str(self.pkgrel)
def updateINIT(self):
@@ -310,64 +304,12 @@ class Packagefile(object):
self.set_srcpkg()
self.pkgrel_incremented = True
- def clearSUMS(self):
- print(" Clearing out old checksums...")
- filename=self.pkgfile
- file_contents=[]
- f = open(filename,"r")
- lineIter= iter(f)
- for aLine in lineIter:
- if (aLine.strip().startswith("md5sums") or aLine.strip().startswith("sha1sums") or
- aLine.strip().startswith("sha256sums") or aLine.strip().startswith("sha224sums") or
- aLine.strip().startswith("sha384sums") or aLine.strip().startswith("sha512sums") or
- aLine.strip().startswith("b2sums") or aLine.strip().startswith("cksums")):
- if aLine.strip().endswith(")"):
- continue
- else:
- for aModule in lineIter:
- if aModule.strip().endswith(")"):
- break
- else:
- file_contents.append(aLine)
- f.close()
- try:
- f = open(filename,"w")
- except:
- outtext="Couldn't open file for writing: %s" %filename
- print(outtext)
- return False
- for line in file_contents:
- f.write(line)
- f.close()
-
def updateSUMS(self):
- print("- Checking checksums...")
- if "--geninteg" in self.cli_list:
- self.clearSUMS()
-
- sums = []
- pkgfile_contents=[]
-
- # Open pkgfile for reading
- f = open(self.pkgfile, 'r')
- pkgfile_contents = f.readlines()
- f.close()
-
- # Iterate through the lines looking for a match pattern
- for line in pkgfile_contents:
- check = re.compile('cksums|sha1sums|sha224sums|sha256sums|sha384sums|sha512sums|md5sums|b2sums')
- sums = check.match(line)
- if sums:
- print(" Found checksums in PKGBUILD")
- break
- if not sums:
- print(" Adding checksums...")
- # If no matches are found, append md5sums to the end of the pkgfile
- p = open(self.pkgfile, 'a')
- sumsgen = subprocess.Popen(["makepkg", "-g"], stdout = subprocess.PIPE,).communicate()[0]
- sumsgen = sumsgen.decode('utf-8')
- p.writelines(sumsgen)
- p.close()
+ print("- Updating checksums...")
+ retcode = subprocess.call(["updpkgsums"])
+ if retcode != 0:
+ self.compile_status = "Failed: %s" %retcode
+ self.failure = self.failure + 1
def make_package(self):
#creates both binary and source package
@@ -390,9 +332,6 @@ class Packagefile(object):
shutil.move(self.pkgfile + '.old', self.pkgfile)
print(" Reverted pkgrel increment.")
return False
- elif "--nobuild" in self.makepkg_cmd:
- self.compile_status = "Failed: nobuild"
- return False
else:
print("-------------Making source package-------------")
retcode = subprocess.call(["makepkg", "--force", "--holdver", "--source"])