[...]
I came up with the following, which should make upgrading easier in
the future. You'll still have to hand-merge this into your existing
scripts though, sorry, but from then on, non-conflicting updates to
g-b-s should be easily retrieved.
How it works: When invoked with the `upgrade-self' command, the script
attempts to get the HEAD-version from cvs, if it hasn't in the last
24 hours. This HEAD-version is invoked with the `version' command
to get it's CVS-revision. If it was just downloaded, the HEAD revision
is stored in /usr/share/gbs as generic-build-script-HEAD and
generic-build-script-<HEAD-revision> If the HEAD-revision doesn't
match this build-script's CVS-revision, the build-script's revision
is gotten from /usr/share/gbs if available, otherwise it is gotten
through CVS and stored in /usr/share/gbs. Than merging is done
on a copy of the build-script. If the merge has conflicts, one is
given the possibility to edit the script and the option to reject the
new script. Finally the new script is copied into place and executed
with the remaining parameters.