Package: devscripts
Version: 2.9.19
Severity: wishlist
Tags: patch

When caching packages with many bugs (e.g. dpkg, www.debian.org)
I often get disrupted and have to start the caching again. This
costs a lot of unnessecary time because most of the bugs are
already downloaded and up-to-date but bts still checks them and
sleeps for a while. I would like to have a --only-new option so that
cached bugs don't get checked for up-to-date'ness and only bugs
completly missing are downloaded.

Patch:
diff -Naur devscripts-2.9.19/bts.pl devscripts-2.9.19.new/bts.pl
--- devscripts-2.9.19/bts.pl    2006-04-15 17:35:16.000000000 -0500
+++ devscripts-2.9.19.new/bts.pl        2006-05-12 00:39:46.000000000 -0500
@@ -244,6 +244,11 @@
 
 Suppress any configuration file --force-refresh option.
 
+=item --only-new
+
+Download only new bugs when caching. Don't check for updates in
+bugs we already have.
+
 =item -q, --quiet
 
 When running bts cache, only display information about newly cached
@@ -265,6 +270,7 @@
 my $caching=1;
 my $cachemode='min';
 my $refreshmode=0;
+my $updatemode=0;
 my $mailreader='mutt -f %s';
 my $sendmailcmd='/usr/sbin/sendmail';
 
@@ -281,6 +287,7 @@
                       'BTS_CACHE' => 'yes',
                       'BTS_CACHE_MODE' => 'min',
                       'BTS_FORCE_REFRESH' => 'no',
+                      'BTS_ONLY_NEW' => 'no',
                       'BTS_MAIL_READER' => 'mutt -f %s',
                       'BTS_SENDMAIL_COMMAND' => '/usr/sbin/sendmail',
                       );
@@ -307,6 +314,8 @@
        or $config_vars{'BTS_CACHE_MODE'}='min';
     $config_vars{'BTS_FORCE_REFRESH'} =~ /^(yes|no)$/
        or $config_vars{'BTS_FORCE_REFRESH'}='no';
+    $config_vars{'BTS_ONLY_NEW'} =~ /^(yes|no)$/
+       or $config_vars{'BTS_ONLY_NEW'}='no';
     $config_vars{'BTS_MAIL_READER'} =~ /\%s/
        or $config_vars{'BTS_MAIL_READER'}='mutt -f %s';
     $config_vars{'BTS_SENDMAIL_COMMAND'} =~ /./
@@ -335,6 +344,7 @@
     $caching = $config_vars{'BTS_CACHE'} eq 'no' ? 0 : 1;
     $cachemode = $config_vars{'BTS_CACHE_MODE'};
     $refreshmode = $config_vars{'BTS_FORCE_REFRESH'} eq 'yes' ? 1 : 0;
+    $updatemode = $config_vars{'BTS_ONLY_NEW'} eq 'yes' ? 1 : 0;
     $mailreader = $config_vars{'BTS_MAIL_READER'};
     $sendmailcmd = $config_vars{'BTS_SENDMAIL_COMMAND'};
 }
@@ -363,6 +373,7 @@
           "sendmail=s" => \$opt_sendmail,
           "f" => \$refreshmode,
           "force-refresh!" => \$refreshmode,
+          "only-new!" => \$updatemode,
           "q|quiet+" => \$quiet,
           "noconf|no-conf" => \$opt_noconf,
           )
@@ -1232,11 +1243,12 @@
 
 sub bts_cache {
     @ARGV = @_;
-    my ($sub_cachemode, $sub_refreshmode);
+    my ($sub_cachemode, $sub_refreshmode, $sub_updatemode);
     my $sub_quiet = $quiet;
     GetOptions("cache-mode|cachemode=s" => \$sub_cachemode,
               "f" => \$sub_refreshmode,
               "force-refresh!" => \$sub_refreshmode,
+              "only-new!" => \$sub_updatemode,
               "q|quiet+" => \$sub_quiet,
               )
     or die "bts: unknown options for bugs command\n";
@@ -1245,6 +1257,9 @@
     if (defined $sub_refreshmode) {
        ($refreshmode, $sub_refreshmode) = ($sub_refreshmode, $refreshmode);
     }
+    if (defined $sub_updatemode) {
+       ($updatemode, $sub_updatemode) = ($sub_updatemode, $updatemode);
+    }
     if (defined $sub_cachemode) {
        if ($sub_cachemode =~ /^(min|mbox|full)$/) {
            ($cachemode, $sub_cachemode) = ($sub_cachemode, $cachemode);
@@ -1310,6 +1325,12 @@
     my $bugcount = 1;
     my $bugtotal = scalar keys %bugs;
     foreach my $bug (keys %bugs) {
+       if (-f cachefile($bug, '') and $updatemode) {
+           print "Skipping $bug as requested ... $bugcount/$bugtotal\n"
+               if !$quiet;
+           $bugcount++;
+           next;
+       }
        download($bug, '', 1, 0, $bugcount, $bugtotal);
         sleep $opt_cachedelay;
        $bugcount++;
@@ -1319,6 +1340,9 @@
     if (defined $sub_refreshmode) {
        $refreshmode = $sub_refreshmode;
     }
+    if (defined $sub_updatemode) {
+       $updatemode = $sub_updatemode;
+    }
     if (defined $sub_cachemode) {
        $cachemode = $sub_cachemode;
     }


Gruesse,
        Frank Lichtenheld

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (990, 'unstable'), (1, 'experimental')
Architecture: powerpc (ppc)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.16-1-powerpc
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)

Versions of packages devscripts depends on:
ii  debianutils                   2.16       Miscellaneous utilities specific t
ii  dpkg-dev                      1.13.19    package building tools for Debian
ii  libc6                         2.3.6-7    GNU C Library: Shared libraries
ii  perl                          5.8.8-4    Larry Wall's Practical Extraction 
ii  sed                           4.1.5-1    The GNU sed stream editor

Versions of packages devscripts recommends:
ii  fakeroot                      1.5.8      Gives a fake root environment

-- no debconf information


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

Reply via email to