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):
|
||||
tar = tarfile.open(file)
|
||||
info = tar.next()
|
||||
if not info or info.name != '.PKGINFO':
|
||||
for _ in range(3):
|
||||
info = tar.next()
|
||||
if info and info.name == '.PKGINFO':
|
||||
break
|
||||
else:
|
||||
logger.warn('%s is not a nice package!', file)
|
||||
info = '.PKGINFO' # have to look further
|
||||
|
||||
f = tar.extractfile(info)
|
||||
data = f.read().decode()
|
||||
tar.close()
|
||||
|
|
Loading…
Add table
Reference in a new issue