checkupdate script 'skeleton' committed

Giorgos Keramidas keramida at ceid.upatras.gr
Sat Jun 14 23:17:12 EEST 2008


I've been working at the `skeleton' of a script called `checkupdate.py'
for a while now.  Gabor Pali (gpj at freebsd.org) sent me a first
version of the script he wrote, which is written in sh(1).

The shell version seems to work.  Gabor used it to produce the following
output from a checkout of the doc/ tree:

  http://people.freebsd.org/~pgj/checkupdate/fgdp.txt

I haven't managed to run the shell version correctly so far, probably
because I didn't read it carefully enough, but if you are online on
EFnet IRC, please feel free to join #bsddocs and talk to me (keramida)
or Gabor (dezzy).

A minor diversion now too...

I had started the original checkupdate.py script in Python because it
tends to be more readable than shell code.  Both versions of the scripts
are now in http://hg.hellug.gr/freebsd/doc-el/ for your review.

I'm also writing a manpage for the Python version of the script, which
is available at:

  doc-el/el_GR.ISO8859-7/share/tools/checkupdate/checkupdate.1

The plan for this script is to implement something that can run in a
checkout of the doc/ tree and show us a mini-report of the Greek files
which are lagging behind their English version.  The script should read
a list of files from stdin, and check for %SOURCE% and %SRCID% tags
inside the files.  Then it should check the $FreeBSD$ version of the
master file pointed by %SOURCE% and report any differences from %SRCID%
in the original Greek file.

A sample run would look like this:

    % cd ~/work/doc
    % find el_GR.ISO8859-7 | checkupdate

    doc/el_GR.ISO8859-7/articles/Makefile
        1.39   -> 1.60    en_US.ISO8859-1/articles/Makefile

    doc/el_GR.ISO8859-7/articles/dialup-firewall/article.sgml
        1.30   -> 1.42    en_US.ISO8859-1/articles/dialup-firewall/article.sgml

    ...

It should also be possible to run the script in 'verbose' mode, by
passing options, i.e.:

    keramida-> echo foo | ./checkupdate.py -vvvv -R $(hg root)
    # Bumping verbosity level to 1
    # Bumping verbosity level to 2
    # Bumping verbosity level to 3
    # Bumping verbosity level to 4
    # Switching to workspace at `/home/keramida/hg/doc/el'
    # Workspace = `/home/keramida/hg/doc/el'
    # Processing file `foo'
    ...
    keramida->

My Python skills are not exactly "guru level" at this point, so if
someone wants to help with writing the script, you can check the code
I've uploaded to hg.hellug.gr so far, and post me patches :)

HTH,
Giorgos




More information about the Freebsd-doc-el mailing list