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

Diff of /eclass/savedconfig.eclass

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

Revision 1.6 Revision 1.7
1# Copyright 1999-2007 Gentoo Foundation 1# Copyright 1999-2007 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/savedconfig.eclass,v 1.6 2007/06/11 04:48:48 dragonheart Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/savedconfig.eclass,v 1.7 2007/06/11 04:52:42 dragonheart Exp $
4 4
5# Original Author: Daniel Black <dragonheart@gentoo.org> 5# Original Author: Daniel Black <dragonheart@gentoo.org>
6# 6#
7# Purpose: Define an interface for ebuilds to save and restore 7# Purpose: Define an interface for ebuilds to save and restore
8# complex configuration that may be edited by users. 8# complex configuration that may be edited by users.
96 found=${configfile}; 96 found=${configfile};
97 break; 97 break;
98 fi 98 fi
99 done 99 done
100 if [[ -f ${found} ]]; then 100 if [[ -f ${found} ]]; then
101 elog "Building using saved configfile ${found}"
101 if [ $# -gt 0 ]; then 102 if [ $# -gt 0 ]; then
102 cp -pPR "${found}" "$1" || die "Failed to restore ${found} to $1" 103 cp -pPR "${found}" "$1" || die "Failed to restore ${found} to $1"
103 else 104 else
104 die "need to know the restoration filename" 105 die "need to know the restoration filename"
105 fi 106 fi
106 elif [[ -d ${found} ]]; then 107 elif [[ -d ${found} ]]; then
108 elog "Building using saved config directory ${found}"
107 dest=${PWD} 109 dest=${PWD}
108 pushd "${found}" 110 pushd "${found}"
109 treecopy . "${dest}" \ 111 treecopy . "${dest}" \
110 || die "Failed to restore ${found} to $1" 112 || die "Failed to restore ${found} to $1"
111 popd 113 popd

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

  ViewVC Help
Powered by ViewVC 1.1.20