port -v returns a pre-formatted string for insertion in a Portfile with the actual checksums of the distfiles. So when I update something, I increment the version, then I run sudo port -v checksum and paste the string into
the Portfile.

Le 24 juin 09 à 20:42, Darren Weber a écrit :


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 <[email protected]> wrote:
Mmh, isn't using `sudo port -v checksum` more straightforward?

Le 23 juin 09 à 19:55, MacPorts a écrit :


Changed page "CommittersTipsAndTricks" by [email protected] 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
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macports-changes

_______________________________________________
macports-dev mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macports-dev


_______________________________________________
macports-dev mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macports-dev

Reply via email to