[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnu-arch-users] new version hook script examples
From: |
Zenaan Harkness |
Subject: |
[Gnu-arch-users] new version hook script examples |
Date: |
Sat, 25 Sep 2004 12:26:54 +1000 |
This seems to come up in public comments any time arch come up.
This thread might be a good place for people to post their hook scripts
to give lurkers/ future users something to go on.
This particular example sets new version based on current date, which is
what I prefer for the Java project I am currently working on. It works
since I have a "constants" file called D.java that other parts of the
system refer to when they want to display such data (eg. window title
bars).
#!/bin/bash
RELEASE_DATE=`date +%Y%m%d-%H.%M.%S`
VERSION_SED_STRING='%my-version%'
sed -e "s/$VERSION_SED_STRING/$RELEASE_DATE/" D.java > D.java
As you can see, I'm overwriting the file, and before doing this, my
build script copies that file to a temporary location, so the original
stays the same, then after the sed, the build takes place.
There's probably more elegant solutions, I'm still a 'young scripter'.
cheers
zen
--
Homepage: http://www.soulsound.net/
Please respect the confidentiality of this email as sensibly warranted.
- [Gnu-arch-users] new version hook script examples,
Zenaan Harkness <=