[packages/adapter: 305/631] - replace into %service and %useradd macros

glen glen at pld-linux.org
Mon Sep 12 20:00:01 CEST 2016


commit 723ce7324e9c43df39b5d8f9aa98c45835f376ec
Author: Elan Ruusamäe <glen at pld-linux.org>
Date:   Tue Mar 14 08:22:29 2006 +0000

    - replace into %service and %useradd macros
    
    Changed files:
        adapter.awk -> 1.295

 adapter.awk | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
---
diff --git a/adapter.awk b/adapter.awk
index 8772f19..32141d2 100644
--- a/adapter.awk
+++ b/adapter.awk
@@ -537,12 +537,18 @@ function b_makekey(a, b,	s) {
 /^%pre/, (!/^%pre/ && $0 ~ SECTIONS) {
 	preamble = 0
 
+	if (gsub("/usr/sbin/useradd", "%useradd")) {
+		sub(" 2> /dev/null \|\| :", "");
+		sub(" >/dev/null 2>&1 \|\|:", "");
+	}
+
 	# %useradd and %groupadd may not be wrapped
 	if (/%(useradd|groupadd).*\\$/) {
 		a = $0; getline;
 		sub(/^[\s\t]*/, "");
 		$0 = substr(a, 1, length(a) - 1) $0;
 	}
+	use_script_macros()
 }
 
 /^%post/, (!/^%post/ && $0 ~ SECTIONS) {
@@ -551,30 +557,39 @@ function b_makekey(a, b,	s) {
 }
 /^%preun/, (!/^%preun/ && $0 ~ SECTIONS) {
 	preamble = 0
+	use_script_macros()
 }
 /^%postun/, (!/^%postun/ && $0 ~ SECTIONS) {
 	preamble = 0
+	use_script_macros()
 }
 /^%triggerin/, (!/^%triggerin/ && $0 ~ SECTIONS) {
 	preamble = 0
+	use_script_macros()
 }
 /^%triggerun/, (!/^%triggerun/ && $0 ~ SECTIONS) {
 	preamble = 0
+	use_script_macros()
 }
 /^%triggerpostun/, (!/^%triggerpostun/ && $0 ~ SECTIONS) {
 	preamble = 0
+	use_script_macros()
 }
 /^%pretrans/, (!/^%pretrans/ && $0 ~ SECTIONS) {
 	preamble = 0
+	use_script_macros()
 }
 /^%posttrans/, (!/^%posttrans/ && $0 ~ SECTIONS) {
 	preamble = 0
+	use_script_macros()
 }
 /^%verifyscript/, (!/^%verifyscript/ && $0 ~ SECTIONS) {
 	preamble = 0
+	use_script_macros()
 }
 /^%check/, (!/^%check/ && $0 ~ SECTIONS) {
 	preamble = 0
+	use_script_macros()
 }
 
 #############
@@ -1332,6 +1347,14 @@ function use_files_macros(	i, n, t, a)
 	gsub("%{_datadir}/pixmaps", "%{_pixmapsdir}");
 }
 
+function use_script_macros()
+{
+	if (gsub("/sbin/service", "%service")) {
+		sub(" >/dev/null 2>&1 \|\|:", "");
+		sub(" 2> /dev/null \|\| :", "");
+	}
+}
+
 function fill(ch, n, i) {
 	for (i = 0; i < n; i++)
 		printf("%c", ch)
================================================================

---- gitweb:

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



More information about the pld-cvs-commit mailing list