43 lines
1.4 KiB
Bash
Executable File
43 lines
1.4 KiB
Bash
Executable File
#!/bin/sh
|
|
# -*- mode: sh; fill-column: 75; tab-width: 8; coding: utf-8-unix -*-
|
|
|
|
ROLE=base
|
|
|
|
. /usr/local/bin/usr_local_tput.bash || exit 2
|
|
|
|
[ $# -eq 0 ] && USAGE $0 url-files...
|
|
|
|
cnt=beowulf-e22532c6f83a
|
|
|
|
cd /mnt/o/Cache/Apt || exit 3
|
|
|
|
cat "$@" | debian_uris_to_urls.bash \
|
|
| grep deb$ \
|
|
| while read url ; do
|
|
root=`echo $url | sed -e 's@.*DEBIAN@@'`
|
|
dir=`dirname $root`
|
|
[ -f Debian/10.6/deb.debian.org/debian/pool/$root ] || {
|
|
new=`echo $url | sed -e 's@deb.devuan.org/@mirrors.dotsrc.org/devuan/@'`
|
|
newf=`echo $new | sed -e 's@^http*:/@Devuan/3@'`
|
|
[ -f $newf ] || echo $new
|
|
continue
|
|
}
|
|
[ -h Devuan/3/deb.devuan.org/merged/pool/DEBIAN/$dir ] && \
|
|
rm Devuan/3/deb.devuan.org/merged/pool/DEBIAN/$dir
|
|
[ -d Devuan/3/deb.devuan.org/merged/pool/DEBIAN/$dir ] || \
|
|
mkdir -p Devuan/3/deb.devuan.org/merged/pool/DEBIAN/$dir
|
|
[ -f Devuan/3/deb.devuan.org/merged/pool/DEBIAN/$root ] && \
|
|
rm Devuan/3/deb.devuan.org/merged/pool/DEBIAN/$root
|
|
[ -h Devuan/3/deb.devuan.org/merged/pool/DEBIAN/$root ] && continue
|
|
ln -s $PWD/Debian/10.6/deb.debian.org/debian/pool/$root \
|
|
Devuan/3/deb.devuan.org/merged/pool/DEBIAN/$root
|
|
done
|
|
|
|
TODIR=/var/lib/lxd/storage-pools/default/containers/$cnt/rootfs
|
|
TODIR=$TODIR/var/cache/apt/archives/
|
|
find Devuan/ -name \*.deb -type l|while read file ; do \
|
|
base=`basename $file`
|
|
[ -e $TODIR/$base ] && continue
|
|
ln -s $PWD/$file $TODIR
|
|
done
|