added version expansion default tip
authorroot@ux6600ws107.fsdportal.local
Sat, 07 Mar 2009 14:54:08 +0100
changeset 5 4654114e55a4
parent 4 3d856ef07f9f
added version expansion
Makefile
iconv.pl
--- a/Makefile	Sat Mar 07 14:23:28 2009 +0100
+++ b/Makefile	Sat Mar 07 14:54:08 2009 +0100
@@ -3,11 +3,12 @@
 group = $(shell id -gn ${user})
 dir  = ~$(user)/htdocs/tools
 
-.PHONY:	all install clean
+version = $(shell hg id -it; hg parents --template '{author} {date|isodate}')
+
+.PHONY:	all install clean .version
 
 all:	iconv
-install:
-	HGRCPATH=.hgrc hg kwexpand
+install: all .version
 	install -m0555 -o ${user} -g ${group} iconv ${dir}/iconv.pl
 
 clean:
@@ -15,4 +16,6 @@
 
 iconv:	iconv.pl
 	perl -c $<
-	install -m0555 $< $@
+	install -m0755 $< $@
+	perl -i -pe 's/_VERSION_/${version}/g' $@
+	chmod u-w $@
--- a/iconv.pl	Sat Mar 07 14:23:28 2009 +0100
+++ b/iconv.pl	Sat Mar 07 14:54:08 2009 +0100
@@ -12,7 +12,7 @@
 $ENV{LANG} = "C";
 delete @ENV{ grep /^LC_/, keys %ENV };
 
-my $VERSION = '$Id$';
+my $VERSION = '_VERSION_';
 
 my $ME       = basename $0;
 my $CHARSETS = [qw(cp437 cp850 latin1)];