/[gentoo-x86]/eclass/gnuconfig.eclass
Gentoo

Diff of /eclass/gnuconfig.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.20 Revision 1.21
1# Copyright 1999-2004 Gentoo Foundation 1# Copyright 1999-2004 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/gnuconfig.eclass,v 1.20 2004/07/05 09:15:27 solar Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/gnuconfig.eclass,v 1.21 2004/07/07 16:14:02 agriffis Exp $
4# 4#
5# Author: Will Woods <wwoods@gentoo.org> 5# Author: Will Woods <wwoods@gentoo.org>
6# 6#
7# This eclass is used to automatically update files that typically come with 7# This eclass is used to automatically update files that typically come with
8# automake to the newest version available on the system. The most common use 8# automake to the newest version available on the system. The most common use
30 if [ $# -gt 0 ] ; then 30 if [ $# -gt 0 ] ; then
31 gnuconfig_do_update "$@" 31 gnuconfig_do_update "$@"
32 else 32 else
33 gnuconfig_do_update config.sub config.guess 33 gnuconfig_do_update config.sub config.guess
34 fi 34 fi
35
36 return $?
35} 37}
36 38
37# Copy the newest available version of specified files over any old ones in the 39# Copy the newest available version of specified files over any old ones in the
38# source dir. This function shouldn't be called directly - use gnuconfig_update 40# source dir. This function shouldn't be called directly - use gnuconfig_update
39gnuconfig_do_update() { 41gnuconfig_do_update() {
40 [ $# -eq 0 ] && die "do not call gnuconfig_do_update(); use gnuconfig_update()" 42 local startdir configsubs_dir target targetlist file
41 43
44 if [[ ${1} == /* ]]; then
45 startdir=${1%/} # remove possible trailing slash
46 shift
47 else
48 startdir=${S}
49 fi
50
51 [ $# -eq 0 ] && die "do not call gnuconfig_do_update; use gnuconfig_update"
52
42 local configsubs_dir="$(gnuconfig_findnewest)" 53 configsubs_dir="$(gnuconfig_findnewest)"
43 local target targetlist file
44 einfo "Using GNU config files from ${configsubs_dir}" 54 einfo "Using GNU config files from ${configsubs_dir}"
45 for file in "$@" ; do 55 for file in "$@" ; do
46 if [ ! -r ${configsubs_dir}/${file} ] ; then 56 if [ ! -r ${configsubs_dir}/${file} ] ; then
47 eerror "Can't read ${configsubs_dir}/${file}, skipping.." 57 eerror "Can't read ${configsubs_dir}/${file}, skipping.."
48 continue 58 continue
49 fi 59 fi
50 targetlist=`find ${S} -name "${file}"` 60 targetlist=`find "${startdir}" -name "${file}"`
51 if [ -n "$targetlist" ] ; then 61 if [ -n "$targetlist" ] ; then
52 for target in $targetlist; do 62 for target in "$targetlist"; do
53 einfo " Updating ${target/$S\//}" 63 einfo " Updating ${target/$startdir\//}"
54 cp -f ${configsubs_dir}/${file} ${target} 64 cp -f ${configsubs_dir}/${file} "${target}"
55 eend $? 65 eend $?
56 done 66 done
57 else 67 else
58 ewarn " No ${file} found in ${S}, skipping.." 68 ewarn " No ${file} found in ${startdir}, skipping.."
59 fi 69 fi
60 done 70 done
71
72 return 0
61} 73}
62 74
63# this searches the standard locations for the newest config.{sub|guess}, and 75# this searches the standard locations for the newest config.{sub|guess}, and
64# returns the directory where they can be found. 76# returns the directory where they can be found.
65gnuconfig_findnewest() { 77gnuconfig_findnewest() {

Legend:
Removed from v.1.20  
changed lines
  Added in v.1.21

  ViewVC Help
Powered by ViewVC 1.1.20