From 17a94df0c108f09cada98535138136779b4e13a4 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 24 May 2015 12:41:09 -0600 Subject: Use XBS instead of the SVN/ABS grossness. * config: drop SVNREPO * cron-jobs/sourceballs: Replace commented out SVN code and active ABS code with XBS code. The XBS code is fairly similar to the SVN code, the difference being that it uses `xbs releasepath` instead of `svn export`. * db-functions: - Rename check_pkgsvn to check_pkgxbs - check_pkgxbs: Drop the `svn export` bit, as `xbs releasepath` assumes that a working directory already exists. Replace the paths created by the `svn export` with calls to `xbs releasepath`. - check_splitpkgs: Drop the ABS `cp` -r bit, as `xbs releasepath` assumes that a working directory already exists. Replace the paths created by the `cp -r` with calls to `xbs releasepath`. Rename the variables and temporary files s/svn/xbs/ . * db-move: - First loop: Rename the variable svnrepo_from to xbsrepo_from, and get the value from `xbs releasepath`. - Second loop: Run `xbs move` before the inner loop to get a list of architectures. Rename the variable `svnrepo_from` to `xbsrepo_to`, and get the value for it from `xbs releasepath`. Because xbs guarantees that the PKGBUILD exists for the architectures listed, replace the check for whether the PKGBUILD exists with `if true`, to keep merging easy (as opposed to removing the if, and de-indenting the whole thing). * db-remove: Get the location of the PKGBUILD from `xbs releasepath`, call `xbs unrelease`, and adjust a message to use `xbs name` and mention the appropriate repo/arch pair. --- db-move | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'db-move') diff --git a/db-move b/db-move index 2ac3f4a..275a11a 100755 --- a/db-move +++ b/db-move @@ -27,14 +27,14 @@ 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}") + pkgver=$(. "${xbsrepo_from}/PKGBUILD"; get_full_version "${epoch:-0}" "${pkgver}" "${pkgrel}") if [ -z "${pkgver}" ]; then die "Could not read pkgver" fi @@ -61,18 +61,20 @@ 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 + 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 "${epoch:-0}" "${pkgver}" "${pkgrel}") + pkgnames=($(. "${xbsrepo_to}/PKGBUILD"; echo "${pkgname[@]}")) + pkgver=$(. "${xbsrepo_to}/PKGBUILD"; get_full_version "${epoch:-0}" "${pkgver}" "${pkgrel}") for pkgname in "${pkgnames[@]}"; do for tarch in "${tarches[@]}"; do -- cgit v1.2.3