[Pkg-bazaar-commits] ./bzr-builddeb/trunk.old r248: Fallback to ../tarballs when looking for .orig.tar.gz.

James Westby jw+debian at jameswestby.net
Wed Dec 10 08:32:53 UTC 2008


------------------------------------------------------------
revno: 248
committer: James Westby <jw+debian at jameswestby.net>
branch nick: 2.0
timestamp: Tue 2008-08-26 16:50:05 +0100
message:
  Fallback to ../tarballs when looking for .orig.tar.gz.
  
  Using .. as the default now may cause some people's setups to break,
  and so this compatibility code should keep them working.
modified:
  TODO
  builder.py
-------------- next part --------------
=== modified file 'TODO'
--- a/TODO	2007-10-29 18:00:52 +0000
+++ b/TODO	2008-08-26 15:50:05 +0000
@@ -19,3 +19,8 @@
 - Check whether epochs are handled sanely, especially in import-dsc and
 merge-upstream.
 
+- Need tests for the following things:
+  - default result dir not being used if the builder puts the files
+    somewhere else so that the build doesn't fail.
+  - Falling back to ../tarballs if .. doesn't have what we need.
+

=== modified file 'builder.py'
--- a/builder.py	2008-08-26 15:41:59 +0000
+++ b/builder.py	2008-08-26 15:50:05 +0000
@@ -241,17 +241,26 @@
     tarball = os.path.join(tarballdir,self._tarball_name())
     info("Looking for %s to use as upstream source", tarball)
     if not os.path.exists(tarball):
-      if self._get_upstream_from_archive():
-        return tarball
-      if not self._has_watch():
-        raise DebianError('Could not find upstream tarball at '+tarball)
-      else:
-        if not os.path.exists(tarballdir):
-          os.mkdir(tarballdir)
+      tarballdir = os.path.join('..', 'tarballs')
+      found = False
+      if tarballdir != self._properties.tarball_dir():
+        tarball = os.path.join(tarballdir,self._tarball_name())
+        info("For compatibility looking for %s to use as upstream source",
+                tarball)
+        if os.path.exists(tarball):
+          found = True
+      if not found:
+        if self._get_upstream_from_archive():
+          return tarball
+        if not self._has_watch():
+          raise DebianError('Could not find upstream tarball at '+tarball)
         else:
-          if not os.path.isdir(tarballdir):
-            raise DebianError('%s is not a directory.' % tarballdir)
-        self._get_upstream_from_watch()
+          if not os.path.exists(tarballdir):
+            os.mkdir(tarballdir)
+          else:
+            if not os.path.isdir(tarballdir):
+              raise DebianError('%s is not a directory.' % tarballdir)
+          self._get_upstream_from_watch()
     return tarball
 
   def _tarball_name(self):



More information about the Pkg-bazaar-commits mailing list