]> git.decadent.org.uk Git - dak.git/blobdiff - tools/debianqueued-0.9/debianqueued
debianqueued: escape "." in ".changes" in regular expression
[dak.git] / tools / debianqueued-0.9 / debianqueued
index 8dd54c49957f8de534bbe71c8001a58d4fa355b4..d5937abbf410989f3ce8d3672f3380301caa0b20 100755 (executable)
@@ -1325,7 +1325,7 @@ outer_loop: while (<COMMANDS>) {
       } elsif ( $conf::upload_method ne "copy" ) {
         msg( "mail,log", "cancel not available\n" );
       } elsif (
-          $word[1] !~ m,$re_file_safe_prefix.changes\z, )
+          $word[1] !~ m,$re_file_safe_prefix\.changes\z, )
       {
         msg( "mail,log",
           "argument to cancel must be one .changes filename without path\n" );
@@ -2095,17 +2095,9 @@ sub check_incoming_writable() {
     unlink $file;
     ftp_cmd( "delete", $file );
   } elsif ( $conf::upload_method eq "copy" ) {
-    unlink("$main::current_targetdir/$testfile");
-    unless (open my $fh, ">>", "$main::current_targetdir/$testfile") {
+    unless(POSIX::access($main::current_targetdir, &POSIX::W_OK)) {
+      $msg = "No write access: $!";
       $stat = 1;
-      $msg = "Could not create $testfile: $!";
-    }
-    else {
-      close $fh;
-      unless (unlink("$main::current_targetdir/$testfile")) {
-        $stat = 1;
-        $msg = "Could not unlink file $testfile: $!";
-      }
     }
   }
   chomp($msg);