directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Seelmann <seelm...@apache.org>
Subject Re: svn commit: r1157741 - /directory/studio/trunk/tools/sign.sh
Date Mon, 15 Aug 2011 17:07:59 GMT
I wonder if it doesn't make sense to use the same tool to create both
md5 and sha1 checksums?


On Mon, Aug 15, 2011 at 10:57 AM,  <elecharny@apache.org> wrote:
> Author: elecharny
> Date: Mon Aug 15 08:57:34 2011
> New Revision: 1157741
>
> URL: http://svn.apache.org/viewvc?rev=1157741&view=rev
> Log:
> Fixed the MD5 signature generation
>
> Modified:
>    directory/studio/trunk/tools/sign.sh
>
> Modified: directory/studio/trunk/tools/sign.sh
> URL: http://svn.apache.org/viewvc/directory/studio/trunk/tools/sign.sh?rev=1157741&r1=1157740&r2=1157741&view=diff
> ==============================================================================
> --- directory/studio/trunk/tools/sign.sh (original)
> +++ directory/studio/trunk/tools/sign.sh Mon Aug 15 08:57:34 2011
> @@ -9,7 +9,7 @@ read PASSWORD
>  stty echo
>  echo ""
>
> -for FILE in $(find . -not '(' -name "*.md5" -or -name "*.sha1" -or -name "*.asc" ')'
-and -type f) ; do
> +for FILE in $(find . -not '(' -name "sign.sh" -or -name ".*" -or -name "*.md5" -or -name
"*.sha1" -or -name "*.asc" ')' -and -type f) ;
>     if [ -f "$FILE.asc" ]; then
>         echo "Skipping: $FILE"
>         continue
> @@ -17,9 +17,30 @@ for FILE in $(find . -not '(' -name "*.m
>
>     echo -n "Signing: $FILE ... "
>
> -    openssl md5 < "$FILE" | cut "-d " -f2 > "$FILE.md5"
> -
> -    gpg --print-md SHA1 "$FILE" > "$FILE".sha1
> +    # MD5
> +    if [ ! -f "$FILE.md5" ];
> +    then
> +        openssl md5 < "$FILE" | cut "-d " -f2 > "$FILE.md5"
> +        echo "  - Generated '$FILE.md5'"
> +    else
> +        echo "  - Skipped '$FILE.md5' (file already existing)"
> +    fi
>
> -    echo "$PASSWORD" | gpg --default-key "$DEFAULT_KEY" --detach-sign --armor --no-tty
--yes --passphrase-fd 0 "$FILE" && echo done.
> +    # SHA1
> +    if [ ! -f "$FILE.sha1" ];
> +    then
> +        gpg --print-md SHA1 "$FILE" > "$FILE".sha1
> +        echo "  - Generated '$FILE.sha1'"
> +    else
> +        echo "  - Skipped '$FILE.sha1' (file already existing)"
> +    fi
> +
> +    # ASC
> +    if [ ! -f "$FILE.asc" ];
> +    then
> +        echo "$PASSWORD" | gpg --detach-sign --armor --no-tty --yes --passphrase-fd
0 "$FILE"
> +        echo "  - Generated '$FILE.asc'"
> +    else
> +        echo "  - Skipped '$FILE.asc' (file already existing)"
> +    fi
>  done
>
>
>

Mime
View raw message