public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo-x86 commit in sys-devel/gcc/files/awk: fixlafiles.awk-no_gcc_la
@ 2009-03-31  7:59 Timothy Redaelli (drizzt)
  0 siblings, 0 replies; 2+ messages in thread
From: Timothy Redaelli (drizzt) @ 2009-03-31  7:59 UTC (permalink / raw
  To: gentoo-commits

drizzt      09/03/31 07:59:19

  Modified:             fixlafiles.awk-no_gcc_la
  Log:
  Fix files/awk/fixlafiles.awk-no_gcc_la for POSIX shell compliant.
  Output functions taken from files/awk/fixlafiles.awk.
  Authorized by vapier wrt #264309.
  (Portage version: 2.2_rc28/cvs/Linux x86_64)

Revision  Changes    Path
1.3                  sys-devel/gcc/files/awk/fixlafiles.awk-no_gcc_la

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-devel/gcc/files/awk/fixlafiles.awk-no_gcc_la?rev=1.3&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-devel/gcc/files/awk/fixlafiles.awk-no_gcc_la?rev=1.3&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-devel/gcc/files/awk/fixlafiles.awk-no_gcc_la?r1=1.2&r2=1.3

Index: fixlafiles.awk-no_gcc_la
===================================================================
RCS file: /var/cvsroot/gentoo-x86/sys-devel/gcc/files/awk/fixlafiles.awk-no_gcc_la,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- fixlafiles.awk-no_gcc_la	15 May 2006 00:17:46 -0000	1.2
+++ fixlafiles.awk-no_gcc_la	31 Mar 2009 07:59:19 -0000	1.3
@@ -1,27 +1,27 @@
 # Copyright 1999-2005 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc/files/awk/fixlafiles.awk-no_gcc_la,v 1.2 2006/05/15 00:17:46 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc/files/awk/fixlafiles.awk-no_gcc_la,v 1.3 2009/03/31 07:59:19 drizzt Exp $
 
 #
 # Helper functions
 #
 function printn(string) {
-	system("echo -n \"" string "\"")
+	printf("%s", string)
 }
 function einfo(string) {
-	system("echo -e \" \\e[32;01m*\\e[0m " string "\"")
+	printf(" \033[32;01m*\033[0m %s\n", string)
 }
 function einfon(string) {
-	system("echo -ne \" \\e[32;01m*\\e[0m " string "\"")
+	printf(" \033[32;01m*\033[0m %s", string)
 }
 function ewarn(string) {
-	system("echo -e \" \\e[33;01m*\\e[0m " string "\"")
+	printf(" \033[33;01m*\033[0m %s\n", string)
 }
 function ewarnn(string) {
-	system("echo -ne \" \\e[33;01m*\\e[0m " string "\"")
+	printf(" \033[33;01m*\033[0m %s", string)
 }
 function eerror(string) {
-	system("echo -e \" \\e[31;01m*\\e[0m " string "\"")
+	printf(" \033[31;01m*\033[0m %s\n", string)
 }
 
 #






^ permalink raw reply	[flat|nested] 2+ messages in thread

* [gentoo-commits] gentoo-x86 commit in sys-devel/gcc/files/awk: fixlafiles.awk-no_gcc_la
@ 2010-03-19 23:53 Mike Frysinger (vapier)
  0 siblings, 0 replies; 2+ messages in thread
From: Mike Frysinger (vapier) @ 2010-03-19 23:53 UTC (permalink / raw
  To: gentoo-commits

vapier      10/03/19 23:53:08

  Modified:             fixlafiles.awk-no_gcc_la
  Log:
  Add support for the "include" keyword in ld.so.conf #304843 by Nico R.
  (Portage version: 2.2_rc67/cvs/Linux x86_64)

Revision  Changes    Path
1.4                  sys-devel/gcc/files/awk/fixlafiles.awk-no_gcc_la

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-devel/gcc/files/awk/fixlafiles.awk-no_gcc_la?rev=1.4&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-devel/gcc/files/awk/fixlafiles.awk-no_gcc_la?rev=1.4&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-devel/gcc/files/awk/fixlafiles.awk-no_gcc_la?r1=1.3&r2=1.4

Index: fixlafiles.awk-no_gcc_la
===================================================================
RCS file: /var/cvsroot/gentoo-x86/sys-devel/gcc/files/awk/fixlafiles.awk-no_gcc_la,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- fixlafiles.awk-no_gcc_la	31 Mar 2009 07:59:19 -0000	1.3
+++ fixlafiles.awk-no_gcc_la	19 Mar 2010 23:53:07 -0000	1.4
@@ -1,6 +1,6 @@
 # Copyright 1999-2005 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc/files/awk/fixlafiles.awk-no_gcc_la,v 1.3 2009/03/31 07:59:19 drizzt Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc/files/awk/fixlafiles.awk-no_gcc_la,v 1.4 2010/03/19 23:53:07 vapier Exp $
 
 #
 # Helper functions
@@ -50,6 +50,54 @@
 		return 0
 }
 
+#
+# parse_ld_conf(config_file)
+#
+function parse_ld_conf(conf,    pipe, ldsoconf_data, CHILD, y) {
+	pipe = "cd /etc; cat " conf " | sort 2>/dev/null"
+	while(((pipe) | getline ldsoconf_data) > 0) {
+		if (ldsoconf_data ~ /^[[:space:]]*#/)
+			continue
+		if (ldsoconf_data == "")
+			continue
+
+		# Handle the "include" keyword
+		if (ldsoconf_data ~ /^include /) {
+			sub(/^include /, "", ldsoconf_data)
+			parse_ld_conf(ldsoconf_data)
+			continue
+		}
+
+		# Remove any trailing comments
+		sub(/#.*$/, "", ldsoconf_data)
+		# Remove any trailing spaces
+		sub(/[[:space:]]+$/, "", ldsoconf_data)
+		# Eat duplicate slashes
+		sub(/\/\//, "/", ldsoconf_data)
+		# Prune trailing /
+		sub(/\/$/, "", ldsoconf_data)
+
+		#
+		# Drop the directory if its a child directory of
+		# one that was already added ...
+		# For example, if we have:
+		#   /usr/lib /usr/libexec /usr/lib/mozilla /usr/lib/nss
+		# We really just want to save /usr/lib /usr/libexec
+		#
+		CHILD = 0
+		for (y in DIRLIST) {
+			if (ldsoconf_data ~ "^" DIRLIST[y] "(/|$)") {
+				CHILD = 1
+				break
+			}
+		}
+		if (CHILD) continue
+
+		DIRLIST[++LIBCOUNT] = ldsoconf_data
+	}
+	close(pipe)
+}
+
 BEGIN {
 	#
 	# Get our variables from environment
@@ -71,50 +119,7 @@
 	#
 	# Walk /etc/ld.so.conf to discover all our library paths
 	#
-	pipe = "cat /etc/ld.so.conf | sort 2>/dev/null"
-	while(((pipe) | getline ldsoconf_data) > 0) {
-		if (ldsoconf_data !~ /^[[:space:]]*#/) {
-			if (ldsoconf_data == "") continue
-
-			# Remove any trailing comments
-			sub(/#.*$/, "", ldsoconf_data)
-			# Remove any trailing spaces
-			sub(/[[:space:]]+$/, "", ldsoconf_data)
-
-			# If there's more than one path per line, split 
-			# it up as if they were sep lines
-			split(ldsoconf_data, nodes, /[:,[:space:]]/)
-
-			# Now add the rest from ld.so.conf
-			for (x in nodes) {
-				# wtf does this line do ?
-				sub(/=.*/, "", nodes[x])
-				# Prune trailing /
-				sub(/\/$/, "", nodes[x])
-
-				if (nodes[x] == "") continue
-
-				#
-				# Drop the directory if its a child directory of
-				# one that was already added ...
-				# For example, if we have:
-				#   /usr/lib /usr/libexec /usr/lib/mozilla /usr/lib/nss
-				# We really just want to save /usr/lib /usr/libexec
-				#
-				CHILD = 0
-				for (y in DIRLIST) {
-					if (nodes[x] ~ "^" DIRLIST[y] "(/|$)") {
-						CHILD = 1
-						break
-					}
-				}
-				if (CHILD) continue
-
-				DIRLIST[++LIBCOUNT] = nodes[x]
-			}
-		}
-	}
-	close(pipe)
+	parse_ld_conf("/etc/ld.so.conf")
 
 	#
 	# Get line from gcc's output containing CHOST






^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-03-19 23:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-31  7:59 [gentoo-commits] gentoo-x86 commit in sys-devel/gcc/files/awk: fixlafiles.awk-no_gcc_la Timothy Redaelli (drizzt)
  -- strict thread matches above, loose matches on Subject: below --
2010-03-19 23:53 Mike Frysinger (vapier)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox