[packages/adapter: 185/631] - set missing NVR if possible

glen glen at pld-linux.org
Mon Sep 12 19:49:58 CEST 2016


commit 1462d6a3763fe17e14e5ece17aca65f046947ab1
Author: Elan Ruusamäe <glen at pld-linux.org>
Date:   Mon Sep 5 10:43:47 2005 +0000

    - set missing NVR if possible
    
    Changed files:
        adapter.awk -> 1.177

 adapter.awk | 36 ++++++++++++++++++++++++++++++++++--
 1 file changed, 34 insertions(+), 2 deletions(-)
---
diff --git a/adapter.awk b/adapter.awk
index fae4814..26544d5 100644
--- a/adapter.awk
+++ b/adapter.awk
@@ -421,6 +421,12 @@ preamble == 1 {
 	# and before the colon.
 	sub(/[ \t]*:/, ":")
 
+	if (/^%perl_module_wo_prefix/) {
+		name = $2
+		version = $3
+		release = "0." fixedsub(".%{disttag}.at", "", $4)
+	}
+
 	field = tolower($1)
 	fieldnlower = $1
 	if (field ~ /group(\([^)]+\)):/)
@@ -478,11 +484,20 @@ preamble == 1 {
 	if (field ~ /copyright:/ && $2 ~ /GPL|BSD/)
 		$1 = "License:"
 
-	if (field ~ /name:/)
+	if (field ~ /name:/) {
 		name = $2
+		name_seen = 1;
+	}
 
-	if (field ~ /version:/)
+	if (field ~ /version:/) {
 		version = $2
+		version_seen = 1;
+	}
+
+	if (field ~ /release:/) {
+		release = $2
+		release_seen = 1;
+	}
 
 	if (field ~ /serial:/)
 		$1 = "Epoch:"
@@ -611,6 +626,21 @@ preamble == 1 {
 
 	sub(/[ \t]+$/, "")
 	print
+
+	if (name_seen == 0 && name) {
+		print "Name:\t" name
+		name_seen = 1
+	}
+
+	if (version_seen == 0 && version) {
+		print "Version:\t" version
+		version_seen = 1
+	}
+
+	if (release_seen == 0 && release) {
+		print "Release:\t" release
+		release_seen = 1
+	}
 }
 
 
@@ -623,6 +653,8 @@ END {
 		print
 	system("rm -f " changelog_file)
 
+
+
 	if (did_clean == 0) {
 		print ""
 		print "%clean"
================================================================

---- gitweb:

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



More information about the pld-cvs-commit mailing list