Issue 71742 - rm -f'ing a target and then let cp check whether the source is newer than the target doesn't make sense
Summary: rm -f'ing a target and then let cp check whether the source is newer than the...
Status: CLOSED FIXED
Alias: None
Product: App Dev
Classification: Unclassified
Component: api (show other issues)
Version: 3.3.0 or older (OOo)
Hardware: All All
: P3 Trivial
Target Milestone: ---
Assignee: jsc
QA Contact: issues@api
URL:
Keywords:
Depends on:
Blocks: 72840
  Show dependency tree
 
Reported: 2006-11-19 17:09 UTC by lohmaier
Modified: 2013-02-24 21:10 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
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