From 3aab49eb698b9697109e8efd22294a4bc3b811d4 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Tue, 7 Oct 2014 15:41:03 +0200 Subject: make tests.d/ftpdir-cleanup work Signed-off-by: Florian Pritz --- cron-jobs/sourceballs | 6 ++---- db-functions | 15 +++++++++++++-- test/test.d/ftpdir-cleanup.sh | 4 ++-- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs index 4126c37..2744be8 100755 --- a/cron-jobs/sourceballs +++ b/cron-jobs/sourceballs @@ -77,10 +77,8 @@ for repo in ${PKGREPOS[@]}; do continue fi - # Get the sources from svn - mkdir -p -m0770 "${WORKDIR}/pkgbuilds/${repo}-${pkgarch}" - arch_svn export -q "${SVNREPO}/${pkgbase}/repos/${repo}-${pkgarch}" \ - "${WORKDIR}/pkgbuilds/${repo}-${pkgarch}/${pkgbase}" >/dev/null 2>&1 + get_dir_from_pkgrepo "${pkgbase}" "${pkgver}" "" \ + "${WORKDIR}/pkgbuilds/${repo}-${pkgarch}/${pkgbase}" if [ $? -ge 1 ]; then failedpkgs[${#failedpkgs[*]}]="${pkgbase}-${pkgver}${SRCEXT}" continue diff --git a/db-functions b/db-functions index 47053ea..c637b35 100644 --- a/db-functions +++ b/db-functions @@ -634,8 +634,19 @@ get_file_from_pkgrepo() { # for git: cd $whereever; git show $tag:$filename #curl -s https://projects.archlinux.org/svntogit/community.git/plain/trunk/$filename?h=packages/$pkgbase # TODO: this requires us to restructure the repos - arch_svn cat "${SVNREPO}/${_pkgbase}/tags/$tag/$filename" - #arch_svn cat "${SVNREPO}/${_pkgbase}/trunk/$filename" + arch_svn cat "${SVNREPO}/${pkgbase}/tags/$tag/$filename" + #arch_svn cat "${SVNREPO}/${pkgbase}/trunk/$filename" +} + +get_dir_from_pkgrepo() { + local pkgbase="$1" + local tag="$2" + local src="$3" + local dest="$4" + + # TODO: implement svn/git extraction + # for git: use git archive? + arch_svn export -q "${SVNREPO}/${pkgbase}/tags/${tag}/${src}" "${dest}" } arch_svn() { diff --git a/test/test.d/ftpdir-cleanup.sh b/test/test.d/ftpdir-cleanup.sh index bfea7ea..68ea922 100755 --- a/test/test.d/ftpdir-cleanup.sh +++ b/test/test.d/ftpdir-cleanup.sh @@ -72,7 +72,7 @@ testCleanupAnyPackages() { done ../db-update - ../db-remove extra any pkg-any-a + ../db-remove extra all pkg-any-a ../cron-jobs/ftpdir-cleanup >/dev/null local pkg1='pkg-any-a-1-1-any.pkg.tar.xz' @@ -100,7 +100,7 @@ testCleanupSplitPackages() { ../db-update for arch in ${arches[@]}; do - ../db-remove extra ${arch} ${pkgs[0]} + ../db-remove extra ${arch} pkg-split-a{1,2} done ../cron-jobs/ftpdir-cleanup >/dev/null -- cgit v1.2.3-24-g4f1b