Browse Source

sde-config: Introduced get_field() function to extract the value of a "^#Foo: ..." line

user/chris/test/patchcksum
Alejandro Mery 13 years ago
parent
commit
f309f098b4
1 changed files with 9 additions and 1 deletions
  1. +9
    -1
      lib/sde-config/functions.in

+ 9
- 1
lib/sde-config/functions.in

@ -2,7 +2,7 @@
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: lib/sde-config/functions.in
# Copyright (C) 2006 - 2008 The OpenSDE Project
# Copyright (C) 2006 - 2011 The OpenSDE Project
# Copyright (C) 2004 - 2006 The T2 SDE Project
# Copyright (C) 1998 - 2003 Clifford Wolf
#
@ -16,6 +16,14 @@
. lib/core-functions.in
# extract first value of a "^#Foo: ..." line from a set of files
#
get_field() {
local label="$1"; shift
sed -n -e "s/^#[ \t]*$label:[ \t]*\(.*\)/\1/p" "$@" 2> /dev/null |
head -n1 | sed -e 's,[ \t]*$,,'
}
# Function to cache config.in and subconfig.in file lists
#
create_configin_list() {

Loading…
Cancel
Save