leah blogs

July 2004

23jul2004 · Two simple Arch tools

I wrote two simple, but very useful scripts for Arch.

The first, mkrelease makes it simple to create releases off an Arch archive, but re-get-ing the source and running a hook. It creates .tar.gz archives for now.

To use it, you’ll need a file =mkrelease in {arch} or the current dir, which will be read by the shell. At least, define version here, which returns the version used in the archive name. For example:

function version {
  ruby -r rlml -e 'puts RLML::VERSION'
}

Optionally, you also may define a posthook, to change files, generate documentation, etc.

After configuring and running mkrelease, you get a nice tarball in your working directory, or the +releases directory, if present.

The second script it likely to create some anger among fellow Arch users, because it’s a implementation of a controversial issue: expanding CVS-like keywords. tla-keywords is a Ruby script to do exactly this job.

It implements most of the useful CVS tags, such as $Author$, $Date$, $Id$, $Header$, $Revision$ and $Source$. There are some Arch specifc keywords too, such as $Arch-Full-Id$.

As a simple example, it converts: FULLVERSION = “$Id$” to : FULLVERSION = “$Id: rlml.rb 0.9 2004/07/23 11:44:12 chneukirchen devo $”

It’s not made to be used for ordinary source files, but when the source leaves the Arch world, for example, after a release. (It works nicely with above mkrelease).

It modifies files in-place, and provides a special keyword to allow meaningful defaults, for example (this is one line):

FULLVERSION = `tla logs -f | tail -1`  # $Arch-Replace: \
              `tla logs -f | tail -1` -> $Arch-Revision$ $

will get replaced with $Arch-Revision$ (which has already been expanded).

Happy hacking!

Hefe ist ein kleines Lebewesen, das Zucker frisst, und dann Alkohol pisst und Kohlenstoffdioxid furzt… [Ja, die Bierbrauer… ;-)]

NP: Steppenwolf—Born To Be Wild

Copyright © 2004–2022