SPECS: adapter.awk, adapter - add parsable versioning
glen
glen at pld-linux.org
Wed Sep 24 17:23:20 CEST 2008
Author: glen Date: Wed Sep 24 15:23:20 2008 GMT
Module: SPECS Tag: HEAD
---- Log message:
- add parsable versioning
---- Files affected:
SPECS:
adapter.awk (1.400 -> 1.401) , adapter (1.29 -> 1.30)
---- Diffs:
================================================================
Index: SPECS/adapter.awk
diff -u SPECS/adapter.awk:1.400 SPECS/adapter.awk:1.401
--- SPECS/adapter.awk:1.400 Wed Sep 24 16:52:20 2008
+++ SPECS/adapter.awk Wed Sep 24 17:23:14 2008
@@ -1,7 +1,6 @@
#!/usr/bin/gawk -f
#
-# This is adapter v0.31. Adapter adapts .spec files for PLD Linux.
-# $Id$
+# Adapter adapts .spec files for PLD Linux.
#
# Copyright (C) 1999-2007 PLD-Team <feedback at pld-linux.org>
# Authors:
@@ -29,6 +28,10 @@
BEGIN {
RPM_SECTIONS = "package|build|changelog|clean|description|install|post|posttrans|postun|pre|prep|pretrans|preun|triggerin|triggerpostun|triggerun|verifyscript|check"
SECTIONS = "^%(" RPM_SECTIONS ")"
+
+ RCSID = "$Id$"
+ rev = RCSID # TODO: parse from RCSID
+ VERSION = "0.31/" rev
PREAMBLE_TAGS = "(R|BR|Summary|Name|Version|Release|Epoch|License|Group|URL|BuildArch|BuildRoot|Obsoletes|Conflicts|Provides|ExclusiveArch|ExcludeArch|Pre[Rr]eq|(Build)?Requires|Suggests)"
================================================================
Index: SPECS/adapter
diff -u SPECS/adapter:1.29 SPECS/adapter:1.30
--- SPECS/adapter:1.29 Wed Sep 24 16:52:33 2008
+++ SPECS/adapter Wed Sep 24 17:23:14 2008
@@ -1,8 +1,5 @@
#!/bin/sh
#
-# This is adapter v0.31. Adapter adapts .spec files for PLD Linux.
-#
-# Copyright (C) 1999-2003 PLD-Team <feedback at pld-linux.org>
# Authors:
# Michał Kuratczyk <kura at pld.org.pl>
# Sebastian Zagrodzki <s.zagrodzki at mimuw.edu.pl>
@@ -15,6 +12,14 @@
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
+RCSID='$Id$'
+r=${RCSID#* * }
+rev=${r%% *}
+VERSION="v0.31/$rev"
+VERSIONSTRING="\
+Adapter adapts .spec files for PLD Linux.
+$VERSION (C) 1999-2008 Free Penguins".
+
self=$(basename "$0")
adapter=$(dirname "$0")/adapter.awk
usage="Usage: $self [FLAGS] SPECFILE
@@ -40,7 +45,7 @@
exit 1
fi
-t=`getopt -o hsmda --long help,sort,sort-br,no-macros,skip-macros,skip-desc,skip-defattr -n "$self" -- "$@"` || exit $?
+t=$(getopt -o hsmdaV --long help,version,sort,sort-br,no-macros,skip-macros,skip-desc,skip-defattr -n "$self" -- "$@") || exit $?
eval set -- "$t"
while true; do
@@ -60,6 +65,10 @@
;;
-a|--skip-defattr)
export SKIP_DEFATTR=1
+ ;;
+ -V|--version)
+ echo "$VERSIONSTRING"
+ exit 0
;;
--)
shift
================================================================
---- CVS-web:
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SPECS/adapter.awk?r1=1.400&r2=1.401&f=u
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SPECS/adapter?r1=1.29&r2=1.30&f=u
More information about the pld-cvs-commit
mailing list