]> git.donarmstrong.com Git - debbugs.git/commitdiff
Merge branch 'master' into cgiencoding
authorDon Armstrong <don@donarmstrong.com>
Tue, 17 Apr 2012 23:18:20 +0000 (16:18 -0700)
committerDon Armstrong <don@donarmstrong.com>
Tue, 17 Apr 2012 23:18:20 +0000 (16:18 -0700)
Debbugs/Config.pm
Debbugs/Control.pm
Debbugs/Text.pm
debian/changelog
examples/debian/misc/bugspam.cgi
scripts/service

index f4761a0d3a5f46d16f4b1433f8eaafd363fb7422..87e61a2f54de7efabac7526b12fda83529065a79 100644 (file)
@@ -103,13 +103,15 @@ use Safe;
 # untaint $ENV{DEBBUGS_CONFIG_FILE} if it's owned by us
 # This enables us to test things that are -T.
 if (exists $ENV{DEBBUGS_CONFIG_FILE}) {
-     if (${[stat($ENV{DEBBUGS_CONFIG_FILE})]}[4] == $<) {
+# This causes all sorts of problems for mirrors of debbugs; disable
+# it.
+#     if (${[stat($ENV{DEBBUGS_CONFIG_FILE})]}[4] == $<) {
          $ENV{DEBBUGS_CONFIG_FILE} =~ /(.+)/;
          $ENV{DEBBUGS_CONFIG_FILE} = $1;
-     }
-     else {
-         die "Environmental variable DEBBUGS_CONFIG_FILE set, and $ENV{DEBBUGS_CONFIG_FILE} is not owned by the user running this script.";
-     }
+     }
+     else {
+#        die "Environmental variable DEBBUGS_CONFIG_FILE set, and $ENV{DEBBUGS_CONFIG_FILE} is not owned by the user running this script.";
+     }
 }
 read_config(exists $ENV{DEBBUGS_CONFIG_FILE}?$ENV{DEBBUGS_CONFIG_FILE}:'/etc/debbugs/config');
 
