]> git.donarmstrong.com Git - cran2deb.git/blob - trunk/exec/repopulate
* fix CONFDIR typo
[cran2deb.git] / trunk / exec / repopulate
1 #!/bin/sh
2
3 ## DOC: cran2deb repopulate
4 ## DOC:     repopulate the cran2deb database and configurations from a new cran2deb release
5 ## DOC:
6
7 set -e
8
9 dir=${CRAN2DEB_CONFDIR:-/etc/cran2deb}
10
11 if [ ! -d "$dir" ]; then
12        echo "Dir $dir does not exist."
13        exit -1
14 fi
15
16 umask 002
17 echo "Setting 'root' var to '$1'."
18 root=$1
19 shift
20 OLDIFS="$IFS"
21 IFS="$(echo -ne '\0')"
22 for x in $(find "${dir}" -type f -name '*.in' -print0); do
23     #echo "x=$x"
24     sed -e "s:@ROOT@:$root:g" <"$x" > "${x%%.in}"
25 done
26 IFS="$OLDIFS"
27
28 # now do an update to reflect any config changes
29 echo "Starting '$root/exec/update"
30 "$root/exec/update" "$root"
31
32 (for fn in populate_licenses quit; do
33     cat "$root/data/$fn"
34 done) | "$root/exec/license" "$root"
35
36 (for fn in populate_depend_aliases populate_sysreq populate_forcedep quit; do
37     cat "$root/data/$fn"
38 done) | "$root/exec/depend" "$root"
39