On 05/01/06 at 23:51 +0100, Lucas Nussbaum wrote:
> apt-cache and apt-get have a -o option, allowing to pass a configuration
> option to libapt. I use this to run apt-get and apt-source on another
> set of Packages and Sources files (example: run apt-cache on an Ubuntu
> package from Debian).
> 
> The following patch adds the same option to apt-rdepends.

Hi Simon,

I intend to NMU apt-rdepends with the attached patch. I really need this
change because I wrote a small script allowing to query the APT database
of another distribution (see chdist - #438971). I'd like to add support
for apt-rdepends in addition to apt-get and apt-cache, but this has to
be fixed first.

Please speak up if you have anything against that NMU.
-- 
| Lucas Nussbaum
| [EMAIL PROTECTED]   http://www.lucas-nussbaum.net/ |
| jabber: [EMAIL PROTECTED]             GPG: 1024D/023B3F4F |
diff -u apt-rdepends-1.3.0/debian/changelog apt-rdepends-1.3.0/debian/changelog
--- apt-rdepends-1.3.0/debian/changelog
+++ apt-rdepends-1.3.0/debian/changelog
@@ -1,3 +1,11 @@
+apt-rdepends (1.3.0-1.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Add support for passing APT configuration on the command line with -o,
+    like apt-get and apt-cache do. Closes: #346140.
+
+ -- Lucas Nussbaum <[EMAIL PROTECTED]>  Tue, 21 Aug 2007 10:12:54 +0200
+
 apt-rdepends (1.3.0-1) unstable; urgency=low
 
   * New upstream release
only in patch2:
unchanged:
--- apt-rdepends-1.3.0.orig/apt-rdepends
+++ apt-rdepends-1.3.0/apt-rdepends
@@ -42,6 +42,10 @@
 my @follow = ();
 # Which types of dependencies do we show?
 my @show = ();
+# Which configuration options do we want to pass to libapt-pkg.
+# The syntax is -o Foo::Bar=bar
+my @configoptions = ();
+
 
 # We don't print package states by default.
 my $printstate = 0;
@@ -62,6 +66,7 @@
 	    'print-state|p'    => \$printstate,
 	    'state-follow=s'   => [EMAIL PROTECTED],
 	    'state-show=s'     => [EMAIL PROTECTED],
+	    'option|o=s'       => [EMAIL PROTECTED],
 	    'help|h|?'         => \$help,
 	    'version'          => \$ver,
 	    'man'              => \$man) or pod2usage(verbose => 0);
@@ -103,6 +108,12 @@
 $_config->init();
 $_system = $_config->system();
 
+# override config if asked to
+for my $opt (@configoptions) {
+  my ($o, $v) = split(/\=/, $opt, 2);
+  $_config->set($o, $v);
+}
+
 # Choose whether we're searching Depends or Build-Depends.
 my $cache = AptPkg::Cache->new();
 my $source;
@@ -658,7 +669,10 @@
 are suggests, orange lines are recommends, red lines are replaces,
 and black lines are depends.
 
-=back
+=item B<-o>, B<--option=>I<OPTION>
+
+Set an APT Configuration Option; This will set an arbitary configuration
+option. The syntax is B<-o Foo::Bar=bar>.
 
 =head1 SEE ALSO
 

Reply via email to