mirror of
https://github.com/lilydjwg/archrepo2.git
synced 2025-03-10 12:02:43 +00:00
pkgreader: better detection of "nice packages"
This commit is contained in:
parent
059e0bb581
commit
2ef72fe1a9
1 changed files with 6 additions and 2 deletions
|
@ -18,10 +18,14 @@ def _add_to_dict(d, key, value):
|
||||||
|
|
||||||
def readpkg(file):
|
def readpkg(file):
|
||||||
tar = tarfile.open(file)
|
tar = tarfile.open(file)
|
||||||
info = tar.next()
|
for _ in range(3):
|
||||||
if not info or info.name != '.PKGINFO':
|
info = tar.next()
|
||||||
|
if info and info.name == '.PKGINFO':
|
||||||
|
break
|
||||||
|
else:
|
||||||
logger.warn('%s is not a nice package!', file)
|
logger.warn('%s is not a nice package!', file)
|
||||||
info = '.PKGINFO' # have to look further
|
info = '.PKGINFO' # have to look further
|
||||||
|
|
||||||
f = tar.extractfile(info)
|
f = tar.extractfile(info)
|
||||||
data = f.read().decode()
|
data = f.read().decode()
|
||||||
tar.close()
|
tar.close()
|
||||||
|
|
Loading…
Add table
Reference in a new issue