diff options
author | Akinori Hattori <hattya@gentoo.org> | 2017-07-12 20:57:45 +0900 |
---|---|---|
committer | Akinori Hattori <hattya@gentoo.org> | 2017-07-12 20:57:45 +0900 |
commit | b6ada62796543c5d2af160e4695795e0cff9bf7f (patch) | |
tree | 3e26b0c2680884769fed5f19a9a8be79a8223ccf /eclass | |
parent | cannadic.eclass: replace ROOT → EROOT (diff) | |
download | gentoo-b6ada62796543c5d2af160e4695795e0cff9bf7f.tar.gz gentoo-b6ada62796543c5d2af160e4695795e0cff9bf7f.tar.bz2 gentoo-b6ada62796543c5d2af160e4695795e0cff9bf7f.zip |
cannadic.eclass: declare internal variables readonly
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/cannadic.eclass | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/eclass/cannadic.eclass b/eclass/cannadic.eclass index 1a0d71e15125..ec7119f8e06c 100644 --- a/eclass/cannadic.eclass +++ b/eclass/cannadic.eclass @@ -22,23 +22,24 @@ DICSDIRFILE="${FILESDIR}/*.dics.dir" CANNADICS="${CANNADICS}" # (optional) # You don't need to modify these -cannadir="${EROOT:-${ROOT}}"var/lib/canna/dic/canna -dicsdir="${EROOT:-${ROOT}}"var/lib/canna/dic/dics.d +CANNADIC_CANNA_DIR="${EROOT:-${ROOT}}"var/lib/canna/dic/canna +CANNADIC_DICS_DIR="${EROOT:-${ROOT}}"var/lib/canna/dic/dics.d +readonly CANNADIC_CANNA_DIR CANNADIC_DICS_DIR # @FUNCTION: cannadic_pkg_setup # @DESCRIPTION: -# Sets up cannadic dir +# Sets up ${CANNADIC_CANNA_DIR} cannadic_pkg_setup() { - keepdir "${cannadir}" - fowners bin:bin "${cannadir}" - fperms 0775 "${cannadir}" + keepdir "${CANNADIC_CANNA_DIR}" + fowners bin:bin "${CANNADIC_CANNA_DIR}" + fperms 0775 "${CANNADIC_CANNA_DIR}" } # @FUNCTION: cannadic-install # @DESCRIPTION: -# Installs dictionaries to cannadir +# Installs dictionaries to ${CANNADIC_CANNA_DIR} cannadic-install() { - insinto "${cannadir}" + insinto "${CANNADIC_CANNA_DIR}" insopts -m 0664 -o bin -g bin doins "${@}" } @@ -47,7 +48,7 @@ cannadic-install() { # @DESCRIPTION: # Installs dics.dir from ${DICSDIRFILE} dicsdir-install() { - insinto "${dicsdir}" + insinto "${CANNADIC_DICS_DIR}" doins "${DICSDIRFILE}" } @@ -80,19 +81,19 @@ update-cannadic-dir() { einfo # write new dics.dir file in case we are interrupted - cat <<-EOF > "${cannadir}"/dics.dir.update-new + cat <<-EOF > "${CANNADIC_CANNA_DIR}"/dics.dir.update-new # dics.dir -- automatically generated file by Portage. # DO NOT EDIT BY HAND. EOF local f - for f in "${dicsdir}"/*.dics.dir; do - echo "# ${f}" >> "${cannadir}"/dics.dir.update-new - cat "${f}" >> "${cannadir}"/dics.dir.update-new + for f in "${CANNADIC_DICS_DIR}"/*.dics.dir; do + echo "# ${f}" >> "${CANNADIC_CANNA_DIR}"/dics.dir.update-new + cat "${f}" >> "${CANNADIC_CANNA_DIR}"/dics.dir.update-new einfo "Added ${f}." done - mv "${cannadir}"/dics.dir.update-new "${cannadir}"/dics.dir + mv "${CANNADIC_CANNA_DIR}"/dics.dir.update-new "${CANNADIC_CANNA_DIR}"/dics.dir einfo einfo "Done." |