3
# This is a little shell script that will launch apt-get in dry-run mode
4
# to find all the dependencies of a specific package
6
# Get the configuration information if necessary
7
if [ -z "$TDIR" -o -z "$CODENAME" -o -z "$ARCH" ]; then
8
if [ -e CONF.sh ]; then
11
echo "Please set the good environment variables before "
12
echo "launching this program ..."
13
echo "Current values are :"
15
echo "CODENAME=$CODENAME"
20
options=" -o Dir::State::status=$TDIR/$CODENAME-$ARCH/status \
21
-o Dir::State=$TDIR/$CODENAME-$ARCH/apt-state/ \
22
-o Dir::Cache=$TDIR/$CODENAME-$ARCH/apt-cache/ \
23
-o Dir::Etc=$TDIR/$CODENAME-$ARCH/apt/ \
24
-o APT::Architecture=$ARCH "
26
# Check for the necessary dirs and files ...
27
if [ ! -d "$TDIR/$CODENAME-$ARCH/apt-state/lists/partial" ]; then
28
mkdir -p "$TDIR/$CODENAME-$ARCH/apt-state/lists/partial"
30
if [ ! -d "$TDIR/$CODENAME-$ARCH/apt-cache/archives/partial" ]; then
31
mkdir -p "$TDIR/$CODENAME-$ARCH/apt-cache/archives/partial"
33
if [ ! -d "$TDIR/$CODENAME-$ARCH/apt" ]; then
34
mkdir -p "$TDIR/$CODENAME-$ARCH/apt"
36
if [ ! -e "$TDIR/$CODENAME-$ARCH/apt/sources.list" ]; then
37
# Generating a correct sources.list file
38
echo "deb file:$MIRROR $CODENAME main contrib non-free" \
39
> $TDIR/$CODENAME-$ARCH/apt/sources.list
40
if [ -n "$NONUS" ]; then
41
# Slink used the old paths
42
if [ "$CODENAME" = "slink" ]; then
43
echo "deb file:$NONUS $CODENAME non-US" \
44
>> $TDIR/$CODENAME-$ARCH/apt/sources.list
46
echo "deb file:$NONUS $CODENAME/non-US main contrib non-free" \
47
>> $TDIR/$CODENAME-$ARCH/apt/sources.list
52
temp=$TDIR/$CODENAME-$ARCH/temp.apt-selection
55
if [ "$1" = "update" -o "$1" = "check" ]; then
58
elif [ "$1" = "cache" ]; then
62
elif [ "$1" = "deselected" ]; then
64
apt-get $options -s $@ > $temp
66
#if [ $num -ne 0 ]; then
67
#echo ": Param: apt-selection deselected $@" >&2;
70
perl -ne 'print "$1\n" if /^Remv (\S+)\s*(?:\[|$)/' $temp | sort
71
elif [ "$1" = "selected" ]; then
73
apt-get $options -s $@ > $temp
75
#if [ $num -ne 0 ]; then
76
# echo "ERROR: Param: apt-selection selected $@" >&2;
79
perl -ne 'print "$1\n" if /^Inst (\S+)\s*(?:\[|$)/' $temp | sort
81
apt-get $options -s $@