From 18ad5610e4888ee1114ae9c002834fd47cb0ff94 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Sat, 23 Aug 2014 21:52:24 -0400 Subject: Make field name checks case insensitive --- (limited to 'lib') 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 -- cgit v0.9.1