You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by Stefan Seelmann <se...@apache.org> on 2011/08/15 19:07:59 UTC

Re: svn commit: r1157741 - /directory/studio/trunk/tools/sign.sh

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,  <el...@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
>
>
>

Re: svn commit: r1157741 - /directory/studio/trunk/tools/sign.sh

Posted by Emmanuel Lecharny <el...@gmail.com>.
On 8/15/11 7:07 PM, Stefan Seelmann wrote:
> I wonder if it doesn't make sense to use the same tool to create both
> md5 and sha1 checksums?

Also, if we can have a script that does not recurse on all the 
directories, it would save us minutes of stupid signatures of all the 
hundreds HTML files below the current directory...

I had no time today to solve this issue...


-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com


Re: svn commit: r1157741 - /directory/studio/trunk/tools/sign.sh

Posted by Emmanuel Lecharny <el...@gmail.com>.
On 8/15/11 7:07 PM, Stefan Seelmann wrote:
> I wonder if it doesn't make sense to use the same tool to create both
> md5 and sha1 checksums?

As soon as we have a working script, I'm fine with the simplest solution :)


-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com