summaryrefslogtreecommitdiff
path: root/db-move
diff options
context:
space:
mode:
Diffstat (limited to 'db-move')
-rwxr-xr-xdb-move35
1 files changed, 15 insertions, 20 deletions
diff --git a/db-move b/db-move
index b057d28..2c7c19e 100755
--- a/db-move
+++ b/db-move
@@ -27,18 +27,13 @@ done
# First loop is to check that all necessary files exist
for pkgbase in "${args[@]:2}"; do
for pkgarch in "${ARCHES[@]}" 'any'; do
- svnrepo_from="${SVNREPO}/${repo_from}/${pkgbase}"
- 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 "${epoch:-0}" "${pkgver}" "${pkgrel}")
- if [ -z "${pkgver}" ]; then
- die "Could not read pkgver"
- fi
-
if [ "${pkgarch}" == 'any' ]; then
tarches=("${ARCHES[@]}")
else
@@ -46,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
@@ -61,29 +60,25 @@ 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
- for pkgarch in "${ARCHES[@]}" 'any'; do
- svnrepo_from="${SVNREPO}/${repo_from}/${pkgbase}"
-
- 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
+ dir_to="$(xbs releasepath "$pkgbase" "$repo_to" "$pkgarch")"
+ if true; then # to add in 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 "${epoch:-0}" "${pkgver}" "${pkgrel}")
+ pkgnames=($(. "${dir_to}/PKGBUILD"; echo "${pkgname[@]}"))
for pkgname in "${pkgnames[@]}"; do
+ pkgver=$(. "${dir_to}/PKGBUILD"; get_full_version "${pkgname}")
for tarch in "${tarches[@]}"; do
pkgpath=$(getpkgfile "${ftppath_from}/${tarch}/${pkgname}-${pkgver}-${pkgarch}"${PKGEXT})
pkgfile="${pkgpath##*/}"
- # copy package to pool if needed
- # TODO: can be removed once every package has been moved to the package pool
- if [ ! -f "${FTP_BASE}/${PKGPOOL}/${pkgfile}" ]; then
- cp "${pkgpath}" "${FTP_BASE}/${PKGPOOL}"
- fi
ln -s "../../../${PKGPOOL}/${pkgfile}" "${ftppath_to}/${tarch}/"
if [ -f "${FTP_BASE}/${PKGPOOL}/${pkgfile}.sig" ]; then
ln -s "../../../${PKGPOOL}/${pkgfile}.sig" "${ftppath_to}/${tarch}/"