]> git.donarmstrong.com Git - cran2deb.git/blob - trunk/exec/repopulate
08862dba2da40a7767fccf2cfc76289082e90d08
[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=/etc/cran2deb
10 if [ ! -d "$dir" ]; then
11        echo "Dir $dir not existing."
12        exit -1
13 fi
14
15 umask 002
16 echo "Setting 'root' var to '$1'."
17 root=$1
18 shift
19 for x in $(find /etc/cran2deb/ -type f -name '*.in'); do
20     #echo "x=$x"
21     y=$(echo $x | sed -e 's,.in$,,')
22     sed -e "s:@ROOT@:$root:g" <"$x" >"$y"
23 done
24
25 # now do an update to reflect any config changes
26 echo "Starting '$root/exec/update"
27 "$root/exec/update" "$root"
28
29 (for fn in populate_licenses quit; do
30     cat "$root/data/$fn"
31 done) | "$root/exec/license" "$root"
32
33 (for fn in populate_depend_aliases populate_sysreq populate_forcedep quit; do
34     cat "$root/data/$fn"
35 done) | "$root/exec/depend" "$root"
36