From: Robin H. Johnson Date: Tue, 11 May 2010 07:58:43 +0000 (+0000) Subject: Improve binary renaming to NOT rename all elements in the path, and also pick up... X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=4af4a05ef38794214d7deef2ce8ff7743b2f7cdc;p=gentoo.git Improve binary renaming to NOT rename all elements in the path, and also pick up binaries that match the prefix of 'db' but not 'db_'. --- diff --git a/eclass/db.eclass b/eclass/db.eclass index f74e39cb1c52..b2e4256bc213 100644 --- a/eclass/db.eclass +++ b/eclass/db.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/db.eclass,v 1.36 2010/05/04 08:03:40 tove Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/db.eclass,v 1.37 2010/05/11 07:58:43 robbat2 Exp $ # This is a common location for functions used in the sys-libs/db ebuilds # # Bugs: pauldv@gentoo.org @@ -90,10 +90,13 @@ db_src_install_examples() { db_src_install_usrbinslot() { # slot all program names to avoid overwriting - for fname in "${D}"/usr/bin/db_* + for fname in "${D}"/usr/bin/db* do - mv "${fname}" "${fname//\/db_//db${SLOT}_}" || \ - die "Failed to rename ${fname}" + dn="$(dirname "${fname}")" + bn="$(basename "${fname}")" + bn="${bn/db/db${SLOT}}" + mv "${fname}" "${dn}/${bn}" || \ + die "Failed to rename ${fname} to ${dn}/${bn}" done }