summaryrefslogtreecommitdiff
path: root/vendor/getinfo
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2016-01-14 14:45:37 +0100
committerDavid Kalnischkies <david@kalnischkies.de>2016-01-14 17:33:58 +0100
commit7fa4f5e12261d39666283051956d9e1f78eb609b (patch)
treeb9ae7b93fe2e0d3d0ed4d1688eec6b1e52db72ef /vendor/getinfo
parent9feb98eb0aeed775f78cb4afbf6bc0e3a90e9fed (diff)
evaluate sourceslist-list-format entity in vendors sources.list
Parsing XML entity files in shell isn't exactly nice and causing the substitution with a while-read loop isn't either, but it seems to be good enough for the moment without changing too much. Thanks: Niels Thykier for reporting on IRC
Diffstat (limited to 'vendor/getinfo')
-rwxr-xr-xvendor/getinfo2
1 files changed, 1 insertions, 1 deletions
diff --git a/vendor/getinfo b/vendor/getinfo
index 415ede98c..79da83620 100755
--- a/vendor/getinfo
+++ b/vendor/getinfo
@@ -11,7 +11,7 @@ if [ -z "$INFO" ] || [ ! -e "$INFO" ]; then
fi
getrawfield() {
- grep --max-count=1 "^<!ENTITY $1 \"" "${2:-$INFO}" | cut -d'"' -f 2
+ awk "/<!ENTITY $1/ {f=NR} f && NR-1==f { print; exit 0 }" RS='"' "${2:-$INFO}"
}
getfield() {