File: simple-cdd-profiles.postinst

package info (click to toggle)
simple-cdd 0.6.10
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 344 kB
  • sloc: python: 1,911; sh: 111; makefile: 13
file content (81 lines) | stat: -rw-r--r-- 2,105 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/bin/sh

# Copyright 2006 Gustavo Franco <stratus@debian.org>.
# Copyright 2004-2006 Vagrant Cascadian <vagrant@freegeek.org>.
# Licensed under the terms of the GNU General Public License,
# version 2 or any later version.

# TODO: figure out a better way to avoid asking about profiles when there are
# no profiles specified

SIMPLE_CDD_DIR=/cdrom/simple-cdd

set -e

if [ ! -d "$SIMPLE_CDD_DIR" ]; then
    exit 1
fi

# load debconf
. /usr/share/debconf/confmodule

if [ -f $SIMPLE_CDD_DIR/simple-cdd.templates ]; then
  echo "loading simple-cdd templates..."

  debconf-loadtemplate simple-cdd $SIMPLE_CDD_DIR/simple-cdd.templates

  echo "asking simple-cdd debconf questions..."

  db_input high simple-cdd/profiles || true
  db_go
else
  echo "NOTE: simple-cdd templates not found, not asking about profiles."
fi

db_get simple-cdd/profiles || true
profiles="$(echo $RET | tr ',' ' ')"
echo "loading simple-cdd preseeding files"
echo "profiles: $profiles"

cd $SIMPLE_CDD_DIR

for p in $profiles ; do
    echo
    if [ "$p" = "$default" ]; then
      echo "default Debconf preseeding already loaded. skipping."
    elif [ -r "$p.preseed" ]; then
      echo "Debconf preseeding for: $p"
      debconf-set-selections $p.preseed
    else
      echo "no Debconf preseeding for: $p"
    fi
done
echo "Finished with simple-cdd debconf preseeding"

echo "Queuing simple-cdd udebs..."
for p in default $profiles ; do
     echo
     if [ -r "$p.udebs" ]; then
        echo "Queuing udebs for profile: $p"
        wanted_packages="$(sed -n '/^[^#]/p' $p.udebs)"
        anna-install $wanted_packages || true
     else
        echo "No udeb list for profile: $p"
     fi
done
echo "Finished queueing simple-cdd udebs"

echo "Queuing simple-cdd packages..."
for p in default $profiles ; do
     echo
     if [ -r "$p.packages" ]; then
        echo "Queuing packages for profile: $p"
        wanted_packages="$(sed -n '/^[^#]/p' $p.packages)"
        apt-install $wanted_packages || true
     else
        echo "No package list for profile: $p"
     fi
done
echo "Finished queueing simple-cdd packages"

exit 0