Hi Jim! Maybe my question below was not visible. I'd like to know what option you prefer.
Le 8 juin 2012 à 14:59, Akim Demaille a écrit : > Hi! > > Le 8 juin 2012 à 14:20, Jim Meyering a écrit : > >> One question: >> >> ... >>> @@ -89,15 +110,23 @@ trap 'exit $?' 1 2 13 15 >>> # We must build using sources for which --version reports the >>> # just-released version number, not some string like 7.6.18-20761. >>> # That version string propagates into all documentation. >>> +set -e >>> git checkout -b $tmp_branch v$version >>> -ok=0 >>> -./bootstrap && ./configure && make && make web-manual && ok=1 >>> -test $ok = 1 || exit 1 >>> - >>> -tmp=$(mktemp -d --tmpdir=. web-doc-update.XXXXXX) || exit 1 >>> +git submodule update --recursive >>> +./bootstrap >> >> I like to avoid using pwd, because it can fail (admittedly unlikely, but...). >> Did you consider just doing the "cd" and those four commands in a sub-shell, >> instead? > > Actually I lost trust in subshells :( It's too hard to have a > shell script fail from a subshell (calling your "die" does not > suffice). > > #! /bin/sh > > set -e > ( > set -e > exit 42 > echo end > ) > echo "done ($?)" > > $ sh /tmp/subsh.sh > done (42) > > I would have expected the outer set -e to be effective. But > I can check $? at the end if you prefer, and go with (). Right above. Should I stick to pwd (my preference), or do you prefer a sub-shell? > (Also, in some of my scripts I issue GNU Make-like "entering" > messages for sake of Emacs, so using "cd $cwd" became more > natural to me than relying on subshells) > >>> +srcdir=$(pwd) >>> +cd "$builddir" >>> + ./config.status --recheck >>> + ./config.status >>> + make >>> + make web-manual >>> +cd "$srcdir" >>> +set +e >>> + >>> +tmp=$(mktemp -d web-doc-update.XXXXXX) || exit 1 >>> ( cd $tmp \ >>> && cvs -d $u...@cvs.sv.gnu.org:/webcvs/$pkg co $pkg ) >>> -rsync -avP doc/manual/ $tmp/$pkg/manual >>> +rsync -avP "$builddir"/doc/manual/ $tmp/$pkg/manual >