[packages/adapter: 421/631] - add parsable versioning

glen glen at pld-linux.org
Mon Sep 12 20:09:44 CEST 2016


commit 18f95017a2a5c7a760ac61a897be845ef1a0fb11
Author: Elan Ruusamäe <glen at pld-linux.org>
Date:   Wed Sep 24 15:23:14 2008 +0000

    - add parsable versioning
    
    Changed files:
        adapter.awk -> 1.401
        adapter.sh -> 1.30

 adapter.awk |  7 +++++--
 adapter.sh  | 17 +++++++++++++----
 2 files changed, 18 insertions(+), 6 deletions(-)
---
diff --git a/adapter.awk b/adapter.awk
index 2ef6b1b..5e13caa 100644
--- a/adapter.awk
+++ b/adapter.awk
@@ -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:
@@ -30,6 +29,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)"
 
 	usedigest = 0	# Enable to switch to rpm 4.4.6+ md5 digests
diff --git a/adapter.sh b/adapter.sh
index 7bf8d57..5b38684 100644
--- a/adapter.sh
+++ b/adapter.sh
@@ -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 @@ if [ ! -x /usr/bin/patch ]; then
 	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
@@ -61,6 +66,10 @@ while true; do
 	-a|--skip-defattr)
 		export SKIP_DEFATTR=1
 	;;
+	-V|--version)
+		echo "$VERSIONSTRING"
+		exit 0
+	;;
 	--)
 		shift
 		break
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/adapter.git/commitdiff/6ca0126d4d0c8c79feb7db10b0a0fade0f3b8885



More information about the pld-cvs-commit mailing list