From 33b8cb611363102e23972cf3914a03d65cb3cad8 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 17 Jun 2013 23:59:15 -0600 Subject: use xbs, not svn --- testing2x | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'testing2x') diff --git a/testing2x b/testing2x index 369857f..a76e972 100755 --- a/testing2x +++ b/testing2x @@ -20,12 +20,10 @@ declare -A pkgs for pkgbase in $*; do if [ ! -d "${WORKDIR}/${pkgbase}" ]; then - arch_svn export -q "${SVNREPO}/${pkgbase}/repos" "${WORKDIR}/${pkgbase}" >/dev/null - found_source=false for pkgarch in ${ARCHES[@]} 'any'; do - svnrepo_from="${WORKDIR}/${pkgbase}/${TESTING_REPO}-${pkgarch}" - if [ -r "${svnrepo_from}/PKGBUILD" ]; then + xbsrepo_from="$(xbs releasepath ${pkgbase} ${TESTING_REPO} ${pkgarch})" + if [ -r "${xbsrepo_from}/PKGBUILD" ]; then found_source=true break fi @@ -34,8 +32,8 @@ for pkgbase in $*; do found_target=false for pkgarch in ${ARCHES[@]} 'any'; do for repo in ${STABLE_REPOS[@]}; do - svnrepo_to="${WORKDIR}/${pkgbase}/${repo}-${pkgarch}" - if [ -r "${svnrepo_to}/PKGBUILD" ]; then + xbsrepo_to="$(xbs releasepath ${pkgbase} ${repo} ${pkgarch})" + if [ -r "${xbsrepo_to}/PKGBUILD" ]; then found_target=true pkgs[${repo}]+="${pkgbase} " break 2 -- cgit v1.2.3-2-g168b From 761b56dcffedc6e484d38c74267810e491add951 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 16 Jun 2013 22:06:51 -0600 Subject: touch up --- testing2x | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'testing2x') diff --git a/testing2x b/testing2x index a76e972..d93c5f8 100755 --- a/testing2x +++ b/testing2x @@ -8,7 +8,7 @@ if [ $# -lt 1 ]; then exit 1 fi -# Lock everything to reduce possibility of interfering task between the different repo-updates +# Lock everything to reduce possibility of interfering task between the different repo-updates script_lock for repo in ${TESTING_REPO} ${STABLE_REPOS[@]}; do for pkgarch in ${ARCHES[@]}; do -- cgit v1.2.3-2-g168b From e6294556d3197b7d87f7659355d0e189fad613d6 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 8 Dec 2013 17:33:25 -0500 Subject: `readlink -e` all "$0"s --- testing2x | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'testing2x') diff --git a/testing2x b/testing2x index d93c5f8..14610c2 100755 --- a/testing2x +++ b/testing2x @@ -1,7 +1,7 @@ #!/bin/bash -. "$(dirname $0)/config" -. "$(dirname $0)/db-functions" +. "$(dirname "$(readlink -e "$0")")/config" +. "$(dirname "$(readlink -e "$0")")/db-functions" if [ $# -lt 1 ]; then msg "usage: ${0##*/} ..." -- cgit v1.2.3-2-g168b From 6a093f1dc6bd5398115544dd229b520f9432e122 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 31 Dec 2013 15:49:06 -0500 Subject: use `readlink -e` on $0 --- testing2x | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'testing2x') diff --git a/testing2x b/testing2x index 14610c2..6646179 100755 --- a/testing2x +++ b/testing2x @@ -52,7 +52,7 @@ for repo in ${STABLE_REPOS[@]}; do repo_unlock ${repo} ${pkgarch} done if [ -n "${pkgs[${repo}]}" ]; then - "$(dirname $0)/db-move" ${TESTING_REPO} "${repo}" ${pkgs[${repo}]} + "$(dirname "$(readlink -e "$0")")/db-move" ${TESTING_REPO} "${repo}" ${pkgs[${repo}]} fi done -- cgit v1.2.3-2-g168b From b6e8ebd66d22abf5439485985a7851e768c71e8a Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 8 Jan 2014 21:04:43 -0500 Subject: Be very careful about using $0. --- testing2x | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'testing2x') diff --git a/testing2x b/testing2x index 54cae11..14a45de 100755 --- a/testing2x +++ b/testing2x @@ -1,10 +1,10 @@ #!/bin/bash -. "$(dirname $0)/db-functions" -. "$(dirname $0)/config" +. "$(dirname "$(readlink -e "$0")")/db-functions" +. "$(dirname "$(readlink -e "$0")")/config" if [ $# -lt 1 ]; then - msg "usage: $(basename $0) ..." + msg "usage: ${0##*/} ..." exit 1 fi @@ -54,7 +54,7 @@ for repo in 'core' 'extra'; do repo_unlock ${repo} ${pkgarch} done if [ -n "${pkgs[${repo}]}" ]; then - "$(dirname $0)/db-move" 'testing' "${repo}" ${pkgs[${repo}]} + "$(dirname "$(readlink -e "$0")")/db-move" 'testing' "${repo}" ${pkgs[${repo}]} fi done -- cgit v1.2.3-2-g168b From eefb787983d2608511214bcd682f3d8271bac60c Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 8 Jan 2014 16:44:51 -0500 Subject: Normalize to load config then local_config then db-functions --- testing2x | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'testing2x') diff --git a/testing2x b/testing2x index 14a45de..b6828fc 100755 --- a/testing2x +++ b/testing2x @@ -1,7 +1,7 @@ #!/bin/bash -. "$(dirname "$(readlink -e "$0")")/db-functions" . "$(dirname "$(readlink -e "$0")")/config" +. "$(dirname "$(readlink -e "$0")")/db-functions" if [ $# -lt 1 ]; then msg "usage: ${0##*/} ..." -- cgit v1.2.3-2-g168b From 46510e1fc48f37ce76c2bf5f19f885bba8d5d098 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 18 Jun 2014 13:05:12 -0400 Subject: Clean up quoting. --- testing2x | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'testing2x') diff --git a/testing2x b/testing2x index b6828fc..37c4395 100755 --- a/testing2x +++ b/testing2x @@ -11,28 +11,28 @@ fi # Lock everything to reduce possibility of interfering task between the different repo-updates script_lock for repo in 'core' 'extra' 'testing'; do - for pkgarch in ${ARCHES[@]}; do - repo_lock ${repo} ${pkgarch} || exit 1 + for pkgarch in "${ARCHES[@]}"; do + repo_lock "${repo}" "${pkgarch}" || exit 1 done done declare -A pkgs -for pkgbase in $*; do +for pkgbase in "$@"; do if [ ! -d "${WORKDIR}/${pkgbase}" ]; then /usr/bin/svn export -q "${SVNREPO}/${pkgbase}/repos" "${WORKDIR}/${pkgbase}" >/dev/null found_source=false - for pkgarch in ${ARCHES[@]} 'any'; do + for pkgarch in "${ARCHES[@]}" 'any'; do svnrepo_from="${WORKDIR}/${pkgbase}/testing-${pkgarch}" if [ -r "${svnrepo_from}/PKGBUILD" ]; then found_source=true break fi done - ${found_source} || die "${pkgbase} not found in [testing]" + "${found_source}" || die "${pkgbase} not found in [testing]" found_target=false - for pkgarch in ${ARCHES[@]} 'any'; do + for pkgarch in "${ARCHES[@]}" 'any'; do for repo in 'core' 'extra'; do svnrepo_to="${WORKDIR}/${pkgbase}/${repo}-${pkgarch}" if [ -r "${svnrepo_to}/PKGBUILD" ]; then @@ -42,16 +42,16 @@ for pkgbase in $*; do fi done done - ${found_target} || die "${pkgbase} neither found in [core] nor [extra]" + "${found_target}" || die "${pkgbase} neither found in [core] nor [extra]" fi done -for pkgarch in ${ARCHES[@]}; do - repo_unlock 'testing' ${pkgarch} +for pkgarch in "${ARCHES[@]}"; do + repo_unlock 'testing' "${pkgarch}" done for repo in 'core' 'extra'; do - for pkgarch in ${ARCHES[@]}; do - repo_unlock ${repo} ${pkgarch} + for pkgarch in "${ARCHES[@]}"; do + repo_unlock "${repo}" "${pkgarch}" done if [ -n "${pkgs[${repo}]}" ]; then "$(dirname "$(readlink -e "$0")")/db-move" 'testing' "${repo}" ${pkgs[${repo}]} -- cgit v1.2.3-2-g168b From 386c2d00249eb244bbcc9a173a64f9435b70180a Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 18 Jun 2014 13:45:10 -0400 Subject: Use printf formatters instead of string interpolation. I used this command to find them: egrep -r --exclude-dir={test,.git} '(plain|msg|msg2|warning|error|stat_busy|stat_done|abort|die)\s+"?[^"]*\$' --- testing2x | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'testing2x') diff --git a/testing2x b/testing2x index 37c4395..0c5c8d7 100755 --- a/testing2x +++ b/testing2x @@ -4,7 +4,7 @@ . "$(dirname "$(readlink -e "$0")")/db-functions" if [ $# -lt 1 ]; then - msg "usage: ${0##*/} ..." + msg "usage: %s ..." "${0##*/}" exit 1 fi @@ -30,7 +30,7 @@ for pkgbase in "$@"; do break fi done - "${found_source}" || die "${pkgbase} not found in [testing]" + "${found_source}" || die "%s not found in [testing]" "${pkgbase}" found_target=false for pkgarch in "${ARCHES[@]}" 'any'; do for repo in 'core' 'extra'; do @@ -42,7 +42,7 @@ for pkgbase in "$@"; do fi done done - "${found_target}" || die "${pkgbase} neither found in [core] nor [extra]" + "${found_target}" || die "%s neither found in [core] nor [extra]" "${pkgbase}" fi done -- cgit v1.2.3-2-g168b From aae3b0a2490d65832547f29327f9e8828442a48d Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 18 Jun 2014 21:33:20 -0400 Subject: cleanup: - move some config into config.local.* - `mv createrepos db-init` - `mv {,db-}check-package-libraries.py` - `mv `list_nonfree_in_db.py db-list-nonfree.py` - `rm abslibre`: To be replaced by XBS+update abs tarballs script - `rm create-repo mkrepo`: Both did the same thing, just fancy `mkdir` - `rm `testing2x`: Just use db-move. --- testing2x | 59 ----------------------------------------------------------- 1 file changed, 59 deletions(-) delete mode 100755 testing2x (limited to 'testing2x') diff --git a/testing2x b/testing2x deleted file mode 100755 index b76438b..0000000 --- a/testing2x +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/bash - -. "$(dirname "$(readlink -e "$0")")/config" -. "$(dirname "$(readlink -e "$0")")/db-functions" - -if [ $# -lt 1 ]; then - msg "usage: %s ..." "${0##*/}" - exit 1 -fi - -# Lock everything to reduce possibility of interfering task between the different repo-updates -script_lock -for repo in "${TESTING_REPO}" "${STABLE_REPOS[@]}"; do - for pkgarch in "${ARCHES[@]}"; do - repo_lock "${repo}" "${pkgarch}" || exit 1 - done -done - -declare -A pkgs - -for pkgbase in "$@"; do - if [ ! -d "${WORKDIR}/${pkgbase}" ]; then - found_source=false - for pkgarch in "${ARCHES[@]}" 'any'; do - xbsrepo_from="$(xbs releasepath "${pkgbase}" "${TESTING_REPO}" "${pkgarch}")" - if [ -r "${xbsrepo_from}/PKGBUILD" ]; then - found_source=true - break - fi - done - "${found_source}" || die "%s not found in [%s]" "${pkgbase}" "${TESTING_REPO}" - found_target=false - for pkgarch in "${ARCHES[@]}" 'any'; do - for repo in "${STABLE_REPOS[@]}"; do - xbsrepo_to="$(xbs releasepath "${pkgbase}" "${repo}" "${pkgarch}")" - if [ -r "${xbsrepo_to}/PKGBUILD" ]; then - found_target=true - pkgs[${repo}]+="${pkgbase} " - break 2 - fi - done - done - "${found_target}" || die "%s not found in any of these repos: %s" "${pkgbase}" "${STABLE_REPOS[*]}" - fi -done - -for pkgarch in "${ARCHES[@]}"; do - repo_unlock "${TESTING_REPO}" "${pkgarch}" -done -for repo in "${STABLE_REPOS[@]}"; do - for pkgarch in "${ARCHES[@]}"; do - repo_unlock "${repo}" "${pkgarch}" - done - if [ -n "${pkgs[${repo}]}" ]; then - "$(dirname "$(readlink -e "$0")")/db-move" ${TESTING_REPO} "${repo}" ${pkgs[${repo}]} - fi -done - -script_unlock -- cgit v1.2.3-2-g168b