summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2014-08-23 21:52:24 (EDT)
committer P. J. McDermott <pj@pehjota.net>2014-08-23 21:52:24 (EDT)
commit18ad5610e4888ee1114ae9c002834fd47cb0ff94 (patch)
tree4614e6d65669f89e627ab3e1c247b529572269fe /lib
parent238960cc83a0d32e60973f93849d68ff46a2e499 (diff)
Make field name checks case insensitive
Diffstat (limited to 'lib')
-rw-r--r--lib/feed.sh13
-rw-r--r--lib/profiles/proteanos.sh2
2 files changed, 8 insertions, 7 deletions
diff --git a/lib/feed.sh b/lib/feed.sh
index feaf7ba..e4ae040 100644
--- a/lib/feed.sh
+++ b/lib/feed.sh
@@ -61,7 +61,7 @@ feed_find_pkgs()
local md5sum_cb="${6}"
local sha256sum_cb="${7}"
- feed_dep_fields=" $(printf '%s ' ${dep_fields})"
+ feed_dep_fields=" $(printf '%s ' ${dep_fields} | tr 'A-Z' 'a-z')"
feed_pkg_cb="${pkg_cb}"
feed_deps_cb="${deps_cb}"
feed_fname_cb="${fname_cb}"
@@ -85,14 +85,15 @@ feed_field_cb()
local name="${1}"
local value="${2}"
- # TODO: These field name checks should be case insensitive.
- if [ "x${name}" = 'xPackage' ]; then
+ name="$(printf '%s\n' "${name}" | tr 'A-Z' 'a-z')"
+
+ if [ "x${name}" = 'xpackage' ]; then
feed_pkg="${value}"
- elif [ "x${name}" = 'xFilename' ]; then
+ elif [ "x${name}" = 'xfilename' ]; then
${feed_fname_cb} "${feed_pkg}" "${value}"
- elif [ "x${name}" = 'xMD5sum' ]; then
+ elif [ "x${name}" = 'xmd5sum' ]; then
${feed_md5sum_cb} "${feed_pkg}" "${value}"
- elif [ "x${name}" = 'xSHA256sum' ]; then
+ elif [ "x${name}" = 'xsha256sum' ]; then
${feed_sha256sum_cb} "${feed_pkg}" "${value}"
elif [ "x${feed_dep_fields#* ${name} }" != "x${feed_dep_fields}" ]; then
feed_deps="${feed_deps}${value}, "
diff --git a/lib/profiles/proteanos.sh b/lib/profiles/proteanos.sh
index c6152d9..68b161e 100644
--- a/lib/profiles/proteanos.sh
+++ b/lib/profiles/proteanos.sh
@@ -160,7 +160,7 @@ prof_proteanos_include_pkg()
local name="${1}"
local value="${2}"
- if [ "x${name}" = 'xPackage' ]; then
+ if [ "x${name}" = 'xpackage' ]; then
case "${value}" in
base-files|busybox|libc.6|opkg)
return 0