[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH for-4.8] tools/libacpi: fix sed usage



Roger Pau Monne writes ("[PATCH for-4.8] tools/libacpi: fix sed usage"):
> Current usage of sed in the libacpi Makefile make uses of non-POSIX options,
> that are not available on all the OSes supported by the Xen tools.
...
> -     awk 'NR > 1 {print s} {s=$$0}' $< > $@.$(TMP_SUFFIX)
> -     # Strip license comment
> -     sed -i '1,/\*\//{/\/\*/,/\*\//d}' $@.$(TMP_SUFFIX)
> +     # Remove last bracket and strip license comment
> +     awk 'NR > 1 {print s} {s=$$0}' $< | sed '1,/\*\//d' > $@.$(TMP_SUFFIX)

Sadly, unless countermeasures are taken, this pretends to succeed if
awk fails.  I don't think the obvious countermeasure (set -o pipefail)
is remotely portable.

I normally split this kind of thing up and just use .1.tmp .2.tmp etc.

Ina.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.