Am 18.11.2014 um 11:02 schrieb Thomas Lange:
>>>>>> On Tue, 18 Nov 2014 09:30:01 +0100, Andreas Heinlein <[email protected]>
>>>>>> said:
> > If I add 'hplip/precise-backports' to the packages file, this works for
> > the normal installation, but it does not for the CDs. The reason is that
> > fai-mirror creates a new repository named 'cskoeln', so FAI/apt cannot
> > find the 'precise-backports' repo when running from CD.
>
> > Any ideas how to solve this cleanly?
> No. Currently fai-mirror can not keep the information about the
> repositories where it downloaded the packages. It builds a complete new
> package repository structur. Is there a tool that can do it better?
>
I found a solution with a slight modification to fai-mirror. Patch is
attached. I added a '-P' option to fai-mirror which allows to copy a
specified APT preferences file to $aptcache/etc/apt/preferences before
creating the mirror.
If I add this to a file 'aptpref'
Package: hplip
Pin: release a=precise-backports
Pin-Priority: 500
and call fai-mirror with ... -P aptpref ..., then the mirror ends up
with hplip_3.13.9... which is from precise-backports. This is enough for
me, don't know if someone else finds this useful.
Bye,
Andreas
--- fai-mirror.orig 2014-09-29 14:46:03.000000000 +0000
+++ fai-mirror 2014-11-18 11:24:00.471899682 +0000
@@ -186,7 +186,7 @@
verbose=0
add=1
qflag=-qq
-while getopts "a:Bvhx:pc:C:m:" opt ; do
+while getopts "a:Bvhx:pc:C:m:P:" opt ; do
case "$opt" in
a) arch=$OPTARG ;;
B) add=0 ;;
@@ -197,6 +197,7 @@
m) MAXPACKAGES="$OPTARG";;
p) preserve=1;;
v) verbose=1; vflag=-v; qflag='';;
+ P) aptpref="$OPTARG";;
?) die 1 "Unknown option";;
esac
done
@@ -250,6 +251,9 @@
# TODO: use -p to preserve sources.list
sed -e 's/file:/copy:/' $cfdir/apt/sources.list >> $aptcache/etc/apt/sources.list
+if [ -f "$aptpref" ]; then
+ cp "$aptpref" $aptcache/etc/apt/preferences
+fi
echo "Getting package information"
apt-get $qflag $aptoptions update >/dev/null