From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([69.77.167.62] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1LPMQr-0005KL-RI for garchives@archives.gentoo.org; Tue, 20 Jan 2009 19:38:42 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 2CD6FE0589; Tue, 20 Jan 2009 19:38:39 +0000 (UTC) Received: from smtp03.tky.fi (smtp03.tky.fi [82.130.63.73]) by pigeon.gentoo.org (Postfix) with SMTP id C5D2CE0589 for ; Tue, 20 Jan 2009 19:38:38 +0000 (UTC) Received: from [82.130.46.209] ([82.130.46.209]) by smtp03.tky.fi (SMSSMTP 4.1.9.35) with SMTP id M2009012021364328620 for ; Tue, 20 Jan 2009 21:36:43 +0200 Message-ID: <497627F1.5060704@gentoo.org> Date: Tue, 20 Jan 2009 21:37:21 +0200 From: =?UTF-8?B?UGV0dGVyaSBSw6R0eQ==?= User-Agent: Mozilla/5.0 (X11; U; Linux i686; fi; rv:1.8.1.19) Gecko/20090111 Thunderbird/2.0.0.19 Mnenhy/0.7.5.666 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org MIME-Version: 1.0 To: gentoo-dev@lists.gentoo.org Subject: Re: [gentoo-dev] Usage of cp -i to prevent overwriting upstream files References: <4976205A.5030600@gentoo.org> <1232479492.31989.140.camel@liasis.inforead.com> In-Reply-To: <1232479492.31989.140.camel@liasis.inforead.com> X-Enigmail-Version: 0.95.7 OpenPGP: url=http://users.tkk.fi/~praty/public.asc Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig486FC793B6BB76C55208EA40" X-Archives-Salt: 89c49b61-5cb5-4339-b555-d6e90e88e81a X-Archives-Hash: 24d82170d34b3d6d601fcd56d6c03279 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig486FC793B6BB76C55208EA40 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Ferris McCormick wrote: > On Tue, 2009-01-20 at 21:04 +0200, Petteri R=C3=A4ty 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 ca= se >> 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 wi= ll >> 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 tha= t >> 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} $* >> >> [[ ${#} !=3D 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 >=20 > Fine with me >=20 >> b) this function should be added to eutils >=20 > I don't like this one ---=20 > [[ ${#} !=3D 2 ]] && die "${FUNCNAME} takes two arguments" > [[ -e ${2} ]] && die "die target exists" >=20 > How does the user recover from that? I would become irate if a build > died without giving some useful indication the problem. >=20 You did not understand the issue if you are fine with a) but then make this statement. a) would surely be even more confusing to the user. Regards, Petteri --------------enig486FC793B6BB76C55208EA40 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkl2J/EACgkQcxLzpIGCsLR3nACeLGGHOnZo4o9V4TkC7EJbYeT5 fkAAmwXzYzHA/EI2liqiAE6lBtgudqhP =f2Fg -----END PGP SIGNATURE----- --------------enig486FC793B6BB76C55208EA40--