Issue 71742

Summary: rm -f'ing a target and then let cp check whether the source is newer than the target doesn't make sense
Product: App Dev Reporter: lohmaier
Component: apiAssignee: jsc
Status: CLOSED FIXED QA Contact: issues@api <issues>
Severity: Trivial    
Priority: P3 CC: eric.bachard, issues
Version: 3.3.0 or older (OOo)   
Target Milestone: ---   
Hardware: All   
OS: All   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---
Issue Depends on:    
Issue Blocks: 72840    

Description lohmaier 2006-11-19 17:09:39 UTC
sdk_oo/pack/copying/makefile.mk contains recipes like:

$(DESTDIRDOCU)$/DevelopersGuide$/DevelopersGuide.pdf : DevelopersGuide.pdf
        +-$(MKDIRHIER) $(@:d)
        +-rm -f $@ >& $(NULLDEV)
        $(MY_COPY) DevelopersGuide.pdf $(DESTDIRDOCU)$/DevelopersGuide

With MY_COPY being defined in sdk_oo/util/makefile.pmk as 

MY_COPY=$(GNUCOPY) -u

-u option in gnu cp is:
"copy only when the SOURCE file is  newer  than  the  destination file or when
the destination file is missing"

Given that the destination file just was forcely removed, this check is superfluous.

Additionally, this seems (so far) to be the only place wher gnucp is actually
required. Everything else works as well with bsd cp (read: the standard cp on mac)

If nobody objects, I'll make this regular $(CP) calls in cloph04. 
If you want to really use the existence/newer than check, then don't use "gnucp
-u", but the "$^" placeholder in the recipe. (don't do the makesystem's job
yourself)
Comment 1 jsc 2006-11-24 08:55:57 UTC
i will check this for all platforms, no need to fix it on cloph04. We can simply
use cp on mac.
Comment 2 jsc 2006-12-01 12:04:32 UTC
fixed on cws jsc15

i've changed the rule to use the $(GNUCOPY) variable directly. GNUCOPY should be
a simple cp cmd on Mac and should work always.
Comment 3 jsc 2006-12-06 09:21:53 UTC
verified
Comment 4 jsc 2007-01-09 09:19:34 UTC
closed