diff options
author | Florian Pritz <bluewind@xinu.at> | 2012-08-22 14:04:08 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2012-08-22 15:40:18 +0200 |
commit | 996c0b124b4fdcdf4ded71fb1c4a5bb8e8784f8f (patch) | |
tree | 1fc90018372dd501f155e4b48609a8e613087d8a /db-move | |
parent | 801f7742004139229866b911634679143f2c9404 (diff) | |
download | dbscripts-996c0b124b4fdcdf4ded71fb1c4a5bb8e8784f8f.tar.gz dbscripts-996c0b124b4fdcdf4ded71fb1c4a5bb8e8784f8f.tar.xz |
WIP: switch from svn to gitgitpackages
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'db-move')
-rwxr-xr-x | db-move | 84 |
1 files changed, 11 insertions, 73 deletions
@@ -24,40 +24,6 @@ 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 -/usr/bin/svn checkout -q -N "${SVNREPO}" "${WORKDIR}/svn" >/dev/null -for pkgbase in ${args[@]:2}; do - /usr/bin/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[@]})) - if [ ${#pkgnames[@]} -lt 1 ]; then - die "Could not read pkgname" - fi - - pkgver=$(. "${svnrepo_from}/PKGBUILD"; echo $(get_full_version ${epoch:-0} ${pkgver} ${pkgrel})) - if [ -z "${pkgver}" ]; then - die "Could not read pkgver" - fi - - if [ "${pkgarch}" == 'any' ]; then - tarches=(${ARCHES[@]}) - else - tarches=("${pkgarch}") - fi - - for pkgname in ${pkgnames[@]}; do - for tarch in ${tarches[@]}; do - getpkgfile "${ftppath_from}/${tarch}/"${pkgname}-${pkgver}-${pkgarch}${PKGEXT} >/dev/null - done - done - continue 2 - fi - done - die "${pkgbase} not found in ${repo_from}" -done - msg "Moving packages from [${repo_from}] to [${repo_to}]..." declare -A add_pkgs @@ -65,51 +31,23 @@ 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}" + pkgfile_from="${GITREPO}/${pkgarch}/${repo_from}/${pkgbase}" + pkgfile_to="${GITREPO}/${pkgarch}/${repo_to}/${pkgbase}" - if [ -f "${svnrepo_from}/PKGBUILD" ]; then - if [ "${pkgarch}" == 'any' ]; then - tarches=(${ARCHES[@]}) - else - tarches=("${pkgarch}") - fi - msg2 "${pkgbase} ($(echo ${tarches[@]}))" - pkgnames=($(. "${svnrepo_from}/PKGBUILD"; echo ${pkgname[@]})) - pkgver=$(. "${svnrepo_from}/PKGBUILD"; echo $(get_full_version ${epoch:-0} ${pkgver} ${pkgrel})) - - if [ -d "${svnrepo_to}" ]; then - for file in $(/usr/bin/svn ls "${svnrepo_to}"); do - /usr/bin/svn rm -q "${svnrepo_to}/$file@" - done - else - mkdir "${svnrepo_to}" - /usr/bin/svn add -q "${svnrepo_to}" - fi + if ! [[ -e "${pkgfile_from}" ]]; then + continue + fi - for file in $(svn ls "${svnrepo_from}"); do - /usr/bin/svn mv -q -r HEAD "${svnrepo_from}/$file@" "${svnrepo_to}/" - done - /usr/bin/svn rm --force -q "${svnrepo_from}" - tag_list="$tag_list, $pkgarch" + version="$(cat "${pkgfile_from}")" - for pkgname in ${pkgnames[@]}; do - for tarch in ${tarches[@]}; do - pkgpath=$(getpkgfile "${ftppath_from}/${tarch}/"${pkgname}-${pkgver}-${pkgarch}${PKGEXT}) - pkgfile="${pkgpath##*/}" + cd "${GITREPO}" + mkdir -p "${pkgfile_to%/*}" + git mv -f "${pkgfile_from}" "${pkgfile_to}" - ln -s "../../../${PKGPOOL}/${pkgfile}" ${ftppath_to}/${tarch}/ - if [ -f ${FTP_BASE}/${PKGPOOL}/${pkgfile}.sig ]; then - ln -s "../../../${PKGPOOL}/${pkgfile}.sig" ${ftppath_to}/${tarch}/ - fi - add_pkgs[${tarch}]+="${FTP_BASE}/${PKGPOOL}/${pkgfile} " - remove_pkgs[${tarch}]+="${pkgname} " - done - done - fi + tag_list="$tag_list, $pkgarch" done tag_list="${tag_list#, }" - /usr/bin/svn commit -q "${WORKDIR}/svn/${pkgbase}" -m "${0##*/}: moved ${pkgbase} from [${repo_from}] to [${repo_to}] (${tag_list})" + git commit -m "db-move: ${repo_from} -> ${repo_to} (${tag_list}): ${pkgbase} " done for tarch in ${ARCHES[@]}; do |