[Parted-commits] GNU Parted Official Repository: Changes to 'next'

Joel Granados jgranados-guest at alioth.debian.org
Mon Jul 27 17:12:50 UTC 2009


 README-release           |    4 ++
 build-aux/parted-release |   68 ++++++++++++++++++++++++++++++++++++++---------
 2 files changed, 59 insertions(+), 13 deletions(-)

New commits:
commit 99105c24f6398b2d127bffc25ed2e72cf8d07ba6
Author: Joel Granados Moreno <jgranado at redhat.com>
Date:   Fri Jul 24 14:37:13 2009 +0200

    Explicitly handle the signing key.
    
    If we are sure that we have the key, we are able to use it in any
    subroutine (like make major).
    
    * build-aux/parted-release (_find_signingkey): New function.
    (_do_release): Use the key_id to sign the tag and to execute `make
    major`.

diff --git a/build-aux/parted-release b/build-aux/parted-release
index 62157a3..fbaad6a 100755
--- a/build-aux/parted-release
+++ b/build-aux/parted-release
@@ -4,7 +4,6 @@ v=""
 date=$(date +%F)
 logfile="release.log"
 parted_dir=""
-key_string=""
 key_id=""
 stage_dir="$(pwd)/parted_release-$$"
 
@@ -26,7 +25,6 @@ while [ $# -gt 0 ] ; do
   case $1 in
 
     --key-id)
-      key_string="-u $2"
       key_id="$2"
       shift; shift
     ;;
@@ -56,15 +54,52 @@ while [ $# -gt 0 ] ; do
   esac
 done
 
-if [ "x$v" = "x" ] ; then
-  usage
+_find_signingkey()
+{
+  # If its already set, return.
+  if [ "x$key_id" != "x" ] ; then
+      return 0
+  fi
+
+  # Maybe the global git config has the key :)
+  key_id=$(git config user.signingkey)
+  if [ "x$key_id" != "x" ] ; then
+    return 0
+  fi
+
+  # Lets ask gpg using git config user.email.  We will choose the first
+  # one in case of multiple keys with the same email.
+  git_uemail=$(git config user.email)
+  if [ "x$git_uemail" != "x" ] ; then
+      key_id=$(gpg --list-keys --with-colons --fixed-list "$git_uemail" |
+               grep pub |
+               head -n 1 |
+               awk -F ':' '{print $5}' |
+               cut -c 9-)
+    if [ "x$key_id" != "x" ] ; then
+      return 0
+    fi
+  fi
+
+  # Lets try with the name.
+  git_uname=$(git config user.name)
+  if [ "x$git_uname" != "x" ] ; then
+      key_id=$(gpg --list-keys --with-colons --fixed-list "$git_uname" |
+               grep pub |
+               head -n 1 |
+               awk -F ':' '{print $5}' |
+               cut -c 9-)
+    if [ "x$key_id" != "x" ] ; then
+      return 0
+    fi
+  fi
+
+  # Don't know where else to look.
+  echo "There was an error finding the key needed to sing the release tag."
+  echo "Please use the --key-id argument when you execute $0 or set the"
+  echo "user.signingkey value in your ~/.gitconfig"
   exit 1
-fi
-
-if [ "x$key_string" = "x" -o "x$key_id" = "x" ] ; then
-  key_string="-s"
-  key_id="FIXME: YOUR_KEY"
-fi
+}
 
 _do_git_clone()
 {
@@ -102,11 +137,11 @@ _do_release()
     commit_message="version $v\n\n* NEWS: Record release date.\n"
     sed -e "s/^.*in release.* (????-??-??) .*/$news_line/" -i NEWS && \
     printf "$commit_message" | git commit NEWS -F - && \
-    git tag $key_string -m "parted $v" v$v HEAD && \
+    git tag -u $key_id -m "parted $v" v$v HEAD && \
     ./bootstrap && \
     ./configure && \
     make && \
-    make major && \
+    make major gpg_key_ID=$key_id && \
     return 0
   ) >> $logfile 2>&1 || return 1
 }
@@ -130,6 +165,15 @@ configuration for possible overlooked issues.
   exit 1
 }
 
+if [ "x$v" = "x" ] ; then
+  usage
+  exit 1
+fi
+
+if [ "x$key_id" = "x" ] ; then
+  _find_signingkey
+fi
+
 _require_git
 echo "git is installed..."
 

commit c736ece2d4b28f3b300cda689fd86f5138478d86
Author: Joel Granados Moreno <jgranado at redhat.com>
Date:   Mon Jul 27 11:12:30 2009 +0200

    Minor corrections to the release README.
    
    * README-release: Change "$v" to "$VERSION", its more explicit.  Include
    a reminder to add the definition of parted to the release mail.

diff --git a/README-release b/README-release
index 1668706..7b7fcd1 100644
--- a/README-release
+++ b/README-release
@@ -8,6 +8,8 @@ Here is most of the steps we (maintainers) follow when making a release.
 
 3. Write the release announcement that will be posted to the mailing lists.
    There is a template generated at /tmp/announce-parted-$VERSION.
+   Remember to include the definition of parted.  You can find this at
+   http://www.gnu.org/software/parted/index.shtml
 
 4. Run the gnupload command that was suggested by the release script.  You can
    find this at the end of release.log.
@@ -22,5 +24,5 @@ Here is most of the steps we (maintainers) follow when making a release.
 7. Send the gpg-signed announcement mail, e.g.,
      To: info-gnu at gnu.org, parted-devel at lists.alioth.debian.org
      Cc: coordinator at translationproject.org, bug-parted at gnu.org
-     Subject: parted-$v released [stable]
+     Subject: parted-$VERSION released [stable]
 



More information about the Parted-commits mailing list