]> git.pld-linux.org Git - packages/rpm-build-tools.git/commitdiff
version 0.12
authorkura <kura@pld-linux.org>
Sat, 26 Feb 2000 12:44:18 +0000 (12:44 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
- added moving %changelog to the end of spec

Changed files:
    adapter.awk -> 1.23

adapter.awk

index 090dc826156b40daa16c12c65b2d10357ecf367e..3f9ecb60b1bfe69dc1f4b3f8ea919ba143cc47df 100644 (file)
@@ -1,6 +1,6 @@
 #!/bin/awk -f
 #
-# This is adapter v0.11. Adapter adapts .spec files for PLD.
+# This is adapter v0.12. Adapter adapts .spec files for PLD.
 # Copyright (C) 1999 Micha³ Kuratczyk <kura@pld.org.pl>
 
 BEGIN {
@@ -9,7 +9,10 @@ BEGIN {
        bod = 0                 # Beggining of %description
        tw = 77                 # Descriptions width
        groups_file = ENVIRON["HOME"] "/rpm/groups" # File with rpm groups
-       
+
+       # Temporary file for changelog section
+       changelog_file = ENVIRON["HOME"] "/tmp/adapter.changelog"
+
        # Is 'date' macro already defined?
        if (is_there_line("%define date"))
                date = 1
@@ -162,10 +165,10 @@ defattr == 1 {
        # There should be some CVS keywords on the first line of %changelog.
        if (boc == 1) {
                if (!/PLD Team/) {
-                       print "* %{date} PLD Team <pld-list@pld.org.pl>"
-                       printf "All below listed persons can be reached on "
-                       print "<cvs_login>@pld.org.pl\n"
-                       print "$" "Log:$"
+                       print "* %{date} PLD Team <pld-list@pld.org.pl>" > changelog_file
+                       printf "All below listed persons can be reached on " > changelog_file
+                       print "<cvs_login>@pld.org.pl\n" > changelog_file
+                       print "$" "Log:$" > changelog_file
                }
                boc = 0
        }
@@ -173,11 +176,17 @@ defattr == 1 {
        # Define date macro.
        if (boc == 2) {
                if (date == 0) {
-                       printf "%%define date\t%%(echo `LC_ALL=\"C\""
-                       print " date +\"%a %b %d %Y\"`)"
+                       printf "%%define date\t%%(echo `LC_ALL=\"C\"" > changelog_file
+                       print " date +\"%a %b %d %Y\"`)" > changelog_file
                }
        boc--
        }
+
+       if (!/^%[a-z]+$/ || /%changelog/)
+               print > changelog_file
+       else
+               print
+       next
 }
 
 # preambles:
@@ -266,12 +275,21 @@ preamble == 1 {
 }
 
 END {
+       if (changelog_file)
+               close(changelog_file)
+                       
        if (boc == 1) {
                print "* %{date} PLD Team <pld-list@pld.org.pl>"
                printf "All below listed persons can be reached on "
                print "<cvs_login>@pld.org.pl\n"
                print "$" "Log:$"
+       } else {
+               while ((getline < changelog_file) > 0)
+                       print
        }
+
+       if (changelog_file)
+               system("rm -f " changelog_file)
 }
 
 # This function uses grep to determine if there is line (in the current file)
This page took 0.047367 seconds and 4 git commands to generate.