chiark / gitweb /
handle #-comments, sort of
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 28 Feb 2019 16:15:32 +0000 (16:15 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 28 Feb 2019 16:15:32 +0000 (16:15 +0000)
fucking-cargo

index 2250cd952368eb35fb26456fe66361a9c8b0842a..7582f1cc0b023a23cf31fabfce50a04b3c93c269 100755 (executable)
@@ -26,6 +26,7 @@ sed='
 exec 204<../Fuck
 while read <&204 what where; do
        if [ "x$what" = x- ]; then continue; fi
+       if [ "x$what" = 'x#' ]; then continue; fi
        qwhere="${where//\//\\/}"
        sed+='
                s/^'$what' *= *\(\".*\"\) *$/'$what' = { version = \1 }/;
@@ -39,6 +40,7 @@ sed+='}
 
 exec 204<../Fuck
 while read <&204 what where; do
+       if [ "x$what" = 'x#' ]; then continue; fi
        wf=../$where/$f
        rm -f $wf.fucking~
        sed <$wf >$wf.fucking~ "$sed"
@@ -46,6 +48,7 @@ done
 
 exec 204<../Fuck
 while read <&204 what where; do
+       if [ "x$what" = 'x#' ]; then continue; fi
        wf=../$where/$f
        if ! test -e $wf.unfucked~; then
                ln $wf $wf.unfucked~
@@ -55,6 +58,7 @@ done
 trap '
        set +e
        while read <&203 what where; do
+               if [ "x$what" = "x#" ]; then continue; fi
                wf=../$where/$f
                if test -e $wf.unfucked~; then
                        rm -f $wf.fucked~
@@ -68,6 +72,7 @@ trap '
 exec 204<../Fuck
 printf >&2 'Fucking'
 while read <&204 what where; do
+       if [ "x$what" = 'x#' ]; then continue; fi
        wf=../$where/$f
        printf >&2 ' %s' "$what"
        if cmp -s $wf.fucked~ $wf.fucking~; then