On Friday 11 April 2008 10:59, Bernhard Fischer wrote:
> >+# Not very elegant: copies testsuite to objdir...
> >+.PHONY: check
> >+.PHONY: test
> > check test: busybox busybox.links
> >-    bindir=$(objtree) srcdir=$(srctree)/testsuite SED="$(SED)" \
> >-    $(SHELL) $(srctree)/testsuite/runtest $(if $(KBUILD_VERBOSE:0=),-v)
> >+    test -d $(objtree)/testsuite || cp -a $(srctree)/testsuite $(objtree)
> 
> cp -a is not portable (IIRC -dpf was)

Neither is. POSIX says:

       -f     If  a  file  descriptor  for  a  destination file cannot be 
obtained, as described in step 3.a.ii., attempt to
              unlink the destination file and proceed.

       -H     Take actions based on the type and contents of the file  
referenced  by  any  symbolic  link  specified  as  a
              source_file operand.

       -i     Write  a  prompt  to  standard error before copying to any 
existing destination file. If the response from the
              standard input is affirmative, the copy shall be attempted; 
otherwise, it shall not.

       -L     Take actions based on the type and contents of the file  
referenced  by  any  symbolic  link  specified  as  a
              source_file operand or any symbolic links encountered during 
traversal of a file hierarchy.

       -P     Take  actions  on any symbolic link specified as a source_file 
operand or any symbolic link encountered during
              traversal of a file hierarchy.

       -p     Duplicate the following characteristics of each source file in 
the corresponding destination file:

-d is _not_ listed! :( Hmm. I guess POSIX's idea of -d is -P...

I am changing it to "cp -fPR"

> 
> >+    bindir=$(objtree) srcdir=$(srctree)/testsuite \
> >+    $(SHELL) -c "cd $(objtree)/testsuite && $(srctree)/testsuite/runtest 
> >$(if $(KBUILD_VERBOSE:0=),-v)"
> 
> You dropped passing down SED so broke running the testsuite on OS that
> doesn't have a working system-provided sed :(

Yes. This was intended. I think we should not do that.
Otherwise, why only sed,
not awk/cp/rm/basename/bzip2/cat/cut/grep/[skip 100 more commands]?

The whole purpose of having POSIX/SUS/... standards is to not
cater for incompatible command options or drag our own, "correct"
implementations, but rely on systems having "reasonably"
standard-conforming utilities.

Back to sed. I don't think busybox build system should have special
hooks just for somebody who have broken sed. This person can
build and install non-broken sed, once and for all.

--
vda
_______________________________________________
busybox mailing list
[email protected]
http://busybox.net/cgi-bin/mailman/listinfo/busybox

Reply via email to