chiark / gitweb /
Fix more srclib-related stuff
authorCiaran Gultnieks <ciaran@ciarang.com>
Wed, 5 Jun 2013 11:54:47 +0000 (12:54 +0100)
committerCiaran Gultnieks <ciaran@ciarang.com>
Wed, 5 Jun 2013 11:54:47 +0000 (12:54 +0100)
fdroidserver/build.py
fdroidserver/common.py

index c2b084927e169e59d9dc4c1aa5bdabb4eda80887..0814a45c5d0e0767b5e608ed93b6cea600c8b99c 100644 (file)
@@ -676,17 +676,20 @@ def main():
                 # there are any.
                 if first:
                     if app['Repo Type'] == 'srclib':
-                        build_dir = os.path.join('build', 'srclib')
+                        build_dir = os.path.join('build', 'srclib', app['Repo'])
                     else:
                         build_dir = os.path.join('build', app['id'])
 
                     # Set up vcs interface and make sure we have the latest code...
+                    if options.verbose:
+                        print "Getting {0} vcs interface for {1}".format(
+                                app['Repo Type'], app['Repo'])
                     vcs = common.getvcs(app['Repo Type'], app['Repo'], build_dir, sdk_path)
 
-                    if app['Repo Type'] == 'srclib':
-                        build_dir = os.path.join(build_dir, app['Repo'])
                     first = False
 
+                if options.verbose:
+                    print "Checking " + thisbuild['version']
                 if trybuild(app, thisbuild, build_dir, output_dir, also_check_dir,
                         srclib_dir, extlib_dir, tmp_dir, repo_dir, vcs, options.test,
                         options.server, options.install, options.force,
index d45bc1866cf2c3fd257a988b87146ca4c2a370e3..2579365e32a12183807ba63a98574a0633f44725 100644 (file)
@@ -35,7 +35,9 @@ def getvcs(vcstype, remote, local, sdk_path):
     if vcstype == 'bzr':
         return vcs_bzr(remote, local, sdk_path)
     if vcstype == 'srclib':
-        return getsrclib(remote, local, sdk_path, raw=True)
+        if local != 'build/srclib/' + remote:
+            raise VCSException("Error: srclib paths are hard-coded!")
+        return getsrclib(remote, 'build/srclib', sdk_path, raw=True)
     raise VCSException("Invalid vcs type " + vcstype)
 
 def getsrclibvcs(name):
@@ -85,6 +87,7 @@ class vcs:
                 '.fdroidvcs-' + os.path.basename(self.local))
         cdata = self.repotype() + ' ' + self.remote
         writeback = True
+        deleterepo = False
         if os.path.exists(self.local):
             if os.path.exists(fdpath):
                 with open(fdpath, 'r') as f:
@@ -92,8 +95,13 @@ class vcs:
                 if fsdata == cdata:
                     writeback = False
                 else:
+                    deleterepo = True
                     print "*** Repository details changed - deleting ***"
-                    shutil.rmtree(self.local)
+            else:
+                deleterepo = True
+                print "*** Repository details missing - deleting ***"
+        if deleterepo:
+            shutil.rmtree(self.local)
 
         self.gotorevisionx(rev)