[packages/adapter: 67/631] - removed all uses of "is_there_line" - adapter can be now used as pipeline filter (%r!adapter.awk
glen
glen at pld-linux.org
Mon Sep 12 19:40:05 CEST 2016
commit ba4b52a7826401e35a7ea5c3b749cca777b041e9
Author: Sebastian Zagrodzki <sebek at zagrodzki.net>
Date: Mon Jul 31 08:37:23 2000 +0000
- removed all uses of "is_there_line" - adapter can be now used as
pipeline filter (%r!adapter.awk works in vim :) )
Changed files:
adapter.awk -> 1.67
adapter.awk | 22 +++-------------------
1 file changed, 3 insertions(+), 19 deletions(-)
---
diff --git a/adapter.awk b/adapter.awk
index 41c7afd..72e766b 100644
--- a/adapter.awk
+++ b/adapter.awk
@@ -24,10 +24,6 @@ BEGIN {
# 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
-
# Load rpm macros
"rpm --eval %_prefix" | getline prefix
"rpm --eval %_bindir" | getline bindir
@@ -62,7 +58,9 @@ defattr == 1 {
# Remove defining _applnkdir (this macro has been included in rpm-3.0.4)
/^%define/ {
if ($2 == "_applnkdir")
- next
+ next
+ if ($2 == "date")
+ date = 1
}
# descriptions:
@@ -411,20 +409,6 @@ END {
}
}
-# This function uses grep to determine if there is line (in the current file)
-# which matches regexp.
-function is_there_line(line, l)
-{
- command = "grep \"" line "\" " ARGV[1]
- command | getline l
- close(command)
-
- if (l != "")
- return 1
- else
- return 0
-}
-
# There should be one or two tabs after the colon.
function format_preamble()
{
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/adapter.git/commitdiff/6ca0126d4d0c8c79feb7db10b0a0fade0f3b8885
More information about the pld-cvs-commit
mailing list