[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

origUrl patch implemented and committed in svn-buildpackage repo

Hash: SHA1

tags 377880 pending

I have created a patch that implements origUrl (r2072 in collab-maint).

 - The tests below were based on the current SDcommon.pm which supports storing deb-layout
information in svn properties (but should work with the older version, too, if the deb-layout is not
stored in properties).
 - Of course, if the .svn/deblayout file exists, it is never rewritten, the properties import
happens, as usual, once, when that file doesn't exist

I have tested it in the following situations and works as expected :
- - origDir not defined, origUrl defined
- - origDir definded, origUrl defined
- - origDir not defined, origUrl not defined
- - origDir defined, origUrl not defined

"Works as expected" is defined as:
- - when the .svn/deb-layout file is missing, it is created and the origUrl field is added, too;
- - when the building is started, if the orig file is needed and is not present in the origDir, then
it is downloaded (via wget) from the location indicated by the origUrl, if it exists; if not the
behaviour is the same as before.

As a bonus, the file will be downloaded in the origDir with the expected name, no matter the name of
the file in the origUrl. This means that if upstream has an orig tarball which has undebianized name
it can be used directly since it will be downloaded under the correct name on the local disk. In
other words, renaming the file is not necessary.

e.g.: The Debian Games Team can keep the file which will end up as wormux_0.8alpha1.orig.tar.gz at
http://pkg-games.alioth.debian.org/tarballs/wormux-0.8alpha1.tar.gz and will have to set the origUrl
layout property to "http://pkg-games.alioth.debian.org/tarballs/wormux-0.8alpha1.tar.gz"; and
svn-buildpackage will take care of that the file will be called locally wormux_0.8alpha1.orig.tar.gz

I am not sure if using wget directly is a good idea, but otherwise it would be necessary to set
somehow the fetch program (and with others is not sure the nice bonus is not lost :-), but I feel
this is overkill, for the moment.

The patch looks like (and is committed already in the svn-buildpackage repo):

Index: svn-buildpackage
- --- svn-buildpackage    (revision 2071)
+++ svn-buildpackage    (revision 2072)
@@ -268,7 +268,18 @@

 if ($$c{"origDir"}) {
    $origExpect = $$c{"origDir"}."/$orig"; # just for the messages
- -   $origfile = long_path($origExpect) if (-f $origExpect); # for the actuall operation
+   if (-f $origExpect) {
+      $origfile = long_path($origExpect); # for the actual operation
+   }
+   else {
+      if ($$c{"origUrl"}) {
+         $oUrl = $$c{"origUrl"};
+         print "Orig tarball not found (expected $origExpect), fetching from $oUrl...\n";
+         system "wget -O $origExpect $oUrl" ;
+         $origfile = long_path($origExpect); # now the file should exist
+      };
+   }
 else {
     $origExpect = "(location unknown, guessed: ../tarballs/$orig)";
Index: debian/control
- --- debian/control      (revision 2071)
+++ debian/control      (revision 2072)
@@ -10,7 +10,7 @@
 Conflicts: svn-devscripts (<< 0.3.5)
 Replaces: svn-devscripts (<< 0.3.5)
 Suggests: fsh
- -Depends: subversion, subversion-tools, devscripts, ${perl:Depends}, libsvn-perl, file
+Depends: subversion, subversion-tools, devscripts, ${perl:Depends}, libsvn-perl, file, wget
 Description: helper programs to maintain Debian packages with Subversion
  svn-buildpackage (formerly svn-devscripts) contains tools that help to
  automate the task of maintaining Debian packages inside of a Subversion
Index: debian/changelog
- --- debian/changelog    (revision 2071)
+++ debian/changelog    (revision 2072)
@@ -4,11 +4,13 @@
   * now is possible to store svn-deblayout information in Subversion
     properties - namespace is svn-bp:* (Closes: #373295, #377411)
   * add depends on file (Closes: #397611)
+  * add support for origUrl (adds also a dependency on wget)
+    (Closes: #377880)

   [ Gonéri Le Bouder ]
   * add --svn-noninteractive to turn off interactive mode (Closes: #349979)

- - -- Eddy Petrișor <eddy.petrisor@gmail.com>  Fri, 15 Dec 2006 18:15:07 +0200
+ -- Eddy Petrișor <eddy.petrisor@gmail.com>  Tue, 19 Dec 2006 10:53:11 +0200

 svn-buildpackage (0.6.15) unstable; urgency=low

- --
"Imagination is more important than knowledge" A.Einstein
Version: GnuPG v1.4.6 (GNU/Linux)


Reply to: