tests/libtest: Fix logic error in creation test-repo file
`test -n` would always be true. Also while I have the patient open let's make writing the file atomic. Maybe someday I'll be motivated enough to write an `O_TMPFILE` patch for bash. Closes: #1103 Approved by: jlebon
This commit is contained in:
parent
d9d8eefdc5
commit
42282c0a84
@ -480,12 +480,13 @@ EOF
|
||||
--define "_rpmdir $test_tmpdir/yumrepo/packages" \
|
||||
--define "_buildrootdir $PWD")
|
||||
(cd yumrepo && createrepo_c --no-database .)
|
||||
if test -n yumrepo.repo; then
|
||||
cat > yumrepo.repo << EOF
|
||||
if test '!' -f yumrepo.repo; then
|
||||
cat > yumrepo.repo.tmp << EOF
|
||||
[test-repo]
|
||||
name=test-repo
|
||||
baseurl=file:///$PWD/yumrepo
|
||||
EOF
|
||||
mv yumrepo.repo{.tmp,}
|
||||
fi
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user