[Moin-user] best way for script to update wiki page ?

Thomas Arthur Oehser tom at toms.net
Wed Jan 7 07:48:34 EST 2009


> Hmmm...
> 
> So, the flow in my utility should be:
> 
> 1) Detect what the latest revision is, say, 23
> 1) Read that latest revsion, (say, 23)
> 2) Process it to generate desired revision, say, 24, in /tmp
> 3) Try to mv the entry from /tmp to the data pages directory
> 4) If that fails, then someone else updated it, try again from (1)
> 
> Good?

Actually, I'll need to update FooBar/current and FooBar/edit-log
and data/edit-log and data/event-log too, in addition to the
FooBar/revisions/00000006 file...

I'm definitely uncertain as to how to do this atomically such that
there is no possible conflict with the online wikiwiki instance.

Presumably, the consequences for messing up the logs would be far
less than if "current" and/or "00000006" file were updated wrongly.

So, maybe,

1) Detect what the latest revision is, say, 23
2) Read that latest revsion, (say, 23)
3) Process it to generate desired revision, say, 24, in /tmp
4) mv the entry from tmp to revisions _and_ update current
5) If that fails, then someone else updated it, try again from (1)
6) Append to the 2 edit-log files and update the event-log

My concern is how to do (4) atomically.





More information about the Moin-user mailing list