diff options
author | Luke Shumaker <lukeshu@parabola.nu> | 2018-06-22 12:54:14 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@parabola.nu> | 2018-10-07 18:54:33 -0400 |
commit | b939861bff0c3a3478e4d718aaee38bf59bd8719 (patch) | |
tree | 266e9492d474495898ae07e284d7441d165a97a7 | |
parent | 0b163ca4be75fbc9345590960ba8c876b3c0186e (diff) |
Add a VCS=none that does nothing, use it instead of VCS=svn
Earlier versions of this patch added VCS=xbs, but XBS is
non-functional. It provided something useful before db-functions-$VCS
was a thing, but now it's dead.
We don't use SVN, and XBS non-functional, just add a null VCS that
does nothing.
-rw-r--r-- | config | 4 | ||||
-rw-r--r-- | db-functions | 7 | ||||
-rw-r--r-- | db-functions-none | 70 | ||||
-rw-r--r-- | test/cases/db-update.bats | 2 | ||||
-rw-r--r-- | test/cases/sourceballs.bats | 4 | ||||
-rw-r--r-- | test/lib/common-none.bash | 70 |
6 files changed, 154 insertions, 3 deletions
@@ -8,9 +8,7 @@ TESTING_REPO='' STABLE_REPOS=() # VCS backend -VCS=svn -SVNREPO='' -SVNUSER='' +VCS=none CLEANUP_DESTDIR="/var/tmp" CLEANUP_DRYRUN=false diff --git a/db-functions b/db-functions index c1576f4..a0b2e42 100644 --- a/db-functions +++ b/db-functions @@ -309,6 +309,9 @@ check_pkgvcs() { in_array "${repo}" "${PKGREPOS[@]}" || return 1 if [[ ! -f ${WORKDIR}/pkgbuilds/${repo}-${_pkgarch}/${_pkgbase}/PKGBUILD ]]; then + if ! type vcs_export &>/dev/null; then + return 0 + fi mkdir -p "${WORKDIR}/pkgbuilds/${repo}-${_pkgarch}" vcs_export "$repo" "$_pkgarch" "$_pkgbase" \ "${WORKDIR}/pkgbuilds/${repo}-${_pkgarch}/${_pkgbase}" >/dev/null || return 1 @@ -343,6 +346,10 @@ check_splitpkgs() { echo "${_pkgname}" >> "${repo}/${_pkgarch}/${_pkgbase}/staging" if [[ ! -f ${WORKDIR}/pkgbuilds/${repo}-${_pkgarch}/${_pkgbase}/PKGBUILD ]]; then + if ! type vcs_export &>/dev/null; then + popd >/dev/null + return 0 + fi mkdir -p "${WORKDIR}/pkgbuilds/${repo}-${_pkgarch}" vcs_export "$repo" "$_pkgarch" "$_pkgbase" \ "${WORKDIR}/pkgbuilds/${repo}-${_pkgarch}/${_pkgbase}" >/dev/null || return 1 diff --git a/db-functions-none b/db-functions-none new file mode 100644 index 0000000..1d5a346 --- /dev/null +++ b/db-functions-none @@ -0,0 +1,70 @@ +#!/hint/bash + +# Within this file (and in most of dbscripts, really): +# - "pkgarch" refers to the package architecture; may be "any" +# - "tarch" refers to the repo architecture; may NOT be "any" + +# usage: vcs_move_preflight_check repo_from pkgarch pkgbase +# +# Verify that $pkgbase exists in $repo_from in VCS, such that we can +# move it to a different repo. +vcs_move_preflight_check() { + local repo_from=$1 + local tarch=$2 + local pkgbase=$3 + + : +} + +# usage: vcs_move_start repo_from repo_to pkgbase +# +# Begin a VCS transaction moving $pkgbase from $repo_from to $repo_to. +# This should be followed by a call to vcs_move_arch for each +# architecture we're movin it for, and finally by a call to +# vcs_move_finish. +vcs_move_start() { + local repo_from=$1 + local repo_to=$2 + local pkgbase=$3 + + : +} + +# usage: vcs_move_arch tarch +# +# Add an architecture to a VCS transaction started by vcs_move_start. +vcs_move_arch() { + local tarch=$1 + + : +} + +# usage: vcs_move_finish +# +# Commit/finalize a VCS transaction started by vcs_move_start. +vcs_move_finish() { + : +} + +# usage: vcs_remove repo pkgarch pkgbase +# +# Remove the given package in VCS. +vcs_remove() { + local repo=$1 + local arch=$2 + local pkgbase=$3 + + : +} + +# usage: vcs_export repo pkgarch pkgbase dest +# +# Export the VCS files for a package to the given $dest directory. +#vcs_export() { +# local repo=$1 +# local pkgarch=$2 +# local pkgbase=$3 +# local dest=$4 +# +# : +#} diff --git a/test/cases/db-update.bats b/test/cases/db-update.bats index 0be47d7..8b557e3 100644 --- a/test/cases/db-update.bats +++ b/test/cases/db-update.bats @@ -119,6 +119,7 @@ load ../lib/common } @test "add incomplete split package fails" { + skip # Requires a functioning VCS backend local arches=('i686' 'x86_64') local repo='extra' local pkgbase='pkg-split-a' @@ -205,6 +206,7 @@ load ../lib/common } @test "add package with inconsistent pkgbuild fails" { + skip # abslibre is broken releasePackage extra 'pkg-any-a' updateRepoPKGBUILD 'pkg-any-a' extra diff --git a/test/cases/sourceballs.bats b/test/cases/sourceballs.bats index df7ddd4..930ad7a 100644 --- a/test/cases/sourceballs.bats +++ b/test/cases/sourceballs.bats @@ -11,6 +11,7 @@ __checkRemovedSourcePackage() { } @test "create simple package sourceballs" { + skip # Requires a functioning VCS backend local arches=('i686' 'x86_64') local pkgs=('pkg-simple-a' 'pkg-simple-b' 'pkg-simple-epoch') local pkgbase @@ -28,6 +29,7 @@ __checkRemovedSourcePackage() { } @test "create any package sourceballs" { + skip # Requires a functioning VCS backend local pkgs=('pkg-any-a' 'pkg-any-b') local pkgbase @@ -43,6 +45,7 @@ __checkRemovedSourcePackage() { } @test "create split package sourceballs" { + skip # Requires a functioning VCS backend local arches=('i686' 'x86_64') local pkgs=('pkg-split-a' 'pkg-split-b') local pkg @@ -62,6 +65,7 @@ __checkRemovedSourcePackage() { } @test "cleanup sourceballs" { + skip # Requires a functioning VCS backend local arches=('i686' 'x86_64') local pkgs=('pkg-simple-a' 'pkg-simple-b') local pkgbase diff --git a/test/lib/common-none.bash b/test/lib/common-none.bash new file mode 100644 index 0000000..a392e25 --- /dev/null +++ b/test/lib/common-none.bash @@ -0,0 +1,70 @@ +#!/hint/bash + +# usage: vcsSetup +# Do any test-suite setup. +# +# Count on $TMP and $DBSCRIPTS_CONFIG being set, but not much else +# being done. Notably $DBSCRIPTS_CONFIG hasn't been loaded yet (so +# that we have a chance to edit it). +vcsSetup() { + : +} + +# usage: vcsDirOfPKGBUILD $pkgbase +# +# Print the path to the directory storing the "trunk"/"master" working +# copy of the PKGBUILD for the given $pkgbase. +vcsDirOfPKGBUILD() { + local pkgbase=$1 + + echo "${TMP}/vcs-none/${pkgbase}" +} + +# usage: vcsInitFixture $pkgbase +# +# Initialize from the test fixtures the "trunk"/"master" working copy +# of the PKGBUILD for the given $pkgbase. +vcsInitFixture() { + local pkgbase=$1 + + mkdir -p "${TMP}/vcs-none/${pkgbase}" + cp "fixtures/${pkgbase}"/* "${TMP}/vcs-none/${pkgbase}" +} + +# usage: vcsCommit $msg +# Commit changes to the PKGBUILD in the current directory +vcsCommit() { + local msg=$1 + : +} + +# usage: vcsRelease $repo +# Run from the "trunk"/"master" PKGBUILD directory. +# +# This is a cheap imitation of the `archrelease` program that is part +# of the `devtools` package. +vcsRelease() { + local repo=$1 + : +} + +# usage: vcsCheckPackage $repo $pkgbase $pkgver +# +# Verify that the PKGBUILD for the given $pkgbase is tagged as +# existing in $repo, and has the correct $pkgver. +vcsCheckPackage() { + local repo=$1 + local pkgbase=$2 + local pkgver=$3 + : +} + +# usage: vcsCheckRemovedPackage $repo $pkgbase +# +# Verify that no PKGBUILD for the given $pkgbase is tagged as existing +# in $repo. +vcsCheckRemovedPackage() { + local repo=$1 + local pkgbase=$2 + : +} |