summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Brown <ben@demerara.io>2021-12-30 13:53:30 +0000
committerBen Brown <ben@demerara.io>2021-12-30 13:53:30 +0000
commit502b8276f95dc3de57f21c44431db8adb3009e79 (patch)
tree46ebfff4c798d783147b8c6c11228d8d8f6df68a
parent07ef3b67c0f13c86d475b3d6743600a0199b7195 (diff)
parentd5baa6cd74289c195c577ce1606a83cfa7ff95a1 (diff)
downloadlorry-502b8276f95dc3de57f21c44431db8adb3009e79.tar.gz
Merge branch 'km/test-fix' into 'master'
Fix default make tarball behaviour and test See merge request CodethinkLabs/lorry/lorry!29
-rwxr-xr-xlorry7
-rwxr-xr-xtests/make-tarball.script5
2 files changed, 7 insertions, 5 deletions
diff --git a/lorry b/lorry
index 2a55969..3e7135e 100755
--- a/lorry
+++ b/lorry
@@ -223,8 +223,8 @@ class Lorry(cliapp.Application):
'first will only tar if there is not already '
'a tarball in TARBALLS (default: first)')
self.settings.string(['tarball-dest'],
- 'put created tarballs in TARBALLS',
- metavar='TARBALLS')
+ 'put created tarballs in DIR',
+ metavar='DIR', default='git-tars')
self.settings.boolean(['keep-multiple-backups'],
'keep multiple (time-stamped) backups (disabled by default)',
default=False)
@@ -249,7 +249,8 @@ class Lorry(cliapp.Application):
self.settings[setting_name] = full_path
ensure_path_exists('working-area')
- ensure_path_exists('tarball-dest')
+ if self.settings['tarball'] != 'never':
+ ensure_path_exists('tarball-dest')
urllib.request.install_opener(
urllib.request.build_opener(SimpleFTPHandler))
diff --git a/tests/make-tarball.script b/tests/make-tarball.script
index 3edecb2..f53f300 100755
--- a/tests/make-tarball.script
+++ b/tests/make-tarball.script
@@ -22,11 +22,12 @@ set -e
logfile="$DATADIR/make-tarball.log"
workdir="$DATADIR/work-dir"
+tardir="$DATADIR/git-tars"
"${SRCDIR}/test-lorry" --pull-only --log="$logfile" --working-area="$workdir" \
- --tarball=first --mirror-base-url-fetch="file://non-existent-url" \
+ --tarball=first --tarball-dest="$tardir" --mirror-base-url-fetch="file://non-existent-url" \
"$DATADIR/make-tarball-repo.lorry" > /dev/null
# verify that we can see the tarball generated of the git tree
-test -r "${workdir}/make-tarball-repo-bzip2/git-a/"*"make_tarball_repo_bzip2.tar"
+test -r "${tardir}/"*"make_tarball_repo_bzip2.tar"