summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Wilcox <AWilcox@Wilcox-Tech.com>2016-04-24 19:48:31 -0500
committerAndrew Wilcox <AWilcox@Wilcox-Tech.com>2016-04-24 19:48:31 -0500
commit6b90744431dd4db48dceed09e7423d9938ec6e27 (patch)
tree264d686ce206bc7ce599ca01d822d8936e41f014
parentce8b474ab715746dd1ae9b56bfd808ec8f7420fb (diff)
downloadapkkit-6b90744431dd4db48dceed09e7423d9938ec6e27.tar.gz
apkkit-6b90744431dd4db48dceed09e7423d9938ec6e27.tar.bz2
apkkit-6b90744431dd4db48dceed09e7423d9938ec6e27.tar.xz
apkkit-6b90744431dd4db48dceed09e7423d9938ec6e27.zip
APKFile: More reliably determine if any files are present
-rw-r--r--apkkit/io/apkfile.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/apkkit/io/apkfile.py b/apkkit/io/apkfile.py
index 34aad2d..7076927 100644
--- a/apkkit/io/apkfile.py
+++ b/apkkit/io/apkfile.py
@@ -204,10 +204,14 @@ def _make_data_tgz(datadir, mode, package, my_filter=None):
format=tarfile.PAX_FORMAT) as data:
for item in glob.glob(datadir + '/*'):
data.add(item, arcname=os.path.basename(item), filter=my_filter)
+ members = [member for member in data.getmembers()
+ if member.isfile()]
- package.size = fdfile.tell()
- if package.size <= 10240:
+ if len(members) == 0:
return None
+
+ fdfile.seek(0, 2)
+ package.size = fdfile.tell()
LOGGER.info('Hashing data.tar [pass 1]...')
fdfile.seek(0)
abuild_pipe = Popen(['abuild-tar', '--hash'], stdin=fdfile,