index c0c835bad98e0f4b85136f0647852fb2b4df4464..631504a8d5420a24db292d736732201a3ad9113b 100644 (file)
@@ -2898,7 +2898,7 @@ sub clone_bug {
     for my $bug (split ' ', $data->{blocks}) {
        for my $new_bug (@new_bugs) {
            set_blocks(bug => $new_bug,
-                      blocks => $bug,
+                      block => $bug,
                       hash_slice(%param,
                                  keys %common_options,
                                  keys %append_action_options),
@@ -2909,7 +2909,7 @@ sub clone_bug {
     for my $bug (split ' ', $data->{blockedby}) {
        for my $new_bug (@new_bugs) {
            set_blocks(bug => $bug,
-                      blocks => $new_bug,
+                      block => $new_bug,
                       hash_slice(%param,
                                  keys %common_options,
                                  keys %append_action_options),
index 3df0e6316d9ee38fa3e4fd1bd7e929a64165a637..f5ede9d699f9791b086a49eb7f06c69445d52b70 100644 (file)
@@ -119,7 +119,7 @@ sub fill_in_template{
                                          output    => {type => HANDLE,
                                                        optional => 1,
                                                       },
-                                         safe      => {type => OBJECT,
+                                         safe      => {type => OBJECT|UNDEF,
                                                        optional => 1,
                                                       },
                                          hole_var  => {type => HASHREF,
@@ -154,41 +154,41 @@ sub fill_in_template{
          die "Unable to find template $param{template} with language $param{language}";
      }
 
-     if (defined $param{safe}) {
-         $safe = $param{safe};
-     }
-     else {
-         print STDERR "Created new safe\n" if $DEBUG;
-         $safe = Safe->new() or die "Unable to create safe compartment";
-         $safe->permit_only(':base_core',':base_loop',':base_mem',
-                            qw(padsv padav padhv padany),
-                            qw(rv2gv refgen srefgen ref),
-                            qw(caller require entereval),
-                            qw(gmtime time sprintf prtf),
-                            qw(sort),
-                           );
-         $safe->share('*STDERR');
-         $safe->share('%config');
-         $hole->wrap(\&Debbugs::Text::include,$safe,'&include');
-         my $root = $safe->root();
-         # load variables into the safe
-         for my $key (keys %{$param{variables}||{}}) {
-              print STDERR "Loading $key\n" if $DEBUG;
-              if (ref($param{variables}{$key})) {
-                   no strict 'refs';
-                   print STDERR $safe->root().'::'.$key,qq(\n) if $DEBUG;
-                   *{"${root}::$key"} = $param{variables}{$key};
-              }
-              else {
-                   no strict 'refs';
-                   ${"${root}::$key"} = $param{variables}{$key};
-              }
-         }
-         for my $key (keys %{exists $param{hole_var}?$param{hole_var}:{}}) {
-              print STDERR "Wraping $key as $param{hole_var}{$key}\n" if $DEBUG;
-              $hole->wrap($param{hole_var}{$key},$safe,$key);
-         }
-     }
+     if (defined $param{safe}) {
+#        $safe = $param{safe};
+     }
+     else {
+#        print STDERR "Created new safe\n" if $DEBUG;
+#        $safe = Safe->new() or die "Unable to create safe compartment";
+#        $safe->permit_only(':base_core',':base_loop',':base_mem',
+#                           qw(padsv padav padhv padany),
+#                           qw(rv2gv refgen srefgen ref),
+#                           qw(caller require entereval),
+#                           qw(gmtime time sprintf prtf),
+#                           qw(sort),
+#                          );
+#        $safe->share('*STDERR');
+#        $safe->share('%config');
+#        $hole->wrap(\&Debbugs::Text::include,$safe,'&include');
+#        my $root = $safe->root();
+#        # load variables into the safe
+#        for my $key (keys %{$param{variables}||{}}) {
+#             print STDERR "Loading $key\n" if $DEBUG;
+#             if (ref($param{variables}{$key})) {
+#                  no strict 'refs';
+#                  print STDERR $safe->root().'::'.$key,qq(\n) if $DEBUG;
+#                  *{"${root}::$key"} = $param{variables}{$key};
+#             }
+#             else {
+#                  no strict 'refs';
+#                  ${"${root}::$key"} = $param{variables}{$key};
+#             }
+#        }
+#        for my $key (keys %{exists $param{hole_var}?$param{hole_var}:{}}) {
+#             print STDERR "Wraping $key as $param{hole_var}{$key}\n" if $DEBUG;
+#             $hole->wrap($param{hole_var}{$key},$safe,$key);
+#        }
+     }
      $language = $param{language};
      my $tt;
      if ($tt_type eq 'FILE' and
@@ -213,7 +213,14 @@ sub fill_in_template{
      if (not defined $tt) {
          die "Unable to create Text::Template for $tt_type:$tt_source";
      }
-     my $ret = $tt->fill_in(SAFE => $safe,
+     my $ret = $tt->fill_in(#SAFE => $safe,
+                           PACKAGE => 'DTT',
+                           HASH => {%{$param{variables}//{}},
+                                    (map {my $t = $_; $t =~ s/^\&//; ($t => $param{hole_var}{$_})}
+                                     keys %{$param{hole_var}//{}}),
+                                    include => \&Debbugs::Text::include,
+                                    config  => \%config,
+                                   },
                            defined $param{output}?(OUTPUT=>$param{output}):(),
                           );
      if (not defined $ret) {
@@ -223,10 +230,10 @@ sub fill_in_template{
      if ($DEBUG) {
          no strict 'refs';
          no warnings 'uninitialized';
-         my $temp = $param{nosafe}?'main':$safe->{Root};
+#        my $temp = $param{nosafe}?'main':$safe->{Root};
          print STDERR "Variables for $param{template}\n";
-         print STDERR "Safe $temp\n";
-         print STDERR map {"$_: ".*{$_}."\n"} keys %{"${temp}::"};
+#        print STDERR "Safe $temp\n";
+#        print STDERR map {"$_: ".*{$_}."\n"} keys %{"${temp}::"};
      }
 
      return $ret;
index 321f032a34bf7937ff57d1c0dd937ca651b36379..2efedc5d063246d0fd16ab69cf187ca735beed00 100644 (file)
@@ -1,6 +1,8 @@
 debbugs (2.4.2~exp2) experimental; urgency=low
 
   * Hack around elinks css bug (closes: #593804)
+  * affects now appends packages by default (closes: #656371). Thanks to
+    Andreas Beckmann and Julien Cristau.
 
  -- Don Armstrong <don@debian.org>  Wed, 25 Aug 2010 01:57:38 -0700
 
index d668503b7d0226a37a55f9e6a19413136c8a5a3e..0e9416554fcceea9c766fe3430b600baa3b1f608 100755 (executable)
@@ -27,7 +27,7 @@ if (not defined $ok) {
 }
 my $time = time();
 
-if ($remote_host =~ /^(?:222\.145\.167\.130|222\.148\.27\.140|61\.192\.213\.69|59\.124\.205\.94|221\.191\.105\.116|87\.69\.80\.58|201\.215\.217\.26|201\.215\.217\.32|66\.63\.250\.28|124\.29\.15\.132|61\.192\.200\.111|58\.81\.190\.204|220\.150\.239\.110|59\.106\.128\.138|216\.170\.223\.41|87\.165\.200\.176|62\.4\.19\.137|122\.16\.111\.96|121\.94\.6\.159|190\.42\.8\.125|61\.192\.200\.130|82\.135\.92\.154|221\.115\.95\.197|222\.239\.79\.10(?:7|8)|210\.91\.8\.51|61\.192\.206\.109|61\.192\.203\.55|140\.123\.100\.(?:15|13))$/) {
+if ($remote_host =~ /^(?:222\.145\.167\.130|222\.148\.27\.140|61\.192\.213\.69|59\.124\.205\.94|221\.191\.105\.116|87\.69\.80\.58|201\.215\.217\.26|201\.215\.217\.32|66\.63\.250\.28|124\.29\.15\.132|61\.192\.200\.111|58\.81\.190\.204|220\.150\.239\.110|59\.106\.128\.138|216\.170\.223\.41|87\.165\.200\.176|62\.4\.19\.137|122\.16\.111\.96|121\.94\.6\.159|190\.42\.8\.125|61\.192\.200\.130|82\.135\.92\.154|221\.115\.95\.197|222\.239\.79\.10(?:7|8)|210\.91\.8\.51|61\.192\.206\.109|61\.192\.203\.55|140\.123\.100\.(?:15|13)|193\.203\.240\.134)$/) {
     print "Content-Type: text/html\n\n";
     print "<HTML><HEAD><TITLE>Go Away</TITLE></HEAD><BODY>\n";
     print "<h2>Report rejeted</h2>\n";
index 1cf0e40d58925a680fd90654f83d3f3e16d30854..29d14af789619d8a4dace8cdfad511bb8a2af909 100755 (executable)
@@ -962,8 +962,19 @@ END
     } elsif (m/^affects?\s+\#?(-?\d+)(?:\s+((?:[=+-])?)\s*(\S.*)?)?\s*$/i) {
        $ok++;
         $ref = $1;
-       my $add_remove = $2 || '';
-       my $packages = $3 || '';
+       my $add_remove = $2;
+       my $packages = $3;
+       # if there isn't a package given, assume that we should unset
+       # affects; otherwise default to adding
+       if (not defined $packages or
+           not length $packages) {
+           $packages = '';
+           $add_remove ||= '=';
+       }
+       elsif (not defined $add_remove or
+              not length $add_remove) {
+           $add_remove = '+';
+       }
        $ref = $clonebugs{$ref} if exists $clonebugs{$ref};
        eval {
             affects(@common_control_options,