On Tue, 2009-01-20 at 21:04 +0200, Petteri Räty wrote:
> Many times upstream Java projects don't include build.xml files or
> proper build systems so we include build.xml files in $FILESDIR. In case
> upstream some day adds one we usually use cp -i to detect if upstream
> adds this file in new versions. If devs do their job properly, this will
> never show to users. On #gentoo-dev at least grobian and darkside did
> not like this and proposed using test and die instead. If we think that
> cp -i is not acceptable, this should be made a function to avoid code
> duplication in my opinion. Here's a suggestion:
>
> function cp-no-replace() {
> debug-print-function ${FUNCNAME} $*
>
> [[ ${#} != 2 ]] && die "${FUNCNAME} takes two arguments"
> [[ -e ${2} ]] && die "die target exists"
>
> cp "${1}" "${2}" || die "cp failed"
> }
>
> So do you think:
> a) cp -i is fine
Fine with me
> b) this function should be added to eutils
I don't like this one ---
[[ ${#} != 2 ]] && die "${FUNCNAME} takes two arguments"
[[ -e ${2} ]] && die "die target exists"
How does the user recover from that? I would become irate if a build
died without giving some useful indication the problem.
> c) keep it restricted to java eclasses
> d) something else
>
> Regards,
> Petteri
Regards,
Ferris
--
Ferris McCormick (P44646, MI) <[email protected]>
Developer, Gentoo Linux (Sparc, Userrel, Trustees)
signature.asc
Description: This is a digitally signed message part
