#408379 apt-file download to download a file from archive

#408379#5
Date:
2007-01-25 12:55:45 UTC
From:
To:
So, I know my example is not a patch. It should works while apt-file doesn't recognise this option.

Is there anywhere a debian archive uncompress, where you could go to download any debian file on the debian's hierarchy ?

Sorry my poor english

apt-file-download.sh:
#!/bin/bash

FILE=$1

if [ $(apt-file search "$FILE" | tee result.txt | wc -l) -ne 1 -o $# -ne 1 ]
then
	echo "Use: apt-file download file"
	echo "You should specific a file from an uniq package"
	rm result.txt
	exit 1
fi
dir=$(mktemp -d )
mv result.txt $dir/result.txt
(cd $dir;
aptitude download $(awk -F ":" '{print $1}' result.txt)
ar xv *deb  data.tar.gz
)

tar -O -zxf $dir/data.tar.gz ./$FILE > ${FILE##*/}
rm -rf $dir

#408379#10
Date:
2008-03-25 20:50:03 UTC
From:
To:
# Automatically generated email from bts, devscripts version 2.10.20
# this is not a patch
tags 408379 - patch

#408379#17
Date:
2008-07-10 10:35:59 UTC
From:
To:
Hi,

I'm not sure we should be adding this. What use cases are there for this?
If you want to reinstate a lost file, couldn't you better do 'apt-get
install --reinstall package'?


Thijs

#408379#22
Date:
2008-07-10 10:51:48 UTC
From:
To:
Ok

Many times I'd like to get a file from a package just for
examinate/study it, like a script in /etc/init.d, a man page, a readme
from doc, a logrotate file, a config file in /etc/ ... but I don't want
to install the package.

Suppose you are talking via telephone with somebody you are helping with
a trouble in a server who has installed a package, and in your
environment you can't install this package and can't have access to
another server with it. You would like just compare a file with the
original and see the diff.

From I openned this bug I downloaded, like an example:

asterisk.logrotate
phpgwaccount.schema
saslauthd.conf
50unattended-upgrades

Thanks you and sorry my english
Thijs Kinkhorst wrote: