chiark / gitweb /
Also glob the 'rm' field
authorDaniel Martí <mvdan@mvdan.cc>
Tue, 15 Apr 2014 21:58:12 +0000 (23:58 +0200)
committerDaniel Martí <mvdan@mvdan.cc>
Tue, 15 Apr 2014 21:58:12 +0000 (23:58 +0200)
fdroidserver/common.py

index 47444e42e3d573f6e6964a69920cc27a5b5f0e71..875fcb44501829b5f43d24e0273a4cf4bc7a1148 100644 (file)
@@ -1094,7 +1094,7 @@ def prepare_source(vcs, app, build, build_dir, srclib_dir, extlib_dir, onserver=
 
     # Delete unwanted files
     if 'rm' in build:
-        for part in build['rm']:
+        for part in getpaths(build_dir, build, 'rm'):
             dest = os.path.join(build_dir, part)
             logging.info("Removing {0}".format(part))
             if os.path.lexists(dest):
@@ -1183,7 +1183,7 @@ def getpaths(build_dir, build, field):
         p = p.strip()
         full_path = os.path.join(build_dir, p)
         full_path = os.path.normpath(full_path)
-        paths += [r[len(build_dir):] for r in glob.glob(full_path)]
+        paths += [r[len(build_dir)+1:] for r in glob.glob(full_path)]
     return paths
 
 # Scan the source code in the given directory (and all subdirectories)
@@ -1259,7 +1259,7 @@ def scan_source(build_dir, root_dir, thisbuild):
 
             # Path (relative) to the file
             fp = os.path.join(r, curfile)
-            fd = fp[len(build_dir):]
+            fd = fp[len(build_dir)+1:]
 
             # Check if this file has been explicitly excluded from scanning
             if toignore(fd):