Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

rpg-install uses delta file unless forced with -f

  • Loading branch information...
commit 0ce8a80aeef11e9656db8593ed15c6a9c2b36ccf 1 parent db10059
@rtomayko authored
Showing with 21 additions and 11 deletions.
  1. +20 −10 rpg-install.sh
  2. +1 −1  rpg-package-install.sh
View
30 rpg-install.sh
@@ -14,11 +14,11 @@ Options
-s <name> Install from a session created with rpg-prepare'
session=session
-packageinstallargs=
+force=false
while getopts fs: opt
do case $opt in
s) session="$OPTARG";;
- f) packageinstallargs=-f;;
+ f) force=true;;
?) helpthem;;
esac
done
@@ -27,6 +27,7 @@ shift $(( $OPTIND - 1 ))
RPGSESSION="$RPGDB"
sessiondir="$RPGSESSION/@$session"
packlist="$sessiondir/package-list"
+delta="$sessiondir/delta"
solved="$sessiondir/solved"
if test "$session" = "session" -a -d "$sessiondir"
@@ -34,16 +35,25 @@ then notice "rm'ing crusty session dir: $sessiondir"
rm -rf "$sessiondir"
fi
-if test -d "$sessiondir"
-then numpacks=$(sed -n '$=' <"$solved")
- heed "$numpacks package(s):
-$(cat "$solved")"
-else trap "rm -rf '$sessiondir'" 0
- rpg-prepare -s "$session" "$@"
+if $force
+then packageinstallargs=-f
+ installfrom="$solved"
+else packageinstallargs=
+ installfrom="$delta"
fi
-cat "$solved" |
-xargs -n 2 rpg-package-install $packageinstallargs
+test -d "$sessiondir" || {
+ trap "rm -rf '$sessiondir'" 0
+ rpg-prepare -s "$session" "$@"
+}
+
+numpacks=$(grep -c . <"$installfrom")
+if $force
+then heed "installing $numpacks packages (forced)"
+else heed "installing $numpacks packages"
+fi
+
+<"$installfrom" xargs -n 2 rpg-package-install $packageinstallargs
heed "installation complete"
View
2  rpg-package-install.sh
@@ -82,7 +82,7 @@ test -d "$packagedir/$version" || {
exit 1
}
-notice "$package $version"
+heed "$package $version"
# Fetch the gem into the cache and unpack into the packs area if
# its not already there.
Please sign in to comment.
Something went wrong with that request. Please try again.