On Mar 21, 2015, at 12:03 PM, René J.V. Bertin <[email protected]> wrote:

> On Saturday March 21 2015 10:46:07 Bradley Giesbrecht wrote:
> 
> Hi,
> 
>> I use sed in a script and am open to something easier:
>> https://svn.macports.org/repository/macports/users/pixilla/scripts/mp-rdeps-grid
> 
> Impressive :)
> 
> Starting from the end seems a bit simpler, and also should cater for any 
> depth. I haven't (yet) figured out how to *not* replace and then restore the 
> 1st '  ' on each line, but that may not even be possible:
> 
> `port -q rdeps "$@" | sed -e '/^-/d' -e 's/   \([^ ]\)/ \| \1/g' -e 's/  /\. 
> /g' -e 's/^\./ /'`
> 
> Why do you need the first pattern, removing lines that start with a dash?

Not sure, written a while ago, probably when the pattern contains many ports 
they are separated by "--" and I was not interested in the separation.

Here it is without, perhaps this is better:
port -q rdeps dependentof:zlib | sed -e 's/  /\.\./g' -e 's/^\.\./  /g' -e 
's/\.\./\. /g' -e 's/\. \([^\.]\)/\| \1/g'


Regards,
Bradley Giesbrecht (pixilla)

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

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

Reply via email to