Package: debarchiver
Severity: wishlist
Tags: patch

Dear Ola,

I am sorry to bring this question again, and sorry that I haven't
filed a wishlist bug to begin with ;-)

Below you can find a patch which provides a very simple feature:
overriding hard-coded default major ('main') with the one provided in
command line (if any). The reason I need to change a major
(main/non-free/etc) is simple.  Since my repository is a temporary
storage for some packages which are in the future to be duploaded, I
don't want to tune .changes files in any way. That is why I came up
with a tiny patch to debarchiver which takes care about overriding the
default major, and now I can organize packages in different majors:

# local -- localy used packages (of limited interest/access for outside people)
# alianed -- packages which are simply alianed rpms
# perspect -- perspective Debian packages, which can appear in Debian
    main repository and present here temporarily for testin
# backport -- repackaged versions of official Debian packages

And depending on who is using my repository, he might choose to use
only specific majors in his /etc/apt/sources.list line

Please consider the patch if you think it might be useful for anyone
else

--- debarchiver/src/debarchiver.pl      2005-08-21 15:10:55.000000000 -0400
+++ debarchiver-0.4.1-y1/src/debarchiver.pl     2005-09-12 14:49:41.000000000 
-0400
@@ -90,6 +90,9 @@
 
 @sections = ('main', 'contrib', 'non-free');
 
+# Default major
+$majordefault = 'main';
+
 @mailtos = ();
 
 @ARGS1 = @ARGV;
@@ -206,6 +209,7 @@
                         This can be used to move away the old packages to
                         some other place.
  --instcmd             DEPRICATED!
+ --major section        Major to use if undefined (default: main)
  -d | --dest dir               Destination directory. The base directory where 
all
   --destdir dir                 the distribution packages reside. Here the
                         \$distrib/\$major/\$arch/\$section directory structure
@@ -250,6 +254,7 @@
     "(relative to input dir) that will be read before the arguments to this 
program
 will be parsed. Here you can change the following variables
        \$destdir       The destination directory (see --destdir above).
+       \$majordefault  Default major (see --major above).
        \$inputdir      The input directory (no effect in $inputconfigfile).
         \$cachedir     The cache directory for apt-ftparchive, used if
                        --index is used.
@@ -323,6 +328,10 @@
            $destdir = shift @ARGS2;
            $destdir =~ s/\/$//;
        }
+       elsif (/^--major$/) {
+           $majordefault = shift @ARGS2;
+           $majordefault =~ s/\/$//;
+       }
        elsif (/^--cachedir$/) {
            $cachedir = shift @ARGS2;
        }
@@ -1648,7 +1657,7 @@
     if ($section =~ /^\s*$/) {
        # on the foo form.
        $section = $major;
-       $major = "main";
+       $major = $majordefault;
     }
     return ($major, $section);
 }


-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.13.4
Locale: LANG=ru_RU.KOI8-R, LC_CTYPE=ru_RU.KOI8-R (charmap=KOI8-R)


--Yarik


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

Reply via email to