]> err.no Git - dak/commitdiff
* debianqueued: allow removal from target delayed queue
authorThomas Viehmann <tv@beamnet.de>
Thu, 11 Sep 2008 20:16:26 +0000 (22:16 +0200)
committerThomas Viehmann <tv@beamnet.de>
Thu, 11 Sep 2008 20:16:26 +0000 (22:16 +0200)
Signed-off-by: Thomas Viehmann <tv@beamnet.de>
tools/debianqueued-0.9/debianqueued

index 207b45e79f640faecbb0505c3f7babcf2996a977..1ca65d0e3d8e29bd4f868d79e90abb12d565e906 100755 (executable)
@@ -1173,7 +1173,7 @@ sub process_changes($\@) {
 #
 sub process_commands($) {
        my $commands = shift;
-       my( @cmds, $cmd, $pgplines, $signator );
+       my( @cmds, $cmd, $pgplines, $signator, $adelay );
        local( *COMMANDS );
        
        format_status_str( $main::current_changes, $commands );
@@ -1257,21 +1257,44 @@ sub process_commands($) {
                if ($word[0] eq "rm") {
                        my( @files, $file, @removed );
                        foreach ( @word[1..$#word] ) {
+                if (m,^DELAYED/([0-9]+)-day/,) {
+                    $adelay = $1;
+                    s,^DELAYED/[0-9]+-day/,,
+                }
+                else {
+                    $adelay = -1;
+                }
                                if (m,/,) {
                                        msg( "mail,log", "$_: filename may not contain slashes\n" );
                                }
-                               elsif (/[*?[]/) {
-                                       # process wildcards
+                               else {
+                                       # process wildcards but also plain names (for delayed target removal)
                                        my $pat = quotemeta($_);
                                        $pat =~ s/\\\*/.*/g;
                                        $pat =~ s/\\\?/.?/g;
                                        $pat =~ s/\\([][])/$1/g;
-                                       opendir( DIR, "." );
-                                       push( @files, grep /^$pat$/, readdir(DIR) );
-                                       closedir( DIR );
-                               }
-                               else {
-                                       push( @files, $_ );
+                    if ($adelay == -1) {
+                                               opendir( DIR, "." );
+                                               push( @files, grep /^$pat$/, readdir(DIR) );
+                                               closedir( DIR );
+                    }
+                                       else {
+                                               if ($conf::upload_method eq "copy") {
+                                       my($dir) = sprintf( $conf::incoming_delayed,
+                                                                                               $adelay );
+                                                       opendir( DIR, "$dir" );
+                                                       push( @files, map ("$dir/$_", grep /^$pat$/, readdir(DIR) ));
+                                                       closedir( DIR );
+                                       $dir = sprintf( $conf::targetdir_delayed,
+                                                                                       $adelay );
+                                                       opendir( DIR, "$dir" );
+                                                       push( @files, map ("$dir/$_", grep /^$pat$/, readdir(DIR) ));
+                                                       closedir( DIR );
+                                               }
+                                               else {
+                                                       msg( "mail,log", "No DELAYED removal possible\n" );
+                                               }
+                                       }
                                }
                        }
                        if (!@files) {
@@ -1549,11 +1572,11 @@ sub pgp_check($) {
                debug( "executing $conf::gpg --no-options --batch ".
                   "--no-default-keyring --always-trust ".
                   "--keyring ". join (" --keyring ",@conf::keyrings).
-                  "--verify '$file'" );
+                  " --verify '$file'" );
                if (!open( PIPE, "$conf::gpg --no-options --batch ".
                   "--no-default-keyring --always-trust ".
                   "--keyring " . join (" --keyring ",@conf::keyrings).
-                  "--verify '$file'".
+                  " --verify '$file'".
                   " 2>&1 |" )) {
                        msg( "log", "Can't open pipe to $conf::gpg: $!\n" );
                        return "LOCAL ERROR";