summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAron Griffis <agriffis@gentoo.org>2004-07-07 16:14:02 +0000
committerAron Griffis <agriffis@gentoo.org>2004-07-07 16:14:02 +0000
commitb5e46d39760daf9e01b5f2eec3399cdcb8321e85 (patch)
tree7c6259ce2e108ba7ee8fa57e29488dac48b1e77f /eclass/gnuconfig.eclass
parentRemoved obsolete versions (Manifest recommit) (diff)
downloadgentoo-2-b5e46d39760daf9e01b5f2eec3399cdcb8321e85.tar.gz
gentoo-2-b5e46d39760daf9e01b5f2eec3399cdcb8321e85.tar.bz2
gentoo-2-b5e46d39760daf9e01b5f2eec3399cdcb8321e85.zip
allow first arg to be starting directory for gnuconfig_update #56279
Diffstat (limited to 'eclass/gnuconfig.eclass')
-rw-r--r--eclass/gnuconfig.eclass30
1 files changed, 21 insertions, 9 deletions
diff --git a/eclass/gnuconfig.eclass b/eclass/gnuconfig.eclass
index 8fbb32f3f4cf..f6ce8d5a3fa3 100644
--- a/eclass/gnuconfig.eclass
+++ b/eclass/gnuconfig.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/gnuconfig.eclass,v 1.20 2004/07/05 09:15:27 solar Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/gnuconfig.eclass,v 1.21 2004/07/07 16:14:02 agriffis Exp $
#
# Author: Will Woods <wwoods@gentoo.org>
#
@@ -32,32 +32,44 @@ gnuconfig_update() {
else
gnuconfig_do_update config.sub config.guess
fi
+
+ return $?
}
# Copy the newest available version of specified files over any old ones in the
# source dir. This function shouldn't be called directly - use gnuconfig_update
gnuconfig_do_update() {
- [ $# -eq 0 ] && die "do not call gnuconfig_do_update(); use gnuconfig_update()"
+ local startdir configsubs_dir target targetlist file
+
+ if [[ ${1} == /* ]]; then
+ startdir=${1%/} # remove possible trailing slash
+ shift
+ else
+ startdir=${S}
+ fi
+
+ [ $# -eq 0 ] && die "do not call gnuconfig_do_update; use gnuconfig_update"
- local configsubs_dir="$(gnuconfig_findnewest)"
- local target targetlist file
+ configsubs_dir="$(gnuconfig_findnewest)"
einfo "Using GNU config files from ${configsubs_dir}"
for file in "$@" ; do
if [ ! -r ${configsubs_dir}/${file} ] ; then
eerror "Can't read ${configsubs_dir}/${file}, skipping.."
continue
fi
- targetlist=`find ${S} -name "${file}"`
+ targetlist=`find "${startdir}" -name "${file}"`
if [ -n "$targetlist" ] ; then
- for target in $targetlist; do
- einfo " Updating ${target/$S\//}"
- cp -f ${configsubs_dir}/${file} ${target}
+ for target in "$targetlist"; do
+ einfo " Updating ${target/$startdir\//}"
+ cp -f ${configsubs_dir}/${file} "${target}"
eend $?
done
else
- ewarn " No ${file} found in ${S}, skipping.."
+ ewarn " No ${file} found in ${startdir}, skipping.."
fi
done
+
+ return 0
}
# this searches the standard locations for the newest config.{sub|guess}, and