/[gentoo-src]/rc-scripts/src/awk/cachedepends.awk
Gentoo

Diff of /rc-scripts/src/awk/cachedepends.awk

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.8 Revision 1.9
1# Copyright 1999-2003 Gentoo Technologies, Inc. 1# Copyright 1999-2003 Gentoo Technologies, Inc.
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# Author: Martin Schlemmer <azarah@gentoo.org> 3# Author: Martin Schlemmer <azarah@gentoo.org>
4# $Header: /var/cvsroot/gentoo-src/rc-scripts/src/awk/cachedepends.awk,v 1.8 2003/02/06 02:00:01 azarah Exp $ 4# $Header: /var/cvsroot/gentoo-src/rc-scripts/src/awk/cachedepends.awk,v 1.9 2003/02/06 02:08:05 azarah Exp $
5 5
6function print_start() { 6function print_start() {
7 print "source /sbin/functions.sh" >> (DEPCACHE) 7 print "source /sbin/functions.sh" >> (DEPCACHE)
8 print "" >> (DEPCACHE) 8 print "" >> (DEPCACHE)
9 print "need() {" >> (DEPCACHE) 9 print "need() {" >> (DEPCACHE)
119 continue 119 continue
120 } 120 }
121 } 121 }
122 122
123 # Filter out comments and only process if its a rcscript 123 # Filter out comments and only process if its a rcscript
124 if (($0 !~ /^[[:space:]]*#/) && (ISRCSCRIPT == 1)) { 124 if (($0 !~ /^[[:space:]]*#/) && (ISRCSCRIPT)) {
125 125
126 # If line contain 'depend()', set GOTDEPEND to 1 126 # If line contain 'depend()', set GOTDEPEND to 1
127 if ($0 ~ /depend[[:space:]]*\(\)/) { 127 if ($0 ~ /depend[[:space:]]*\(\)/) {
128 128
129 GOTDEPEND = 1 129 GOTDEPEND = 1
131 print_header2() 131 print_header2()
132 print " # Actual depend() function ..." >> (DEPCACHE) 132 print " # Actual depend() function ..." >> (DEPCACHE)
133 } 133 }
134 134
135 # We have the depend function... 135 # We have the depend function...
136 if (GOTDEPEND == 1) { 136 if (GOTDEPEND) {
137 137
138 # Basic theory is that COUNT will be 0 when we 138 # Basic theory is that COUNT will be 0 when we
139 # have matching '{' and '}' 139 # have matching '{' and '}'
140 COUNT += gsub(/{/, "{") 140 COUNT += gsub(/{/, "{")
141 COUNT -= gsub(/}/, "}") 141 COUNT -= gsub(/}/, "}")

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

  ViewVC Help
Powered by ViewVC 1.1.20