Commits

Zhang Huangbin committed abaabfc

/etc/make.conf was moved to /etc/portage/make.conf on Gentoo.

Comments (0)

Files changed (2)

         export VALUE="${2}"
 
         # Comment out old setting.
-        perl -pi -e 's/($ENV{VAR}.*)/#${1}/' /etc/make.conf
+        perl -pi -e 's/($ENV{VAR}.*)/#${1}/' ${GENTOO_CONF_MAKE_CONF}
 
         # Add new setting.
-        echo "${VAR}='${VALUE}'" >> /etc/make.conf
+        echo "${VAR}='${VALUE}'" >> ${GENTOO_CONF_MAKE_CONF}
 
         unset VAR VALUE
     fi
 freebsd_add_make_conf()
 {
     # USAGE: freebsd_add_make_conf VAR VALUE
-    [ -f /etc/make.conf ] || touch /etc/make.conf
+    [ -f ${FREEBSD_MAKE_CONF} ] || touch ${FREEBSD_MAKE_CONF}
     if [ X"$#" == X'2' ]; then
         var="${1}"
         value="${2}"
         final_option="${1}=${2}"
         comment_mark="# ${PROG_NAME}-${var}"
-        if ! grep "^${comment_mark}$" /etc/make.conf &>/dev/null; then
-            ECHO_DEBUG "Add make option in /etc/make.conf: ${final_option}"
-            echo "${comment_mark}" >> /etc/make.conf
-            echo "${final_option}" >> /etc/make.conf
+        if ! grep "^${comment_mark}$" ${FREEBSD_MAKE_CONF} &>/dev/null; then
+            ECHO_DEBUG "Add make option in ${FREEBSD_MAKE_CONF}: ${final_option}"
+            echo "${comment_mark}" >> ${FREEBSD_MAKE_CONF}
+            echo "${final_option}" >> ${FREEBSD_MAKE_CONF}
         else
-            ECHO_DEBUG "Skip adding option in /etc/make.conf: ${final_option}"
+            ECHO_DEBUG "Skip adding option in ${FREEBSD_MAKE_CONF}: ${final_option}"
         fi
     fi
 }
     export PKG_DIALOG="dialog"
     export PKG_BZIP2="bzip2"
 
+    # make.conf
+    export GENTOO_CONF_MAKE_CONF='/etc/portage/make.conf'
+
     # Options used for install package
     export GENTOO_EMERGE_INSTALL_OPTIONS='--binpkg-respect-use --buildpkg'
     export GENTOO_CONF_PACKAGE_USE='/etc/portage/package.use'
     export CRON_SPOOL_DIR='/var/cron/tabs'
 
     export ETC_SYSCONFIG_DIR='/etc/defaults'
+    export FREEBSD_MAKE_CONF='/etc/make.conf'
 
     # IPFW rule file.
     export FIREWALL_RULE_CONF="${ETC_SYSCONFIG_DIR}/ipfw.rules"