[darcs-users] darcs patch: Add copyright information to .hs files.

Trent W.Buck twb at cyber.com.au
Sun Oct 5 04:32:09 UTC 2008

A lot of files in the codebase lack copyright declarations.
Copyright is automatic; declarations aren't *necessary*,
but it's polite to include them.

Here's a demonstration of an entirely scripted approach to just dump
copyright information into files based on their darcs metadata.

I ran

    find -name _darcs -prune -o -name \*.hs -exec ../tmp.sh {} -- \;
    darcs record --all
where ../tmp.sh is an executable script containing

    #!/bin/sh -x
    if ! grep -qi copyright "$1"
        echo 1i
        darcs changes --xml "$1" |
        xmlstarlet sel -t -m changelog/patch -v "concat('$2 Copyright ',substring(@date,0,5),', ', at author)" -n |
        sed 's/ *<.*>//' | sort -u -k 3
        echo .
        echo wq
      } | ed -s "$1"

Sun Oct  5 15:23:10 EST 2008  Trent W. Buck <twb at cyber.com.au>
  * Add copyright information to .hs files.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/x-darcs-patch
Size: 5397 bytes
Desc: A darcs patch for your repository!
Url : http://lists.osuosl.org/pipermail/darcs-users/attachments/20081005/668085bd/attachment.bin 

More information about the darcs-users mailing list