From b7c82adb5afd3791eda59133df205f47c1213d33 Mon Sep 17 00:00:00 2001 From: James Meyer Date: Sun, 31 Jul 2011 10:01:55 -0500 Subject: mp.py: add the ability to account for epoch tag in PKGBUILD --- build_tools/bin/mp.py | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/build_tools/bin/mp.py b/build_tools/bin/mp.py index 7744450..0d7f98d 100755 --- a/build_tools/bin/mp.py +++ b/build_tools/bin/mp.py @@ -17,7 +17,7 @@ PKGHOME = "/data/pkg_repo/packages" SRCPKGHOME = "/data/pkg_repo/src_packages" mydir = os.getcwd() repolist = ['core', 'extra'] -variables = ['pkgbase','pkgname','pkgver','pkgrel','arch'] +variables = ['pkgbase','pkgname','pkgver','pkgrel','arch','epoch'] cli_dict = {} cli_list = [] makepkg_cmd = ['makepkg'] @@ -29,6 +29,7 @@ pkgbase = "" pkgname = "" pkgver = "" pkgrel = "" +epoch = "" arch = "" CARCH = "" PKGDEST = "" @@ -228,9 +229,10 @@ def update_repo(): for i in pkglist: print "Package name:",i + + GZPKG = i + "-" + epoch + pkgver + "-" + pkgrel + "-" + CARCH + ".pkg.tar.gz" + XZPKG = i + "-" + epoch + pkgver + "-" + pkgrel + "-" + CARCH + ".pkg.tar.xz" - GZPKG = i + "-" + pkgver + "-" + pkgrel + "-" + CARCH + ".pkg.tar.gz" - XZPKG = i + "-" + pkgver + "-" + pkgrel + "-" + CARCH + ".pkg.tar.xz" if os.path.isfile(PKGDEST + "/" + XZPKG): TOTALPKG = XZPKG elif os.path.isfile(PKGDEST + "/" + GZPKG): @@ -354,6 +356,7 @@ def config_file(): global pkglist global pkgver global pkgrel + global epoch global arch global SRCPKG global CARCH @@ -376,6 +379,7 @@ def config_file(): for item in variables: v = subprocess.Popen(['/bin/bash','-c', 'source ' + pkgfile + '; echo ${' + item + '[@]}'], stdout = subprocess.PIPE,) value = v.communicate()[0].strip('\n') + if item == "pkgbase": pkgbase = value print "pkgbase:",pkgbase @@ -390,14 +394,19 @@ def config_file(): elif item == "pkgrel": pkgrel = value print "pkgrel:",pkgrel + elif item == "epoch": + if value: + epoch = "%s:" %value + print "epoch" , epoch elif item == "arch": arch = value print "arch:",arch + if pkgbase: - SRCPKG = pkgbase + "-" + pkgver + "-" + pkgrel + ".src.tar.gz" + SRCPKG = pkgbase + "-" + epoch + pkgver + "-" + pkgrel + ".src.tar.gz" else: - SRCPKG = pkgname + "-" + pkgver + "-" + pkgrel + ".src.tar.gz" + SRCPKG = pkgname + "-" + epoch + pkgver + "-" + pkgrel + ".src.tar.gz" print "Source package will be:",SRCPKG # Get needed makepkg.conf variables -- cgit v0.12