From: blundellc Date: Sat, 13 Sep 2008 13:28:03 +0000 (+0000) Subject: repopulate: the repopulate command, as previously promised but somehow missed from... X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=03024f7f896f0409774b7ec985d4499dda252e84;p=cran2deb.git repopulate: the repopulate command, as previously promised but somehow missed from the commit. git-svn-id: svn://svn.r-forge.r-project.org/svnroot/cran2deb@135 edb9625f-4e0d-4859-8d74-9fd3b1da38cb --- diff --git a/pkg/trunk/exec/repopulate b/pkg/trunk/exec/repopulate new file mode 100755 index 0000000..ea10800 --- /dev/null +++ b/pkg/trunk/exec/repopulate @@ -0,0 +1,24 @@ +#!/bin/sh +## DOC: cran2deb repopulate +## DOC: repopulate the cran2deb database and configurations from a new cran2deb release +## DOC: + +umask 022 +root=$1 +shift +for x in $(find /etc/cran2deb/ -type f -name '*.in'); do + y=$(echo $x | sed -e 's,.in$,,') + sed -e "s:@ROOT@:$root:g" <"$x" >"$y" +done + +# now do an update to reflect any config changes +"$root/exec/update" "$root" + +(for fn in populate_licenses quit; do + cat "$root/data/$fn" +done) | "$root/exec/license" "$root" + +(for fn in populate_depend_aliases populate_sysreq populate_forcedep quit; do + cat "$root/data/$fn" +done) | "$root/exec/depend" "$root" +