Lines 43-59
save_config() {
Link Here
|
43 |
fi |
43 |
fi |
44 |
;; |
44 |
;; |
45 |
*) |
45 |
*) |
46 |
dodir "${PORTAGE_CONFIGROOT}"/etc/portage/savedconfig/${CATEGORY}/${PF} |
46 |
dodir /etc/portage/savedconfig/${CATEGORY}/${PF} |
47 |
treecopy $* "${D}/${PORTAGE_CONFIGROOT}"/etc/portage/savedconfig/${CATEGORY}/${PF} \ |
47 |
treecopy $* "${D}"/etc/portage/savedconfig/${CATEGORY}/${PF} \ |
48 |
|| die "Failed to save $1" |
48 |
|| die "Failed to save $1" |
49 |
esac |
49 |
esac |
50 |
elog "Your configuration for ${CATEGORY}/${PF} has been saved in " |
50 |
elog "Your configuration for ${CATEGORY}/${PF} has been saved in " |
51 |
elog "/etc/portage/savedconfig/${CATEGORY}/${PF} for your editing pleasure." |
51 |
elog "${ROOT}etc/portage/savedconfig/${CATEGORY}/${PF} for your editing pleasure." |
52 |
elog "You can edit these files by hand and remerge this package with" |
52 |
elog "You can edit these files by hand and remerge this package with" |
53 |
elog "USE=savedconfig to customise the configuration." |
53 |
elog "USE=savedconfig to customise the configuration." |
54 |
elog "You can rename this file/directory to one of the following for" |
54 |
elog "You can rename this file/directory to one of the following for" |
55 |
elog "its configuration to apply to multiple versions:" |
55 |
elog "its configuration to apply to multiple versions:" |
56 |
elog '${PORTAGE_CONFIGROOT}/etc/portage/savedconfig/' |
56 |
elog '${ROOT}/etc/portage/savedconfig/' |
57 |
elog '[${CTARGET}|${CHOST}|""]/${CATEGORY}/[${PF}|${P}|${PN}]' |
57 |
elog '[${CTARGET}|${CHOST}|""]/${CATEGORY}/[${PF}|${P}|${PN}]' |
58 |
} |
58 |
} |
59 |
|
59 |
|
Lines 66-80
save_config() {
Link Here
|
66 |
# |
66 |
# |
67 |
# Config files can be laid out as: |
67 |
# Config files can be laid out as: |
68 |
# @CODE |
68 |
# @CODE |
69 |
# ${PORTAGE_CONFIGROOT}/etc/portage/savedconfig/${CTARGET}/${CATEGORY}/${PF} |
69 |
# ${ROOT}/etc/portage/savedconfig/${CTARGET}/${CATEGORY}/${PF} |
70 |
# ${PORTAGE_CONFIGROOT}/etc/portage/savedconfig/${CHOST}/${CATEGORY}/${PF} |
70 |
# ${ROOT}/etc/portage/savedconfig/${CHOST}/${CATEGORY}/${PF} |
71 |
# ${PORTAGE_CONFIGROOT}/etc/portage/savedconfig/${CATEGORY}/${PF} |
71 |
# ${ROOT}/etc/portage/savedconfig/${CATEGORY}/${PF} |
72 |
# ${PORTAGE_CONFIGROOT}/etc/portage/savedconfig/${CTARGET}/${CATEGORY}/${P} |
72 |
# ${ROOT}/etc/portage/savedconfig/${CTARGET}/${CATEGORY}/${P} |
73 |
# ${PORTAGE_CONFIGROOT}/etc/portage/savedconfig/${CHOST}/${CATEGORY}/${P} |
73 |
# ${ROOT}/etc/portage/savedconfig/${CHOST}/${CATEGORY}/${P} |
74 |
# ${PORTAGE_CONFIGROOT}/etc/portage/savedconfig/${CATEGORY}/${P} |
74 |
# ${ROOT}/etc/portage/savedconfig/${CATEGORY}/${P} |
75 |
# ${PORTAGE_CONFIGROOT}/etc/portage/savedconfig/${CTARGET}/${CATEGORY}/${PN} |
75 |
# ${ROOT}/etc/portage/savedconfig/${CTARGET}/${CATEGORY}/${PN} |
76 |
# ${PORTAGE_CONFIGROOT}/etc/portage/savedconfig/${CHOST}/${CATEGORY}/${PN} |
76 |
# ${ROOT}/etc/portage/savedconfig/${CHOST}/${CATEGORY}/${PN} |
77 |
# ${PORTAGE_CONFIGROOT}/etc/portage/savedconfig/${CATEGORY}/${PN} |
77 |
# ${ROOT}/etc/portage/savedconfig/${CATEGORY}/${PN} |
78 |
# @CODE |
78 |
# @CODE |
79 |
restore_config() { |
79 |
restore_config() { |
80 |
use savedconfig || return |
80 |
use savedconfig || return |
Lines 84-90
restore_config() {
Link Here
|
84 |
*) die "Bad package! restore_config only for use in src_{unpack,compile,configure,prepare} functions!" ;; |
84 |
*) die "Bad package! restore_config only for use in src_{unpack,compile,configure,prepare} functions!" ;; |
85 |
esac |
85 |
esac |
86 |
local found check configfile |
86 |
local found check configfile |
87 |
local base=${PORTAGE_CONFIGROOT}/etc/portage/savedconfig |
87 |
local base=${ROOT}etc/portage/savedconfig |
88 |
for check in {${CATEGORY}/${PF},${CATEGORY}/${P},${CATEGORY}/${PN}}; do |
88 |
for check in {${CATEGORY}/${PF},${CATEGORY}/${P},${CATEGORY}/${PN}}; do |
89 |
configfile=${base}/${CTARGET}/${check} |
89 |
configfile=${base}/${CTARGET}/${check} |
90 |
[[ -r ${configfile} ]] || configfile=${base}/${CHOST}/${check} |
90 |
[[ -r ${configfile} ]] || configfile=${base}/${CHOST}/${check} |
Lines 116-122
restore_config() {
Link Here
|
116 |
die "Reading config files failed" |
116 |
die "Reading config files failed" |
117 |
fi |
117 |
fi |
118 |
ewarn "No saved config to restore - please remove USE=savedconfig or" |
118 |
ewarn "No saved config to restore - please remove USE=savedconfig or" |
119 |
ewarn "provide a configuration file in ${PORTAGE_CONFIGROOT}/etc/portage/savedconfig/${CATEGORY}/${PN}" |
119 |
ewarn "provide a configuration file in ${ROOT}/etc/portage/savedconfig/${CATEGORY}/${PN}" |
120 |
ewarn "Your config file(s) will not be used this time" |
120 |
ewarn "Your config file(s) will not be used this time" |
121 |
fi |
121 |
fi |
122 |
} |
122 |
} |