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

Diff of /eclass/savedconfig.eclass

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

Revision 1.14 Revision 1.15
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.14 2010/10/05 19:51:05 vapier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/savedconfig.eclass,v 1.15 2011/07/26 17:35:12 zmedico Exp $
4 4
5# @ECLASS: savedconfig.eclass 5# @ECLASS: savedconfig.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# base-system@gentoo.org 7# base-system@gentoo.org
8# @BLURB: common API for saving/restoring complex configuration files 8# @BLURB: common API for saving/restoring complex configuration files
27# time in order for things to work properly. 27# time in order for things to work properly.
28save_config() { 28save_config() {
29 if [[ ${EBUILD_PHASE} != "install" ]]; then 29 if [[ ${EBUILD_PHASE} != "install" ]]; then
30 die "Bad package! save_config only for use in src_install functions!" 30 die "Bad package! save_config only for use in src_install functions!"
31 fi 31 fi
32 [[ -z "${ED}" ]] && ED=${D}
32 case $# in 33 case $# in
33 0) die "Tell me what to save" 34 0) die "Tell me what to save"
34 ;; 35 ;;
35 1) if [[ -f "$1" ]]; then 36 1) if [[ -f "$1" ]]; then
36 dodir /etc/portage/savedconfig/${CATEGORY} 37 dodir /etc/portage/savedconfig/${CATEGORY}
37 cp "$1" "${D}"/etc/portage/savedconfig/${CATEGORY}/${PF} \ 38 cp "$1" "${ED}"/etc/portage/savedconfig/${CATEGORY}/${PF} \
38 || die "Failed to save $1" 39 || die "Failed to save $1"
39 else 40 else
40 dodir /etc/portage/savedconfig/${CATEGORY}/${PF} 41 dodir /etc/portage/savedconfig/${CATEGORY}/${PF}
41 treecopy "$1" "${D}"/etc/portage/savedconfig/${CATEGORY}/${PF} \ 42 treecopy "$1" "${ED}"/etc/portage/savedconfig/${CATEGORY}/${PF} \
42 || die "Failed to save $1" 43 || die "Failed to save $1"
43 fi 44 fi
44 ;; 45 ;;
45 *) 46 *)
46 dodir "${PORTAGE_CONFIGROOT}"/etc/portage/savedconfig/${CATEGORY}/${PF} 47 dodir "${PORTAGE_CONFIGROOT}"/etc/portage/savedconfig/${CATEGORY}/${PF}

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.15

  ViewVC Help
Powered by ViewVC 1.1.20