[packages/adapter: 468/631] - export pkgconfigdir - versionize awk and shell script dependency - allow adapter.awk to return non

glen glen at pld-linux.org
Mon Sep 12 20:13:40 CEST 2016


commit a4de4386cf6efbb93780a7b693d3c31e1b6e4bf6
Author: Elan Ruusamäe <glen at pld-linux.org>
Date:   Mon Feb 22 08:23:26 2010 +0000

    - export pkgconfigdir
    - versionize awk and shell script dependency
    - allow adapter.awk to return non-ok exit code
    - update copyright year
    
    Changed files:
        adapter.awk -> 1.439
        adapter.sh -> 1.44

 adapter.awk | 21 ++++++++++++++++-----
 adapter.sh  | 16 +++++++++-------
 2 files changed, 25 insertions(+), 12 deletions(-)
---
diff --git a/adapter.awk b/adapter.awk
index 2c5eebf..0713152 100644
--- a/adapter.awk
+++ b/adapter.awk
@@ -2,7 +2,7 @@
 #
 # Adapter adapts .spec files for PLD Linux.
 #
-# Copyright (C) 1999-2008 PLD-Team <feedback at pld-linux.org>
+# Copyright (C) 1999-2010 PLD-Team <feedback at pld-linux.org>
 # Authors:
 # 	Michał Kuratczyk <kura at pld.org.pl>
 # 	Sebastian Zagrodzki <s.zagrodzki at mimuw.edu.pl>
@@ -137,7 +137,7 @@ function b_makekey(a, b,	s) {
 		while (getline)		# print the rest of spec as it is
 			print
 		do_not_touch_anything = 1 # do not touch anything in END()
-		exit 0
+		exit(rc = 0)
 	}
 
 	# Generally, comments are printed without touching
@@ -975,8 +975,9 @@ preamble == 1 {
 
 
 END {
-	if (do_not_touch_anything)
-		exit 0
+	if (do_not_touch_anything) {
+		exit(rc)
+	}
 
 	# TODO: need to output these in proper place
 	if (BR_count > 0) {
@@ -1092,6 +1093,9 @@ function use_macros()
 	gsub("%{_datadir}/pixmaps", "%{_pixmapsdir}")
 	gsub("%{_datadir}/java", "%{_javadir}")
 
+	gsub("%{_libdir}/pkgconfig", "%{_pkgconfigdir}")
+	gsub(pkgconfigdir, "%{_pkgconfigdir}")
+
 	gsub(libdir, "%{_libdir}")
 	gsub(javadir, "%{_javadir}")
 
@@ -1724,7 +1728,13 @@ function import_rpm_macros() {
 	if (!topdir) {
 		print "adapter.awk should not not be invoked directly, but via adapter script" > "/dev/stderr"
 		do_not_touch_anything = 1
-		exit(1);
+		exit(rc = 1);
+	}
+
+	if (!ENVIRON["ADAPTER_REVISION"] || ENVIRON["ADAPTER_REVISION"] < 1.44) {
+		print "adapter shell script is outdated, please cvs up it" > "/dev/stderr"
+		do_not_touch_anything = 1
+		exit(rc = 1);
 	}
 
 	# get cvsaddress for changelog section
@@ -1748,6 +1758,7 @@ function import_rpm_macros() {
 	desktopdir = ENVIRON["_desktopdir"]
 	pixmapsdir = ENVIRON["_pixmapsdir"]
 	javadir = ENVIRON["_javadir"]
+	pkgconfigdir = ENVIRON["_pkgconfigdir"]
 
 	perl_sitearch = ENVIRON["perl_sitearch"]
 	perl_archlib = ENVIRON["perl_archlib"]
diff --git a/adapter.sh b/adapter.sh
index f3b2505..94a1c3d 100644
--- a/adapter.sh
+++ b/adapter.sh
@@ -13,12 +13,11 @@
 # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
 
 RCSID='$Id$'
-r=${RCSID#* * }
-rev=${r%% *}
-VERSION="v0.35/$rev"
+REVISION=${RCSID#* * } REVISION=${REVISION%% *}
+VERSION="v0.35/$REVISION"
 VERSIONSTRING="\
 Adapter adapts .spec files for PLD Linux.
-$VERSION (C) 1999-2009 Free Penguins".
+$VERSION (C) 1999-2010 Free Penguins".
 
 PROGRAM=${0##*/}
 dir=$(d=$0; [ -L "$d" ] && d=$(readlink "$d"); dirname "$d")
@@ -194,6 +193,7 @@ import_rpm_macros() {
 	_desktopdir
 	_pixmapsdir
 	_javadir
+	_pkgconfigdir
 
 	perl_sitearch
 	perl_archlib
@@ -231,19 +231,21 @@ import_rpm_macros() {
 	export _cvsmailfeedback='%{?_cvsmailfeedback}%{!?_cvsmailfeedback:PLD Team <feedback at pld-linux.org>}'
 	"
 
+	export ADAPTER_REVISION=$REVISION
+
 	eval $(rpm --eval "$(echo -e $eval_expr)")
 }
 
 adapterize() {
 	local workdir
-	workdir=$(mktemp -d ${TMPDIR:-/tmp}/adapter-XXXXXX) || exit
+	workdir=$(mktemp -d ${TMPDIR:-/tmp}/adapter-XXXXXX) || exit $?
 	awk=gawk
 
-	local tmp=$workdir/$(basename $SPECFILE) || exit
+	local tmp=$workdir/$(basename $SPECFILE) || exit $?
 
 	import_rpm_macros
 
-	LC_ALL=en_US.UTF-8 $awk -f $adapter $SPECFILE > $tmp || exit
+	LC_ALL=en_US.UTF-8 $awk -f $adapter $SPECFILE > $tmp || exit $?
 
 	if [ "$outputonly" = 1 ]; then
 		cat $tmp
================================================================

---- gitweb:

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



More information about the pld-cvs-commit mailing list