Date: Wed, 9 Jan 2002 19:54:58 +0100 From: Debian User Jean-Baptiste Note <noteje@poly.polytechnique.fr> Hello, here's my first patch, before i go into the minutiae of all the packages. The problems are multiple however : *it's against an old version of portage (1.8.2, i think) *it's a modification on portage, so it would probably be wiser to ask drobbin about it first :) *it's not a big one though, but it can and will break things, according to the formula *i don't know how to make it proper so that you can use it easily, i've not read the dev-howto, but i'm really overwhelmed at school for now :( so, the patch is to ebuild.sh not big, really, but it's my first one :) and it is a requisite so that i can make ppc-specific patches in the .ebuilds
--- /usr/sbin/ebuild.sh.orig Tue Jan 8 20:07:19 2002 +++ /usr/sbin/ebuild.sh Wed Jan 9 18:41:25 2002 @@ -24,7 +24,10 @@ export DIROPTIONS="-m0755" export MOPREFIX=${PN} export KVERS=`uname -r` +export ARCH=`uname -m | sed s/i[3-6]86/i386/` +function_set="src_unpack src_compile src_install pkg_preinst pkg_postinst pkg_prerm pkg_postrm pkg_config" +#variable_set="SRC_URI PATCHES DEPEND" unpack() { local x @@ -280,7 +283,7 @@ install -m0700 -d ${WORKDIR} cd ${WORKDIR} echo ">>> Unpacking source..." - src_unpack + ${src_unpack_all} echo ">>> Source unpacked." cd .. trap SIGINT SIGQUIT @@ -463,7 +466,7 @@ then cd ${S} fi - src_compile + ${src_compile_all} cd ${BUILDDIR} touch .compiled if [ ! -e "build-info" ] @@ -520,7 +523,7 @@ fi echo echo ">>> Install ${PF} into ${D} category ${CATEGORY}" - src_install + ${src_install_all} prepall cd ${D} echo ">>> Completed installing into ${D}" @@ -645,6 +648,33 @@ exit 1 fi +# there was not, so we try to find host-specific functions +for funct in $function_set +{ + if (type -p ${funct}_${ARCH}) + then + declare ${funct}_all=${funct}_${ARCH} + else + declare ${funct}_all=${funct} + fi +} + +# the same for host_specific variables +# note that replacement is done after +# substitution in ${EBUILD} so that +# one can use eg SRC_URI_ppc="$SRC_URI my_patch" +#for variable in $variable_set +#{ +# if (type -p ${variable}_${ARCH}) +# then +# { +# arch_var_name=${variable}_${ARCH} +# declare ${variable}="${!arch_var_name}" +# echo "$arch_var_name redefined"; +# } +# fi +#} + if [ "${SRC_URI}" != "" ] then rm -f ${T}/archives.orig @@ -687,10 +717,11 @@ prerm|postrm|preinst|postinst|config) if [ "$PORTAGE_DEBUG" = "0" ] then - pkg_${myarg} + pkg_func_name=pkg_${myarg}_all + ${!pkg_func_name} else set -x - pkg_${myarg} + ${!pkg_func_name} set +x fi ;;
hasnt ARCH support been 'properly' addressed through the KEYWORDS variable now ? so can we close this bug ?
ditto.