Hi

On Sat, Jun 10, 2006 at 02:10:33PM +0200, Michael Hanke wrote:
> tags 372130 patch
> thanks
> 
> On Fri, Jun 09, 2006 at 06:41:52PM +0200, Ola Lundqvist wrote:
> <snip>
> > In any case I made this as a wishlist bug and if someone can point me
> > to a good solution or even provide a patch for it, than I'm more than
> > happy.
> 
> Ok, I tried to make US happy. I attached a small patch that seems to do
> the work. I do not know whether it works in any case, but it worked for
> all of my tests.

It will work for many testcases but it will not remove the orig file
if you have two uploads and one of them with no orig file (for example
if one is -1 version and the other one -2)...

> Please note, that I have virtually no experience with Perl, so there is
> probably a much more elegant/efficient way to do this.

So thanks for the patch but unfortunatly the .dsc file need to be parsed
in some way as well in order to make this work good.

Best regards,

// Ola

> 
> HTH,
> 
> Michael
> 
> 
> -- 
> GPG key:  1024D/3144BE0F Michael Hanke
> http://apsy.gse.uni-magdeburg.de/hanke
> ICQ: 48230050

> --- /usr/bin/debarchiver      2006-06-10 13:57:07.000000000 +0200
> +++ /home/hanke/bin/my-debarchiver    2006-06-10 13:53:43.871757480 +0200
> @@ -1611,9 +1611,31 @@
>                 "Installing $file to $installto.",
>                 2);
>      }
> -    cmdaction("$rmcmd $file",
> -           "Removing $file after it has been installed.",
> -           2);
> +             # flag whether file should get deleted
> +             my $killfile = 1;
> +             
> +             # only do checks of processing source tarballs
> +             if ($file =~ m/.tar.gz$/) {
> +                     my @upstream_version = split(/-/, $ver);
> +                     $upstream_version = $upstream_version[0];
> +                     
> +                     # get list of remaining *.dsc files
> +                     my @dscfiles = <$inputdir/${pkgname}_$upver*.dsc>;
> +
> +                     # check whether any of the *.dsc files does not match 
> the current package
> +                     foreach my $dscfile (@dscfiles) {
> +                             if ($dscfile ne 
> "$inputdir/${pkgname}_$ver.dsc") {
> +                                     pdebug(4, "Found additional package 
> using the source tarball of the package. Will not delete it now!");
> +                                     $killfile = 0;
> +                             }
> +                     }
> +             }
> +    
> +             if ($killfile) {
> +                             cmdaction("$rmcmd $file",
> +              "Removing $file after it has been installed.",
> +              2);
> +             }
>  }
>  
>  
> ###############################################################################




-- 
 --- Ola Lundqvist systemkonsult --- M Sc in IT Engineering ----
/  [EMAIL PROTECTED]                   Annebergsslingan 37        \
|  [EMAIL PROTECTED]                   654 65 KARLSTAD            |
|  http://www.opal.dhs.org           Mobile: +46 (0)70-332 1551 |
\  gpg/f.p.: 7090 A92B 18FE 7994 0C36 4FE4 18A1 B1CF 0FE5 3DD9  /
 ---------------------------------------------------------------


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to