diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2014-06-18 11:12:18 -0400 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2014-06-18 11:12:18 -0400 |
commit | e8f411803648f64b386dd2970b024b9ba15ba682 (patch) | |
tree | ca56d48e18c4801be9ab00bee901a830cc6e9ec9 | |
parent | bcaa90a2e6f26191ff4aa9e0279080d1efeec3e7 (diff) |
The eval+printf %q thing wasn't worth the hard-to-read code
-rwxr-xr-x | cron-jobs/repo-sanity-check | 2 | ||||
-rw-r--r-- | db-functions | 4 | ||||
-rwxr-xr-x | db-move | 4 | ||||
-rwxr-xr-x | db-remove | 2 | ||||
-rw-r--r-- | test/lib/common.inc | 6 | ||||
-rwxr-xr-x | test/test.d/create-filelists.sh | 2 |
6 files changed, 10 insertions, 10 deletions
diff --git a/cron-jobs/repo-sanity-check b/cron-jobs/repo-sanity-check index 73ec171..fadb248 100755 --- a/cron-jobs/repo-sanity-check +++ b/cron-jobs/repo-sanity-check @@ -24,7 +24,7 @@ for _repo in "${PKGREPOS[@]}"; do done # this fills the on_abs array - printf '%q ' "${pkgname[@]}" + echo "${pkgname[@]}" done )) diff --git a/db-functions b/db-functions index ebf1d47..f703386 100644 --- a/db-functions +++ b/db-functions @@ -305,7 +305,7 @@ check_pkgxbs() { local xbsver="$(. "`xbs releasepath ${_pkgbase} ${repo} ${_pkgarch}`/PKGBUILD"; get_full_version "${_pkgname}")" [ "${xbsver}" == "${_pkgver}" ] || return 1 - eval "local xbsnames=($(. "`xbs releasepath ${_pkgbase} ${repo} ${_pkgarch}`/PKGBUILD"; printf '%q ' "${pkgname[@]}"))" + local xbsnames=($(. "$(xbs releasepath "${_pkgbase}" "${repo}" "${_pkgarch}")/PKGBUILD"; echo "${pkgname[@]}")) in_array "${_pkgname}" "${xbsnames[@]}" || return 1 return 0 @@ -331,7 +331,7 @@ check_splitpkgs() { mkdir -p "${repo}/${_pkgarch}/${_pkgbase}" echo "${_pkgname}" >> "${repo}/${_pkgarch}/${_pkgbase}/staging" - eval "local xbsnames=($(. "`xbs releasepath ${_pkgbase} ${repo} ${_pkgarch}`/PKGBUILD"; printf '%q ' "${pkgname[@]}"))" + local xbsnames=($(. "$(xbs releasepath "${_pkgbase}" "${repo}" "${_pkgarch}")/PKGBUILD"; echo "${pkgname[@]}")) for xbsname in "${xbsnames[@]}"; do echo "${xbsname}" >> "${repo}/${_pkgarch}/${_pkgbase}/xbs" done @@ -29,7 +29,7 @@ for pkgbase in "${args[@]:2}"; do for pkgarch in "${ARCHES[@]}" 'any'; do xbsrepo_from="$(xbs releasepath ${pkgbase} ${repo_from} ${pkgarch})" if [ -r "${xbsrepo_from}/PKGBUILD" ]; then - eval "pkgnames=($(. "${xbsrepo_from}/PKGBUILD"; printf '%q ' "${pkgname[@]}"))" + pkgnames=($(. "${xbsrepo_from}/PKGBUILD"; echo "${pkgname[@]}")) if [ ${#pkgnames[@]} -lt 1 ]; then die "Could not read pkgname" fi @@ -71,7 +71,7 @@ for pkgbase in "${args[@]:2}"; do else tarches=("${pkgarch}") fi - eval "pkgnames=($(. "${dir_to}/PKGBUILD"; printf '%q ' "${pkgname[@]}"))" + pkgnames=($(. "${dir_to}/PKGBUILD"; echo "${pkgname[@]}")) for pkgname in "${pkgnames[@]}"; do pkgver=$(. "${dir_to}/PKGBUILD"; get_full_version "${pkgname}") @@ -31,7 +31,7 @@ for pkgbase in "${pkgbases[@]}"; do msg "Removing %s from [%s]..." "$pkgbase" "$repo" path="$(xbs releasepath "$pkgbase" "$repo" "$arch")" if [ -d "$path" ]; then - eval "remove_pkgs+=($(. "$path/PKGBUILD"; printf '%q ' "${pkgname[@]}"))" + remove_pkgs+=($(. "$path/PKGBUILD"; echo "${pkgname[@]}")) xbs unrelease "$pkgbase" "$repo" "$arch" else warning "%s not found in XBS %s" "$pkgbase" "$repo-$arch" diff --git a/test/lib/common.inc b/test/lib/common.inc index a241615..1feb1bb 100644 --- a/test/lib/common.inc +++ b/test/lib/common.inc @@ -52,8 +52,8 @@ oneTimeSetUp() { msg 'Building packages...' for d in "${pkgdir}"/*; do pushd $d >/dev/null - eval "pkgname=($(. PKGBUILD; printf '%q ' "${pkgname[@]}"))" - eval "pkgarch=($(. PKGBUILD; printf '%q ' "${arch[@]}"))" + pkgname=($(. PKGBUILD; echo "${pkgname[@]}")) + pkgarch=($(. PKGBUILD; echo "${arch[@]}")) pkgversion=$(. PKGBUILD; get_full_version) build=true @@ -170,7 +170,7 @@ releasePackage() { pushd "${TMP}/svn-packages-copy"/${pkgbase}/trunk/ >/dev/null xbs release ${repo} ${arch} >/dev/null 2>&1 pkgver=$(. PKGBUILD; get_full_version) - eval "pkgname=($(. PKGBUILD; printf '%q ' "${pkgname[@]}"))" + pkgname=($(. PKGBUILD; echo "${pkgname[@]}")) popd >/dev/null cp "${pkgdir}/${pkgbase}"/*-${pkgver}-${arch}${PKGEXT} "${STAGING}"/${repo}/ diff --git a/test/test.d/create-filelists.sh b/test/test.d/create-filelists.sh index 1126972..b5ec5c8 100755 --- a/test/test.d/create-filelists.sh +++ b/test/test.d/create-filelists.sh @@ -62,7 +62,7 @@ testCreateSplitFileLists() { ../db-update for pkgbase in "${pkgs[@]}"; do - eval "pkgnames=($(source "${TMP}/svn-packages-copy/${pkgbase}/trunk/PKGBUILD"; printf '%q ' "${pkgname[@]}"))" + pkgnames=($(source "${TMP}/svn-packages-copy/${pkgbase}/trunk/PKGBUILD"; echo "${pkgname[@]}")) for pkgname in "${pkgnames[@]}"; do for arch in "${arches[@]}"; do if ! bsdtar -xOf "${FTP_BASE}/extra/os/${arch}/extra${FILESEXT}" | grep "usr/bin/${pkgname}" &>/dev/null; then |