[latexrefman] autoupdate for svn

Karl Berry karl at freefriends.org
Fri Oct 5 23:40:48 CEST 2018

    # 	cd $(htmlsplit)/latex2e &&  svn status | grep ^! | awk '/.html$/ {print " --force "$2}' | xargs svn rm 
    # 	cd $(htmlsplit)/latex2e && svn status *.html | grep ^? | awk '{print " "$2}' | xargs svn add

Looks ok, but, comments:

1) you could simplify the first awk with the rm by doing svn status
*.html in the first place there, as you do with the add.

2) Specifying --force redundantly with every file, leading to a
cmd line like
  svn rm --force foo.html --force bar.html
is ok, I expect, but weird. It should not be necessary to specify
--force at all; the status can be ! only if the file does not exist,
as far as I know.

3) For the record, I believe it is possible to do the whole thing with one sed:

htmlsplitstatus = cd $(htmlsplit)/latex2e && svn status *.html
$(htmlsplitstatus) | sed -n 's/^\?//p' | xargs -r svn rm
$(htmlsplitstatus) | sed -n 's/^\!//p' | xargs -r svn add

(The -n says "don't print by default", so non-?! lines are ignored;
then the s/// removes the marker char and prints the result if there was
a substitution.)

I think xargs -r is needed to avoid an error msg from svn rm/add in the
event that there are no files to be added/removed.

All untested in situ, though ... let me know if you want me to go
further with it ... --best, karl.

More information about the latexrefman mailing list