[MacPorts] CommittersTipsAndTricks modified

Darren Weber dweber at macports.org
Wed Jun 24 11:42:33 PDT 2009


I use this bash script on a download file that will identifed as a distfile,
during the process of updating a Portfile.  So, it's designed to generate a
new checksum for a Portfile.  For example, I updated libpqxx from 3.0 to
3.0.1 yesterday, so all the checksums had to be changed in the Portfile.
I've noticed that I need to do this often, when either creating a new port
or updating an existing port, so I created a short bash script to make that
work-flow a little easier.

Does port -v checksum create a new checksum for an update to a Portfile?  I
assume that any port command can only use the information given in a
Portfile, not replace that information automatically.

Take care,
Darren



On Wed, Jun 24, 2009 at 9:13 AM, nox <n.oxyde at gmail.com> wrote:

> Mmh, isn't using `sudo port -v checksum` more straightforward?
>
> Le 23 juin 09 à 19:55, MacPorts a écrit :
>
>
>> Changed page "CommittersTipsAndTricks" by dweber at macports.org from
>> 206.176.233.162*
>> Page URL: <http://trac.macports.org/wiki/CommittersTipsAndTricks>
>> Diff URL: <
>> http://trac.macports.org/wiki/CommittersTipsAndTricks?action=diff&version=21
>> >
>> Revision 21
>>
>> -------8<------8<------8<------8<------8<------8<------8<------8<--------
>> Index: CommittersTipsAndTricks
>> =========================================================================
>> --- CommittersTipsAndTricks (version: 20)
>> +++ CommittersTipsAndTricks (version: 21)
>> @@ -178,3 +178,26 @@
>>
>> See [BbeditLanguageModule this page] for setting up BBEdit or TextWrangler
>> to have a MacPorts Language Module
>>
>> +
>> +== A bash script to run checksums ==
>> +
>> +{{{
>> +#!/bin/bash
>> +if [ -f "$1" ]; then
>> +    basename $1 | sed -e "s/\(.*\)/\1 \\\/"
>> +    md5 $1 | sed -e "s/^MD5.*=/md5/" | sed -e "s/\(.*\)/\1 \\\/"
>> +    openssl sha1 $1 | sed -e "s/^SHA1.*=/sha1/" | sed -e "s/\(.*\)/\1
>> \\\/"
>> +    openssl rmd160 $1 | sed -e "s/^R.*=/rmd160/"
>> +fi
>> +}}}
>> +
>> +For example, assume this is in ~/bin/macports_checksum.bash, then we get:
>> +
>> +{{{
>> +$ macports_checksum.bash ~/Downloads/libpqxx-3.0.1.tar.gz
>> +libpqxx-3.0.1.tar.gz \
>> +md5 23557f306821bf4cae39cca45acdf9e1 \
>> +sha1 a37874511946ba340d5df2d92252177f9eb906f6 \
>> +rmd160 1f842ea95ad6dd2cba2cdc2d2bd8e0be5063fb9b
>> +}}}
>> +
>>
>> -------8<------8<------8<------8<------8<------8<------8<------8<--------
>>
>> * The IP shown here might not mean anything if the user or the server is
>> behind a proxy.
>>
>> --
>> MacPorts <http://www.macports.org/>
>> Ports system for Mac OS
>>
>> This is an automated message. Someone at http://www.macports.org/ added
>> your email
>> address to be notified of changes on CommittersTipsAndTricks. If it was
>> not you, please
>> report to .
>> _______________________________________________
>> macports-changes mailing list
>> macports-changes at lists.macosforge.org
>> http://lists.macosforge.org/mailman/listinfo.cgi/macports-changes
>>
>
> _______________________________________________
> macports-dev mailing list
> macports-dev at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/macports-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-dev/attachments/20090624/925475b8/attachment.html>


More information about the macports-dev mailing list