tupkgupdate resource usage improvements

now gets binary package name/ver/rel from filename, rather than untarring
This commit is contained in:
simo 2005-12-31 05:54:11 +00:00
parent 4e74ee9adf
commit f47b09de42

View file

@ -212,8 +212,12 @@ def areFilesIdentical(file_a, file_b):
############################################################ ############################################################
def infoFromPackageFile(filename): def infoFromPackageFile(filename):
pkg = pacman.load(filename) pkg = os.path.basename(filename)
return pkg.name, pkg.version + "-" + pkg.release m = re.compile("(?P<pkgname>.*)-(?P<pkgver>.*)-(?P<pkgrel>.*).pkg.tar.gz").search(pkg)
if not m:
raise Exception("Non-standard filename")
else:
return m.group('pkgname'), m.group('pkgver') + "-" + m.group('pkgrel')
def infoFromPkgbuildFile(filename): def infoFromPkgbuildFile(filename):
# first grab the category based on the file path # first grab the category based on the file path