summaryrefslogtreecommitdiff
path: root/db-move
diff options
context:
space:
mode:
Diffstat (limited to 'db-move')
-rwxr-xr-xdb-move52
1 files changed, 16 insertions, 36 deletions
diff --git a/db-move b/db-move
index 55121be..89a0ad6 100755
--- a/db-move
+++ b/db-move
@@ -24,23 +24,16 @@ for pkgarch in "${ARCHES[@]}"; do
repo_lock "${repo_from}" "${pkgarch}" || exit 1
done
-# check if packages to be moved exist in svn and ftp dir
-arch_svn checkout -q -N "${SVNREPO}" "${WORKDIR}/svn" >/dev/null
+# First loop is to check that all necessary files exist
for pkgbase in "${args[@]:2}"; do
- arch_svn up -q "${WORKDIR}/svn/${pkgbase}" >/dev/null
for pkgarch in "${ARCHES[@]}" 'any'; do
- svnrepo_from="${WORKDIR}/svn/${pkgbase}/repos/${repo_from}-${pkgarch}"
- if [ -r "${svnrepo_from}/PKGBUILD" ]; then
- pkgnames=($(. "${svnrepo_from}/PKGBUILD"; echo "${pkgname[@]}"))
+ xbsrepo_from="$(xbs releasepath "${pkgbase}" "${repo_from}" "${pkgarch}")"
+ if [ -r "${xbsrepo_from}/PKGBUILD" ]; then
+ pkgnames=($(. "${xbsrepo_from}/PKGBUILD"; echo "${pkgname[@]}"))
if [ ${#pkgnames[@]} -lt 1 ]; then
die "Could not read pkgname"
fi
- pkgver=$(. "${svnrepo_from}/PKGBUILD"; get_full_version)
- if [ -z "${pkgver}" ]; then
- die "Could not read pkgver"
- fi
-
if [ "${pkgarch}" == 'any' ]; then
tarches=("${ARCHES[@]}")
else
@@ -48,6 +41,10 @@ for pkgbase in "${args[@]:2}"; do
fi
for pkgname in "${pkgnames[@]}"; do
+ pkgver=$(. "${xbsrepo_from}/PKGBUILD"; get_full_version "${pkgname}")
+ if [ -z "${pkgver}" ]; then
+ die "Could not read pkgver"
+ fi
for tarch in "${tarches[@]}"; do
getpkgfile "${ftppath_from}/${tarch}/${pkgname}-${pkgver}-${pkgarch}"${PKGEXT} >/dev/null
done
@@ -63,37 +60,22 @@ msg "Moving packages from [%s] to [%s]..." "${repo_from}" "${repo_to}"
declare -A add_pkgs
declare -A remove_pkgs
for pkgbase in "${args[@]:2}"; do
- tag_list=""
- for pkgarch in "${ARCHES[@]}" 'any'; do
- svnrepo_from="${WORKDIR}/svn/${pkgbase}/repos/${repo_from}-${pkgarch}"
- svnrepo_to="${WORKDIR}/svn/${pkgbase}/repos/${repo_to}-${pkgarch}"
-
- if [ -f "${svnrepo_from}/PKGBUILD" ]; then
+ # move the package in xbs
+ arches=($(xbs move "${repo_from}" "${repo_to}" "${pkgbase}"))
+ # move the package in ftp
+ for pkgarch in "${arches[@]}"; do
+ xbsrepo_to="$(xbs releasepath "$pkgbase" "$repo_to" "$pkgarch")"
+ if true; then # to add an indent level to make merging easier
if [ "${pkgarch}" == 'any' ]; then
tarches=("${ARCHES[@]}")
else
tarches=("${pkgarch}")
fi
msg2 "%s (%s)" "${pkgbase}" "${tarches[*]}"
- pkgnames=($(. "${svnrepo_from}/PKGBUILD"; echo "${pkgname[@]}"))
- pkgver=$(. "${svnrepo_from}/PKGBUILD"; get_full_version)
-
- if [ -d "${svnrepo_to}" ]; then
- for file in $(arch_svn ls "${svnrepo_to}"); do
- arch_svn rm -q "${svnrepo_to}/$file@"
- done
- else
- mkdir "${svnrepo_to}"
- arch_svn add -q "${svnrepo_to}"
- fi
-
- for file in $(arch_svn ls "${svnrepo_from}"); do
- arch_svn mv -q -r HEAD "${svnrepo_from}/$file@" "${svnrepo_to}/"
- done
- arch_svn rm --force -q "${svnrepo_from}"
- tag_list+=", $pkgarch"
+ pkgnames=($(. "${xbsrepo_to}/PKGBUILD"; echo "${pkgname[@]}"))
for pkgname in "${pkgnames[@]}"; do
+ pkgver=$(. "${xbsrepo_to}/PKGBUILD"; get_full_version "${pkgname}")
for tarch in "${tarches[@]}"; do
pkgpath=$(getpkgfile "${ftppath_from}/${tarch}/${pkgname}-${pkgver}-${pkgarch}"${PKGEXT})
pkgfile="${pkgpath##*/}"
@@ -108,8 +90,6 @@ for pkgbase in "${args[@]:2}"; do
done
fi
done
- tag_list="${tag_list#, }"
- arch_svn commit -q "${WORKDIR}/svn/${pkgbase}" -m "${0##*/}: moved ${pkgbase} from [${repo_from}] to [${repo_to}] (${tag_list})"
done
for tarch in "${ARCHES[@]}"; do