sed patterns to add sha256

Jeremy Lavergne jeremy at lavergne.gotdns.org
Thu Jul 28 20:17:13 PDT 2011


In case you're wondering, it's setup for multiline as you'll likely need it to replace everything before rmd160:

/checksums.*rmd160/checksums\ \ \ \ \ \ \ \ \ \ \ rmd160/

On Jul 28, 2011, at 22:45 , Jeremy Lavergne wrote:
> 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/ea288dd1/attachment.bin>


More information about the macports-dev mailing list