27 lines
718 B
Bash
Executable File
27 lines
718 B
Bash
Executable File
#!/bin/sh
|
|
# -*-mode: sh; tab-width: 8; coding: utf-8-unix -*-
|
|
# filter
|
|
|
|
ROLE=base
|
|
|
|
[ -z "$CACHE" ] && CACHE=/mnt/o/Cache/Apt/Debian/10.6
|
|
[ -d "$CACHE" ] || exit 1$?
|
|
|
|
[ -d /etc/apt ] || exit 0
|
|
|
|
cd $CACHE || exit 2
|
|
|
|
[ -d var/cache/apt/archives ] || mkdir -p var/cache/apt/archives
|
|
|
|
find *.deb -type f -name \*.deb | while read file; do
|
|
base=$( basename $file )
|
|
[ ! -d /var/cache/apt/archives/ ] || \
|
|
[ -e /var/cache/apt/archives/$base ] || ln -s $PWD/$file /var/cache/apt/archives/$base
|
|
[ -f var/cache/apt/archives/$base -a ! -h var/cache/apt/archives/$base ] && rm var/cache/apt/archives/$base
|
|
[ -e var/cache/apt/archives/$base ] || ln -s $PWD/$file var/cache/apt/archives/$base
|
|
done
|
|
|
|
|
|
exit 0
|
|
|