Package list metche / 4c9604c
Added "No changelog monitoring" option in metche/changelog/type. Added retrieval of metche/changelog/type default value from configuration file. ricola 15 years ago
2 changed file(s) with 15 addition(s) and 11 deletion(s). Raw diff Collapse all Expand all
66 if [ -e $CONFIGFILE ]; then
77 . $CONFIGFILE || true
88 db_set metche/email $EMAIL_ADDRESS
9 db_set metche/changelog/type "No changelog monitoring"
910 if [ "$CHANGELOG_FILE" ]; then
11 db_set metche/changelog/type "Single changelog file"
1012 db_set metche/changelog/file $CHANGELOG_FILE
1113 fi
1214 if [ "$CHANGELOG_DIR" ]; then
15 db_set metche/changelog/type "Multiple changelog files"
1316 db_set metche/changelog/directory $CHANGELOG_DIR
1417 fi
1518 fi
33 set -e
44 . /usr/share/debconf/confmodule
55
6 cp -a -f $CONFIGFILE $CONFIGFILE.tmp
7
68 db_get metche/email
79 EMAIL_ADDRESS="$RET"
10 sed -e "s/^ *EMAIL_ADDRESS=.*/EMAIL_ADDRESS=\"$EMAIL_ADDRESS\"/" -i $CONFIGFILE.tmp
11
812 db_get metche/changelog/type
913 case "$RET" in
1014 "Single changelog file")
1115 db_get metche/changelog/file
1216 CHANGELOG_FILE="$RET"
17 sed -e "s@^[# ]*CHANGELOG_FILE=.*@CHANGELOG_FILE=\"$CHANGELOG_FILE\"@" \
18 -e "s@^[# ]*CHANGELOG_DIR@#CHANGELOG_DIR@" -i $CONFIGFILE.tmp
1319 ;;
1420 "Multiple changelog files")
1521 db_get metche/changelog/directory
1622 CHANGELOG_DIR="$RET"
23 sed -e "s@^[# ]*CHANGELOG_DIR=.*@CHANGELOG_DIR=\"$CHANGELOG_DIR\"@" \
24 -e "s@^[# ]*CHANGELOG_FILE@#CHANGELOG_FILE@" -i $CONFIGFILE.tmp
25 ;;
26 "No changelog monitoring")
27 sed -e "s@^[# ]*CHANGELOG_FILE@#CHANGELOG_FILE@" \
28 -e "s@^[# ]*CHANGELOG_DIR@#CHANGELOG_DIR@" -i $CONFIGFILE.tmp
1729 ;;
1830 esac
1931
20 cp -a -f $CONFIGFILE $CONFIGFILE.tmp
21 if [ "$CHANGELOG_FILE" ]; then
22 sed -e "s/^ *EMAIL_ADDRESS=.*/EMAIL_ADDRESS=\"$EMAIL_ADDRESS\"/" \
23 -e "s@^[# ]*CHANGELOG_FILE=.*@CHANGELOG_FILE=\"$CHANGELOG_FILE\"@" \
24 -e "s@^[# ]*CHANGELOG_DIR@#CHANGELOG_DIR@" < $CONFIGFILE > $CONFIGFILE.tmp
25 fi
26 if [ "$CHANGELOG_DIR" ]; then
27 sed -e "s/^ *EMAIL_ADDRESS=.*/EMAIL_ADDRESS=\"$EMAIL_ADDRESS\"/" \
28 -e "s@^[# ]*CHANGELOG_DIR=.*@CHANGELOG_DIR=\"$CHANGELOG_DIR\"@" \
29 -e "s@^[# ]*CHANGELOG_FILE@#CHANGELOG_FILE@" < $CONFIGFILE > $CONFIGFILE.tmp
30 fi
3132 mv -f $CONFIGFILE.tmp $CONFIGFILE
3233
3334 metche cron