[arch-dev-public] [PATCH] Move build logs to WORKDIR, otherwise they're lost
--- makechrootpkg | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/makechrootpkg b/makechrootpkg index e48db6f..80b5e16 100755 --- a/makechrootpkg +++ b/makechrootpkg @@ -254,6 +254,11 @@ if mkarchroot -r "/chrootbuild" "$uniondir"; then mv "$f" "${WORKDIR}" fi done + + if [ -f $uniondir/build/*-build.log ]; then + echo "Moving build log(s) to ${WORKDIR}" + mv $uniondir/build/*-{build,package}.log* "${WORKDIR}" + fi else #just in case. We returned 1, make sure we fail touch "${chrootdir}/union/build/BUILD_FAILED" -- 1.6.6.1
Am Mittwoch, 10. Februar 2010 15:49:35 schrieb Francois Charette:
+ if [ -f $uniondir/build/*-build.log ]; then + echo "Moving build log(s) to ${WORKDIR}" + mv $uniondir/build/*-{build,package}.log* "${WORKDIR}" + fi
What do you think about this: for l in "${uniondir}"/build/*-{build,package}.log*; do [ -f "$l" ] && mv "$l" "${WORKDIR}" done The globing in the if clause will fail if there are for some reason more than one match. It's also quite common not to have a package.log. (for that case I have added the check within the for loop) -- Pierre Schmitz, https://users.archlinux.de/~pierre
On 11/02/10 12:27, Pierre Schmitz wrote:
Am Mittwoch, 10. Februar 2010 15:49:35 schrieb Francois Charette:
+ if [ -f $uniondir/build/*-build.log ]; then + echo "Moving build log(s) to ${WORKDIR}" + mv $uniondir/build/*-{build,package}.log* "${WORKDIR}" + fi
What do you think about this:
for l in "${uniondir}"/build/*-{build,package}.log*; do [ -f "$l" ]&& mv "$l" "${WORKDIR}" done
The globing in the if clause will fail if there are for some reason more than one match. It's also quite common not to have a package.log. (for that case I have added the check within the for loop)
I think the glob at the end (log*) is unnecessary. The point of this is that there should be no old build logs there. Otherwise, that seems fine. Allan
Am Donnerstag, 11. Februar 2010 03:37:54 schrieb Allan McRae:
Otherwise, that seems fine.
I think I'll commit this patch and other changes to devtools today. -- Pierre Schmitz, https://users.archlinux.de/~pierre
On 11/02/2010 03:37, Allan McRae wrote:
On 11/02/10 12:27, Pierre Schmitz wrote:
Am Mittwoch, 10. Februar 2010 15:49:35 schrieb Francois Charette:
+ if [ -f $uniondir/build/*-build.log ]; then + echo "Moving build log(s) to ${WORKDIR}" + mv $uniondir/build/*-{build,package}.log* "${WORKDIR}" + fi
What do you think about this:
for l in "${uniondir}"/build/*-{build,package}.log*; do [ -f "$l" ]&& mv "$l" "${WORKDIR}" done
The globing in the if clause will fail if there are for some reason more than one match. It's also quite common not to have a package.log. (for that case I have added the check within the for loop) Yes. Better.
I think the glob at the end (log*) is unnecessary. The point of this is that there should be no old build logs there.
Agreed again. Should I send a corrected patch?
Am Donnerstag, 11. Februar 2010 08:02:40 schrieb Firmicus:
Should I send a corrected patch?
Don't worry. It's trivial enough for me to manage this. :-) -- Pierre Schmitz, https://users.archlinux.de/~pierre
participants (4)
-
Allan McRae
-
Firmicus
-
Francois Charette
-
Pierre Schmitz