chiark / gitweb /
uncompress using `jar xf` in a folder with the same name
authorHans-Christoph Steiner <hans@eds.org>
Wed, 7 Jan 2015 18:56:55 +0000 (19:56 +0100)
committerHans-Christoph Steiner <hans@eds.org>
Mon, 12 Jan 2015 09:46:04 +0000 (10:46 +0100)
This makes it easier to compare the whole APK folders when there are
multiple methods of uncompressing the APK.

fdroidserver/common.py

index a7b380fbc6cfe3eb94e512e17473b19a774804d4..c8ed3756da34d7eb6530804be5127fe491d40211 100644 (file)
@@ -1886,14 +1886,15 @@ def compare_apks(apk1, apk2, tmp_dir):
         if os.path.exists(d):
             shutil.rmtree(d)
         os.mkdir(d)
+        os.mkdir(os.path.join(d, 'jar-xf'))
 
     if subprocess.call(['jar', 'xf',
                         os.path.abspath(apk1)],
-                       cwd=apk1dir) != 0:
+                       cwd=os.path.join(apk1dir, 'jar-xf')) != 0:
         return("Failed to unpack " + apk1)
     if subprocess.call(['jar', 'xf',
                         os.path.abspath(apk2)],
-                       cwd=apk2dir) != 0:
+                       cwd=os.path.join(apk2dir, 'jar-xf')) != 0:
         return("Failed to unpack " + apk2)
 
     p = FDroidPopen(['diff', '-r', apk1dir, apk2dir], output=False)