summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsrc/abslibre-tools/librestage3
-rw-r--r--test/librestage-test.sh14
2 files changed, 16 insertions, 1 deletions
diff --git a/src/abslibre-tools/librestage b/src/abslibre-tools/librestage
index 16dc772..6eba8dd 100755
--- a/src/abslibre-tools/librestage
+++ b/src/abslibre-tools/librestage
@@ -60,6 +60,7 @@ main() {
# Load configuration
load_files libretools
check_vars libretools WORKDIR ARCHES || return 1
+ load_files makepkg # for PKGDEST, which is optional
# Load the PKGBUILD
source ./PKGBUILD
@@ -69,7 +70,7 @@ main() {
for CARCH in "${ARCHES[@]}" any; do
for _pkgname in "${pkgname[@]}"; do
pkgfile=${_pkgname}-$(get_full_version $_pkgname)-${CARCH}${PKGEXT}
- pkgpath="$(find . "$PKGDEST" -maxdepth 1 -type f -name "$pkgfile"|sed 1q)"
+ pkgpath="$(find . "${PKGDEST:-.}" -maxdepth 1 -type f -name "$pkgfile"|sed 1q)"
if [[ ! -f "${pkgpath}" ]]; then
continue
diff --git a/test/librestage-test.sh b/test/librestage-test.sh
index 11b4739..016b576 100644
--- a/test/librestage-test.sh
+++ b/test/librestage-test.sh
@@ -9,6 +9,7 @@ before() {
mkdir -p $XDG_CONFIG_HOME/libretools
echo "WORKDIR='$tmpdir/workdir'" >$XDG_CONFIG_HOME/libretools/libretools.conf
+ echo "ARCHES=('x86_64' 'i686' 'misp64el')" >>$XDG_CONFIG_HOME/libretools/libretools.conf
export HOME=$XDG_CONFIG_HOME
echo 'PKGEXT=.pkg.tar.gz' > $HOME/.makepkg.conf
@@ -69,3 +70,16 @@ it_stages_packages_to_multiple_repos() {
[[ -f $tmpdir/workdir/staging/repo2/libretools-hello-1.0-1-any.pkg.tar.gz ]]
[[ -f $tmpdir/workdir/staging/repo3/libretools-hello-1.0-1-any.pkg.tar.gz ]]
}
+
+
+it_stages_packages_without_PKGDEST() {
+ echo "PKGDEST=''" >> $HOME/.makepkg.conf
+
+ cp librestage.d/PKGBUILD-hello "$tmpdir/PKGBUILD"
+ cd "$tmpdir"
+
+ makepkg
+ librestage repo1
+
+ [[ -f $tmpdir/workdir/staging/repo1/libretools-hello-1.0-1-any.pkg.tar.gz ]]
+}