From 97a608633fd3fe187af5b1269fcc3398add75901 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?coadde=20=5BM=C3=A1rcio=20Alexandre=20Silva=20Delgado=5D?= Date: Wed, 26 Aug 2015 22:40:54 -0300 Subject: porting db-pkg-rm (db-repo-remove) from xbs, fix comments from db-pkg-add, db-init and fix db-pkg-add --- src/bin/db-pkg-add | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/bin/db-pkg-add') diff --git a/src/bin/db-pkg-add b/src/bin/db-pkg-add index 6b9e154..8f961ee 100755 --- a/src/bin/db-pkg-add +++ b/src/bin/db-pkg-add @@ -6,7 +6,7 @@ source "${CONFIG_DIR}/xbs.cfg" source "${SHARE_DIR}/db-functions" if [ "${#}" -lt '4' ]; then - "usage: %s ..." "${0##*/}" + msg "usage: %s ..." "${0##*/}" exit 1 fi @@ -36,11 +36,15 @@ for '_platform' in "${PLATFORMS[@]}"; do for 'tarch' in "${tarches[@]}"; do if [[ ! -d "${repo_path} ]]; then - die "This ${repo} doesn't exist" + die "This [%s] doesn't exist" "${repo}" elif [[ ! -d "${repo_path}/${tarch}" ]]; then - die "This ${repo} doesn't support ${arch} archictecture" + die "This [%s] doesn't support %s archictecture" "${repo}" "${arch}" + else + repo_lock "${repo}" "${tarch}" || exit 1 fi - repo_lock "${repo}" "${tarch}" || exit 1 + done + + for 'tarch' in "${tarches[@]}"; do for 'pkg_file' in "${pkg_files[@]}"; do if [[ ! -f "${repo_path}/${arch}/${pkg_file##*/}" ]]; then die "Package file %s not found in %s" "${pkg_file##*/}" "${repo_path}/${arch}/" @@ -52,6 +56,6 @@ for '_platform' in "${PLATFORMS[@]}"; do repo_unlock "${repo}" "${tarch}" done else - die "This ${plataform} doesn't exist" + die "This %s plataform doesn't exist" "${plataform}" fi done -- cgit v1.2.3-2-g168b