diff options
| author | rhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58> | 2009-01-22 01:55:26 +0000 | 
|---|---|---|
| committer | rhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58> | 2009-01-22 01:55:26 +0000 | 
| commit | 9bdbd82aa16d3ff0b4cd2828adde49a73c3f1c9b (patch) | |
| tree | 3a47075c2e259da6176bd05c75362f25e48e28de | |
| parent | c46804a91d09ae9d737715dfb14019458bceefa1 (diff) | |
| download | simplepkg-9bdbd82aa16d3ff0b4cd2828adde49a73c3f1c9b.tar.gz simplepkg-9bdbd82aa16d3ff0b4cd2828adde49a73c3f1c9b.tar.bz2  | |
more changes towards #41 completion
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@766 04377dda-e619-0410-9926-eae83683ac58
| -rw-r--r-- | trunk/lib/common.sh | 36 | ||||
| -rw-r--r-- | trunk/mkbuild/generic.mkSlackBuild | 9 | ||||
| -rw-r--r-- | trunk/mkbuild/kde4.mkSlackBuild | 9 | ||||
| -rw-r--r-- | trunk/mkbuild/perl.mkSlackBuild | 9 | ||||
| -rw-r--r-- | trunk/src/createpkg | 3 | ||||
| -rwxr-xr-x | trunk/src/mkbuild | 29 | 
6 files changed, 67 insertions, 28 deletions
diff --git a/trunk/lib/common.sh b/trunk/lib/common.sh index cc63bc6..c3b09d6 100644 --- a/trunk/lib/common.sh +++ b/trunk/lib/common.sh @@ -1686,6 +1686,42 @@ function get_sign_user {  } +function update_keyring  { + +  # update keyring using GPG-KEY from a repository +  # usage: update_keyring <keyfile> + +  local keyring keys key + +  keyring="$1" + +  if [ ! -e "$keyring" ]; then +    repo_gpg_key $MKBUILDS_DIR +    return +  fi +   +  keys="`gpg --with-colons $keyring | cut -d : -f 5 | sed -e '/^$/d'`" + +  for key in $keys; do +    if [ ! -z "$SIGN_USER" ] && [ "`whoami`" != "$SIGN_USER" ]; then +      su $SIGN_USER -c "gpg --list-keys $key &> /dev/null" +      if [ "$?" != "0" ]; then +        echo "Updating keyring using $keyring..." +        su $SIGN_USER -c "gpg --import $keyring" +        break +      fi +    else +      gpg --list-keys $key &> /dev/null +      if [ "$?" != "0" ]; then +        echo "Updating keyring using $keyring..." +        gpg --import $keyring +        break +      fi +    fi +  done + +} +  function rmd160sum {    # computes RIPEMD-160 message digest diff --git a/trunk/mkbuild/generic.mkSlackBuild b/trunk/mkbuild/generic.mkSlackBuild index 93e7746..972c9f4 100644 --- a/trunk/mkbuild/generic.mkSlackBuild +++ b/trunk/mkbuild/generic.mkSlackBuild @@ -239,6 +239,15 @@ echo Success.  # Check Manifest file  if [ -e "$CWD/Manifest" ]; then +  # Manifest signature checking +  if grep -q -- "-----BEGIN PGP SIGNED MESSAGE-----" $CWD/Manifest; then +    echo "Checking Manifest signature..." +    gpg --verify $CWD/Manifest +    if [ "$?" != "0" ]; then +      exit $ERROR_MANIFEST +    fi +  fi +    MANIFEST_LINES="`grep -E -v "^(MKBUILD|SLACKBUILD)" $CWD/Manifest | wc -l`"    for ((MANIFEST_COUNT=1; MANIFEST_COUNT <= $MANIFEST_LINES; MANIFEST_COUNT++)); do diff --git a/trunk/mkbuild/kde4.mkSlackBuild b/trunk/mkbuild/kde4.mkSlackBuild index 0e34547..7ca8989 100644 --- a/trunk/mkbuild/kde4.mkSlackBuild +++ b/trunk/mkbuild/kde4.mkSlackBuild @@ -226,6 +226,15 @@ echo Success.  # Check Manifest file  if [ -e "$CWD/Manifest" ]; then +  # Manifest signature checking +  if grep -q -- "-----BEGIN PGP SIGNED MESSAGE-----" $CWD/Manifest; then +    echo "Checking Manifest signature..." +    gpg --verify $CWD/Manifest +    if [ "$?" != "0" ]; then +      exit $ERROR_MANIFEST +    fi +  fi +    MANIFEST_LINES="`grep -E -v "^(MKBUILD|SLACKBUILD)" $CWD/Manifest | wc -l`"    for ((MANIFEST_COUNT=1; MANIFEST_COUNT <= $MANIFEST_LINES; MANIFEST_COUNT++)); do diff --git a/trunk/mkbuild/perl.mkSlackBuild b/trunk/mkbuild/perl.mkSlackBuild index 3a8f091..a7fa7a8 100644 --- a/trunk/mkbuild/perl.mkSlackBuild +++ b/trunk/mkbuild/perl.mkSlackBuild @@ -187,6 +187,15 @@ echo Success.  # Check Manifest file  if [ -e "$CWD/Manifest" ]; then +  # Manifest signature checking +  if grep -q -- "-----BEGIN PGP SIGNED MESSAGE-----" $CWD/Manifest; then +    echo "Checking Manifest signature..." +    gpg --verify $CWD/Manifest +    if [ "$?" != "0" ]; then +      exit $ERROR_MANIFEST +    fi +  fi +    MANIFEST_LINES="`grep -E -v "^(MKBUILD|SLACKBUILD)" $CWD/Manifest | wc -l`"    for ((MANIFEST_COUNT=1; MANIFEST_COUNT <= $MANIFEST_LINES; MANIFEST_COUNT++)); do diff --git a/trunk/src/createpkg b/trunk/src/createpkg index 705b10b..bbb0a4b 100644 --- a/trunk/src/createpkg +++ b/trunk/src/createpkg @@ -657,6 +657,9 @@ esac  # Synchronize repository  [ $SYNC -eq $yes ] && sync_repo $SLACKBUILDS_DIR $SLACKBUILDS_SVN +# Update keyring +update_keyring $SLACKBUILDS_DIR/GPG-KEY +  # Get SlackBuild script  BUILD_SCRIPT="`find_slackbuild $PACKAGE`" diff --git a/trunk/src/mkbuild b/trunk/src/mkbuild index 6ca1259..0f786e1 100755 --- a/trunk/src/mkbuild +++ b/trunk/src/mkbuild @@ -1540,34 +1540,7 @@ function mkbuild_update_keyring  {    # Update keyring using GPG-KEY from    # mkbuild repository -  local keyring keys key - -  keyring="$MKBUILDS_DIR/GPG-KEY" - -  if [ ! -e "$keyring" ]; then -    repo_gpg_key $MKBUILDS_DIR -    return -  fi -   -  keys="`gpg --with-colons $MKBUILDS_DIR/GPG-KEY | cut -d : -f 5 | sed -e '/^$/d'`" - -  for key in $keys; do -    if [ ! -z "$SIGN_USER" ] && [ "`whoami`" != "$SIGN_USER" ]; then -      su $SIGN_USER -c "gpg --list-keys $key &> /dev/null" -      if [ "$?" != "0" ]; then -        echo "Updating keyring using $keyring..." -        su $SIGN_USER -c "gpg --import $keyring" -        break -      fi -    else -      gpg --list-keys $key &> /dev/null -      if [ "$?" != "0" ]; then -        echo "Updating keyring using $keyring..." -        gpg --import $keyring -        break -      fi -    fi -  done +  update_keyring $MKBUILDS_DIR/GPG-KEY  }  | 
