diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2018-10-14 21:05:31 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2018-10-15 14:51:18 -0400 |
commit | 0a8afc0fae040ee20650c935094f4ceb34ef8b22 (patch) | |
tree | f6cb0dcd68223f432953f20e0ec8df2f62c4fa12 /test | |
parent | d9588459d035cc3d890892c8a8b3adbd466797e5 (diff) |
libremakepkg: Add -S flag to use an existing source package
"Ignore space change" might be helpful when viewing this diff.
Diffstat (limited to 'test')
-rw-r--r-- | test/cases/libremakepkg.bats | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/cases/libremakepkg.bats b/test/cases/libremakepkg.bats index 9ddfd2e..2184de2 100644 --- a/test/cases/libremakepkg.bats +++ b/test/cases/libremakepkg.bats @@ -241,3 +241,31 @@ teardown() { popd diff -u fixtures/libremakepkg/PKGBUILD-pkgver "$tmpdir/PKGBUILD" } + +@test "libremakepkg can re-use source-packages" { + require network sudo || skip + + cp fixtures/libremakepkg/PKGBUILD-hello "$tmpdir/PKGBUILD" + cd "$tmpdir" + + # I'm tempted to use file checksums here, but that would break + # when we gain support for reproducible builds. So just use + # timestamps. + + testsudo libremakepkg -l "$BATS_TEST_NAME" + globfile libretools-hello-1.0-1-any.src.tar.?z + globfile libretools-hello-1.0-1-any.pkg.tar.?z + a_stime=$(stat -c %Y -- libretools-hello-1.0-1-any.src.tar.?z) + a_ptime=$(stat -c %Y -- libretools-hello-1.0-1-any.pkg.tar.?z) + + testsudo libremakepkg -l "$BATS_TEST_NAME" -S libretools-hello-1.0-1-any.src.tar.?z + globfile libretools-hello-1.0-1-any.src.tar.?z + globfile libretools-hello-1.0-1-any.pkg.tar.?z + b_stime=$(stat -c %Y -- libretools-hello-1.0-1-any.src.tar.?z) + b_ptime=$(stat -c %Y -- libretools-hello-1.0-1-any.pkg.tar.?z) + + (( a_stime == b_stime )) + (( a_ptime < b_ptime )) + (( a_ptime > a_stime )) + (( b_ptime > a_stime )) +} |