Akim Demaille wrote: > Le 6 juil. 2012 à 13:56, Jim Meyering a écrit : > >> Um... this is a good reason to post an adjusted patch. >> What I meant was that it is fine to continue to print that diagnostic >> on one line, but not using echo; using the new "warn". >> >> It should use warn, and warn should be defined as in init.sh. > > Ah, ok. But the messages were already on several lines before, > so you actually prefer to make the diagnostic less formatted? > > -if test $found_aux_dir = no; then > - echo "$0: expected line not found in configure.ac. Add the following:" >&2 > - echo " AC_CONFIG_AUX_DIR([$build_aux])" >&2 > - exit 1 > -fi > +test $found_aux_dir = yes \ > + || die "expected line not found in configure.ac. Add the following:" \ > + " AC_CONFIG_AUX_DIR([$build_aux])"
Actually, using die above is fine. However, I would like to keep bootstrap's warn and init.sh's warn_ compatible. > - echo "$me: Error: '$app' version == $inst_ver is too old" >&2 > - echo " '$app' version >= $req_ver is required" >&2 > + warn "Error: '$app' version == $inst_ver is too old" \ > + " '$app' version >= $req_ver is required" > > Or do you prefer reintroducing braces and several commands for a single, > but multi-line, message? Converting separate arguments into separate lines seems wrong. Inserting newlines is the job of a printf-like function. Options: - use printf 1>&2 ... or - use a printf-style variant, say warnf, that would be used like this: warnf '%s\n' "Error: '$app' version == $inst_ver is too old" \ " '$app' version >= $req_ver is required"