sed patterns to add sha256

Jeremy Lavergne jeremy at lavergne.gotdns.org
Thu Jul 28 19:45:13 PDT 2011


While tinkering around tonight I figured I'd share my multline sed for updating sha256:

for i in `port -q echo maintainer:snc`; do x=$(sudo port -v checksum $i | grep sha256 |grep -v checksum | awk '{print $NF}');  sed -i '' -n '1h;1!H;${;g;s/sha256\ \ s/sha256\ \ '$x'/g;p;}' "`port file $i`"; done 2>/dev/null

It assumes you have this line as a placeholder in the portfile already:
sha256  s

You can follow the general idea to come up with other handy patterns.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3749 bytes
Desc: not available
URL: <http://lists.macosforge.org/pipermail/macports-dev/attachments/20110728/84db2695/attachment.bin>


More information about the macports-dev mailing list