Created
November 15, 2016 08:31
-
-
Save hiredgunhouse/201a2786d8946f64df43c5f1e9ddb660 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- pact_BAK 2015-06-23 11:07:20.000000000 +0200 | |
+++ pact 2016-11-14 17:17:08.459807000 +0100 | |
@@ -33,6 +33,7 @@ | |
echo "" | |
echo "Usage:" | |
echo " \"pact install <package names>\" to install given packages" | |
+ echo " \"pact installprev <package names>\" to install previous versions of given packages" | |
echo " \"pact remove <package names>\" to remove given packages" | |
echo " \"pact update <package names>\" to update given packages" | |
echo " \"pact show\" to show installed packages" | |
@@ -194,7 +195,16 @@ | |
# download and unpack the bz2 file | |
# pick the latest version, which comes first | |
+ if test "-$command-" = "-install-" | |
+ then | |
install=`cat "release/$pkg/desc" | awk '/^install: / { print $2; exit }'` | |
+ else | |
+ # pick the previous version, which comes after [prev] | |
+ if test "-$command-" = "-installprev-" | |
+ then | |
+ install=`cat "release/$pkg/desc" | sed '0,/\[prev\]/d' | awk '/^install: / { print $2; exit }'` | |
+ fi | |
+ fi | |
if test "-$install-" = "--" | |
then | |
@@ -207,7 +217,15 @@ | |
wget --user-agent="$USER_AGENT" -nc $mirror/$install | |
# check the verification hash (md5 or sha512) | |
+ if test "-$command-" = "-install-" | |
+ then | |
digest=`cat "desc" | awk '/^install: / { print $4; exit }'` | |
+ else | |
+ if test "-$command-" = "-installprev-" | |
+ then | |
+ digest=`cat "desc" | sed '0,/\[prev\]/d' | awk '/^install: / { print $4; exit }'` | |
+ fi | |
+ fi | |
md5digactual=`md5sum $file | awk '{print $1}'` | |
if ! [[ $digest == $md5digactual ]] | |
then | |
@@ -369,7 +387,7 @@ | |
;; | |
- invalidate|update|show|find|describe|packageof|install|remove) | |
+ invalidate|update|show|find|describe|packageof|install|installprev|remove) | |
if test "-$command-" = "--" | |
then | |
command=$1 | |
@@ -468,7 +486,7 @@ | |
;; | |
- install) | |
+ install|installprev) | |
checkCygwin | |
checkpackages |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment