summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@parabola.nu>2018-06-22 12:54:14 -0400
committerLuke Shumaker <lukeshu@parabola.nu>2018-08-20 19:53:44 -0400
commite3f7e93bb73dcdbe1632853dc0eec927928ffa95 (patch)
tree6854c4efc1363a50ef956ffc5acecd39b5037fef
parent821c0b9a7783bff5266b85b812232b0c74eae00f (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--config4
-rw-r--r--db-functions7
-rw-r--r--db-functions-none71
-rw-r--r--test/cases/db-update.bats2
-rw-r--r--test/cases/sourceballs.bats4
-rw-r--r--test/lib/common-none.bash70
6 files changed, 155 insertions, 3 deletions
diff --git a/config b/config
index 1cfe11f..71c07aa 100644
--- a/config
+++ b/config
@@ -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 a704f3c..52ccadc 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..38806d2
--- /dev/null
+++ b/db-functions-none
@@ -0,0 +1,71 @@
+#!/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
+ local path
+
+ :
+}
+
+# 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
+ :
+}