EXEMODE = 0755
DIRMODE = 0755
SYSCONFDIR_FILES = etc-update.conf dispatch-conf.conf
-PORTAGE_CONFDIR_FILES = make.globals repos.conf
+PORTAGE_CONFDIR_FILES = make.conf.example make.globals repos.conf
LOGROTATE_FILES = elog-save-summary
BINDIR_FILES = ebuild egencache emerge emerge-webrsync \
emirrordist portageq quickpkg repoman
cd "$(srcdir)/cnf"; \
install -m$(INSMODE) $(PORTAGE_CONFDIR_FILES) \
"$(DESTDIR)$(portage_confdir)"; \
- install -m$(INSMODE) "$(srcdir)/cnf/make.conf" \
- "$(DESTDIR)$(portage_confdir)/make.conf.example"; \
- \
install -d -m$(DIRMODE) "$(DESTDIR)$(portage_setsdir)"; \
cd "$(S)/cnf/sets"; \
install -m$(INSMODE) *.conf "$(DESTDIR)$(portage_setsdir)"; \
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# Contains local system settings for Portage system
---- make.conf 2006-03-19 18:40:11.000000000 +0100
-+++ make.conf.alpha 2006-03-19 18:26:21.000000000 +0100
-@@ -23,6 +23,17 @@
+--- make.conf.example
++++ make.conf.example
+@@ -22,6 +22,17 @@
# Example:
#USE="X gtk gnome -alsa"
# Host and optimization settings
# ==============================
#
-@@ -33,10 +44,18 @@
- # package (and in some cases the libraries it uses) at default optimizations
- # before reporting errors to developers.
+@@ -39,10 +50,18 @@
+ # -frecord-gcc-switches, since otherwise the check could result in false
+ # positive results.
#
-# Please refer to the GCC manual for a list of possible values.
+# -mcpu=<cpu-type> means optimize code for the particular type of CPU. In
# If you set a CFLAGS above, then this line will set your default C++ flags to
# the same settings.
#CXXFLAGS="${CFLAGS}"
-@@ -61,7 +80,7 @@
+@@ -76,7 +95,7 @@
# DO NOT PUT ANYTHING BUT YOUR SPECIFIC ~ARCHITECTURE IN THE LIST.
# IF YOU ARE UNSURE OF YOUR ARCH, OR THE IMPLICATIONS, DO NOT MODIFY THIS.
#
-#ACCEPT_KEYWORDS="~arch"
+#ACCEPT_KEYWORDS="~alpha"
- # Portage Directories
- # ===================
+ # ACCEPT_LICENSE is used to mask packages based on licensing restrictions.
+ # It may contain both license and group names, where group names are
---- make.conf 2006-03-19 18:40:11.000000000 +0100
-+++ make.conf.amd64-fbsd 2006-03-19 18:26:21.000000000 +0100
-@@ -23,6 +23,11 @@
+--- make.conf.example
++++ make.conf.example
+@@ -22,6 +22,11 @@
# Example:
#USE="X gtk gnome -alsa"
# Host and optimization settings
# ==============================
#
-@@ -33,10 +38,35 @@
- # package (and in some cases the libraries it uses) at default optimizations
- # before reporting errors to developers.
+@@ -39,10 +44,35 @@
+ # -frecord-gcc-switches, since otherwise the check could result in false
+ # positive results.
#
-# Please refer to the GCC manual for a list of possible values.
+# -mcpu=<cpu-type> means optimize code for the particular type of CPU without
# If you set a CFLAGS above, then this line will set your default C++ flags to
# the same settings.
#CXXFLAGS="${CFLAGS}"
-@@ -61,7 +91,7 @@
+@@ -76,7 +106,7 @@
# DO NOT PUT ANYTHING BUT YOUR SPECIFIC ~ARCHITECTURE IN THE LIST.
# IF YOU ARE UNSURE OF YOUR ARCH, OR THE IMPLICATIONS, DO NOT MODIFY THIS.
#
-#ACCEPT_KEYWORDS="~arch"
+#ACCEPT_KEYWORDS="~amd64-fbsd"
- # Portage Directories
- # ===================
+ # ACCEPT_LICENSE is used to mask packages based on licensing restrictions.
+ # It may contain both license and group names, where group names are
---- make.conf 2006-03-19 18:40:11.000000000 +0100
-+++ make.conf.amd64 2006-03-19 18:26:21.000000000 +0100
-@@ -23,6 +23,11 @@
+--- make.conf.example
++++ make.conf.example
+@@ -22,6 +22,11 @@
# Example:
#USE="X gtk gnome -alsa"
# Host and optimization settings
# ==============================
#
-@@ -33,10 +38,35 @@
- # package (and in some cases the libraries it uses) at default optimizations
- # before reporting errors to developers.
+@@ -39,10 +44,35 @@
+ # -frecord-gcc-switches, since otherwise the check could result in false
+ # positive results.
#
-# Please refer to the GCC manual for a list of possible values.
+# -mcpu=<cpu-type> means optimize code for the particular type of CPU without
# If you set a CFLAGS above, then this line will set your default C++ flags to
# the same settings.
#CXXFLAGS="${CFLAGS}"
-@@ -61,7 +91,7 @@
+@@ -76,7 +106,7 @@
# DO NOT PUT ANYTHING BUT YOUR SPECIFIC ~ARCHITECTURE IN THE LIST.
# IF YOU ARE UNSURE OF YOUR ARCH, OR THE IMPLICATIONS, DO NOT MODIFY THIS.
#
-#ACCEPT_KEYWORDS="~arch"
+#ACCEPT_KEYWORDS="~amd64"
- # Portage Directories
- # ===================
+ # ACCEPT_LICENSE is used to mask packages based on licensing restrictions.
+ # It may contain both license and group names, where group names are
---- make.conf 2006-03-19 18:40:11.000000000 +0100
-+++ make.conf.arm 2006-03-19 18:26:21.000000000 +0100
-@@ -23,6 +23,19 @@
+--- make.conf.example
++++ make.conf.example
+@@ -22,6 +22,19 @@
# Example:
#USE="X gtk gnome -alsa"
# Host and optimization settings
# ==============================
#
-@@ -33,10 +46,22 @@
- # package (and in some cases the libraries it uses) at default optimizations
- # before reporting errors to developers.
+@@ -39,10 +52,22 @@
+ # -frecord-gcc-switches, since otherwise the check could result in false
+ # positive results.
#
-# Please refer to the GCC manual for a list of possible values.
-#
---- make.conf 2006-03-19 18:40:11.000000000 +0100
-+++ make.conf.hppa 2006-03-24 18:36:24.000000000 +0100
-@@ -23,6 +23,18 @@
+--- make.conf.example
++++ make.conf.example
+@@ -22,6 +22,18 @@
# Example:
#USE="X gtk gnome -alsa"
# Host and optimization settings
# ==============================
#
-@@ -33,14 +45,38 @@
- # package (and in some cases the libraries it uses) at default optimizations
- # before reporting errors to developers.
+@@ -39,14 +51,38 @@
+ # -frecord-gcc-switches, since otherwise the check could result in false
+ # positive results.
#
-# Please refer to the GCC manual for a list of possible values.
+# -march=<cpu-type> means to take full advantage of the ABI and instructions
+#
+# Architectures types supported in gcc-3.2 and higher: 1.0, 1.1 and 2.0
+# Note that 64bit userspace is not yet implemented.
- #
--#CFLAGS="-O2 -pipe"
++#
+# Decent examples:
- #
++#
+#
+# Use this one if you have a hppa1.1
+#CFLAGS="-march=1.1 -O2 -pipe -mschedule=7100LC"
+# Note that -march=2.0 was unstable on some stations.
+# -march=1.0 will create problems too.
+#CFLAGS="-O2 -pipe -mschedule=8000"
-+#
-+#
+ #
+-#CFLAGS="-O2 -pipe"
+ #
# If you set a CFLAGS above, then this line will set your default C++ flags to
# the same settings.
#CXXFLAGS="${CFLAGS}"
# If you set a CFLAGS above, then this line will set your default FORTRAN 77
# flags to the same settings.
#FFLAGS="${CFLAGS}"
-@@ -61,7 +97,7 @@
+@@ -76,7 +112,7 @@
# DO NOT PUT ANYTHING BUT YOUR SPECIFIC ~ARCHITECTURE IN THE LIST.
# IF YOU ARE UNSURE OF YOUR ARCH, OR THE IMPLICATIONS, DO NOT MODIFY THIS.
#
-#ACCEPT_KEYWORDS="~arch"
+#ACCEPT_KEYWORDS="~hppa"
- # Portage Directories
- # ===================
+ # ACCEPT_LICENSE is used to mask packages based on licensing restrictions.
+ # It may contain both license and group names, where group names are
---- make.conf
-+++ make.conf.ia64
+--- make.conf.example
++++ make.conf.example
@@ -22,6 +22,13 @@
# Example:
#USE="X gtk gnome -alsa"
# Host and optimization settings
# ==============================
#
-@@ -75,7 +82,7 @@
+@@ -76,7 +83,7 @@
# DO NOT PUT ANYTHING BUT YOUR SPECIFIC ~ARCHITECTURE IN THE LIST.
# IF YOU ARE UNSURE OF YOUR ARCH, OR THE IMPLICATIONS, DO NOT MODIFY THIS.
#
-#ACCEPT_KEYWORDS="~arch"
+#ACCEPT_KEYWORDS="~ia64"
- # Portage Directories
- # ===================
+ # ACCEPT_LICENSE is used to mask packages based on licensing restrictions.
+ # It may contain both license and group names, where group names are
---- make.conf
-+++ make.conf.m68k
-@@ -23,6 +23,13 @@
+--- make.conf.example
++++ make.conf.example
+@@ -22,6 +22,13 @@
# Example:
#USE="X gtk gnome -alsa"
# Host and optimization settings
# ==============================
#
-@@ -35,7 +42,7 @@
+@@ -41,7 +48,7 @@
#
# Please refer to the GCC manual for a list of possible values.
#
#
# If you set a CFLAGS above, then this line will set your default C++ flags to
# the same settings.
-@@ -61,7 +68,7 @@
+@@ -76,7 +83,7 @@
# DO NOT PUT ANYTHING BUT YOUR SPECIFIC ~ARCHITECTURE IN THE LIST.
# IF YOU ARE UNSURE OF YOUR ARCH, OR THE IMPLICATIONS, DO NOT MODIFY THIS.
#
-#ACCEPT_KEYWORDS="~arch"
+#ACCEPT_KEYWORDS="~m68k"
- # Portage Directories
- # ===================
+ # ACCEPT_LICENSE is used to mask packages based on licensing restrictions.
+ # It may contain both license and group names, where group names are
---- make.conf 2006-03-19 18:40:11.000000000 +0100
-+++ make.conf.mips 2006-03-19 18:26:21.000000000 +0100
-@@ -23,6 +23,13 @@
+--- make.conf.example
++++ make.conf.example
+@@ -22,6 +22,13 @@
# Example:
#USE="X gtk gnome -alsa"
# Host and optimization settings
# ==============================
#
-@@ -33,10 +40,15 @@
- # package (and in some cases the libraries it uses) at default optimizations
- # before reporting errors to developers.
+@@ -39,10 +46,15 @@
+ # -frecord-gcc-switches, since otherwise the check could result in false
+ # positive results.
#
-# Please refer to the GCC manual for a list of possible values.
+# -mcpu=<cpu-type> for MIPS systems selects the type of processor you want
# If you set a CFLAGS above, then this line will set your default C++ flags to
# the same settings.
#CXXFLAGS="${CFLAGS}"
-@@ -61,7 +73,7 @@
+@@ -76,7 +88,7 @@
# DO NOT PUT ANYTHING BUT YOUR SPECIFIC ~ARCHITECTURE IN THE LIST.
# IF YOU ARE UNSURE OF YOUR ARCH, OR THE IMPLICATIONS, DO NOT MODIFY THIS.
#
-#ACCEPT_KEYWORDS="~arch"
+#ACCEPT_KEYWORDS="~mips"
- # Portage Directories
- # ===================
+ # ACCEPT_LICENSE is used to mask packages based on licensing restrictions.
+ # It may contain both license and group names, where group names are
---- make.conf 2006-03-19 18:40:11.000000000 +0100
-+++ make.conf.ppc 2006-03-19 18:26:21.000000000 +0100
-@@ -23,6 +23,13 @@
+--- make.conf.example
++++ make.conf.example
+@@ -22,6 +22,13 @@
# Example:
#USE="X gtk gnome -alsa"
# Host and optimization settings
# ==============================
#
-@@ -33,10 +40,56 @@
- # package (and in some cases the libraries it uses) at default optimizations
- # before reporting errors to developers.
+@@ -39,10 +46,56 @@
+ # -frecord-gcc-switches, since otherwise the check could result in false
+ # positive results.
#
-# Please refer to the GCC manual for a list of possible values.
+# -mcpu=<cpu-type> for PowerPC systems selects the type of processor you want
+#
+# Long term testing has shown that -O3 opts can be unreliable on G4's but work
+# on G3 series processors or earlier.
-+#
-+# The following is the suggested CFLAGS for a generic G4 cpu
-+#
-+#CFLAGS="-O2 -pipe -mcpu=G4 -maltivec -mabi=altivec -fno-strict-aliasing"
#
-#CFLAGS="-O2 -pipe"
++# The following is the suggested CFLAGS for a generic G4 cpu
#
++#CFLAGS="-O2 -pipe -mcpu=G4 -maltivec -mabi=altivec -fno-strict-aliasing"
++#
++#
+# All non G4 PPC boxen should choose this next option. It will work fine for
+# all G3 and pre machines. (note it will not hurt pre G3 machines either to
+# use this mcpu option as it is the default for gcc 3.2.x anyway)
# If you set a CFLAGS above, then this line will set your default C++ flags to
# the same settings.
#CXXFLAGS="${CFLAGS}"
-@@ -61,7 +114,10 @@
+@@ -76,7 +129,10 @@
# DO NOT PUT ANYTHING BUT YOUR SPECIFIC ~ARCHITECTURE IN THE LIST.
# IF YOU ARE UNSURE OF YOUR ARCH, OR THE IMPLICATIONS, DO NOT MODIFY THIS.
#
+#
+#ACCEPT_KEYWORDS="~ppc"
- # Portage Directories
- # ===================
+ # ACCEPT_LICENSE is used to mask packages based on licensing restrictions.
+ # It may contain both license and group names, where group names are
---- make.conf 2006-03-19 18:40:11.000000000 +0100
-+++ make.conf.ppc64 2006-03-19 18:26:21.000000000 +0100
-@@ -23,6 +23,13 @@
+--- make.conf.example
++++ make.conf.example
+@@ -22,6 +22,13 @@
# Example:
#USE="X gtk gnome -alsa"
# Host and optimization settings
# ==============================
#
-@@ -33,9 +40,38 @@
- # package (and in some cases the libraries it uses) at default optimizations
- # before reporting errors to developers.
+@@ -39,9 +46,38 @@
+ # -frecord-gcc-switches, since otherwise the check could result in false
+ # positive results.
#
-# Please refer to the GCC manual for a list of possible values.
+# -mtune=<cpu-type> for PowerPC64 systems instructs the gcc compiler that
+# 970 (aka G5), and power5.
+#
+# RS64 processors should specify power3.
-+#
+ #
+-#CFLAGS="-O2 -pipe"
+# Additional options of interest:
+#
+# -maltivec enables optional altivec support and should be used
+# only for 970 processors. It also requires that you have
+# the alitvec option compiled into your kernel to take full advantage of this
+# feature. Note: you should also include -mabi=altivec flag if using this option.
- #
--#CFLAGS="-O2 -pipe"
++#
+# -O3 for the most part seems ok but should be used with caution as
+# for instance app-editors/vim has problems if it is used. -O2 is a
+# good selection.
#
# If you set a CFLAGS above, then this line will set your default C++ flags to
# the same settings.
-@@ -61,7 +97,10 @@
+@@ -76,7 +112,10 @@
# DO NOT PUT ANYTHING BUT YOUR SPECIFIC ~ARCHITECTURE IN THE LIST.
# IF YOU ARE UNSURE OF YOUR ARCH, OR THE IMPLICATIONS, DO NOT MODIFY THIS.
#
+#
+#ACCEPT_KEYWORDS="ppc64"
- # Portage Directories
- # ===================
+ # ACCEPT_LICENSE is used to mask packages based on licensing restrictions.
+ # It may contain both license and group names, where group names are
---- make.conf
-+++ make.conf.s390
+--- make.conf.example
++++ make.conf.example
@@ -22,6 +22,13 @@
# Example:
#USE="X gtk gnome -alsa"
# Host and optimization settings
# ==============================
#
-@@ -75,7 +82,7 @@
+@@ -76,7 +83,7 @@
# DO NOT PUT ANYTHING BUT YOUR SPECIFIC ~ARCHITECTURE IN THE LIST.
# IF YOU ARE UNSURE OF YOUR ARCH, OR THE IMPLICATIONS, DO NOT MODIFY THIS.
#
-#ACCEPT_KEYWORDS="~arch"
+#ACCEPT_KEYWORDS="~s390"
- # Portage Directories
- # ===================
+ # ACCEPT_LICENSE is used to mask packages based on licensing restrictions.
+ # It may contain both license and group names, where group names are
---- make.conf 2006-03-19 18:40:11.000000000 +0100
-+++ make.conf.sh 2006-03-19 18:26:21.000000000 +0100
-@@ -23,6 +23,19 @@
+--- make.conf.example
++++ make.conf.example
+@@ -22,6 +22,19 @@
# Example:
#USE="X gtk gnome -alsa"
# Host and optimization settings
# ==============================
#
-@@ -33,10 +46,15 @@
- # package (and in some cases the libraries it uses) at default optimizations
- # before reporting errors to developers.
+@@ -39,10 +52,15 @@
+ # -frecord-gcc-switches, since otherwise the check could result in false
+ # positive results.
#
-# Please refer to the GCC manual for a list of possible values.
--#
--#CFLAGS="-O2 -pipe"
+# -m# optimize code for the particular type of CPU. The number should match
+# your CHOST so if you are using "sh4-unknown-linux-gnu", you should have
+# -m4 below.
#
+-#CFLAGS="-O2 -pipe"
+# For a full listing of supported CPU models, please refer to the GCC website:
+# http://gcc.gnu.org/onlinedocs/gcc-3.3/gcc/SH-Options.html
-+#
+ #
+#CFLAGS="-m4 -O2 -pipe"
+
# If you set a CFLAGS above, then this line will set your default C++ flags to
---- make.conf 2006-10-16 17:06:32 +0100
-+++ make.conf.sparc-fbsd 2006-10-16 17:09:22 +0100
-@@ -23,6 +23,13 @@
+--- make.conf.example
++++ make.conf.example
+@@ -22,6 +22,13 @@
# Example:
#USE="X gtk gnome -alsa"
# Host and optimization settings
# ==============================
#
-@@ -61,7 +68,7 @@
+@@ -76,7 +83,7 @@
# DO NOT PUT ANYTHING BUT YOUR SPECIFIC ~ARCHITECTURE IN THE LIST.
# IF YOU ARE UNSURE OF YOUR ARCH, OR THE IMPLICATIONS, DO NOT MODIFY THIS.
#
-#ACCEPT_KEYWORDS="~arch"
+ACCEPT_KEYWORDS="~sparc-fbsd"
- # Portage Directories
- # ===================
+ # ACCEPT_LICENSE is used to mask packages based on licensing restrictions.
+ # It may contain both license and group names, where group names are
---- make.conf 2006-03-19 18:40:11.000000000 +0100
-+++ make.conf.sparc 2006-03-19 18:26:21.000000000 +0100
-@@ -23,6 +23,15 @@
+--- make.conf.example
++++ make.conf.example
+@@ -22,6 +22,15 @@
# Example:
#USE="X gtk gnome -alsa"
# Host and optimization settings
# ==============================
#
-@@ -33,10 +42,34 @@
- # package (and in some cases the libraries it uses) at default optimizations
- # before reporting errors to developers.
+@@ -39,10 +48,34 @@
+ # -frecord-gcc-switches, since otherwise the check could result in false
+ # positive results.
#
-# Please refer to the GCC manual for a list of possible values.
-#
# If you set a CFLAGS above, then this line will set your default C++ flags to
# the same settings.
#CXXFLAGS="${CFLAGS}"
-@@ -61,7 +94,7 @@
+@@ -76,7 +109,7 @@
# DO NOT PUT ANYTHING BUT YOUR SPECIFIC ~ARCHITECTURE IN THE LIST.
# IF YOU ARE UNSURE OF YOUR ARCH, OR THE IMPLICATIONS, DO NOT MODIFY THIS.
#
-#ACCEPT_KEYWORDS="~arch"
+#ACCEPT_KEYWORDS="~sparc"
- # Portage Directories
- # ===================
+ # ACCEPT_LICENSE is used to mask packages based on licensing restrictions.
+ # It may contain both license and group names, where group names are
---- make.conf 2006-03-19 18:40:11.000000000 +0100
-+++ make.conf.x86-fbsd 2006-03-19 18:26:21.000000000 +0100
-@@ -23,6 +23,16 @@
+--- make.conf.example
++++ make.conf.example
+@@ -22,6 +22,16 @@
# Example:
#USE="X gtk gnome -alsa"
# Host and optimization settings
# ==============================
#
-@@ -33,10 +43,34 @@
- # package (and in some cases the libraries it uses) at default optimizations
- # before reporting errors to developers.
+@@ -39,10 +49,34 @@
+ # -frecord-gcc-switches, since otherwise the check could result in false
+ # positive results.
#
-# Please refer to the GCC manual for a list of possible values.
+# -mtune=<cpu-type> means optimize code for the particular type of CPU without
# If you set a CFLAGS above, then this line will set your default C++ flags to
# the same settings.
#CXXFLAGS="${CFLAGS}"
-@@ -61,7 +95,7 @@
+@@ -76,7 +110,7 @@
# DO NOT PUT ANYTHING BUT YOUR SPECIFIC ~ARCHITECTURE IN THE LIST.
# IF YOU ARE UNSURE OF YOUR ARCH, OR THE IMPLICATIONS, DO NOT MODIFY THIS.
#
-#ACCEPT_KEYWORDS="~arch"
+ACCEPT_KEYWORDS="~x86-fbsd"
- # Portage Directories
- # ===================
+ # ACCEPT_LICENSE is used to mask packages based on licensing restrictions.
+ # It may contain both license and group names, where group names are
---- make.conf 2007-01-10 03:22:07.410548112 +0100
-+++ make.conf.x86 2007-01-10 03:22:13.206910362 +0100
-@@ -23,6 +23,15 @@
+--- make.conf.example
++++ make.conf.example
+@@ -22,6 +22,15 @@
# Example:
#USE="X gtk gnome -alsa"
# Host and optimization settings
# ==============================
#
-@@ -33,10 +42,65 @@
- # package (and in some cases the libraries it uses) at default optimizations
- # before reporting errors to developers.
+@@ -39,10 +48,65 @@
+ # -frecord-gcc-switches, since otherwise the check could result in false
+ # positive results.
#
-# Please refer to the GCC manual for a list of possible values.
-#
# If you set a CFLAGS above, then this line will set your default C++ flags to
# the same settings.
#CXXFLAGS="${CFLAGS}"
-@@ -61,7 +125,7 @@
+@@ -76,7 +140,7 @@
# DO NOT PUT ANYTHING BUT YOUR SPECIFIC ~ARCHITECTURE IN THE LIST.
# IF YOU ARE UNSURE OF YOUR ARCH, OR THE IMPLICATIONS, DO NOT MODIFY THIS.
#
-#ACCEPT_KEYWORDS="~arch"
+#ACCEPT_KEYWORDS="~x86"
- # Portage Directories
- # ===================
+ # ACCEPT_LICENSE is used to mask packages based on licensing restrictions.
+ # It may contain both license and group names, where group names are
+++ /dev/null
-#!/bin/bash
-
-die() {
- echo "ERROR: $*" > /dev/stderr
- patch -p0 make.conf < make.conf.diff
- exit 1
-}
-
-if [[ ! -f make.conf || ! -f make.conf.x86.diff || ! -d ../.git ]]; then
- echo "ERROR: current directory is invalid" > /dev/stderr
- exit 1
-fi
-
-git diff --no-prefix --relative="$(basename "$(pwd)")" make.conf > make.conf.diff
-git checkout -- make.conf
-
-archs=()
-for x in make.conf.*.diff; do
- archs+=("$(basename ${x:10} .diff)")
-done
-
-
-for arch in "${archs[@]}"; do
- echo "* Patching ${arch}"
- cp make.conf make.conf.${arch} || die "copy failed"
- patch -p0 make.conf.${arch} < make.conf.${arch}.diff > /dev/null || die "arch-patch failed"
- patch -p0 make.conf.${arch} < make.conf.diff > /dev/null || die "patch failed"
-done
-
-echo "* Re-patching make.conf"
-patch -p0 make.conf < make.conf.diff > /dev/null || die "repatch failed"
-
-for arch in "${archs[@]}"; do
- echo "* Creating diff for ${arch}"
- diff -u make.conf make.conf.${arch} > make.conf.${arch}.diff
- [[ -z ${KEEP_ARCH_MAKE_CONF} ]] && rm -f make.conf.${arch} make.conf.${arch}.orig
-done
-
-rm make.conf.diff
-
-echo "Done"
--- /dev/null
+#!/bin/bash
+
+die() {
+ echo "ERROR: $*" > /dev/stderr
+ patch -p0 make.conf.example < make.conf.example.diff
+ exit 1
+}
+
+if [[ ! -f make.conf.example || ! -f make.conf.example.x86.diff || ! -d ../.git ]]; then
+ echo "ERROR: current directory is invalid" > /dev/stderr
+ exit 1
+fi
+
+git diff --no-prefix --relative="$(basename "$(pwd)")" make.conf.example > make.conf.example.diff
+git checkout -- make.conf.example
+
+archs=()
+for x in make.conf.example.*.diff; do
+ archs+=("$(basename ${x:18} .diff)")
+done
+
+
+for arch in "${archs[@]}"; do
+ echo "* Patching ${arch}"
+ cp make.conf.example make.conf.example.${arch} || die "copy failed"
+ patch -p0 make.conf.example.${arch} < make.conf.example.${arch}.diff > /dev/null || die "arch-patch failed"
+ patch -p0 make.conf.example.${arch} < make.conf.example.diff > /dev/null || die "patch failed"
+done
+
+echo "* Re-patching make.conf.example"
+patch -p0 make.conf.example < make.conf.example.diff > /dev/null || die "repatch failed"
+
+for arch in "${archs[@]}"; do
+ echo "* Creating diff for ${arch}"
+ diff -u make.conf.example make.conf.example.${arch} > make.conf.example.${arch}.diff
+ [[ -z ${KEEP_ARCH_MAKE_CONF_EXAMPLE} ]] && rm -f make.conf.example.${arch} make.conf.example.${arch}.orig
+done
+
+rm make.conf.example.diff
+
+echo "Done"