]> git.donarmstrong.com Git - cran2deb.git/commitdiff
repopulate: the repopulate command, as previously promised but somehow missed from...
authorblundellc <blundellc@edb9625f-4e0d-4859-8d74-9fd3b1da38cb>
Sat, 13 Sep 2008 13:28:03 +0000 (13:28 +0000)
committerblundellc <blundellc@edb9625f-4e0d-4859-8d74-9fd3b1da38cb>
Sat, 13 Sep 2008 13:28:03 +0000 (13:28 +0000)
git-svn-id: svn://svn.r-forge.r-project.org/svnroot/cran2deb@135 edb9625f-4e0d-4859-8d74-9fd3b1da38cb

pkg/trunk/exec/repopulate [new file with mode: 0755]

diff --git a/pkg/trunk/exec/repopulate b/pkg/trunk/exec/repopulate
new file mode 100755 (executable)
index 0000000..ea10800
--- /dev/null
@@ -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"
+