#550961 debtree: I can't specify a local Packages.gz from command line

#550961#5
Date:
2009-10-14 12:59:10 UTC
From:
To:
Hello.

I'd like to specify a file Packages.gz from command line. Debtree uses
AptPkg. I could hack my env variables in order to specify my Packages
file via apt options, but this is a bit painful (maybe you have a simple
way of doing it ?). Do you think it would be a good idea to add a
command line option like "--source Packages.gz" and let debtree to do
the hard work ?

thanks.

pietro

#550961#10
Date:
2009-11-07 02:13:05 UTC
From:
To:
Yes, that's something I've considered myself. Such an option could simplify
regression testing too.

It would have to be separate options for files for source and binary
packages though.

If you'd like to take a shot at creating a patch, that would be most
welcome. You could probably get some inspiration from apt-rdepends.

Cheers,
FJP

#550961#15
Date:
2010-03-10 15:21:29 UTC
From:
To:
Hi,
actually adding this feature is trivial. This is the diff for debtree :
----------------- 61d60 < my $aptconf=""; 95d93 < 'conf=s' => \$aptconf, 159,161d156 < if ($aptconf) { < $ENV{'APT_CONFIG'} = $aptconf < } ----------------- and a typical local apt.conf file will look like this :
---------------- APT::Get::List-Cleanup "false"; Dir::Cache /tmp/apt; Dir::State /tmp/apt; Dir::State::status /tmp/apt/status; Dir::Etc::SourceList /tmp/apt/sources.list; --------------- of course you will need a proper apt repository mkdir -p /tmp/apt/{archives,lists}/partial cp $yourPackagesfile /tmp/apt/lists cp $yourstatusfile /tmp/apt/ apt-get -c=apt.conf update Then calling debtree as : ./debtree -conf=apt.conf dpkg should do the trick. if you want I can send you a proper patch... but I guess this is so trivial that you might want to fill the details yourself. thanks ! pietro
#550961#20
Date:
2010-03-10 15:55:03 UTC
From:
To:
setting APT_CONFIG is the way to go. No need to modify debtree...

APT_CONFIG=apt.conf apt-get update
APT_CONFIG=apt.conf debtree dpkg

... I guess time to close this bug.

#550961#25
Date:
2010-03-10 18:23:19 UTC
From:
To:
been documented, for example in a README.Debian.

I suspect that it may not work correctly for '-b --arch=all' (as that uses
apt-cache instead of the apt database). I'll have to test that.

I'll give the recipe you gave in your previous mail a try and then work
something out. If I have any questions I'll get back to you.

Another question could be: does this also allow to make graphs for other
architectures? For example, create a graph for arm on an i386 host.
I guess that as long as you copy Packages and Sources files (instead of
using a sources.list) it could work.
APT could have internal checks against the current arch. But possibly
setting "APT::Architecture" would fix that.

Cheers,
FJP

#550961#30
Date:
2010-03-31 10:39:24 UTC
From:
To:
Hi again,
a small script to make this easier.

Notice that you must init the repo specifying the architecture,
you want to work on. This should answer your question.

I'm not sure about '-b --arch=all'

:)
p
----------------------- #!/bin/bash # Wed Mar 31 2010 Pietro Abate <pietro.abate@pps.jussieu.fr> TMPAPT=$TMP/fakeapt function init() { mkdir -p $TMPAPT/{archives,lists}/partial cp $1 $TMPAPT/lists/Packages touch $TMPAPT/status cat > $TMPAPT/apt.conf <<EOF APT::Architecture "$2"; APT::Get::List-Cleanup "false"; Dir::Cache $TMPAPT; Dir::State $TMPAPT; Dir::State::status $TMPAPT/status; Dir::Etc::SourceList $TMPAPT/sources.list; EOF cat > $TMPAPT/sources.list <<EOF deb file:$TMPAPT/lists/ ./ EOF APT_CONFIG=$TMPAPT/apt.conf apt-get update } function debtree() { APT_CONFIG=$TMPAPT/apt.conf /usr/bin/debtree $@ } case "$1" in init) init $3 $2 ;; *) debtree $@ ;; esac -------------------------