[packages/adapter: 47/631] - rm -rf $RPM_BUILD_ROOT at very beginnning of %install - adds %changelog and %define date if they a

glen glen at pld-linux.org
Mon Sep 12 19:38:24 CEST 2016


commit dda3eaa5b1f3b8ee247c09d81d1b5e5da1995d38
Author: Sebastian Zagrodzki <sebek at zagrodzki.net>
Date:   Tue May 9 21:09:53 2000 +0000

    - rm -rf $RPM_BUILD_ROOT at very beginnning of %install
    - adds %changelog and %define date if they aren'talready in spec.
    
    Changed files:
        adapter.awk -> 1.47

 adapter.awk | 27 +++++++++++++++++++++++----
 1 file changed, 23 insertions(+), 4 deletions(-)
---
diff --git a/adapter.awk b/adapter.awk
index df4025a..cf43d02 100644
--- a/adapter.awk
+++ b/adapter.awk
@@ -5,7 +5,7 @@
 # Copyright (C) 1999, 2000 PLD-Team <pld-list at pld.org.pl>
 # Authors:
 # 	Micha� Kuratczyk <kura at pld.org.pl>
-# 	Sebastian Zagrodzki <s.zagrodzki at sith.mimuw.edu.pl>
+# 	Sebastian Zagrodzki <s.zagrodzki at mimuw.edu.pl>
 # 	Tomasz K�oczko <kloczek at rudy.mif.pg.gda.pl>
 # 	Artur Frysiak <wiget at pld.org.pl>
 # 	Michal Kochanowicz <mkochano at ee.pw.edu.pl>
@@ -132,10 +132,22 @@ defattr == 1 {
 
 # %install section:
 /^%install/, (/^%[a-z]+$/ && !/^%install/) {
+	
 	preamble = 0
 	
-	use_macros()
+	if (/^[ \t]*rm([ \t]+-[rf]+)*[ \t]+\${?RPM_BUILD_ROOT}?/) {
+		did_clean=1
+		print "rm -rf $RPM_BUILD_ROOT"
+		next
+	}
 
+	if (!/^$/ && !/^%install/ && did_clean==0) {
+		print "rm -rf $RPM_BUILD_ROOT"
+		did_clean=1
+	}
+	
+	use_macros()
+	
 	# 'install -d' instead 'mkdir -p'
 	if (/mkdir -p/)
 		sub(/mkdir -p/, "install -d")
@@ -182,7 +194,7 @@ defattr == 1 {
 # %changelog section:
 /^%changelog/, (/^%[a-z]+$/ && !/^%changelog/) {
 	preamble = 0
-	
+	has_changelog = 1
 	# There should be some CVS keywords on the first line of %changelog.
 	if (boc == 1) {
 		if (!/PLD Team/) {
@@ -304,7 +316,14 @@ END {
 		print
 	system("rm -f " changelog_file)
 
-	if (boc == 1) {
+	if (date == 0) {
+		print ""
+		print "%define date\t%(echo `LC_ALL=\"C\" date +\"%a %b %d %Y\"`)"
+	}
+
+	if (boc > 0) {
+		print ""
+		print "%changelog"
 		print "* %{date} PLD Team <pld-list at pld.org.pl>"
 		printf "All persons listed below can be reached at "
 		print "<cvs_login>@pld.org.pl\n"
================================================================

---- gitweb:

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



More information about the pld-cvs-commit mailing list