Re: an apt wrapper for dependency resolving
On Mon, Jun 20, 2005 at 01:26:04PM +0300, Tzafrir Cohen wrote:
> Hi
>
> So far I've been unable to find a simple debian tool to get "a list of
> packages and their dependencies". So here's a small wrapper around
> apt-get/apt-cache/aptitude to use a separate tree. This lets me use
> 'apt-get -d' to get all the missing packages and add them as an extra
> directory ( /pool/debian , a sibling of /pool/main) of my source.
>
> And it actually works (for me).
For the record: I later noticed an extra problem: The files downloaded
by apt-get don't have exactly the same names as the originals. It seems
apt-get attaches '<epoch-num>%3a' before the version number. I could not
find a way to override this behaviour and did not want to rename
in-place (or otherwise I'll have to re-download the file), so I ended up
using a symlinks directory. The main part of my "copy" script is now:
# LINKS_DIR: a temporary simlinks directory
# CACHE_DIR: a directory to which apt-get downloads, Aptdir/var/cache/apt/archives
# POOL_DIR: the target directory I wish to update
# recreate the links dir:
rm -f ${LINKS_DIR}/*.deb
for file in ${CACHE_DIR}/*.deb
do
orig=`basename "$file"`
new=`echo $orig | sed -e 's/_[0-9]\+%3a/_/'`
# TODO: absolute symlinks:
ln -s "$PWD/$file" "${LINKS_DIR}/$new"
done
# re-create the pool:
rm -f ${POOL_DIR}/*.deb 2>/dev/null || true
# Any way for a smarter rsync? Anyway, this still doesn't take much on my
# system:
cp -Lp ${LINKS_DIR}/*.deb ${POOL_DIR}/
--
Tzafrir Cohen icq#16849755 +972-50-7952406
tzafrir.cohen@xorcom.com http://www.xorcom.com
Reply to: