? bin/.ebuild-functions.sh.swp Index: ChangeLog =================================================================== RCS file: /cvsroot/portage/ChangeLog,v retrieving revision 1.1.1.8 diff -u -r1.1.1.8 ChangeLog --- ChangeLog 4 Apr 2005 07:17:25 -0000 1.1.1.8 +++ ChangeLog 4 Apr 2005 08:11:43 -0000 @@ -1,12 +1,32 @@ # ChangeLog for Portage; the Gentoo Linux ports system # Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL v2 -# $Id: ChangeLog,v 1.1.1.8 2005/04/04 07:17:25 haubi Exp $ +# $Id: ChangeLog,v 1.15 2005/04/04 07:28:48 haubi Exp $ MAJOR CHANGES in 2.0.51: 1. /var/cache/edb/virtuals is no longer used at all. It's calculated now. 2. /var/cache/edb/world is now /var/lib/portage/world. 3. /etc/portage/profile/virtuals is _USER_ configs only. + 04 Apr 2005; Michael Haubenwallner + generally: + added ability to work with prefix other than /usr, including installing + of packages into a different prefix using PREFIX=/usr/local, much like + using ROOT=/tmp/test/; PREFIX can be set with or without setting ROOT. + This adds two ebuild-env-variables (samples are for + ./configure --prefix={/usr,/usr/local} ): + PREFIX={/usr,/usr/local} + AFFIX={,usr/local/} + Look at bin/ebuild-functions.sh (econf and einstall) for how to use them. + + 04 Apr 2005; Michael Haubenwallner + cnf/Makefile.in Makefile.am: + also install /etc/make.conf.example and /etc/make.globals + + 04 Apr 2005; Michael Haubenwallner + src/filter-env/getopt.c src/filter-env/getopt.h src/filter-env/posix.c + src/filter-env/Makefile.am: + provide own getopt in cases where libc doesnt. + 03 Apr 2005; Jason Stubbs pym/portage_dep.py: Added shortcut to circular dep "resolution" as per bug 85130. Removed the traversed cache dict from __traverse_nodes and made the original Index: Makefile.am =================================================================== RCS file: /cvsroot/portage/Makefile.am,v retrieving revision 1.1.1.1 retrieving revision 1.4 diff -u -r1.1.1.1 -r1.4 --- Makefile.am 4 Mar 2005 10:29:00 -0000 1.1.1.1 +++ Makefile.am 25 Mar 2005 09:41:48 -0000 1.4 @@ -1,3 +1,27 @@ -SUBDIRS = src man bin pym +SUBDIRS = src man bin pym cnf AUTOMAKE_OPTIONS = dist-bzip2 no-dist-gzip + +BUILT_SOURCES = subst-install.vars + +subst-install: subst-install.vars + +subst-install.vars: subst-install.vars.in + @rm -f $@ \ + ; { sed -e 's,[\\#],\\&,g' < subst-install.vars.in \ + ; echo "$@:" \ + ; echo " @echo 'creating \$$@'" \ + ; echo " @{ \\" \ + ; eval `grep '^all_configurevars=' $@.in` \ + ; for v in $${all_configurevars} all_configurevars \ + ; do echo " echo $${v}=\'\$$($${v})\' ; \\" \ + ; done \ + ; echo " } > \$$@" \ + ; } \ + | ${MAKE} -f - $@ + +distclean-local: + rm -f subst-install.vars + +MAINTAINERCLEANFILES = subst-install.vars.in.in \ + Makefile.in config.guess config.sub configure ltmain.sh aclocal.m4 Index: acinclude.m4 =================================================================== RCS file: acinclude.m4 diff -N acinclude.m4 --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ acinclude.m4 25 Mar 2005 10:42:25 -0000 1.2 @@ -0,0 +1,199 @@ +dnl acinclude.m4 generated automatically by ac-archive's acinclude 0.5.57 + +dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without +dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A +dnl PARTICULAR PURPOSE. + +dnl ______ ______ + +dnl ______ /usr/share/aclocal/djmitche/ax_with_python.m4 ______ +dnl @synopsis AX_WITH_PYTHON([minimum-version], [value-if-not-found], [path]) +dnl +dnl Locates an installed Python binary, placing the result in the precious +dnl variable $PYTHON. Accepts a present $PYTHON, then --with-python, and failing +dnl that searches for python in the given path (which defaults to the system +dnl path). If python is found, $PYTHON is set to the full path of the binary; if +dnl it is not found, $PYTHON is set to VALUE-IF-NOT-FOUND, which defaults to +dnl 'python'. +dnl +dnl Example: +dnl +dnl AX_WITH_PYTHON(2.2, missing) +dnl +dnl @author Dustin Mitchell +dnl @version %Id: % + +AC_DEFUN([AX_WITH_PYTHON], +[ + AC_ARG_VAR([PYTHON]) + + dnl unless PYTHON was supplied to us (as a precious variable) + if test -z "$PYTHON" + then + AC_MSG_CHECKING(for --with-python) + AC_ARG_WITH(python, + AC_HELP_STRING([--with-python=PYTHON], + [absolute path name of Python executable]), + [ if test "$withval" != "yes" + then + PYTHON="$withval" + AC_MSG_RESULT($withval) + else + AC_MSG_RESULT(no) + fi + ], + [ AC_MSG_RESULT(no) + ]) + fi + + dnl if it's still not found, check the paths, or use the fallback + if test -z "$PYTHON" + then + AC_PATH_PROG([PYTHON], python, m4_ifval([$2],[$2],[python]), $3) + fi + + dnl check version if required + m4_ifvaln([$1], [ + dnl do this only if we didn't fall back + if test "$PYTHON" != "m4_ifval([$2],[$2],[python])" + then + AC_MSG_CHECKING($PYTHON version >= $1) + if test `$PYTHON -c ["import sys; print sys.version[:3] >= \"$1\" and \"OK\" or \"OLD\""]` = "OK" + then + AC_MSG_RESULT(ok) + else + AC_MSG_RESULT(no) + PYTHON="$2" + fi + fi]) +]) + +dnl ______ /usr/share/aclocal/Installed_Packages/ac_prog_perl_version.m4 ______ +dnl @synopsis AC_PROG_PERL_VERSION(VERSION, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) +dnl +dnl Makes sure that perl supports the version indicated. If true the shell +dnl commands in ACTION-IF-TRUE are executed. If not the shell commands in +dnl ACTION-IF-FALSE are run. Note if $PERL is not set (for example by +dnl running AC_CHECK_PROG or AC_PATH_PROG), AC_CHECK_PROG(PERL, perl, perl) will +dnl be run. +dnl +dnl Example: +dnl +dnl AC_PROG_PERL_VERSION(5.6.0) +dnl +dnl This will check to make sure that the perl you have supports at least +dnl version 5.6.0. +dnl +dnl @version %Id: ac_prog_perl_version.m4,v 1.1 2002/12/12 23:14:52 guidod Exp % +dnl @author Dean Povey +dnl +AC_DEFUN([AC_PROG_PERL_VERSION],[dnl +# Make sure we have perl +if test -z "$PERL"; then +AC_CHECK_PROG(PERL,perl,perl) +fi + +# Check if version of Perl is sufficient +ac_perl_version="$1" + +if test "x$PERL" != "x"; then + AC_MSG_CHECKING(for perl version greater than or equal to $ac_perl_version) + # NB: It would be nice to log the error if there is one, but we cannot rely + # on autoconf internals + $PERL -e "use $ac_perl_version;" > /dev/null 2>&1 + if test $? -ne 0; then + AC_MSG_RESULT(no); + $3 + else + AC_MSG_RESULT(ok); + $2 + fi +else + AC_MSG_WARN(could not find perl) +fi +])dnl + + +dnl ______ acpackage.m4 ______ +dnl @synopsis AX_PATH_XCU_ID +dnl +dnl Find the correct 'id' programm which accepts the arguments specified +dnl in http://www.opengroup.org/onlinepubs/007908799/xcu/id.html +dnl SunOS for example has this one in /usr/xpg4/bin, not /usr/bin +dnl +dnl This does AC_SUBST(XCU_ID) and accepts an absolute path +dnl to be preset in XCU_ID variable. +dnl If no id program is found, XCU_ID is left empty, not the word 'no'. +dnl +dnl Q: Why is it called 'XCU_ID' ? +dnl A: The name 'ID' might be misunderstood, so i decided 'XCU_ID'. +dnl XCU is the section where the specification of 'id' resides in at +dnl opengroup.org, whereof 'CU' is synonym for "commandline utilities". +dnl +dnl @version $Id: acinclude.m4,v 1.2 2005/03/25 10:42:25 haubi Exp $ +dnl +dnl @author Michael Haubenwallner +dnl +AC_DEFUN([AX_PATH_XCU_ID],[dnl + AC_CACHE_CHECK([for a SUSv2-compatible xcu id], [ax_cv_path_XCU_ID], + [case $XCU_ID in + [[\\/]]* | ?:[[\\/]]*) + # Let the user override the test with a path. + ax_cv_path_XCU_ID="$XCU_ID" + ;; + *) + save_IFS=${IFS} + ax_cv_path_XCU_ID=no + IFS=':' + for p in /usr/bin:/usr/xpg4/bin:${PATH} + do + IFS=${save_IFS} + test -x "${p}/id" || continue + ax_cv_path_XCU_ID="${p}/id" + for a in '' '-G' '-Gn' '-g' '-gn' '-gr' '-gnr' '-u' '-un' '-ur' '-unr' + do + "${ax_cv_path_XCU_ID}" ${a} >/dev/null 2>&1 \ + || { ax_cv_path_XCU_ID=no ; break ; } + done + test "x${ax_cv_path_XCU_ID}" = "xno" || break + done + IFS=${save_IFS} + ;; + esac]) + XCU_ID="${ax_cv_path_XCU_ID}" + test "x${XCU_ID}" != "xno" || XCU_ID= + test "$1:${XCU_ID}" != "required:"dnl + || AC_MSG_ERROR([SUSv2-compatible id not found (use XCU_ID=/path/to/id).]) + AC_SUBST(XCU_ID)dnl +])dnl + +dnl @synopsis AX_PATH_EGREP +dnl +dnl Much like AC_PROG_EGREP, but set output variable EGREP to an absolute path. +dnl +dnl Example: +dnl +dnl AX_PATH_EGREP +dnl +dnl This let EGREP be the absolute path for egrep +dnl +dnl @version %Id:% +dnl @author Michael Haubenwallner +dnl +AC_DEFUN([AX_PATH_EGREP],[dnl + AC_REQUIRE([AC_PROG_EGREP])dnl + set dummy ${EGREP} + egrep=[$]2 ; shift ; shift + egrep_args=[$]* + EGREP= + AC_PATH_PROG(EGREP, [${egrep}]) + EGREP="${EGREP} ${egrep_args}" +])dnl + + Index: aclocal.m4 =================================================================== RCS file: aclocal.m4 diff -N aclocal.m4 --- aclocal.m4 4 Mar 2005 10:29:00 -0000 1.1.1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,908 +0,0 @@ -# generated automatically by aclocal 1.8.5 -*- Autoconf -*- - -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 -# Free Software Foundation, Inc. -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -# -*- Autoconf -*- -# Copyright (C) 2002, 2003 Free Software Foundation, Inc. -# Generated from amversion.in; do not edit by hand. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - -# AM_AUTOMAKE_VERSION(VERSION) -# ---------------------------- -# Automake X.Y traces this macro to ensure aclocal.m4 has been -# generated from the m4 files accompanying Automake X.Y. -AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.8"]) - -# AM_SET_CURRENT_AUTOMAKE_VERSION -# ------------------------------- -# Call AM_AUTOMAKE_VERSION so it can be traced. -# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. -AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], - [AM_AUTOMAKE_VERSION([1.8.5])]) - -# AM_AUX_DIR_EXPAND - -# Copyright (C) 2001, 2003 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets -# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to -# `$srcdir', `$srcdir/..', or `$srcdir/../..'. -# -# Of course, Automake must honor this variable whenever it calls a -# tool from the auxiliary directory. The problem is that $srcdir (and -# therefore $ac_aux_dir as well) can be either absolute or relative, -# depending on how configure is run. This is pretty annoying, since -# it makes $ac_aux_dir quite unusable in subdirectories: in the top -# source directory, any form will work fine, but in subdirectories a -# relative path needs to be adjusted first. -# -# $ac_aux_dir/missing -# fails when called from a subdirectory if $ac_aux_dir is relative -# $top_srcdir/$ac_aux_dir/missing -# fails if $ac_aux_dir is absolute, -# fails when called from a subdirectory in a VPATH build with -# a relative $ac_aux_dir -# -# The reason of the latter failure is that $top_srcdir and $ac_aux_dir -# are both prefixed by $srcdir. In an in-source build this is usually -# harmless because $srcdir is `.', but things will broke when you -# start a VPATH build or use an absolute $srcdir. -# -# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, -# iff we strip the leading $srcdir from $ac_aux_dir. That would be: -# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` -# and then we would define $MISSING as -# MISSING="\${SHELL} $am_aux_dir/missing" -# This will work as long as MISSING is not called from configure, because -# unfortunately $(top_srcdir) has no meaning in configure. -# However there are other variables, like CC, which are often used in -# configure, and could therefore not use this "fixed" $ac_aux_dir. -# -# Another solution, used here, is to always expand $ac_aux_dir to an -# absolute PATH. The drawback is that using absolute paths prevent a -# configured tree to be moved without reconfiguration. - -AC_DEFUN([AM_AUX_DIR_EXPAND], -[dnl Rely on autoconf to set up CDPATH properly. -AC_PREREQ([2.50])dnl -# expand $ac_aux_dir to an absolute path -am_aux_dir=`cd $ac_aux_dir && pwd` -]) - -# AM_CONDITIONAL -*- Autoconf -*- - -# Copyright (C) 1997, 2000, 2001, 2003 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -# serial 6 - -# AM_CONDITIONAL(NAME, SHELL-CONDITION) -# ------------------------------------- -# Define a conditional. -AC_DEFUN([AM_CONDITIONAL], -[AC_PREREQ(2.52)dnl - ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], - [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl -AC_SUBST([$1_TRUE]) -AC_SUBST([$1_FALSE]) -if $2; then - $1_TRUE= - $1_FALSE='#' -else - $1_TRUE='#' - $1_FALSE= -fi -AC_CONFIG_COMMANDS_PRE( -[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then - AC_MSG_ERROR([conditional "$1" was never defined. -Usually this means the macro was only invoked conditionally.]) -fi])]) - -# serial 7 -*- Autoconf -*- - -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 -# Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - - -# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be -# written in clear, in which case automake, when reading aclocal.m4, -# will think it sees a *use*, and therefore will trigger all it's -# C support machinery. Also note that it means that autoscan, seeing -# CC etc. in the Makefile, will ask for an AC_PROG_CC use... - - - -# _AM_DEPENDENCIES(NAME) -# ---------------------- -# See how the compiler implements dependency checking. -# NAME is "CC", "CXX", "GCJ", or "OBJC". -# We try a few techniques and use that to set a single cache variable. -# -# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was -# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular -# dependency, and given that the user is not expected to run this macro, -# just rely on AC_PROG_CC. -AC_DEFUN([_AM_DEPENDENCIES], -[AC_REQUIRE([AM_SET_DEPDIR])dnl -AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl -AC_REQUIRE([AM_MAKE_INCLUDE])dnl -AC_REQUIRE([AM_DEP_TRACK])dnl - -ifelse([$1], CC, [depcc="$CC" am_compiler_list=], - [$1], CXX, [depcc="$CXX" am_compiler_list=], - [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], - [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], - [depcc="$$1" am_compiler_list=]) - -AC_CACHE_CHECK([dependency style of $depcc], - [am_cv_$1_dependencies_compiler_type], -[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named `D' -- because `-MD' means `put the output - # in D'. - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub - - am_cv_$1_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` - fi - for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with - # Solaris 8's {/usr,}/bin/sh. - touch sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - - case $depmode in - nosideeffect) - # after this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested - if test "x$enable_dependency_tracking" = xyes; then - continue - else - break - fi - ;; - none) break ;; - esac - # We check with `-c' and `-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle `-M -o', and we need to detect this. - if depmode=$depmode \ - source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && - ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_$1_dependencies_compiler_type=$depmode - break - fi - fi - done - - cd .. - rm -rf conftest.dir -else - am_cv_$1_dependencies_compiler_type=none -fi -]) -AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) -AM_CONDITIONAL([am__fastdep$1], [ - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) -]) - - -# AM_SET_DEPDIR -# ------------- -# Choose a directory name for dependency files. -# This macro is AC_REQUIREd in _AM_DEPENDENCIES -AC_DEFUN([AM_SET_DEPDIR], -[AC_REQUIRE([AM_SET_LEADING_DOT])dnl -AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl -]) - - -# AM_DEP_TRACK -# ------------ -AC_DEFUN([AM_DEP_TRACK], -[AC_ARG_ENABLE(dependency-tracking, -[ --disable-dependency-tracking speeds up one-time build - --enable-dependency-tracking do not reject slow dependency extractors]) -if test "x$enable_dependency_tracking" != xno; then - am_depcomp="$ac_aux_dir/depcomp" - AMDEPBACKSLASH='\' -fi -AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) -AC_SUBST([AMDEPBACKSLASH]) -]) - -# Generate code to set up dependency tracking. -*- Autoconf -*- - -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -#serial 2 - -# _AM_OUTPUT_DEPENDENCY_COMMANDS -# ------------------------------ -AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], -[for mf in $CONFIG_FILES; do - # Strip MF so we end up with the name of the file. - mf=`echo "$mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named `Makefile.in', but - # some people rename them; so instead we look at the file content. - # Grep'ing the first line is not enough: some people post-process - # each Makefile.in and add a new line on top of each file to say so. - # So let's grep whole file. - if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then - dirpart=`AS_DIRNAME("$mf")` - else - continue - fi - grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue - # Extract the definition of DEP_FILES from the Makefile without - # running `make'. - DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` - test -z "$DEPDIR" && continue - # When using ansi2knr, U may be empty or an underscore; expand it - U=`sed -n 's/^U = //p' < "$mf"` - test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" - # We invoke sed twice because it is the simplest approach to - # changing $(DEPDIR) to its actual value in the expansion. - for file in `sed -n ' - /^DEP_FILES = .*\\\\$/ { - s/^DEP_FILES = // - :loop - s/\\\\$// - p - n - /\\\\$/ b loop - p - } - /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do - # Make sure the directory exists. - test -f "$dirpart/$file" && continue - fdir=`AS_DIRNAME(["$file"])` - AS_MKDIR_P([$dirpart/$fdir]) - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" - done -done -])# _AM_OUTPUT_DEPENDENCY_COMMANDS - - -# AM_OUTPUT_DEPENDENCY_COMMANDS -# ----------------------------- -# This macro should only be invoked once -- use via AC_REQUIRE. -# -# This code is only required when automatic dependency tracking -# is enabled. FIXME. This creates each `.P' file that we will -# need in order to bootstrap the dependency handling code. -AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], -[AC_CONFIG_COMMANDS([depfiles], - [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], - [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) -]) - -# Do all the work for Automake. -*- Autoconf -*- - -# This macro actually does too much some checks are only needed if -# your package does certain things. But this isn't really a big deal. - -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 -# Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -# serial 11 - -# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) -# AM_INIT_AUTOMAKE([OPTIONS]) -# ----------------------------------------------- -# The call with PACKAGE and VERSION arguments is the old style -# call (pre autoconf-2.50), which is being phased out. PACKAGE -# and VERSION should now be passed to AC_INIT and removed from -# the call to AM_INIT_AUTOMAKE. -# We support both call styles for the transition. After -# the next Automake release, Autoconf can make the AC_INIT -# arguments mandatory, and then we can depend on a new Autoconf -# release and drop the old call support. -AC_DEFUN([AM_INIT_AUTOMAKE], -[AC_PREREQ([2.58])dnl -dnl Autoconf wants to disallow AM_ names. We explicitly allow -dnl the ones we care about. -m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl -AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl -AC_REQUIRE([AC_PROG_INSTALL])dnl -# test to see if srcdir already configured -if test "`cd $srcdir && pwd`" != "`pwd`" && - test -f $srcdir/config.status; then - AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) -fi - -# test whether we have cygpath -if test -z "$CYGPATH_W"; then - if (cygpath --version) >/dev/null 2>/dev/null; then - CYGPATH_W='cygpath -w' - else - CYGPATH_W=echo - fi -fi -AC_SUBST([CYGPATH_W]) - -# Define the identity of the package. -dnl Distinguish between old-style and new-style calls. -m4_ifval([$2], -[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl - AC_SUBST([PACKAGE], [$1])dnl - AC_SUBST([VERSION], [$2])], -[_AM_SET_OPTIONS([$1])dnl - AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl - AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl - -_AM_IF_OPTION([no-define],, -[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) - AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl - -# Some tools Automake needs. -AC_REQUIRE([AM_SANITY_CHECK])dnl -AC_REQUIRE([AC_ARG_PROGRAM])dnl -AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) -AM_MISSING_PROG(AUTOCONF, autoconf) -AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) -AM_MISSING_PROG(AUTOHEADER, autoheader) -AM_MISSING_PROG(MAKEINFO, makeinfo) -AM_MISSING_PROG(AMTAR, tar) -AM_PROG_INSTALL_SH -AM_PROG_INSTALL_STRIP -AC_REQUIRE([AM_PROG_MKDIR_P])dnl -# We need awk for the "check" target. The system "awk" is bad on -# some platforms. -AC_REQUIRE([AC_PROG_AWK])dnl -AC_REQUIRE([AC_PROG_MAKE_SET])dnl -AC_REQUIRE([AM_SET_LEADING_DOT])dnl - -_AM_IF_OPTION([no-dependencies],, -[AC_PROVIDE_IFELSE([AC_PROG_CC], - [_AM_DEPENDENCIES(CC)], - [define([AC_PROG_CC], - defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl -AC_PROVIDE_IFELSE([AC_PROG_CXX], - [_AM_DEPENDENCIES(CXX)], - [define([AC_PROG_CXX], - defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl -]) -]) - - -# When config.status generates a header, we must update the stamp-h file. -# This file resides in the same directory as the config header -# that is generated. The stamp files are numbered to have different names. - -# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the -# loop where config.status creates the headers, so we can generate -# our stamp files there. -AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], -[# Compute $1's index in $config_headers. -_am_stamp_count=1 -for _am_header in $config_headers :; do - case $_am_header in - $1 | $1:* ) - break ;; - * ) - _am_stamp_count=`expr $_am_stamp_count + 1` ;; - esac -done -echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) - -# AM_PROG_INSTALL_SH -# ------------------ -# Define $install_sh. - -# Copyright (C) 2001, 2003 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -AC_DEFUN([AM_PROG_INSTALL_SH], -[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -install_sh=${install_sh-"$am_aux_dir/install-sh"} -AC_SUBST(install_sh)]) - -# -*- Autoconf -*- -# Copyright (C) 2003 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -# serial 1 - -# Check whether the underlying file-system supports filenames -# with a leading dot. For instance MS-DOS doesn't. -AC_DEFUN([AM_SET_LEADING_DOT], -[rm -rf .tst 2>/dev/null -mkdir .tst 2>/dev/null -if test -d .tst; then - am__leading_dot=. -else - am__leading_dot=_ -fi -rmdir .tst 2>/dev/null -AC_SUBST([am__leading_dot])]) - -# Check to see how 'make' treats includes. -*- Autoconf -*- - -# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -# serial 2 - -# AM_MAKE_INCLUDE() -# ----------------- -# Check to see how make treats includes. -AC_DEFUN([AM_MAKE_INCLUDE], -[am_make=${MAKE-make} -cat > confinc << 'END' -am__doit: - @echo done -.PHONY: am__doit -END -# If we don't find an include directive, just comment out the code. -AC_MSG_CHECKING([for style of include used by $am_make]) -am__include="#" -am__quote= -_am_result=none -# First try GNU make style include. -echo "include confinc" > confmf -# We grep out `Entering directory' and `Leaving directory' -# messages which can occur if `w' ends up in MAKEFLAGS. -# In particular we don't look at `^make:' because GNU make might -# be invoked under some other name (usually "gmake"), in which -# case it prints its new name instead of `make'. -if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then - am__include=include - am__quote= - _am_result=GNU -fi -# Now try BSD make style include. -if test "$am__include" = "#"; then - echo '.include "confinc"' > confmf - if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then - am__include=.include - am__quote="\"" - _am_result=BSD - fi -fi -AC_SUBST([am__include]) -AC_SUBST([am__quote]) -AC_MSG_RESULT([$_am_result]) -rm -f confinc confmf -]) - -# -*- Autoconf -*- - - -# Copyright (C) 1997, 1999, 2000, 2001, 2003 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -# serial 3 - -# AM_MISSING_PROG(NAME, PROGRAM) -# ------------------------------ -AC_DEFUN([AM_MISSING_PROG], -[AC_REQUIRE([AM_MISSING_HAS_RUN]) -$1=${$1-"${am_missing_run}$2"} -AC_SUBST($1)]) - - -# AM_MISSING_HAS_RUN -# ------------------ -# Define MISSING if not defined so far and test if it supports --run. -# If it does, set am_missing_run to use it, otherwise, to nothing. -AC_DEFUN([AM_MISSING_HAS_RUN], -[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" -# Use eval to expand $SHELL -if eval "$MISSING --run true"; then - am_missing_run="$MISSING --run " -else - am_missing_run= - AC_MSG_WARN([`missing' script is too old or missing]) -fi -]) - -# AM_PROG_MKDIR_P -# --------------- -# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise. - -# Copyright (C) 2003, 2004 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories -# created by `make install' are always world readable, even if the -# installer happens to have an overly restrictive umask (e.g. 077). -# This was a mistake. There are at least two reasons why we must not -# use `-m 0755': -# - it causes special bits like SGID to be ignored, -# - it may be too restrictive (some setups expect 775 directories). -# -# Do not use -m 0755 and let people choose whatever they expect by -# setting umask. -# -# We cannot accept any implementation of `mkdir' that recognizes `-p'. -# Some implementations (such as Solaris 8's) are not thread-safe: if a -# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c' -# concurrently, both version can detect that a/ is missing, but only -# one can create it and the other will error out. Consequently we -# restrict ourselves to GNU make (using the --version option ensures -# this.) -AC_DEFUN([AM_PROG_MKDIR_P], -[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then - # Keeping the `.' argument allows $(mkdir_p) to be used without - # argument. Indeed, we sometimes output rules like - # $(mkdir_p) $(somedir) - # where $(somedir) is conditionally defined. - # (`test -n '$(somedir)' && $(mkdir_p) $(somedir)' is a more - # expensive solution, as it forces Make to start a sub-shell.) - mkdir_p='mkdir -p -- .' -else - # On NextStep and OpenStep, the `mkdir' command does not - # recognize any option. It will interpret all options as - # directories to create, and then abort because `.' already - # exists. - for d in ./-p ./--version; - do - test -d $d && rmdir $d - done - # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. - if test -f "$ac_aux_dir/mkinstalldirs"; then - mkdir_p='$(mkinstalldirs)' - else - mkdir_p='$(install_sh) -d' - fi -fi -AC_SUBST([mkdir_p])]) - -# Helper functions for option handling. -*- Autoconf -*- - -# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -# serial 2 - -# _AM_MANGLE_OPTION(NAME) -# ----------------------- -AC_DEFUN([_AM_MANGLE_OPTION], -[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) - -# _AM_SET_OPTION(NAME) -# ------------------------------ -# Set option NAME. Presently that only means defining a flag for this option. -AC_DEFUN([_AM_SET_OPTION], -[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) - -# _AM_SET_OPTIONS(OPTIONS) -# ---------------------------------- -# OPTIONS is a space-separated list of Automake options. -AC_DEFUN([_AM_SET_OPTIONS], -[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) - -# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) -# ------------------------------------------- -# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. -AC_DEFUN([_AM_IF_OPTION], -[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) - -# -# Check to make sure that the build environment is sane. -# - -# Copyright (C) 1996, 1997, 2000, 2001, 2003 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -# serial 3 - -# AM_SANITY_CHECK -# --------------- -AC_DEFUN([AM_SANITY_CHECK], -[AC_MSG_CHECKING([whether build environment is sane]) -# Just in case -sleep 1 -echo timestamp > conftest.file -# Do `set' in a subshell so we don't clobber the current shell's -# arguments. Must try -L first in case configure is actually a -# symlink; some systems play weird games with the mod time of symlinks -# (eg FreeBSD returns the mod time of the symlink's containing -# directory). -if ( - set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` - if test "$[*]" = "X"; then - # -L didn't work. - set X `ls -t $srcdir/configure conftest.file` - fi - rm -f conftest.file - if test "$[*]" != "X $srcdir/configure conftest.file" \ - && test "$[*]" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken -alias in your environment]) - fi - - test "$[2]" = conftest.file - ) -then - # Ok. - : -else - AC_MSG_ERROR([newly created file is older than distributed files! -Check your system clock]) -fi -AC_MSG_RESULT(yes)]) - -# AM_PROG_INSTALL_STRIP - -# Copyright (C) 2001, 2003 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -# One issue with vendor `install' (even GNU) is that you can't -# specify the program used to strip binaries. This is especially -# annoying in cross-compiling environments, where the build's strip -# is unlikely to handle the host's binaries. -# Fortunately install-sh will honor a STRIPPROG variable, so we -# always use install-sh in `make install-strip', and initialize -# STRIPPROG with the value of the STRIP variable (set by the user). -AC_DEFUN([AM_PROG_INSTALL_STRIP], -[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl -# Installed binaries are usually stripped using `strip' when the user -# run `make install-strip'. However `strip' might not be the right -# tool to use in cross-compilation environments, therefore Automake -# will honor the `STRIP' environment variable to overrule this program. -dnl Don't test for $cross_compiling = yes, because it might be `maybe'. -if test "$cross_compiling" != no; then - AC_CHECK_TOOL([STRIP], [strip], :) -fi -INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" -AC_SUBST([INSTALL_STRIP_PROGRAM])]) - Index: acpackage.m4 =================================================================== RCS file: acpackage.m4 diff -N acpackage.m4 --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ acpackage.m4 25 Mar 2005 09:41:48 -0000 1.1 @@ -0,0 +1,75 @@ +dnl @synopsis AX_PATH_XCU_ID +dnl +dnl Find the correct 'id' programm which accepts the arguments specified +dnl in http://www.opengroup.org/onlinepubs/007908799/xcu/id.html +dnl SunOS for example has this one in /usr/xpg4/bin, not /usr/bin +dnl +dnl This does AC_SUBST(XCU_ID) and accepts an absolute path +dnl to be preset in XCU_ID variable. +dnl If no id program is found, XCU_ID is left empty, not the word 'no'. +dnl +dnl Q: Why is it called 'XCU_ID' ? +dnl A: The name 'ID' might be misunderstood, so i decided 'XCU_ID'. +dnl XCU is the section where the specification of 'id' resides in at +dnl opengroup.org, whereof 'CU' is synonym for "commandline utilities". +dnl +dnl @version $Id: acpackage.m4,v 1.1 2005/03/25 09:41:48 haubi Exp $ +dnl +dnl @author Michael Haubenwallner +dnl +AC_DEFUN([AX_PATH_XCU_ID],[dnl + AC_CACHE_CHECK([for a SUSv2-compatible xcu id], [ax_cv_path_XCU_ID], + [case $XCU_ID in + [[\\/]]* | ?:[[\\/]]*) + # Let the user override the test with a path. + ax_cv_path_XCU_ID="$XCU_ID" + ;; + *) + save_IFS=${IFS} + ax_cv_path_XCU_ID=no + IFS=':' + for p in /usr/bin:/usr/xpg4/bin:${PATH} + do + IFS=${save_IFS} + test -x "${p}/id" || continue + ax_cv_path_XCU_ID="${p}/id" + for a in '' '-G' '-Gn' '-g' '-gn' '-gr' '-gnr' '-u' '-un' '-ur' '-unr' + do + "${ax_cv_path_XCU_ID}" ${a} >/dev/null 2>&1 \ + || { ax_cv_path_XCU_ID=no ; break ; } + done + test "x${ax_cv_path_XCU_ID}" = "xno" || break + done + IFS=${save_IFS} + ;; + esac]) + XCU_ID="${ax_cv_path_XCU_ID}" + test "x${XCU_ID}" != "xno" || XCU_ID= + test "$1:${XCU_ID}" != "required:"dnl + || AC_MSG_ERROR([SUSv2-compatible id not found (use XCU_ID=/path/to/id).]) + AC_SUBST(XCU_ID)dnl +])dnl + +dnl @synopsis AX_PATH_EGREP +dnl +dnl Much like AC_PROG_EGREP, but set output variable EGREP to an absolute path. +dnl +dnl Example: +dnl +dnl AX_PATH_EGREP +dnl +dnl This let EGREP be the absolute path for egrep +dnl +dnl @version %Id:% +dnl @author Michael Haubenwallner +dnl +AC_DEFUN([AX_PATH_EGREP],[dnl + AC_REQUIRE([AC_PROG_EGREP])dnl + set dummy ${EGREP} + egrep=[$]2 ; shift ; shift + egrep_args=[$]* + EGREP= + AC_PATH_PROG(EGREP, [${egrep}]) + EGREP="${EGREP} ${egrep_args}" +])dnl + Index: autogen.sh =================================================================== RCS file: /cvsroot/portage/autogen.sh,v retrieving revision 1.1.1.1 retrieving revision 1.4 diff -u -r1.1.1.1 -r1.4 --- autogen.sh 7 Mar 2005 10:46:31 -0000 1.1.1.1 +++ autogen.sh 25 Mar 2005 09:41:48 -0000 1.4 @@ -1,7 +1,22 @@ -#!/bin/sh +#! /bin/bash -autoheader || exit 1 +set -e + +cd `dirname $0` + +test -f subst-install.vars.in.in || touch subst-install.vars.in.in +rm -rf autom4te.cache +if type -p acinclude >/dev/null 2>&1 ; then + acinclude +elif [ acpackage.m4 -nt acinclude.m4 ]; then + echo "NOTE: missing acinclude: have you sys-devel/ac-archive installed ?" + echo "NOTE: acinclude.m4 might is out of date" + sleep 2 +fi aclocal-1.8 || exit 1 +if grep '^[ \t]*A[CM]_CONFIG_HEADER' configure.in ; then + autoheader +fi libtoolize --automake -c -f || exit 1 autoconf || exit 1 automake-1.8 -a -c || exit 1 Index: configure.in =================================================================== RCS file: /cvsroot/portage/configure.in,v retrieving revision 1.1.1.1 retrieving revision 1.8 diff -u -r1.1.1.1 -r1.8 --- configure.in 4 Mar 2005 10:29:00 -0000 1.1.1.1 +++ configure.in 25 Mar 2005 10:42:25 -0000 1.8 @@ -1,5 +1,18 @@ dnl Process this file with autoconf to produce a configure script. AC_INIT(portage, cvs, dev-portage@gentoo.org) + +case "${prefix}" in +"") AC_MSG_ERROR(bad value '${prefix}' for --prefix, must not be empty) ;; +/) AC_MSG_ERROR(bad value '${prefix}' for --prefix, must not be '/' only) ;; +*/) AC_MSG_ERROR(bad value '${prefix}' for --prefix, must not end with '/') ;; +/*|NONE) ;; +*) AC_MSG_ERROR(bad value '${prefix}' for --prefix, must start with /) ;; +esac + +AC_CANONICAL_BUILD +AC_CANONICAL_HOST +AC_CANONICAL_TARGET + AM_INIT_AUTOMAKE dnl AM_CONFIG_HEADER(config.h) @@ -13,6 +26,66 @@ AC_PREFIX_DEFAULT([/usr]) AC_PROG_CC AC_PROG_INSTALL +AC_PROG_LN_S +AX_PATH_EGREP +case `${EGREP} --version 2>/dev/null` in +*"GNU grep"*) ;; +*) + AC_MSG_ERROR([Need GNU grep for ${EGREP}]) + ;; +esac +AX_PATH_XCU_ID([required]) +AC_PATH_PROG(RM, rm, /bin/rm) +AC_PATH_PROG(MV, mv, /bin/mv) +AC_PATH_PROGS(SED, [gsed sed], /usr/bin/sed) + +dnl when /bin/sh is bash, then BASH is set to /bin/sh +test "${BASH}" != "/bin/sh" || $as_unset BASH +AC_PATH_PROGS(BASH, [bash2 bash], /bin/bash) + +dnl >=python-2.2, but prefer path .../python +AC_PATH_PROG(PYTHON, [python], /usr/bin/python) +AX_WITH_PYTHON([2.2], [missing]) +if test "x${PYTHON}" = "xmissing"; then + PYTHON= + AC_PATH_PROGS(PYTHON, + [python2.4 python2.3 python2.2 python2 python], + [/usr/bin/python]) + AX_WITH_PYTHON([2.2], [missing]) +fi +if test "x${PYTHON}" = "xmissing"; then + AC_MSG_ERROR([cannot find python version >= 2.2]) +fi + +AC_PATH_PROG(PERL, perl, [/usr/bin/perl]) +AC_PROG_PERL_VERSION([5.6.0], , [PERL=]) +if test "x${PERL}" = "x"; then + AC_PATH_PROGS(PERL, [perl5.8.6 perl5.8.5 perl5.8.4 perl5.8.3 perl5.8.2 \ + perl5.8.1 perl5.8.0 perl5.8 perl5.6.1 perl5.6.0 perl5.6 perl5 perl], + [/usr/bin/perl]) + AC_PROG_PERL_VERSION([5.6.0], , + [AC_MSG_ERROR([cannot find a perl version >= 5.6.0])] + ) +fi + +AC_PATH_PROG(BASENAME, basename, /bin/basename) +AC_PATH_PROG(DIRNAME, dirname, /usr/bin/dirname) +AC_PATH_PROG(DIALOG, dialog, /usr/bin/dialog) +AC_PATH_PROG(WGET, wget, /usr/bin/wget) +AC_PATH_PROG(INSTALL_INFO, install-info, /usr/bin/install-info) +AC_PATH_PROG(SANDBOX, sandbox, /usr/bin/sandbox) +AC_PATH_PROG(PRELINK, prelink, /usr/sbin/prelink) +AC_PATH_PROG(RSYNC, rsync, /usr/bin/rsync) +AC_PATH_PROG(CVS, cvs, /usr/bin/cvs) +AC_PATH_PROGS(GPG, [gpg pgp], /usr/bin/gpg) +AC_PATH_PROG(INSTALL_INFO, install-info, /usr/bin/install-info) +AC_PATH_PROG(MD5SUM, md5sum, /usr/bin/md5sum) +AC_PATH_PROG(LOGGER, logger, /usr/bin/logger) +AC_PATH_PROG(FIND, find, /usr/bin/find) +AC_PATH_PROG(FILE, file, /usr/bin/file) +AC_PATH_PROG(READELF, readelf, /usr/bin/readelf) +AC_PATH_PROG(SETFILES, setfiles, /usr/sbin/setfiles) +AC_PATH_PROG(FAKEROOT, fakeroot, /usr/bin/fakeroot) dnl Checks for libraries. dnl Replace `main' with a function in -lc: @@ -78,6 +151,38 @@ esac], [enable_py_sources=true]) +AC_ARG_WITH(user, +AC_HELP_STRING([--with-user=me],[use user 'me' for portage to work as (default portage)]), +[case "${withval}" in + ""|yes) AC_MSG_ERROR(bad value ${withval} for --with-user);; + *) portageuser="${withval}";; +esac], +[portageuser="portage"]) + +AC_ARG_WITH(group, +AC_HELP_STRING([--with-group=mygroup],[use group 'mygroup' for portage to work as (default portage)]), +[case "${withval}" in + ""|yes) AC_MSG_ERROR(bad value ${withval} for --with-group);; + *) portagegroup="${withval}";; +esac], +[portagegroup="portage"]) + +AC_ARG_WITH(wheelgroup, +AC_HELP_STRING([--with-wheelgroup=wheelgroup],[let portage use 'wheelgroup' as wheel group (default wheel)]), +[case "${withval}" in + ""|yes) AC_MSG_ERROR(bad value ${withval} for --with-wheelgroup);; + *) wheelgroup="${withval}";; +esac], +[wheelgroup="wheel"]) + +AC_ARG_WITH(rootuser, +AC_HELP_STRING([--with-rootuser=me],[allows 'me' to do root tasks (default root)]), +[case "${withval}" in + ""|yes) AC_MSG_ERROR(bad value ${withval} for --with-rootuser);; + *) rootuser=${withval};; +esac], +[rootuser=root]) + if test x$enable_missingos = xauto then pyver=[`python -c 'import sys;print sys.version[0:3]';`] @@ -89,17 +194,77 @@ esac fi +dnl according to FHS: +dnl if prefix=/usr then '/'+affix = '/' +dnl else '/'+affix=prefix+'/' +dnl +dnl "${affix}" never starts with '/', but "/${affix}" always ends with '/' +AC_MSG_CHECKING([for affix to be used]) +case "${prefix}" in +/usr|NONE) affix= ;; +*) affix=`echo "${prefix}" | cut -c2-`'/' ;; +esac +AC_MSG_RESULT(['${affix}']) + +AC_MSG_CHECKING([for ARCH to be used]) +dnl detect ARCH from target_cpu +case "${target_cpu}" in +i?86) ARCH=x86 ;; +sparc*) ARCH=sparc ;; +hppa*) ARCH=hppa ;; +powerpc*) ARCH=ppc ;; +dnl don't know more target_cpus yet... +*) AC_MSG_RESULT([unknown]) + AC_MSG_CHECKING([for default ARCH to be used]) + ARCH=${target_cpu} ;; +esac +AC_MSG_RESULT([${ARCH}]) + AC_CONFIG_FILES([ Makefile ]) +AC_CONFIG_FILES([ subst-install ]) +AC_CONFIG_FILES([ subst-install.vars.in ]) AC_CONFIG_FILES([ src/Makefile ]) AC_CONFIG_FILES([ src/filter-env/Makefile ]) AC_CONFIG_FILES([ man/Makefile ]) AC_CONFIG_FILES([ src/python-missingos/Makefile ]) AC_CONFIG_FILES([ bin/Makefile ]) AC_CONFIG_FILES([ pym/Makefile ]) +AC_CONFIG_FILES([ cnf/Makefile ]) -AC_SUBST(PORTAGE_BASE,"/usr/lib/portage") +AC_SUBST(affix) +AC_SUBST(portageuser) +AC_SUBST(portagegroup) +AC_SUBST(wheelgroup) +AC_SUBST(rootuser) +AC_SUBST(ARCH) +AC_SUBST(PORTAGE_BASE,['${libdir}/portage']) AM_CONDITIONAL(INSTALL_PYTHON_SOURCES, test x$enable_py_sources = xtrue) AM_CONDITIONAL(BUILD_TBZ2TOOL, test x$enable_tbz2tool = xtrue) AM_CONDITIONAL(BUILD_MISSINGOS, test x$enable_missingos = xtrue) AM_CONDITIONAL(BUILD_FILTER_ENV, test x$enable_filter_env = xtrue) + +AC_MSG_CHECKING([for a list of variables known by configure]) +rm -f subst-install.vars.in.in.tmp +pt_configvars=`grep '^s,@' ${srcdir}/configure | sed -e 's|^s,@\([[^@]][[^@]]*\)@.*$|\1|'` +{ + pt_all_configurevars= + for pt_configvar in ${pt_configvars} + do + echo "${pt_configvar}=@${pt_configvar}@" + pt_all_configurevars="${pt_all_configurevars} ${pt_configvar}" + done + + echo "all_configurevars='${pt_all_configurevars}'" + +} > subst-install.vars.in.in.tmp +diff ${srcdir}/subst-install.vars.in.in subst-install.vars.in.in.tmp >/dev/null +if [[ $? != 0 ]] +then + rm -f ${srcdir}/subst-install.vars.in.in + cp subst-install.vars.in.in.tmp ${srcdir}/subst-install.vars.in.in +fi +rm -f subst-install.vars.in.in.tmp +$as_unset pt_configvar pt_configvars pt_all_configurevars +AC_MSG_RESULT([ok]) + AC_OUTPUT Index: subst-install.in =================================================================== RCS file: subst-install.in diff -N subst-install.in --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ subst-install.in 8 Mar 2005 07:43:56 -0000 1.1 @@ -0,0 +1,72 @@ +#! @SHELL@ + +SED="@SED@" +RM="@RM@" +BASENAME="@BASENAME@" +DIRNAME="@DIRNAME@" + +case "${SED}" in ""|@*@) SED=sed ;; esac +case "${RM}" in ""|@*@) RM=rm ;; esac +case "${BASENAME}" in ""|@*@) BASENAME=basename ;; esac +case "${DIRNAME}" in ""|@*@) DIRNAME=dirname ;; esac + +mydir=`${DIRNAME} $0` +myname=`${BASENAME} $0` +mydir=`cd ${mydir};pwd` +me=${mydir}/${myname} + +. ${mydir}/subst-install.vars + +substinstall_tmpdir=${TMP-/tmp}/${myname}.$$ +trap "${RM} -rf \${substinstall_tmpdir}" "0" +mkdir -p ${substinstall_tmpdir} \ +|| { echo "cannot create directory ${substinstall_tmpdir}" >&2 ; exit 1 ; } + +substinstall_tmpsed=${substinstall_tmpdir}/sedscript + +{ for v in ${all_configurevars} + do + eval "echo \"s,@${v}@,\${${v}},g;\"" + done +} | ${SED} 's/^s,@/s@@/; s/@,/@@/; s/,g;$/@;/; s/[\\&,]/\\&/g; + s/^s@@/s,@/; s/@@/@,/; s/@;$/,g;/' > ${substinstall_tmpsed} + +substinstall_installcmd= +substinstall_sources= +substinstall_target= + +while [ "$1" ] +do + substinstall_arg=$1 + shift + case "${substinstall_arg}" in + --installcmd=*) + substinstall_installcmd=`echo ${substinstall_arg} | ${SED} -e 's,^--installcmd=,,'` + ;; + *) + substinstall_sources="${substinstall_sources} ${substinstall_target}" + substinstall_target=${substinstall_arg} + ;; + esac +done + +[ -n "${substinstall_installcmd}" ] || { echo "missing --installcmd=" ; exit 1 ; } + +substinstall_tmpsources= + +for substinstall_s in ${substinstall_sources} +do + [ -r ${substinstall_s} ] || { echo "cannot read ${substinstall_s}" >&2 ; exit 1 ; } + tmpsource=${substinstall_tmpdir}/`basename ${substinstall_s}`.subst + ${SED} -f ${substinstall_tmpsed} < ${substinstall_s} > ${tmpsource} \ + || { echo "cannot sed from ${substinstall_s} to ${tmpsource}" >&2 ; exit 1 ; } + substinstall_tmpsources="${substinstall_tmpsources} ${tmpsource}" +done + +${substinstall_installcmd} ${substinstall_tmpsources} ${substinstall_target} + +substinstall_installrv=$? + +${RM} -rf ${substinstall_tmpdir} + +exit ${substinstall_installrv} Index: bin/Makefile.in =================================================================== RCS file: /cvsroot/portage/bin/Makefile.in,v retrieving revision 1.1.1.1 retrieving revision 1.5 diff -u -r1.1.1.1 -r1.5 --- bin/Makefile.in 4 Mar 2005 10:29:00 -0000 1.1.1.1 +++ bin/Makefile.in 25 Mar 2005 10:42:25 -0000 1.5 @@ -1,15 +1,99 @@ -PORTAGE_BASEDIR = @PORTAGE_BASE@ -INSTALL = @INSTALL@ -INSTALL_script = @INSTALL_PROGRAM@ -D -o 0 -g portage -m 755 +prefix = @prefix@ +exec_prefix = @exec_prefix@ +libdir = @libdir@ + +srcdir=@srcdir@ +top_builddir=@top_builddir@ + +portageuser = @portageuser@ +portagegroup = @portagegroup@ + +PORTAGE_BIN = @PORTAGE_BASE@/bin +LN_S = @LN_S@ +INSTALL = @INSTALL@ +INSTALL_script = @INSTALL_PROGRAM@ -o $(portageuser) -g $(portagegroup) -m 755 +INSTALL_scriptsubst = $(SHELL) ${top_builddir}/subst-install --installcmd='${INSTALL_script}' + +user_binprogs = \ + ebuild \ + emerge \ + g-cpan.pl \ + portageq \ + quickpkg \ + repoman \ + tbz2tool \ + xpak + +user_sbinprogs = \ + archive-conf \ + dispatch-conf \ + ebuild \ + ebuild.sh \ + env-update \ + etc-update \ + fixpackages \ + pkgmerge \ + regenworld + +list_sourcedir = \ + ( cd ${srcdir} \ + && find . -name 'CVS' -prune \ + -o -name 'Makefile*' -prune \ + -o -type f -print \ + ) all: + install: - $(INSTALL) -d -m 755 -o 0-g portage $(DESTDIR)/$(PORTAGE_BASEDIR)/bin || exit 1 - find . -type f -maxdepth 1 -exec $(INSTALL_script) {} $(DESTDIR)/$(PORTAGE_BASEDIR)/bin/{} \; || exit 1 - rm $(DESTDIR)/$(PORTAGE_BASEDIR)/bin/Makefile* || exit 1 + $(INSTALL) -d -m 755 -o $(portageuser) -g $(portagegroup) $(DESTDIR)$(PORTAGE_BIN) + $(list_sourcedir) | while read f \ + ; do echo "$(INSTALL_scriptsubst) ${srcdir}/$${f} $(DESTDIR)$(PORTAGE_BIN)/$${f}" \ + ; $(INSTALL_scriptsubst) ${srcdir}/$${f} $(DESTDIR)$(PORTAGE_BIN)/$${f} \ + ; done + $(INSTALL) -d -m 755 -o $(portageuser) -g $(portagegroup) $(DESTDIR)$(prefix)/bin + cd $(DESTDIR)$(prefix)/bin \ + ; for p in $(user_binprogs) \ + ; do test -f $(DESTDIR)$(PORTAGE_BIN)/$${p} \ + || { echo "$(DESTDIR)$(PORTAGE_BIN)/$${p} does not exist" ; exit 1 ; } \ + ; echo "rm -f $(DESTDIR)$(prefix)/bin/$${p}" \ + ; rm -f $(DESTDIR)$(prefix)/bin/$${p} \ + ; echo "$(LN_S) ../lib/portage/bin/$${p} $${p}" \ + ; $(LN_S) ../lib/portage/bin/$${p} $${p} || exit 1 \ + ; done + $(INSTALL) -d -m 755 -o $(portageuser) -g $(portagegroup) $(DESTDIR)$(prefix)/sbin + cd $(DESTDIR)$(prefix)/sbin \ + ; for p in $(user_sbinprogs) \ + ; do test -f $(DESTDIR)$(PORTAGE_BIN)/$${p} \ + || { echo "$(DESTDIR)$(PORTAGE_BIN)/$${p} does not exist" ; exit 1 ; } \ + ; echo "rm -f $(DESTDIR)$(prefix)/sbin/$${p}" \ + ; rm -f $(DESTDIR)$(prefix)/sbin/$${p} \ + ; echo "$(LN_S) ../lib/portage/bin/$${p} $${p}" \ + ; $(LN_S) ../lib/portage/bin/$${p} $${p} || exit 1 \ + ; done + +uninstall: + $(list_sourcedir) | while read f \ + ; do echo "rm -f $(DESTDIR)$(PORTAGE_BIN)/$${f}" \ + ; rm -f $(DESTDIR)$(PORTAGE_BIN)/$${f} \ + ; done + for p in $(user_binprogs) \ + ; do echo "rm -f $(DESTDIR)$(prefix)/bin/$${p}" \ + ; rm -f $(DESTDIR)$(prefix)/bin/$${p} \ + ; done + for p in $(user_sbinprogs) \ + ; do echo "rm -f $(DESTDIR)$(prefix)/sbin/$${p}" \ + ; rm -f $(DESTDIR)$(prefix)/sbin/$${p} \ + ; done distdir: - find . -type f -maxdepth 1 -exec $(INSTALL_script) {} $(distdir)/{} \; -clean: + $(list_sourcedir) | while read f \ + ; do echo "$(INSTALL_script) ${srcdir}/$${f} $(distdir)/$${f}" \ + ; $(INSTALL_script) ${srcdir}/$${f} $(distdir)/$${f} \ + ; done + +all dvi check installcheck: +clean distclean maintainer-clean: -.PHONY: distdir install clean +.PHONY: all install distdir uninstall +.PHONY: dvi check installcheck +.PHONY: clean distclean maintainer-clean Index: bin/affect-fakeroot-perms.sh =================================================================== RCS file: /cvsroot/portage/bin/affect-fakeroot-perms.sh,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- bin/affect-fakeroot-perms.sh 4 Mar 2005 10:29:00 -0000 1.1.1.1 +++ bin/affect-fakeroot-perms.sh 9 Mar 2005 16:16:26 -0000 1.2 @@ -1,8 +1,8 @@ -#!/bin/bash +#! @BASH@ # affect-fakeroot-perms.sh; Make claimed fakeroot permissions, a reality. # Copyright 2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -$Header: /cvsroot/portage/bin/affect-fakeroot-perms.sh,v 1.1.1.1 2005/03/04 10:29:00 haubi Exp $ +$Header: /cvsroot/portage/bin/affect-fakeroot-perms.sh,v 1.2 2005/03/09 16:16:26 haubi Exp $ echo "adjusting $2 using $1" >&2 Index: bin/archive-conf =================================================================== RCS file: /cvsroot/portage/bin/archive-conf,v retrieving revision 1.1.1.1 retrieving revision 1.3 diff -u -r1.1.1.1 -r1.3 --- bin/archive-conf 4 Mar 2005 10:29:00 -0000 1.1.1.1 +++ bin/archive-conf 19 Mar 2005 20:55:22 -0000 1.3 @@ -1,7 +1,7 @@ -#!/usr/bin/python +#! @PYTHON@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /cvsroot/portage/bin/archive-conf,v 1.1.1.1 2005/03/04 10:29:00 haubi Exp $ +# $Header: /cvsroot/portage/bin/archive-conf,v 1.3 2005/03/19 20:55:22 haubi Exp $ # # archive-conf -- save off a config file in the dispatch-conf archive dir @@ -11,9 +11,10 @@ # import os, sys, string -sys.path = ["/usr/lib/portage/pym"]+sys.path +sys.path = ["@PORTAGE_BASE@/pym"]+sys.path import portage, dispatch_conf +from portage import ROOT, VDB_PATH FIND_EXTANT_CONTENTS = "find %s -name CONTENTS" @@ -56,7 +57,7 @@ md5_match_hash[conf] = '' # Find all the CONTENT files in VDB_PATH. - content_files += os.popen(FIND_EXTANT_CONTENTS % (portage.root+portage.VDB_PATH)).readlines() + content_files += os.popen(FIND_EXTANT_CONTENTS % (ROOT(VDB_PATH))).readlines() # Search for the saved md5 checksum of all the specified config files # and see if the current file is unmodified or not. Index: bin/chkcontents =================================================================== RCS file: /cvsroot/portage/bin/chkcontents,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- bin/chkcontents 4 Mar 2005 10:29:00 -0000 1.1.1.1 +++ bin/chkcontents 9 Mar 2005 16:16:26 -0000 1.2 @@ -1,7 +1,7 @@ -#!/usr/bin/python +#! @PYTHON@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /cvsroot/portage/bin/chkcontents,v 1.1.1.1 2005/03/04 10:29:00 haubi Exp $ +# $Header: /cvsroot/portage/bin/chkcontents,v 1.2 2005/03/09 16:16:26 haubi Exp $ # Very simple program to compare the md5sums of a package as listed # in VDB_PATH/category/package/CONTENTS with the md5sums of the @@ -9,7 +9,7 @@ # the right files). import string, os.path, os, sys -sys.path = ["/usr/lib/portage/pym"]+sys.path +sys.path = ["@PORTAGE_BASE@/pym"]+sys.path import portage def CONTENTScheck(path): Index: bin/clean_locks =================================================================== RCS file: /cvsroot/portage/bin/clean_locks,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- bin/clean_locks 4 Mar 2005 10:29:00 -0000 1.1.1.1 +++ bin/clean_locks 9 Mar 2005 16:16:26 -0000 1.2 @@ -1,10 +1,10 @@ -#!/usr/bin/python -O +#! @PYTHON@ -O # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /cvsroot/portage/bin/clean_locks,v 1.1.1.1 2005/03/04 10:29:00 haubi Exp $ +# $Header: /cvsroot/portage/bin/clean_locks,v 1.2 2005/03/09 16:16:26 haubi Exp $ import os,sys -sys.path = ["/usr/lib/portage/pym"]+sys.path +sys.path = ["@PORTAGE_BASE@/pym"]+sys.path import portage_locks @@ -15,8 +15,8 @@ print "of the locks, even if we can't establish if they are in use." print "Please attempt cleaning without force first." print - print sys.argv[0]+" /usr/portage/distfiles/.locks" - print sys.argv[0]+" --force /usr/portage/distfiles/.locks" + print sys.argv[0]+" @prefix@/portage/distfiles/.locks" + print sys.argv[0]+" --force @prefix@/portage/distfiles/.locks" print sys.exit(1) @@ -33,4 +33,4 @@ - \ No newline at end of file + Index: bin/db-update.py =================================================================== RCS file: /cvsroot/portage/bin/db-update.py,v retrieving revision 1.1.1.1 retrieving revision 1.4 diff -u -r1.1.1.1 -r1.4 --- bin/db-update.py 4 Mar 2005 10:29:00 -0000 1.1.1.1 +++ bin/db-update.py 21 Mar 2005 12:59:30 -0000 1.4 @@ -1,15 +1,16 @@ -#!/usr/bin/python -O +#! @PYTHON@ -O # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /cvsroot/portage/bin/db-update.py,v 1.1.1.1 2005/03/04 10:29:00 haubi Exp $ +# $Header: /cvsroot/portage/bin/db-update.py,v 1.4 2005/03/21 12:59:30 haubi Exp $ import os,sys,string -sys.path = ["/usr/lib/portage/pym"]+sys.path +sys.path = ["@PORTAGE_BASE@/pym"]+sys.path import portage +from portage import MYROOT,ROOT,VDB_PATH,CACHE_PATH -os.chdir(portage.root+portage.VDB_PATH) -myvirts=portage.grabdict(portage.root+"var/cache/edb/virtuals") +os.chdir(ROOT(VDB_PATH)) +myvirts=portage.grabdict(ROOT(CACHE_PATH+"/virtuals")) mypvirts={} if portage.profiledir: mypvirts=portage.grabdict(portage.profiledir+"/virtuals") @@ -50,11 +51,11 @@ myvirts[x]=[mydict[x]] print ">>> Database upgrade..." print ">>> Writing out new virtuals file..." -portage.writedict(myvirts,portage.root+"var/cache/edb/virtuals") -if not os.path.exists("/tmp/db-upgrade-bak"): - os.mkdir("/tmp/db-upgrade-bak") -print ">>> Backing up to /tmp/db-upgrade-bak..." +portage.writedict(myvirts,ROOT(CACHE_PATH+"/virtuals")) +if not os.path.exists(MYROOT("tmp/db-upgrade-bak")): + os.mkdir(MYROOT("tmp/db-upgrade-bak")) +print ">>> Backing up to "+MYROOT("tmp/db-upgrade-bak")+"..." for myarg in myvalidargs: - print ">>> Backing up",portage.root+portage.VDB_PATH+"/"+origkey[myarg] - os.system("mv "+portage.root+portage.VDB_PATH+"/"+origkey[myarg]+" /tmp/db-upgrade-bak") + print ">>> Backing up",ROOT(VDB_PATH+"/"+origkey[myarg]) + os.system("mv "+ROOT(VDB_PATH+"/"+origkey[myarg])+" "+MYROOT("tmp/db-upgrade-bak")) print ">>> Done." Index: bin/dispatch-conf =================================================================== RCS file: /cvsroot/portage/bin/dispatch-conf,v retrieving revision 1.1.1.2 retrieving revision 1.4 diff -u -r1.1.1.2 -r1.4 --- bin/dispatch-conf 25 Mar 2005 09:35:13 -0000 1.1.1.2 +++ bin/dispatch-conf 25 Mar 2005 09:43:56 -0000 1.4 @@ -1,7 +1,7 @@ -#!/usr/bin/python -O +#! @PYTHON@ -O # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /cvsroot/portage/bin/dispatch-conf,v 1.1.1.2 2005/03/25 09:35:13 haubi Exp $ +# $Header: /cvsroot/portage/bin/dispatch-conf,v 1.4 2005/03/25 09:43:56 haubi Exp $ # # dispatch-conf -- Integrate modified configs, post-emerge @@ -15,9 +15,10 @@ from stat import * from random import * import os, shutil, sys, string, re, commands, atexit -sys.path = ["/usr/lib/portage/pym"]+sys.path +sys.path = ["@PORTAGE_BASE@/pym"]+sys.path import portage, dispatch_conf +from portage import MYROOT FIND_EXTANT_CONFIGS = "find %s/ -iname '._cfg????_*' | sed -e 's://:/:g'" DIFF_CONTENTS = 'diff -Nu %s %s' @@ -237,8 +238,8 @@ def massage (self, newconfigs): """Sort, rstrip, remove old versions, break into triad hash. - Triad is dictionary of current (/etc/make.conf), new (/etc/._cfg0003_make.conf) - and dir (/etc). + Triad is dictionary of current ("""+MYROOT("etc/make.conf")+"""), new ("""+MYROOT("etc/._cfg0003_make.conf")+""") + and dir ("""+MYROOT("etc")+"""). We keep ._cfg0002_conf over ._cfg0001_conf and ._cfg0000_conf. """ Index: bin/dispatch-conf-dialog =================================================================== RCS file: /cvsroot/portage/bin/dispatch-conf-dialog,v retrieving revision 1.1.1.1 retrieving revision 1.3 diff -u -r1.1.1.1 -r1.3 --- bin/dispatch-conf-dialog 4 Mar 2005 10:29:00 -0000 1.1.1.1 +++ bin/dispatch-conf-dialog 19 Mar 2005 20:55:22 -0000 1.3 @@ -1,7 +1,7 @@ -#!/usr/bin/python -O +#! @PYTHON@ -O # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /cvsroot/portage/bin/dispatch-conf-dialog,v 1.1.1.1 2005/03/04 10:29:00 haubi Exp $ +# $Header: /cvsroot/portage/bin/dispatch-conf-dialog,v 1.3 2005/03/19 20:55:22 haubi Exp $ # # dispatch-conf-dialog -- Integrate modified configs, post-emerge @@ -13,10 +13,11 @@ # dialog menus # import os, shutil, sys, string, re, commands -sys.path = ["/usr/lib/portage/pym"]+sys.path +sys.path = ["@PORTAGE_BASE@/pym"]+sys.path from stat import * import portage, dispatch_conf +from portage import MYROOT from dcdialog import * @@ -216,8 +217,8 @@ def massage (self, newconfigs): """Sort, rstrip, remove old versions, break into triad hash. - Triad is dictionary of current (/etc/make.conf), new (/etc/._cfg0003_make.conf) - and dir (/etc). + Triad is dictionary of current ("""+MYROOT("etc/make.conf")+"""), new ("""+MYROOT("etc/._cfg0003_make.conf")+""") + and dir ("""+MYROOT("etc")+"""). We keep ._cfg0002_conf over ._cfg0001_conf and ._cfg0000_conf. """ Index: bin/dobin =================================================================== RCS file: /cvsroot/portage/bin/dobin,v retrieving revision 1.1.1.1 retrieving revision 1.3 diff -u -r1.1.1.1 -r1.3 --- bin/dobin 4 Mar 2005 10:29:00 -0000 1.1.1.1 +++ bin/dobin 22 Mar 2005 08:10:36 -0000 1.3 @@ -1,7 +1,7 @@ -#!/bin/bash +#! @BASH@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /cvsroot/portage/bin/dobin,v 1.1.1.1 2005/03/04 10:29:00 haubi Exp $ +# $Header: /cvsroot/portage/bin/dobin,v 1.3 2005/03/22 08:10:36 haubi Exp $ if [ ${#} -lt 1 ] ; then echo "${0}: at least one argument needed" @@ -19,8 +19,12 @@ else #otherwise, use reasonable defaults echo ">>> dobin: making ${x} executable..." - if [ "$USERLAND" == "GNU" ]; then + if [ "/@affix@" != "/" ]; then + install -m0755 -o @rootuser@ -g @wheelgroup@ "${x}" "${D}${DESTTREE}/bin" || exit 4 + elif [ "$USERLAND" == "GNU" ]; then install -m0755 -o root -g root "${x}" "${D}${DESTTREE}/bin" || exit 4 + elif [ "$USERLAND" == "UNIX" ]; then + install -m0755 -o root -g bin "${x}" "${D}${DESTTREE}/bin" || exit 4 else install -m0755 -o root -g wheel "${x}" "${D}${DESTTREE}/bin" || exit 4 fi Index: bin/doconfd =================================================================== RCS file: /cvsroot/portage/bin/doconfd,v retrieving revision 1.1.1.1 retrieving revision 1.4 diff -u -r1.1.1.1 -r1.4 --- bin/doconfd 4 Mar 2005 10:29:00 -0000 1.1.1.1 +++ bin/doconfd 21 Mar 2005 14:56:09 -0000 1.4 @@ -1,7 +1,7 @@ -#!/bin/bash +#! @BASH@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /cvsroot/portage/bin/doconfd,v 1.1.1.1 2005/03/04 10:29:00 haubi Exp $ +# $Header: /cvsroot/portage/bin/doconfd,v 1.4 2005/03/21 14:56:09 haubi Exp $ if [ ${#} -lt 1 ] ; then echo "doconfd: at least one argument needed" @@ -9,7 +9,7 @@ fi tmp_INSDESTTREE="${INSDESTTREE}" -INSDESTTREE=/etc/conf.d/ +INSDESTTREE=/${AFFIX}etc/conf.d/ doins "$@" INSDESTTREE="${tmp_INSDESTTREE}" unset tmp_INSDESTTREE Index: bin/dodir =================================================================== RCS file: /cvsroot/portage/bin/dodir,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- bin/dodir 4 Mar 2005 10:29:00 -0000 1.1.1.1 +++ bin/dodir 9 Mar 2005 16:16:27 -0000 1.2 @@ -1,7 +1,7 @@ -#!/bin/bash +#! @BASH@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /cvsroot/portage/bin/dodir,v 1.1.1.1 2005/03/04 10:29:00 haubi Exp $ +# $Header: /cvsroot/portage/bin/dodir,v 1.2 2005/03/09 16:16:27 haubi Exp $ for x in "$@" ; do install -d ${DIROPTIONS} "${D}${x}" Index: bin/dodoc =================================================================== RCS file: /cvsroot/portage/bin/dodoc,v retrieving revision 1.1.1.1 retrieving revision 1.3 diff -u -r1.1.1.1 -r1.3 --- bin/dodoc 4 Mar 2005 10:29:00 -0000 1.1.1.1 +++ bin/dodoc 19 Mar 2005 20:55:23 -0000 1.3 @@ -1,19 +1,19 @@ -#!/bin/bash +#! @BASH@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /cvsroot/portage/bin/dodoc,v 1.1.1.1 2005/03/04 10:29:00 haubi Exp $ +# $Header: /cvsroot/portage/bin/dodoc,v 1.3 2005/03/19 20:55:23 haubi Exp $ for x in "$@" ; do if [ -s "${x}" ] ; then - if [ ! -d "${D}usr/share/doc/${PF}" ] ; then - install -d "${D}usr/share/doc/${PF}" + if [ ! -d "${D}${PREFIX}/share/doc/${PF}" ] ; then + install -d "${D}${PREFIX}/share/doc/${PF}" fi if [ -z "${DOCDESTTREE}" ] ; then - install -m0644 "${x}" "${D}usr/share/doc/${PF}" - gzip -f -9 "${D}usr/share/doc/${PF}/${x##*/}" + install -m0644 "${x}" "${D}${PREFIX}/share/doc/${PF}" + gzip -f -9 "${D}${PREFIX}/share/doc/${PF}/${x##*/}" else - install -m0644 "${x}" "${D}usr/share/doc/${PF}/${DOCDESTTREE}" - gzip -f -9 "${D}usr/share/doc/${PF}/${DOCDESTTREE}/${x##*/}" + install -m0644 "${x}" "${D}${PREFIX}/share/doc/${PF}/${DOCDESTTREE}" + gzip -f -9 "${D}${PREFIX}/share/doc/${PF}/${DOCDESTTREE}/${x##*/}" fi else echo "${0}: ${x} does not exist." Index: bin/doenvd =================================================================== RCS file: /cvsroot/portage/bin/doenvd,v retrieving revision 1.1.1.1 retrieving revision 1.4 diff -u -r1.1.1.1 -r1.4 --- bin/doenvd 4 Mar 2005 10:29:00 -0000 1.1.1.1 +++ bin/doenvd 21 Mar 2005 14:56:09 -0000 1.4 @@ -1,7 +1,7 @@ -#!/bin/bash +#! @BASH@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /cvsroot/portage/bin/doenvd,v 1.1.1.1 2005/03/04 10:29:00 haubi Exp $ +# $Header: /cvsroot/portage/bin/doenvd,v 1.4 2005/03/21 14:56:09 haubi Exp $ if [ ${#} -lt 1 ] ; then echo "doenvd: at least one argument needed" @@ -9,7 +9,7 @@ fi tmp_INSDESTTREE="${INSDESTTREE}" -INSDESTTREE=/etc/env.d/ +INSDESTTREE=/${AFFIX}etc/env.d/ doins "$@" INSDESTTREE="${tmp_INSDESTTREE}" unset tmp_INSDESTTREE Index: bin/doexe =================================================================== RCS file: /cvsroot/portage/bin/doexe,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- bin/doexe 4 Mar 2005 10:29:00 -0000 1.1.1.1 +++ bin/doexe 9 Mar 2005 16:16:27 -0000 1.2 @@ -1,7 +1,7 @@ -#!/bin/bash +#! @BASH@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /cvsroot/portage/bin/doexe,v 1.1.1.1 2005/03/04 10:29:00 haubi Exp $ +# $Header: /cvsroot/portage/bin/doexe,v 1.2 2005/03/09 16:16:27 haubi Exp $ mynum=${#} if [ ${mynum} -lt 1 ] ; then @@ -15,7 +15,7 @@ for x in "$@" ; do if [ -L "${x}" ] ; then cp "${x}" "${T}" - mysrc="${T}"/`/usr/bin/basename "${x}"` + mysrc="${T}"/`@BASENAME@ "${x}"` elif [ -d "${x}" ] ; then echo "doexe: warning, skipping directory ${x}" continue Index: bin/dohard =================================================================== RCS file: /cvsroot/portage/bin/dohard,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- bin/dohard 4 Mar 2005 10:29:00 -0000 1.1.1.1 +++ bin/dohard 9 Mar 2005 16:16:27 -0000 1.2 @@ -1,7 +1,7 @@ -#!/bin/bash +#! @BASH@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /cvsroot/portage/bin/dohard,v 1.1.1.1 2005/03/04 10:29:00 haubi Exp $ +# $Header: /cvsroot/portage/bin/dohard,v 1.2 2005/03/09 16:16:27 haubi Exp $ if [ ${#} -ne 2 ] ; then echo "${0}: two arguments needed" Index: bin/dohtml =================================================================== RCS file: /cvsroot/portage/bin/dohtml,v retrieving revision 1.1.1.1 retrieving revision 1.4 diff -u -r1.1.1.1 -r1.4 --- bin/dohtml 4 Mar 2005 10:29:00 -0000 1.1.1.1 +++ bin/dohtml 21 Mar 2005 14:17:56 -0000 1.4 @@ -1,7 +1,7 @@ -#!/usr/bin/python +#! @PYTHON@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /cvsroot/portage/bin/dohtml,v 1.1.1.1 2005/03/04 10:29:00 haubi Exp $ +# $Header: /cvsroot/portage/bin/dohtml,v 1.4 2005/03/21 14:17:56 haubi Exp $ # # Typical usage: @@ -48,9 +48,9 @@ if dirname: fullpath = dirname + "/" + fullpath if options.DOCDESTTREE: - destdir = options.D + "usr/share/doc/" + options.PF + "/" + options.DOCDESTTREE + "/" + options.doc_prefix + "/" + prefix + destdir = options.D + options.PREFIX + "/share/doc/" + options.PF + "/" + options.DOCDESTTREE + "/" + options.doc_prefix + "/" + prefix else: - destdir = options.D + "usr/share/doc/" + options.PF + "/html/" + options.doc_prefix + "/" + prefix + destdir = options.D + options.PREFIX + "/share/doc/" + options.PF + "/html/" + options.doc_prefix + "/" + prefix if os.path.isfile(fullpath): ext = os.path.splitext(basename)[1] @@ -74,6 +74,10 @@ self.PF = os.environ["PF"] if os.environ.has_key("D"): self.D = os.environ["D"] + if os.environ.has_key("AFFIX"): + self.AFFIX = os.environ["AFFIX"] + if os.environ.has_key("PREFIX"): + self.PREFIX = os.environ["PREFIX"] if os.environ.has_key("DOCDESTTREE"): self.DOCDESTTREE = os.environ["DOCDESTTREE"] Index: bin/doinfo =================================================================== RCS file: /cvsroot/portage/bin/doinfo,v retrieving revision 1.1.1.1 retrieving revision 1.3 diff -u -r1.1.1.1 -r1.3 --- bin/doinfo 4 Mar 2005 10:29:00 -0000 1.1.1.1 +++ bin/doinfo 19 Mar 2005 20:55:23 -0000 1.3 @@ -1,20 +1,20 @@ -#!/bin/bash +#! @BASH@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /cvsroot/portage/bin/doinfo,v 1.1.1.1 2005/03/04 10:29:00 haubi Exp $ +# $Header: /cvsroot/portage/bin/doinfo,v 1.3 2005/03/19 20:55:23 haubi Exp $ if [ ${#} -lt 1 ] ; then echo "doinfo: at least one argument needed" exit 1 fi -if [ ! -d "${D}usr/share/info" ] ; then - install -d "${D}usr/share/info" +if [ ! -d "${D}${PREFIX}/share/info" ] ; then + install -d "${D}${PREFIX}/share/info" fi for x in "$@" ; do if [ -e "${x}" ] ; then - install -m0644 "${x}" "${D}usr/share/info" - gzip -f -9 "${D}usr/share/info/${x##*/}" + install -m0644 "${x}" "${D}${PREFIX}/share/info" + gzip -f -9 "${D}${PREFIX}/share/info/${x##*/}" else echo "doinfo: ${x} does not exist" fi Index: bin/doinitd =================================================================== RCS file: /cvsroot/portage/bin/doinitd,v retrieving revision 1.1.1.1 retrieving revision 1.4 diff -u -r1.1.1.1 -r1.4 --- bin/doinitd 4 Mar 2005 10:29:00 -0000 1.1.1.1 +++ bin/doinitd 21 Mar 2005 14:56:09 -0000 1.4 @@ -1,7 +1,7 @@ -#!/bin/bash +#! @BASH@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /cvsroot/portage/bin/doinitd,v 1.1.1.1 2005/03/04 10:29:00 haubi Exp $ +# $Header: /cvsroot/portage/bin/doinitd,v 1.4 2005/03/21 14:56:09 haubi Exp $ if [ ${#} -lt 1 ] ; then echo "doinitd: at least one argument needed" @@ -9,7 +9,7 @@ fi tmp_EXEDESTTREE="${EXEDESTTREE}" -EXEDESTTREE=/etc/init.d/ +EXEDESTTREE=/${AFFIX}etc/init.d/ doexe "$@" EXEDESTTREE="${tmp_EXEDESTTREE}" unset tmp_EXEDESTTREE Index: bin/doins =================================================================== RCS file: /cvsroot/portage/bin/doins,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- bin/doins 4 Mar 2005 10:29:00 -0000 1.1.1.1 +++ bin/doins 9 Mar 2005 16:16:27 -0000 1.2 @@ -1,7 +1,7 @@ -#!/bin/bash +#! @BASH@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /cvsroot/portage/bin/doins,v 1.1.1.1 2005/03/04 10:29:00 haubi Exp $ +# $Header: /cvsroot/portage/bin/doins,v 1.2 2005/03/09 16:16:27 haubi Exp $ if [ $# -lt 1 ] ; then echo "${0}: at least one argument needed" @@ -25,7 +25,7 @@ for x in "$@" ; do if [ -L "$x" ] ; then cp "$x" "${T}" - mysrc="${T}/$(/usr/bin/basename "${x}")" + mysrc="${T}/$(@BASENAME@ "${x}")" elif [ -d "$x" ] ; then if [ "${DOINSRECUR}" == "n" ] ; then continue Index: bin/dojar =================================================================== RCS file: /cvsroot/portage/bin/dojar,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- bin/dojar 4 Mar 2005 10:29:00 -0000 1.1.1.1 +++ bin/dojar 9 Mar 2005 16:16:27 -0000 1.2 @@ -1,7 +1,7 @@ -#!/bin/sh +#! /bin/sh # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /cvsroot/portage/bin/dojar,v 1.1.1.1 2005/03/04 10:29:00 haubi Exp $ +# $Header: /cvsroot/portage/bin/dojar,v 1.2 2005/03/09 16:16:27 haubi Exp $ # Author Karl Trygve Kalleberg # Index: bin/dolib =================================================================== RCS file: /cvsroot/portage/bin/dolib,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- bin/dolib 4 Mar 2005 10:29:00 -0000 1.1.1.1 +++ bin/dolib 9 Mar 2005 16:16:27 -0000 1.2 @@ -1,7 +1,7 @@ -#!/bin/bash +#! @BASH@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /cvsroot/portage/bin/dolib,v 1.1.1.1 2005/03/04 10:29:00 haubi Exp $ +# $Header: /cvsroot/portage/bin/dolib,v 1.2 2005/03/09 16:16:27 haubi Exp $ LIBDIR_VAR="LIBDIR_${ABI}" if [ -n "${ABI}" -a -n "${!LIBDIR_VAR}" ]; then Index: bin/dolib.a =================================================================== RCS file: /cvsroot/portage/bin/dolib.a,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- bin/dolib.a 7 Mar 2005 10:51:01 -0000 1.1.1.1 +++ bin/dolib.a 9 Mar 2005 16:16:27 -0000 1.2 @@ -1,7 +1,7 @@ -#!/bin/bash +#! @BASH@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /cvsroot/portage/bin/dolib.a,v 1.1.1.1 2005/03/07 10:51:01 haubi Exp $ +# $Header: /cvsroot/portage/bin/dolib.a,v 1.2 2005/03/09 16:16:27 haubi Exp $ exec env LIBOPTIONS="-m0644" \ dolib "$@" Index: bin/dolib.so =================================================================== RCS file: /cvsroot/portage/bin/dolib.so,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- bin/dolib.so 7 Mar 2005 10:51:01 -0000 1.1.1.1 +++ bin/dolib.so 9 Mar 2005 16:16:27 -0000 1.2 @@ -1,7 +1,7 @@ -#!/bin/bash +#! @BASH@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /cvsroot/portage/bin/dolib.so,v 1.1.1.1 2005/03/07 10:51:01 haubi Exp $ +# $Header: /cvsroot/portage/bin/dolib.so,v 1.2 2005/03/09 16:16:27 haubi Exp $ exec env LIBOPTIONS="-m0755" \ dolib "$@" Index: bin/doman =================================================================== RCS file: /cvsroot/portage/bin/doman,v retrieving revision 1.1.1.1 retrieving revision 1.5 diff -u -r1.1.1.1 -r1.5 --- bin/doman 4 Mar 2005 10:29:00 -0000 1.1.1.1 +++ bin/doman 25 Mar 2005 09:41:48 -0000 1.5 @@ -1,7 +1,7 @@ -#!/bin/bash +#! @BASH@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /cvsroot/portage/bin/doman,v 1.1.1.1 2005/03/04 10:29:00 haubi Exp $ +# $Header: /cvsroot/portage/bin/doman,v 1.5 2005/03/25 09:41:48 haubi Exp $ if [ ${#} -lt 1 ] ; then echo "${0}: at least one argument needed" 1>&2 @@ -13,15 +13,15 @@ # /opt/gnome/man # /opt/kde/man -BASE="/usr/share" +BASE="${PREFIX}/share" OLDBASE="$BASE" i18n="" for x in "$@" ; do - [ "$x" == "--" ] && BASE="/usr/share" - [ "$x" == "-kde" ] && BASE="/opt/kde" - [ "$x" == "-gnome" ] && BASE="/opt/gnome" - [ "$x" == "-x11" ] && BASE="/usr/X11R6" + [ "$x" == "--" ] && BASE="${PREFIX}/share" + [ "$x" == "-kde" ] && BASE="/${AFFIX}opt/kde" + [ "$x" == "-gnome" ] && BASE="/${AFFIX}opt/gnome" + [ "$x" == "-x11" ] && BASE="${PREFIX}/X11R6" if [ "${x:0:6}" == "-i18n=" ] ; then i18n="${x:6}/" fi @@ -48,12 +48,12 @@ if [ "x" == "${suffix:1:1}" ] ; then OLDBASE="$BASE" - BASE="/usr/X11R6" + BASE="${PREFIX}/X11R6" fi mandir=${i18n}man${suffix:0:1} - if echo ${mandir} | egrep -q 'man[1-8n]$' -; then + if echo ${mandir} | @EGREP@ -q 'man[1-8n]$' -; then if [ -e "${x}" ] ; then if [ ! -d "${D}${BASE}/man/${mandir}" ] ; then install -d "${D}${BASE}/man/${mandir}" Index: bin/domo =================================================================== RCS file: /cvsroot/portage/bin/domo,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- bin/domo 4 Mar 2005 10:29:00 -0000 1.1.1.1 +++ bin/domo 9 Mar 2005 16:16:27 -0000 1.2 @@ -1,7 +1,7 @@ -#!/bin/bash +#! @BASH@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /cvsroot/portage/bin/domo,v 1.1.1.1 2005/03/04 10:29:00 haubi Exp $ +# $Header: /cvsroot/portage/bin/domo,v 1.2 2005/03/09 16:16:27 haubi Exp $ mynum=${#} if [ ${mynum} -lt 1 ] ; then Index: bin/dopython =================================================================== RCS file: /cvsroot/portage/bin/dopython,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- bin/dopython 4 Mar 2005 10:29:00 -0000 1.1.1.1 +++ bin/dopython 9 Mar 2005 16:16:27 -0000 1.2 @@ -1,10 +1,10 @@ -#!/usr/bin/python +#! @PYTHON@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /cvsroot/portage/bin/dopython,v 1.1.1.1 2005/03/04 10:29:00 haubi Exp $ +# $Header: /cvsroot/portage/bin/dopython,v 1.2 2005/03/09 16:16:27 haubi Exp $ import sys -sys.path = ["/usr/lib/portage/pym"]+sys.path +sys.path = ["@PORTAGE_BASE@/pym"]+sys.path from sys import * import portage Index: bin/dosbin =================================================================== RCS file: /cvsroot/portage/bin/dosbin,v retrieving revision 1.1.1.1 retrieving revision 1.3 diff -u -r1.1.1.1 -r1.3 --- bin/dosbin 4 Mar 2005 10:29:00 -0000 1.1.1.1 +++ bin/dosbin 22 Mar 2005 08:10:36 -0000 1.3 @@ -1,7 +1,7 @@ -#!/bin/bash +#! @BASH@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /cvsroot/portage/bin/dosbin,v 1.1.1.1 2005/03/04 10:29:00 haubi Exp $ +# $Header: /cvsroot/portage/bin/dosbin,v 1.3 2005/03/22 08:10:36 haubi Exp $ if [ ${#} -lt 1 ] ; then echo "${0}: at least one argument needed" @@ -18,8 +18,12 @@ else #otherwise, use reasonable defaults echo ">>> dosbin: making ${x} executable..." - if [ "$USERLAND" == "GNU" ]; then + if [ "/@affix@" != "/" ]; then + install -m0755 -o @rootuser@ -g @wheelgroup@ "${x}" "${D}${DESTTREE}/sbin" || exit 4 + elif [ "$USERLAND" == "GNU" ]; then install -m0755 -o root -g root "${x}" "${D}${DESTTREE}/sbin" || exit 4 + elif [ "$USERLAND" == "UNIX" ]; then + install -m0755 -o root -g bin "${x}" "${D}${DESTTREE}/sbin" || exit 4 else install -m0755 -o root -g wheel "${x}" "${D}${DESTTREE}/sbin" || exit 4 fi Index: bin/dosed =================================================================== RCS file: /cvsroot/portage/bin/dosed,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- bin/dosed 4 Mar 2005 10:29:00 -0000 1.1.1.1 +++ bin/dosed 9 Mar 2005 16:16:27 -0000 1.2 @@ -1,7 +1,7 @@ -#!/bin/bash +#! @BASH@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /cvsroot/portage/bin/dosed,v 1.1.1.1 2005/03/04 10:29:00 haubi Exp $ +# $Header: /cvsroot/portage/bin/dosed,v 1.2 2005/03/09 16:16:27 haubi Exp $ mysed="s:${D}::g" Index: bin/dosym =================================================================== RCS file: /cvsroot/portage/bin/dosym,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- bin/dosym 4 Mar 2005 10:29:00 -0000 1.1.1.1 +++ bin/dosym 9 Mar 2005 16:16:27 -0000 1.2 @@ -1,7 +1,7 @@ -#!/bin/bash +#! @BASH@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /cvsroot/portage/bin/dosym,v 1.1.1.1 2005/03/04 10:29:00 haubi Exp $ +# $Header: /cvsroot/portage/bin/dosym,v 1.2 2005/03/09 16:16:27 haubi Exp $ if [ ${#} -ne 2 ] ; then echo "${0}: two arguments needed" Index: bin/ebuild =================================================================== RCS file: /cvsroot/portage/bin/ebuild,v retrieving revision 1.1.1.1 retrieving revision 1.3 diff -u -r1.1.1.1 -r1.3 --- bin/ebuild 4 Mar 2005 10:29:00 -0000 1.1.1.1 +++ bin/ebuild 19 Mar 2005 20:55:23 -0000 1.3 @@ -1,10 +1,10 @@ -#!/usr/bin/python -O +#! @PYTHON@ -O # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /cvsroot/portage/bin/ebuild,v 1.1.1.1 2005/03/04 10:29:00 haubi Exp $ +# $Header: /cvsroot/portage/bin/ebuild,v 1.3 2005/03/19 20:55:23 haubi Exp $ import os,sys,portage_util -sys.path = ["/usr/lib/portage/pym"]+sys.path +sys.path = ["@PORTAGE_BASE@/pym"]+sys.path def getroot(): try: Index: bin/ebuild-daemon.sh =================================================================== RCS file: /cvsroot/portage/bin/ebuild-daemon.sh,v retrieving revision 1.1.1.2 retrieving revision 1.6 diff -u -r1.1.1.2 -r1.6 --- bin/ebuild-daemon.sh 9 Mar 2005 13:50:23 -0000 1.1.1.2 +++ bin/ebuild-daemon.sh 25 Mar 2005 09:41:48 -0000 1.6 @@ -1,10 +1,10 @@ -#!/bin/bash +#! @BASH@ # ebuild-daemon.sh; core ebuild processor handling code # Copyright 2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -$Header: /cvsroot/portage/bin/ebuild-daemon.sh,v 1.1.1.2 2005/03/09 13:50:23 haubi Exp $ +# $Header: /cvsroot/portage/bin/ebuild-daemon.sh,v 1.6 2005/03/25 09:41:48 haubi Exp $ -source /usr/lib/portage/bin/ebuild.sh daemonize +source ${PORTAGE_BASE}/bin/ebuild.sh daemonize alias die='diefunc "$FUNCNAME" "$LINENO" "$?"' #alias listen='read -u 3 -t 10' @@ -13,14 +13,14 @@ # use listen/speak for talking to the running portage instance instead of echo'ing to the fd yourself. # this allows us to move the open fd's w/out issues down the line. listen() { - if ! read -u 3 $1; then + if ! read -u 5 $1; then echo "coms error, read failed: backing out of daemon." exit 1 fi } speak() { - echo "$*" >&4 + echo "$*" >&6 } declare -rf speak @@ -154,13 +154,13 @@ export QA_CONTROLLED_EXTERNALLY="yes" enable_qa_interceptors -source "/usr/lib/portage/bin/ebuild-functions.sh" || die "failed sourcing ebuild-functions.sh" +source "@PORTAGE_BASE@/bin/ebuild-functions.sh" || die "failed sourcing ebuild-functions.sh" export PORTAGE_PRELOADED_ECLASSES='' unset_colors -PATH='/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/lib/portage/bin' +PATH='/@affix@bin:/@affix@sbin:@prefix@/bin:@prefix@/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:@PORTAGE_BASE@/bin' while [ "$alive" == "1" ]; do com='' listen com Index: bin/ebuild-default-functions.sh =================================================================== RCS file: /cvsroot/portage/bin/ebuild-default-functions.sh,v retrieving revision 1.1.1.2 retrieving revision 1.8 diff -u -r1.1.1.2 -r1.8 --- bin/ebuild-default-functions.sh 21 Mar 2005 09:47:18 -0000 1.1.1.2 +++ bin/ebuild-default-functions.sh 25 Mar 2005 09:41:48 -0000 1.8 @@ -1,8 +1,8 @@ -#!/bin/bash +#! @BASH@ # ebuild-default-functions.sh; default functions for ebuild env that aren't saved- specific to the portage instance. # Copyright 2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -$Header: /cvsroot/portage/bin/ebuild-default-functions.sh,v 1.1.1.2 2005/03/21 09:47:18 haubi Exp $ +$Header: /cvsroot/portage/bin/ebuild-default-functions.sh,v 1.8 2005/03/25 09:41:48 haubi Exp $ has_version() { # if there is a predefined portageq call, use it. @@ -16,10 +16,10 @@ # Takes single depend-type atoms. if declare -F portageq &> /dev/null; then - portageq 'has_version' "${ROOT}" "$1" + portageq 'has_version' "${ROOT}${AFFIX}" "$1" e=$? else - /usr/lib/portage/bin/portageq 'has_version' "${ROOT}" "$1" + @PORTAGE_BASE@/bin/portageq 'has_version' "${ROOT}${AFFIX}" "$1" e=$? fi return $e @@ -28,10 +28,10 @@ best_version() { local -i e if declare -F portageq &> /dev/null; then - portageq 'best_version' "${ROOT}" "$1" + portageq 'best_version' "${ROOT}${AFFIX}" "$1" e=$? else - /usr/lib/portage/bin/portageq 'best_version' "${ROOT}" "$1" + @PORTAGE_BASE@/bin/portageq 'best_version' "${ROOT}${AFFIX}" "$1" e=$? fi return $e @@ -97,6 +97,7 @@ if [ "$USERLAND" == "BSD" ]; then tarvars="" else + # GNU or UNIX (where GNU tar is required) tarvars="--no-same-owner" fi @@ -158,14 +159,14 @@ # Make sure we can have it disabled somehow .... if [ "${DISABLE_GEN_GCC_WRAPPERS}" != "yes" ]; then # Create /lib/cpp if missing or a symlink - if [ -L /lib/cpp -o ! -e /lib/cpp ]; then - [ -L /lib/cpp ] && rm -f /lib/cpp - gen_wrapper /lib/cpp cpp + if [ -L /@affix@lib/cpp -o ! -e /@affix@lib/cpp ]; then + [ -L /@affix@lib/cpp ] && rm -f /@affix@lib/cpp + gen_wrapper /@affix@lib/cpp cpp fi # Create /usr/bin/cc if missing for a symlink - if [ -L /usr/bin/cc -o ! -e /usr/bin/cc ]; then - [ -L /usr/bin/cc ] && rm -f /usr/bin/cc - gen_wrapper /usr/bin/cc gcc + if [ -L @prefix@/bin/cc -o ! -e @prefix@/bin/cc ]; then + [ -L @prefix@/bin/cc ] && rm -f @prefix@/bin/cc + gen_wrapper @prefix@/bin/cc gcc fi fi fi @@ -424,11 +425,11 @@ echo "UNSAFE SetUID: $i" done - if [ -x /usr/bin/readelf -a -x /usr/bin/file ]; then + if [ -x "@READELF@" -a -x "@FILE@" ]; then for x in $(find "${D}/" -type f \( -perm -04000 -o -perm -02000 \) ); do f=$(file "${x}") if [ -z "${f/*SB executable*/}" -o -z "${f/*SB shared object*/}" ]; then - /usr/bin/readelf -d "${x}" | egrep '\(FLAGS(.*)NOW' > /dev/null + "@READELF@" -d "${x}" | @EGREP@ '\(FLAGS(.*)NOW' > /dev/null if [ "$?" != "0" ]; then if [ ! -z "${f/*statically linked*/}" ]; then #uncomment this line out after developers have had ample time to fix pkgs. @@ -459,12 +460,16 @@ [ -h "$file" ] || chmod "$s" "$file" done - find "${D}/" -group portage -print | while read file; do + find "${D}/" -group @portagegroup@ -print | while read file; do # Too annoying - uncommenting this as it's a regression - it's not, commenting again #ewarn "file $file was installed with group portage!" s=$(stat_perms "$file") - if [ "$USERLAND" == "BSD" ]; then + if [ "/@affix@" != "/"]; then + chgrp @wheelgroup@ "$file" + elif [ "$USERLAND" == "BSD" ]; then chgrp wheel "$file" + elif [ "$USERLAND" == "UNIX" ]; then + chgrp bin "$file" else chgrp root "$file" fi @@ -472,13 +477,13 @@ [ -h "$file" ] || chmod "$s" "$file" done - if hasq multilib-strict ${FEATURES} && [ -x /usr/bin/file -a -x /usr/bin/find -a \ + if hasq multilib-strict ${FEATURES} && [ -x "@FILE@" -a -x "@FIND@" -a \ -n "${MULTILIB_STRICT_DIRS}" -a -n "${MULTILIB_STRICT_DENY}" ]; then MULTILIB_STRICT_EXEMPT=${MULTILIB_STRICT_EXEMPT:-"(perl5|gcc|gcc-lib)"} for dir in ${MULTILIB_STRICT_DIRS}; do [ -d "${D}/${dir}" ] || continue - for file in $(find ${D}/${dir} -type f | egrep -v "^${D}/${dir}/${MULTILIB_STRICT_EXEMPT}"); do - file ${file} | egrep -q "${MULTILIB_STRICT_DENY}" && die "File ${file} matches a file type that is not allowed in ${dir}" + for file in $(find ${D}/${dir} -type f | @EGREP@ -v "^${D}/${dir}/${MULTILIB_STRICT_EXEMPT}"); do + file ${file} | @EGREP@ -q "${MULTILIB_STRICT_DENY}" && die "File ${file} matches a file type that is not allowed in ${dir}" done done fi @@ -503,17 +508,17 @@ # remove man pages if hasq noman $FEATURES; then - rm -fR "${IMAGE}/usr/share/man" + rm -fR "${IMAGE}${PREFIX}/share/man" fi # remove info pages if hasq noinfo $FEATURES; then - rm -fR "${IMAGE}/usr/share/info" + rm -fR "${IMAGE}${PREFIX}/share/info" fi # remove docs if hasq nodoc $FEATURES; then - rm -fR "${IMAGE}/usr/share/doc" + rm -fR "${IMAGE}${PREFIX}/share/doc" fi # hopefully this will someday allow us to get rid of the no* feature flags @@ -535,7 +540,7 @@ # remove share dir if unnessesary if hasq nodoc $FEATURES -o hasq noman $FEATURES -o hasq noinfo $FEATURES; then - rmdir "${IMAGE}/usr/share" &> /dev/null + rmdir "${IMAGE}${PREFIX}/share" &> /dev/null fi # Smart FileSystem Permissions @@ -554,7 +559,7 @@ # total suid control. if hasq suidctl $FEATURES > /dev/null ; then - sfconf=/etc/portage/suidctl.conf + sfconf=/@affix@etc/portage/suidctl.conf echo ">>> Preforming suid scan in ${IMAGE}" for i in $(find ${IMAGE}/ -type f \( -perm -4000 -o -perm -2000 \) ); do if [ -s "${sfconf}" ]; then @@ -588,7 +593,7 @@ if hasq selinux $FEATURES || use selinux; then # only attempt to label if setfiles is executable # and 'context' is available on selinuxfs. - if [ -f /selinux/context -a -x /usr/sbin/setfiles ]; then + if [ -f /selinux/context -a -x "@SETFILES@" ]; then echo ">>> Setting SELinux security labels" if [ -f ${POLICYDIR}/file_contexts/file_contexts ]; then cp -f "${POLICYDIR}/file_contexts/file_contexts" "${T}" @@ -597,7 +602,7 @@ fi addwrite /selinux/context - /usr/sbin/setfiles -r "${IMAGE}" "${T}/file_contexts" "${IMAGE}" \ + @SETFILES@ -r "${IMAGE}" "${T}/file_contexts" "${IMAGE}" \ || die "Failed to set SELinux security labels." else # nonfatal, since merging can happen outside a SE kernel @@ -714,7 +719,7 @@ # You can override the setting by exporting a new one from the console, or you can # set a new default in make.*. Here the default is "" or unset. -# in the future might use e* from /etc/init.d/functions.sh if i feel like it +# in the future might use e* from /@affix@etc/init.d/functions.sh if i feel like it debug-print() { if [ "$EBUILD_PHASE" == "depend" ] && [ -z "${PORTAGE_DEBUG}" ]; then return @@ -1058,7 +1063,7 @@ # Used to generate the /lib/cpp and /usr/bin/cc wrappers gen_wrapper() { cat > $1 << END -#!/bin/sh +#! @SHELL@ $2 "\$@" END Index: bin/ebuild-functions.sh =================================================================== RCS file: /cvsroot/portage/bin/ebuild-functions.sh,v retrieving revision 1.1.1.3 retrieving revision 1.6 diff -u -r1.1.1.3 -r1.6 --- bin/ebuild-functions.sh 29 Mar 2005 08:53:32 -0000 1.1.1.3 +++ bin/ebuild-functions.sh 29 Mar 2005 08:56:00 -0000 1.6 @@ -1,8 +1,8 @@ -#!/bin/bash +#! @BASH@ # ebuild-functions.sh; ebuild env functions, saved with the ebuild (not specific to the portage version). # Copyright 2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -$Header: /cvsroot/portage/bin/ebuild-functions.sh,v 1.1.1.3 2005/03/29 08:53:32 haubi Exp $ +$Header: /cvsroot/portage/bin/ebuild-functions.sh,v 1.6 2005/03/29 08:56:00 haubi Exp $ use() { if useq ${1}; then @@ -74,11 +74,11 @@ ECONF_SOURCE="${ECONF_SOURCE:-.}" if [ -x "${ECONF_SOURCE}/configure" ]; then if hasq autoconfig $FEATURES && ! hasq autoconfig $RESTRICT; then - if [ -e /usr/share/gnuconfig/ ]; then + if [ -e @prefix@/share/gnuconfig/ ]; then local x for x in $(find ${WORKDIR} -type f -name config.guess -o -name config.sub); do - echo " * econf: updating ${x/${WORKDIR}\/} with /usr/share/gnuconfig/${x##*/}" - cp -f "/usr/share/gnuconfig/${x##*/}" "${x}" + echo " * econf: updating ${x/${WORKDIR}\/} with @prefix@/share/gnuconfig/${x##*/}" + cp -f "@prefix@/share/gnuconfig/${x##*/}" "${x}" done fi fi @@ -105,7 +105,7 @@ CONF_PREFIX=${pref} [ "${CONF_PREFIX:0:1}" != "/" ] && CONF_PREFIX="/${CONF_PREFIX}" else - CONF_PREFIX="/usr" + CONF_PREFIX="${PREFIX}" fi export CONF_PREFIX [ "${CONF_LIBDIR:0:1}" != "/" ] && CONF_LIBDIR="/${CONF_LIBDIR}" @@ -123,25 +123,26 @@ EECONF_CACHE="--cache-file=${T}/local_cache" fi echo "${ECONF_SOURCE}/configure" \ - --prefix=/usr \ + --prefix=${PREFIX} \ --host=${CHOST} \ - --mandir=/usr/share/man \ - --infodir=/usr/share/info \ - --datadir=/usr/share \ - --sysconfdir=/etc \ - --localstatedir=/var/lib \ + --mandir=${PREFIX}/share/man \ + --infodir=${PREFIX}/share/info \ + --datadir=${PREFIX}/share \ + --sysconfdir=/${AFFIX}etc \ + --localstatedir=/${AFFIX}var/lib \ ${EXTRA_ECONF} \ ${EECONF_CACHE} \ "$@" if ! "${ECONF_SOURCE}/configure" \ --prefix=/usr \ + --prefix=${PREFIX} \ --host=${CHOST} \ - --mandir=/usr/share/man \ - --infodir=/usr/share/info \ - --datadir=/usr/share \ - --sysconfdir=/etc \ - --localstatedir=/var/lib \ + --mandir=${PREFIX}/share/man \ + --infodir=${PREFIX}/share/info \ + --datadir=${PREFIX}/share \ + --sysconfdir=/${AFFIX}etc \ + --localstatedir=/${AFFIX}var/lib \ ${EXTRA_ECONF} \ ${EECONF_CACHE} \ "$@" ; then @@ -188,21 +189,21 @@ if [ -f ./[mM]akefile -o -f ./GNUmakefile ] ; then if [ ! -z "${PORTAGE_DEBUG}" ]; then - make -n prefix=${D}/usr \ - datadir=${D}/usr/share \ - infodir=${D}/usr/share/info \ - localstatedir=${D}/var/lib \ - mandir=${D}/usr/share/man \ - sysconfdir=${D}/etc \ + make -n prefix=${D}${PREFIX} \ + datadir=${D}${PREFIX}/share \ + infodir=${D}${PREFIX}/share/info \ + localstatedir=${D}${AFFIX}var/lib \ + mandir=${D}${PREFIX}/share/man \ + sysconfdir=${D}${AFFIX}etc \ ${EXTRA_EINSTALL} \ "$@" install fi - make prefix=${D}/usr \ - datadir=${D}/usr/share \ - infodir=${D}/usr/share/info \ - localstatedir=${D}/var/lib \ - mandir=${D}/usr/share/man \ - sysconfdir=${D}/etc \ + make prefix=${D}${PREFIX} \ + datadir=${D}${PREFIX}/share \ + infodir=${D}${PREFIX}/share/info \ + localstatedir=${D}${AFFIX}var/lib \ + mandir=${D}${PREFIX}/share/man \ + sysconfdir=${D}${AFFIX}etc \ ${EXTRA_EINSTALL} \ "$@" install || die "einstall failed" else @@ -324,8 +325,8 @@ export DOCDESTTREE="" else export DOCDESTTREE="$1" - if [ ! -d "${D}usr/share/doc/${PF}/${DOCDESTTREE}" ]; then - install -d "${D}usr/share/doc/${PF}/${DOCDESTTREE}" + if [ ! -d "${D}${PREFIX}/share/doc/${PF}/${DOCDESTTREE}" ]; then + install -d "${D}${PREFIX}/share/doc/${PF}/${DOCDESTTREE}" fi fi } Index: bin/ebuild.sh =================================================================== RCS file: /cvsroot/portage/bin/ebuild.sh,v retrieving revision 1.1.1.1 retrieving revision 1.5 diff -u -r1.1.1.1 -r1.5 --- bin/ebuild.sh 4 Mar 2005 10:29:00 -0000 1.1.1.1 +++ bin/ebuild.sh 25 Mar 2005 09:41:48 -0000 1.5 @@ -1,8 +1,8 @@ -#!/bin/bash +#! @BASH@ # ebuild.sh; ebuild phase processing, env handling # Copyright 2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -$Header: /cvsroot/portage/bin/ebuild.sh,v 1.1.1.1 2005/03/04 10:29:00 haubi Exp $ +$Header: /cvsroot/portage/bin/ebuild.sh,v 1.5 2005/03/25 09:41:48 haubi Exp $ # general phase execution path- # execute_phases is called, which sets EBUILD_PHASE, and then depending on the phase, @@ -23,7 +23,7 @@ # readonly. This limits users, but also helps to ensure that reloaded envs from older portages don't # overwrite an internal ebd.sh function that has since changed. -ORIG_VARS=`declare | egrep '^[^[:space:]{}()]+=' | cut -s -d '=' -f 1` +ORIG_VARS=`declare | @EGREP@ '^[^[:space:]{}()]+=' | cut -s -d '=' -f 1` ORIG_FUNCS=`declare -F | cut -s -d ' ' -f 3` DONT_EXPORT_FUNCS='portageq speak' DONT_EXPORT_VARS="ORIG_VARS GROUPS ORIG_FUNCS FUNCNAME DAEMONIZED CCACHE.* DISTCC.* AUTOCLEAN CLEAN_DELAY SYNC @@ -38,7 +38,7 @@ # knock the sandbox vars back to the defaults. reset_sandbox() { export SANDBOX_ON="1" - export SANDBOX_PREDICT="${SANDBOX_PREDICT:+${SANDBOX_PREDICT}:}/proc/self/maps:/dev/console:/usr/lib/portage/pym:/dev/random" + export SANDBOX_PREDICT="${SANDBOX_PREDICT:+${SANDBOX_PREDICT}:}/proc/self/maps:/dev/console:${PORTAGE_BASE}/pym:/dev/random" export SANDBOX_WRITE="${SANDBOX_WRITE:+${SANDBOX_WRITE}:}/dev/shm:${PORTAGE_TMPDIR}" export SANDBOX_READ="${SANDBOX_READ:+${SANDBOX_READ}:}/dev/shm:${PORTAGE_TMPDIR}" } @@ -177,18 +177,18 @@ echo "reinstate_loaded_env_attributes ()" echo "{" - x=$(export | get_vars | egrep -v "$(gen_filter ${DONT_EXPORT_VARS} f x y)$") + x=$(export | get_vars | @EGREP@ -v "$(gen_filter ${DONT_EXPORT_VARS} f x y)$") [ ! -z "$x" ] && echo " export `echo $x`" - x=$(readonly | get_vars | egrep -v "$(gen_filter ${DONT_EXPORT_VARS} f x y)") + x=$(readonly | get_vars | @EGREP@ -v "$(gen_filter ${DONT_EXPORT_VARS} f x y)") [ ! -z "$x" ] && echo " readonly `echo $x`" - x=$(declare -i | get_vars | egrep -v "$(gen_filter ${DONT_EXPORT_VARS} f x y)") + x=$(declare -i | get_vars | @EGREP@ -v "$(gen_filter ${DONT_EXPORT_VARS} f x y)") [ ! -z "$x" ] && echo " declare -i `echo $x`" - declare -F | egrep "^declare -[aFfirtx]+ $(gen_filter ${f} )\$" | egrep -v "^declare -f " + declare -F | @EGREP@ "^declare -[aFfirtx]+ $(gen_filter ${f} )\$" | @EGREP@ -v "^declare -f " shopt -p echo " unset reinstate_loaded_env_attributes" echo "}" @@ -252,7 +252,7 @@ local SANDBOX_STATE=$SANDBOX_ON local EBUILD_PHASE=$EBUILD_PHASE SANDBOX_ON=0 - SANDBOX_READ="/bin:${SANDBOX_READ}:/dev/urandom:/dev/random:/usr/lib/portage/bin/" + SANDBOX_READ="/bin:${SANDBOX_READ}:/dev/urandom:/dev/random:${PORTAGE_BASE}/bin/" SANDBOX_ON=$SANDBOX_STATE if [ ! -z $DEBUGGING ]; then @@ -281,7 +281,7 @@ eval "$({ [ "${src%.bz2}" != "${src}" ] && bzcat "$src" || cat "${src}" } | filter-env -v $(convert_filter ${DONT_EXPORT_VARS}) \ -f $(convert_filter ${DONT_EXPORT_FUNCS}) )" -# } | egrep -v "^$(gen_filter $DONT_EXPORT_VARS)=")" +# } | @EGREP@ -v "^$(gen_filter $DONT_EXPORT_VARS)=")" else echo "ebuild=${EBUILD}, phase $EBUILD_PHASE" >&2 return 1 @@ -321,8 +321,7 @@ OCC="$CC" OCXX="$CXX" - - export PATH="/sbin:/usr/sbin:/usr/lib/portage/bin:/bin:/usr/bin${ROOTPATH:+:${ROOTPATH}}" + export PATH="/@affix@sbin:@prefix@/sbin:/sbin:/usr/sbin:${PORTAGE_BASE}/bin:/@affix@bin:@prefix@/bin:/bin:/usr/bin${ROOTPATH:+:${ROOTPATH}}" if [ "${EBUILD_PHASE}" == "setup" ]; then #we specifically save the env so it's not stomped on by sourcing. #bug 51552 @@ -330,7 +329,7 @@ if [ "$USERLAND" == "GNU" ]; then local PORTAGE_SHIFTED_PATH="$PATH" - source /etc/profile.env &>/dev/null + source /@affix@etc/profile.env &>/dev/null PATH="${PORTAGE_SHIFTED_PATH:+${PORTAGE_SHIFTED_PATH}}${PATH:+:${PATH}}" fi #shift path. I don't care about 51552, I'm not using the env's supplied path, alright? :) @@ -354,7 +353,7 @@ [ ! -z "$PREROOTPATH" ] && export PATH="${PREROOTPATH%%:}:$PATH" - export DESTTREE=/usr + export DESTTREE=${PREFIX} export INSDESTTREE="" export EXEDESTTREE="" export DOCDESTTREE="" @@ -366,7 +365,7 @@ # if daemonized, it's already loaded these funcs. if [ "$DAEMONIZED" != "yes" ]; then - source "/usr/lib/portage/bin/ebuild-functions.sh" || die "failed sourcing ebuild-functions.sh" + source "${PORTAGE_BASE}/bin/ebuild-functions.sh" || die "failed sourcing ebuild-functions.sh" fi SANDBOX_ON="1" export S=${WORKDIR}/${P} @@ -435,8 +434,8 @@ # echo "DONT_EXPORT_FUNCS=$DONT_EXPORT_FUNCS" >&2 } -source "/usr/lib/portage/bin/ebuild-default-functions.sh" || die "failed sourcing ebuild-default-functions.sh" -source "/usr/lib/portage/bin/isolated-functions.sh" || die "failed sourcing stripped down functions.sh" +source "${PORTAGE_BASE}/bin/ebuild-default-functions.sh" || die "failed sourcing ebuild-default-functions.sh" +source "${PORTAGE_BASE}/bin/isolated-functions.sh" || die "failed sourcing stripped down functions.sh" # general func to call for phase execution. this handles necessary env loading/dumping, and executing pre/post/dyn # calls. @@ -509,7 +508,7 @@ setup) #pkg_setup needs to be out of the sandbox for tmp file creation; #for example, awking and piping a file in /tmp requires a temp file to be created - #in /etc. If pkg_setup is in the sandbox, both our lilo and apache ebuilds break. + #in /@affix@etc. If pkg_setup is in the sandbox, both our lilo and apache ebuilds break. export SANDBOX_ON="0" @@ -531,7 +530,15 @@ [ "$PORTAGE_DEBUG" == "1" ] && set +x if hasq distcc ${FEATURES} &>/dev/null; then - if [ -d /usr/lib/distcc/bin ]; then + if [ -d @prefix@/lib/distcc/bin ]; then + #We can enable distributed compile support + if [ -z "${PATH/*distcc*/}" ]; then + # Remove the other reference. + remove_path_entry "distcc" + fi + export PATH="@prefix@/lib/distcc/bin:${PATH}" + [ ! -z "${DISTCC_LOG}" ] && addwrite "$(dirname ${DISTCC_LOG})" + elif [ -d /usr/lib/distcc/bin ]; then #We can enable distributed compile support if [ -z "${PATH/*distcc*/}" ]; then # Remove the other reference. @@ -552,7 +559,11 @@ remove_path_entry "ccache" fi - if [ -d /usr/lib/ccache/bin ]; then + if [ -d @prefix@/lib/ccache/bin ]; then + export PATH="@prefix@/lib/ccache/bin:${PATH}" + elif [ -d @prefix@/bin/ccache ]; then + export PATH="@prefix@/bin/ccache:${PATH}" + elif [ -d /usr/lib/ccache/bin ]; then export PATH="/usr/lib/ccache/bin:${PATH}" elif [ -d /usr/bin/ccache ]; then export PATH="/usr/bin/ccache:${PATH}" @@ -691,7 +702,7 @@ if [ -z "${ORIG_VARS}" ]; then DONT_EXPORT_VARS="${DONT_EXPORT_VARS} ${f}" else - DONT_EXPORT_VARS="${DONT_EXPORT_VARS} $(echo "${f}" | egrep -v "^`gen_filter ${ORIG_VARS}`\$")" + DONT_EXPORT_VARS="${DONT_EXPORT_VARS} $(echo "${f}" | @EGREP@ -v "^`gen_filter ${ORIG_VARS}`\$")" fi unset f @@ -703,7 +714,7 @@ set +f export XARGS -if [ "$(id -nu)" == "portage" ] ; then +if [ "$(@XCU_ID@ -nu)" == "portage" ] ; then export USER=portage fi set +H -h Index: bin/emake =================================================================== RCS file: /cvsroot/portage/bin/emake,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- bin/emake 4 Mar 2005 10:29:00 -0000 1.1.1.1 +++ bin/emake 9 Mar 2005 16:16:27 -0000 1.2 @@ -1,7 +1,7 @@ -#!/bin/bash +#! @BASH@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /cvsroot/portage/bin/emake,v 1.1.1.1 2005/03/04 10:29:00 haubi Exp $ +# $Header: /cvsroot/portage/bin/emake,v 1.2 2005/03/09 16:16:27 haubi Exp $ # # emake: Supplies some default parameters to GNU make. At the moment the # only parameter supplied is -jN, where N is a number of Index: bin/emerge =================================================================== RCS file: /cvsroot/portage/bin/emerge,v retrieving revision 1.1.1.3 retrieving revision 1.3 diff -u -r1.1.1.3 -r1.3 --- bin/emerge 9 Mar 2005 13:50:23 -0000 1.1.1.3 +++ bin/emerge 19 Mar 2005 20:55:23 -0000 1.3 @@ -1,13 +1,14 @@ -#!/usr/bin/python -O +#! @PYTHON@ -O # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /cvsroot/portage/bin/emerge,v 1.1.1.3 2005/03/09 13:50:23 haubi Exp $ +# $Header: /cvsroot/portage/bin/emerge,v 1.3 2005/03/19 20:55:23 haubi Exp $ import os,sys os.environ["PORTAGE_CALLER"]="emerge" -sys.path = ["/usr/lib/portage/pym"]+sys.path +sys.path = ["@PORTAGE_BASE@/pym"]+sys.path -import portage +import portage_const, portage +from portage_const import MYROOT,ROOT,VDB_PATH,WORLD_FILE import random import emergehelp,xpak,string,re,commands,time,shutil,traceback,atexit,signal,socket,types @@ -391,9 +392,9 @@ print print red("*** --inject has been deprecated.") print red("*** If you manage a piece of software yourself, add it's name and") - print red("*** version (eg foo/bar-1.0) to /etc/portage/profile/package.provided.") + print red("*** version (eg foo/bar-1.0) to "+MYROOT(CUSTOM_PROFILE_PATH+"/package.provided")+".") print red("*** If you want to prevent portage from upgrading a package, add it to") - print red("*** /etc/portage/package.mask prepending it with '>' (eg >foo/bar-1.0)") + print red("*** "+MYROOT(USER_CONFIG_PATH+"/package.mask")+" prepending it with '>' (eg >foo/bar-1.0)") print red("*** For more information on fine-grained portage control, please see") print red("*** the portage man page.") print @@ -406,12 +407,12 @@ xtermTitle(mystr) try: #seems odd opening a file each write... - if not os.path.exists("/var/log/emerge.log"): - mylogfile=open("/var/log/emerge.log", "w") - os.chmod("/var/log/emerge.log", S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP) - os.chown("/var/log/emerge.log", portage.portage_uid, portage.portage_gid) + if not os.path.exists(MYROOT("var/log/emerge.log")): + mylogfile=open(MYROOT("var/log/emerge.log"), "w") + os.chmod(MYROOT("var/log/emerge.log"), S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP) + os.chown(MYROOT("var/log/emerge.log"), portage.portage_uid, portage.portage_gid) else: - mylogfile=open("/var/log/emerge.log", "a") + mylogfile=open(MYROOT("var/log/emerge.log"), "a") l=portage_locks.lockfile(mylogfile) # seek because we may have gotten held up by the lock. @@ -473,13 +474,13 @@ return: the current in-use gcc version """ - gcc_env_dir = os.path.join('/', 'etc', 'env.d', 'gcc') + gcc_env_dir = os.path.join(MYROOT(), 'etc', 'env.d', 'gcc') gcc_config_config = os.path.join(gcc_env_dir, 'config') gcc_ver_command = 'gcc -dumpversion' gcc_ver_prefix = 'gcc-' gcc_not_found_error = red( - "!!! No gcc found. You probably need to 'source /etc/profile'\n" + + "!!! No gcc found. You probably need to 'source "+MYROOT("etc/profile")+"'\n" + "!!! to update the environment of this terminal and possibly\n" + "!!! other terminals also." ) @@ -534,7 +535,7 @@ def getportageversion(): try: import re - profilever = os.path.normpath("///"+os.readlink("/etc/make.profile")) + profilever = os.path.normpath("///"+os.readlink(MYROOT("etc/make.profile"))) basepath = os.path.normpath("///"+portage.settings["PORTDIR"]+"/profiles") if re.match(basepath,profilever): profilever = profilever[len(basepath)+1:] @@ -546,8 +547,8 @@ except: profilever="unavailable" libcver=[] - libclist = portage.vardbapi(portage.root).match("virtual/libc") - libclist += portage.vardbapi(portage.root).match("virtual/glibc") + libclist = portage.vardbapi(ROOT).match("virtual/libc") + libclist += portage.vardbapi(ROOT).match("virtual/glibc") libclist = portage_util.unique_array(libclist) for x in libclist: xs=portage_versions.catpkgsplit(x) @@ -658,7 +659,7 @@ """Searches the available and installed packages for the supplied search key. The list of available and installed packages is created at object instantiation. This makes successive searches faster.""" - self.installcache = portage.db["/"]["vartree"] + self.installcache = portage.db[MYROOT()]["vartree"] def execute(self,searchkey): """Performs the search for the supplied search key""" @@ -752,7 +753,7 @@ mycat = match.split("/")[0] mypkg = match.split("/")[1] - mydigest = portage.db["/"]["porttree"].dbapi.finddigest(mycat+"/"+mypkg + "-" + myversion) + mydigest = portage.db[MYROOT()]["porttree"].dbapi.finddigest(mycat+"/"+mypkg + "-" + myversion) try: myfile = open(mydigest,"r") @@ -828,7 +829,7 @@ mylines=portage.settings.packages elif mode=="world": try: - myfile=open(portage.root+portage.WORLD_FILE,"r") + myfile=open(ROOT(WORLD_FILE),"r") mylines=myfile.readlines() myfile.close() except OSError: @@ -864,7 +865,8 @@ global olddbapi self.pkgsettings = portage.config(clone=portage.settings) if not self.pkgsettings["ARCH"]: - portage.writemsg(red("\a!!! ARCH is not set... Are you missing the /etc/make.profile symlink?\n")) + portage.writemsg(red("\a!!! ARCH is not set... Are you missing the " + +MYROOT("etc/make.profile")+" symlink?\n")) portage.writemsg(red("\a!!! Is the symlink correct? Is your portage tree complete?\n\n")) sys.exit(9) self.applied_useflags = {} @@ -875,18 +877,18 @@ self.orderedkeys=[] self.outdatedpackages=[] self.mydbapi={} - self.mydbapi["/"] = portage.fakedbapi() + self.mydbapi[MYROOT()] = portage.fakedbapi() if "empty" not in myparams: - for pkg in portage.db["/"]["vartree"].getallcpv(): - self.mydbapi["/"].cpv_inject(pkg) - if portage.root != "/": - self.mydbapi[portage.root] = portage.fakedbapi() + for pkg in portage.db[MYROOT()]["vartree"].getallcpv(): + self.mydbapi[MYROOT()].cpv_inject(pkg) + if ROOT() != MYROOT(): + self.mydbapi[ROOT()] = portage.fakedbapi() if "empty" not in myparams: - for pkg in portage.db[portage.root]["vartree"].getallcpv(): - self.mydbapi[portage.root].cpv_inject(pkg) + for pkg in portage.db[ROOT()]["vartree"].getallcpv(): + self.mydbapi[ROOT()].cpv_inject(pkg) if "--usepkg" in myopts: - portage.db["/"]["bintree"].populate(("--getbinpkg" in myopts), ("--getbinpkgonly" in myopts)) + portage.db[MYROOT()]["bintree"].populate(("--getbinpkg" in myopts), ("--getbinpkgonly" in myopts)) def create(self,mybigkey,myparent=None,addme=1,myuse=None): """creates the actual digraph of packages to merge. return 1 on success, 0 on failure @@ -898,7 +900,9 @@ #"no downgrade" emerge #print "mybigkey:",mybigkey - jbigkey=" ".join(mybigkey) + jbigkey="" + for k in mybigkey: + jbigkey=jbigkey+" "+str(k) if self.mynewgraph.has_node(jbigkey+" merge") or self.mynewgraph.has_node(jbigkey+" nomerge"): if myparent: if self.mynewgraph.has_node(jbigkey+" merge"): @@ -913,16 +917,19 @@ mytype,myroot,mykey=mybigkey # select the correct /var database that we'll be checking against - vardbapi=portage.db[myroot]["vartree"].dbapi + vardbapi=portage.db[myroot()]["vartree"].dbapi if addme: if mytype=="blocks": # we've encountered a "blocks" node. We will totally ignore this # node and not add it to our digraph if it doesn't apply to us. - if myparent and (self.mydbapi[myroot].match(mykey) or vardbapi.match(mykey)): + if myparent and (self.mydbapi[myroot()].match(mykey) or vardbapi.match(mykey)): mybigkey.append(myparent.split()[2]) - self.mynewgraph.add_node(" ".join(mybigkey)) - self.mynewgraph.add_relationship(myparent, " ".join(mybigkey)) + jbigkey="" + for k in mybigkey: + jbigkey=jbigkey+" "+str(k) + self.mynewgraph.add_node(jbigkey) + self.mynewgraph.add_relationship(myparent, jbigkey) return 1 if myuse == None: @@ -963,9 +970,12 @@ # whatever the case, we need to add the node to our digraph so # that children can depend upon it. - self.mynewgraph.add_node(" ".join(mybigkey)) + jbigkey="" + for k in mybigkey: + jbigkey=jbigkey+" "+str(k) + self.mynewgraph.add_node(jbigkey) if myparent: - self.mynewgraph.add_relationship(myparent, " ".join(mybigkey)) + self.mynewgraph.add_relationship(myparent, jbigkey) if ("deep" not in myparams) and (not merging): return 1 elif "recurse" not in myparams: @@ -975,19 +985,19 @@ if mytype=="binary": mypkgparts=portage_versions.catpkgsplit(mykey) tbz2name = mykey.split("/")[1]+".tbz2" - if tbz2name in portage.db[portage.root]["bintree"].invalids: + if tbz2name in portage.db[ROOT()]["bintree"].invalids: sys.stderr.write("\nINVALID PACKAGE (is required to continue): "+str(mykey)+"\n") sys.exit(1) - if portage.db[portage.root]["bintree"].isremote(mykey): - edepend = portage.db[portage.root]["bintree"].remotepkgs[tbz2name] + if portage.db[ROOT()]["bintree"].isremote(mykey): + edepend = portage.db[ROOT()]["bintree"].remotepkgs[tbz2name] edepend["DEPEND"] ="" edepend["RDEPEND"]=" ".join(edepend["RDEPEND"].split()) edepend["PDEPEND"]=" ".join(edepend["PDEPEND"].split()) edepend["CDEPEND"]=" ".join(edepend["CDEPEND"].split()) edepend["SLOT"] =edepend["SLOT"].strip() - #portage.db[portage.root]["bintree"].gettbz2(mykey) + #portage.db[ROOT()]["bintree"].gettbz2(mykey) else: # It's local. - mytbz2=xpak.tbz2(portage.db[portage.root]["bintree"].getname(mykey)) + mytbz2=xpak.tbz2(portage.db[ROOT()]["bintree"].getname(mykey)) edepend["DEPEND"] ="" edepend["RDEPEND"]=" ".join(mytbz2.getelements("RDEPEND")) edepend["PDEPEND"]=" ".join(mytbz2.getelements("PDEPEND")) @@ -1003,18 +1013,20 @@ print "emerge: create(): aux_get() error on",mykey+"; aborting..." sys.exit(1) mydep={} - mp=" ".join(mybigkey) - - if myroot=="/": - mydep["/"]=edepend["DEPEND"]+" "+edepend["RDEPEND"] - if not self.select_dep("/",mydep["/"],myparent=mp,myuse=myuse): + mp="" + for k in mybigkey: + mp=mp+" "+str(k) + + if myroot()==MYROOT(): + mydep[MYROOT()]=edepend["DEPEND"]+" "+edepend["RDEPEND"] + if not self.select_dep(MYROOT,mydep[MYROOT()],myparent=mp,myuse=myuse): return 0 else: - mydep["/"]=edepend["DEPEND"] - mydep[myroot]=edepend["RDEPEND"] - if not self.select_dep("/",mydep["/"],myparent=mp,myuse=myuse): + mydep[MYROOT()]=edepend["DEPEND"] + mydep[myroot()]=edepend["RDEPEND"] + if not self.select_dep(MYROOT,mydep[MYROOT()],myparent=mp,myuse=myuse): return 0 - if not self.select_dep(myroot,mydep[myroot],myparent=mp,myuse=myuse): + if not self.select_dep(myroot,mydep[myroot()],myparent=mp,myuse=myuse): return 0 if edepend.has_key("PDEPEND") and edepend["PDEPEND"]: @@ -1041,30 +1053,30 @@ sys.exit(1) mytbz2=xpak.tbz2(x) mykey=mytbz2.getelements("CATEGORY")[0]+"/"+os.path.basename(x)[:-5] - if os.path.realpath(portage.db["/"]["bintree"].getname(mykey)) != os.path.realpath(x): + if os.path.realpath(portage.db[MYROOT()]["bintree"].getname(mykey)) != os.path.realpath(x): print red("\n*** You need to adjust PKGDIR to emerge this package.\n") sys.exit(1) - if not self.create(["binary",portage.root,mykey],None,"--onlydeps" not in myopts): + if not self.create(["binary",ROOT,mykey],None,"--onlydeps" not in myopts): return (0,myfavorites) elif not "--oneshot" in myopts: myfavorites.append(mykey) elif x[-7:]==".ebuild": x = os.path.realpath(x) mykey=os.path.basename(os.path.normpath(x+"/../.."))+"/"+os.path.basename(x)[:-7] - ebuild_path = portage.db["/"]["porttree"].dbapi.findname(mykey) + ebuild_path = portage.db[MYROOT()]["porttree"].dbapi.findname(mykey) if ebuild_path: if os.path.realpath(ebuild_path) != x: print red("\n*** You need to adjust PORTDIR or PORTDIR_OVERLAY to emerge this package.\n") sys.exit(1) - if mykey not in portage.db["/"]["porttree"].dbapi.xmatch("match-visible", portage.portage_dep.dep_getkey(mykey)): + if mykey not in portage.db[MYROOT()]["porttree"].dbapi.xmatch("match-visible", portage.portage_dep.dep_getkey(mykey)): print red("\n*** You are emerging a masked package. It is MUCH better to use") - print red("*** /etc/portage/package.* to accomplish this. See portage(5) man") + print red("*** "+MYROOT(USER_CONFIG_PATH+"/")+"package.* to accomplish this. See portage(5) man") print red("*** page for details.") countdown(EMERGE_WARNING_DELAY, "Continuing...") else: print red("\n*** "+x+" does not exist") sys.exit(1) - if not self.create(["ebuild",portage.root,mykey],None,"--onlydeps" not in myopts): + if not self.create(["ebuild",ROOT,mykey],None,"--onlydeps" not in myopts): return (0,myfavorites) elif not "--oneshot" in myopts: myfavorites.append(mykey) @@ -1085,7 +1097,7 @@ sys.stderr.flush() try: - self.mysd = self.select_dep(portage.root,mykey,arg=x) + self.mysd = self.select_dep(ROOT,mykey,arg=x) except portage_exception.MissingSignature, e: portage.writemsg("\n\n!!! A missing gpg signature is preventing portage from calculating the\n") portage.writemsg("!!! required dependencies. This is a security feature enabled by the admin\n") @@ -1129,14 +1141,14 @@ def is_newer_ver_installed(self,myroot,pkg,pkgver): "if there is a version of pkg installed newer than pkgver, return it" - vardbapi=portage.db[myroot]["vartree"].dbapi + vardbapi=portage.db[myroot()]["vartree"].dbapi - matches=portage.db[myroot]["vartree"].dbapi.match(pkg) + matches=portage.db[myroot()]["vartree"].dbapi.match(pkg) if matches: - myslot=portage.db["/"]["porttree"].getslot(pkgver) + myslot=portage.db[MYROOT()]["porttree"].getslot(pkgver) for match in matches: if portage_versions.pkgcmp(portage_versions.catpkgsplit(pkgver)[1:], portage_versions.catpkgsplit(match)[1:]) < 0: - curslot=portage.db[myroot]["vartree"].getslot(match) + curslot=portage.db[myroot()]["vartree"].getslot(match) if curslot == myslot: return match @@ -1148,8 +1160,8 @@ print "Depstring:",depstring if not arg: #processing dependencies - mycheck=portage.dep_check(depstring,self.mydbapi[myroot],self.pkgsettings,myuse=myuse,use_binaries=("--usepkg" in myopts)) - #mycheck=portage.dep_check(depstring,self.mydbapi[myroot],self.pkgsettings,myuse=myuse) + mycheck=portage.dep_check(depstring,self.mydbapi[myroot()],self.pkgsettings,myuse=myuse,use_binaries=("--usepkg" in myopts)) + #mycheck=portage.dep_check(depstring,self.mydbapi[myroot()],self.pkgsettings,myuse=myuse) if not mycheck[0]: mymerge=[] @@ -1167,11 +1179,11 @@ if myparent: myp = myparent.split() if myp[3]=="merge": - self.mydbapi[myroot].cpv_inject(myp[2]) + self.mydbapi[myroot()].cpv_inject(myp[2]) if myp[0]=="binary": - self.pkgsettings.setinst(myp[2],portage.db["/"]["bintree"].dbapi) + self.pkgsettings.setinst(myp[2],portage.db[MYROOT()]["bintree"].dbapi) else: - self.pkgsettings.setinst(myp[2],portage.db[myroot]["porttree"].dbapi) + self.pkgsettings.setinst(myp[2],portage.db[myroot()]["porttree"].dbapi) if not mymerge: return 1 @@ -1202,7 +1214,7 @@ if ("--usepkg" in myopts): # The next line assumes the binarytree has been populated. # XXX: Need to work out how we use the binary tree with roots. - myeb_pkg_matches=portage.db["/"]["bintree"].dbapi.match(x) + myeb_pkg_matches=portage.db[MYROOT()]["bintree"].dbapi.match(x) if ("--usepkgonly" not in myopts): # Remove any binary package entries that are masked in the portage tree (#55871) for idx in range(len(myeb_pkg_matches)-1,-1,-1): @@ -1281,7 +1293,7 @@ if myeb: myk=["ebuild",myroot,myeb] elif myeb_pkg: - binpkguseflags=portage.db[portage.root]["bintree"].get_use(myeb_pkg) + binpkguseflags=portage.db[ROOT()]["bintree"].get_use(myeb_pkg) myk=["binary",myroot,myeb_pkg] else: sys.stderr.write("!!! Confused... Don't know what I'm using for dependency info. :(\n") @@ -1289,7 +1301,7 @@ #if "--usepkg" in myopts: # #If we want to use packages, see if we have a pre-built one... - # mypk=portage.db["/"]["bintree"].dbapi.match(x) + # mypk=portage.db[MYROOT()]["bintree"].dbapi.match(x) # if myeb in mypk: # #Use it only if it's exactly the version we want. # myk=["binary",myroot,myeb] @@ -1314,7 +1326,7 @@ def altlist(self): mygraph=self.mynewgraph.clone() - dolist=["/"] + dolist=[MYROOT()] retlist=[] for x in portage.db: portage.db[x]["merge"]=[] @@ -1323,7 +1335,8 @@ while mygraph.get_all_nodes(): mycurkey=mygraph.get_leaf_nodes()[0] splitski=mycurkey.split() - portage.db[splitski[1]]["merge"].append(splitski) + splitski[1] = portage_const.find_root_instance(splitski[1]) + portage.db[splitski[1]()]["merge"].append(splitski) mygraph.remove_node(mycurkey) for x in dolist: for y in portage.db[x]["merge"]: @@ -1345,9 +1358,9 @@ #actually installed -- this prevents the remerging of already unmerged packages when we do a world --update; #actually available -- this prevents emerge from bombing out due to no match being found (we want a silent ignore) if "empty" in myparams: - if portage.db["/"]["vartree"].dbapi.match(x): + if portage.db[MYROOT()]["vartree"].dbapi.match(x): sysdict[x]=worlddict[x] - elif portage.db[portage.root]["vartree"].dbapi.match(x): + elif portage.db[ROOT()]["vartree"].dbapi.match(x): #package is installed sysdict[x]=worlddict[x] else: @@ -1361,7 +1374,7 @@ continue if "--upgradeonly" in myopts: - cand=self.is_newer_ver_installed(portage.root,mydep,myeb) + cand=self.is_newer_ver_installed(ROOT,mydep,myeb) if cand: myeb=cand @@ -1369,20 +1382,20 @@ #if mydep2[0]=="!":, etc. binpkguseflags = None if "--usepkg" in myopts: - mypk=portage.db[portage.root]["bintree"].dep_bestmatch(mydep) + mypk=portage.db[ROOT()]["bintree"].dep_bestmatch(mydep) if myeb==mypk: - myk=["binary",portage.root,mypk] - binpkguseflags=portage.db[portage.root]["bintree"].get_use(mypk) + myk=["binary",ROOT,mypk] + binpkguseflags=portage.db[ROOT()]["bintree"].get_use(mypk) elif "--usepkgonly" in myopts: if not mypk: self.missingbins += [myeb] - myk=["binary",portage.root,myeb] + myk=["binary",ROOT,myeb] else: - myk=["binary",portage.root,mypk] + myk=["binary",ROOT,mypk] else: - myk=["ebuild",portage.root,myeb] + myk=["ebuild",ROOT,myeb] else: - myk=["ebuild",portage.root,myeb] + myk=["ebuild",ROOT,myeb] if not self.create(myk,myuse=binpkguseflags): print @@ -1392,13 +1405,13 @@ return 0 return 1 - def match(self,mydep,myroot=portage.root,mykey=None): + def match(self,mydep,myroot=ROOT,mykey=None): # support mutual exclusive deps if mydep[0]=="!": #add our blocker; it will be ignored later if necessary (if we are remerging the same pkg, for example) myk="blocks "+myroot+" "+mydep[1:] else: - myeb=portage.db[portage.root]["porttree"].dep_bestmatch(mydep) + myeb=portage.db[ROOT()]["porttree"].dep_bestmatch(mydep) if not myeb: if not mykey: print "\n!!! Error: couldn't find match for",mydep @@ -1408,13 +1421,13 @@ sys.exit(1) if "--usepkg" in myopts: - mypk=portage.db[portage.root]["bintree"].dep_bestmatch(mydep) + mypk=portage.db[ROOT()]["bintree"].dep_bestmatch(mydep) if myeb==mypk: - myk="binary "+portage.root+" "+mypk + myk="binary "+ROOT()+" "+mypk else: - myk="ebuild "+myroot+" "+myeb + myk="ebuild "+myroot()+" "+myeb else: - myk="ebuild "+myroot+" "+myeb + myk="ebuild "+myroot()+" "+myeb return myk @@ -1470,11 +1483,11 @@ addl=" "+yellow("R")+fetch+" " elif (not "--emptytree" in myopts) and portage.db[x[1]]["vartree"].exists_specific_cat(x[2]): if x[0] == "binary": - mynewslot=portage.db["/"]["bintree"].getslot(x[2]) + mynewslot=portage.db[MYROOT()]["bintree"].getslot(x[2]) elif x[0] == "ebuild": - mynewslot=portage.db["/"]["porttree"].getslot(x[2]) + mynewslot=portage.db[MYROOT()]["porttree"].getslot(x[2]) myoldlist=portage.db[x[1]]["vartree"].dbapi.match(portage_versions.pkgsplit(x[2])[0]) - myinslotlist=filter((lambda p: portage.db[portage.root]["vartree"].getslot(p)==mynewslot),myoldlist) + myinslotlist=filter((lambda p: portage.db[ROOT()]["vartree"].getslot(p)==mynewslot),myoldlist) if myinslotlist: myoldbest=portage.best(myinslotlist) addl=" "+fetch @@ -1491,7 +1504,7 @@ if "--changelog" in myopts: changelogs.extend(self.calc_changelog( portage.portdb.findname(x[2]), - portage.db["/"]["vartree"].dep_bestmatch('/'.join(portage_versions.catpkgsplit(x[2])[:2])), + portage.db[MYROOT()]["vartree"].dep_bestmatch('/'.join(portage_versions.catpkgsplit(x[2])[:2])), x[2] )) else: @@ -1502,7 +1515,7 @@ # iuse verbose try: if x[0] == "binary": - iuse_split = portage.db["/"]["bintree"].dbapi.aux_get(x[2],["IUSE"])[0].split() + iuse_split = portage.db[MYROOT()]["bintree"].dbapi.aux_get(x[2],["IUSE"])[0].split() elif x[0] == "ebuild": iuse_split = portage.portdb.aux_get(x[2],["IUSE"])[0].split() else: @@ -1519,9 +1532,9 @@ pkg=myoldbest else: pkg=x[2] - if portage.db["/"]["vartree"].dbapi.cpv_exists(pkg): + if portage.db[MYROOT()]["vartree"].dbapi.cpv_exists(pkg): try: - old_use=portage.db["/"]["vartree"].dbapi.aux_get(pkg, ["USE"])[0].split() + old_use=portage.db[MYROOT()]["vartree"].dbapi.aux_get(pkg, ["USE"])[0].split() except SystemExit, e: raise # Needed else can't exit except: @@ -1779,7 +1792,7 @@ del portage.mtimedb["resume"]["mergelist"][0] del mymergelist[0] else: - myfavs=portage.grabfile(portage.root+portage.WORLD_FILE) + myfavs=portage.grabfile(ROOT(WORLD_FILE)) myfavdict=genericdict(myfavs) for x in range(len(mylist)): if mylist[x][3]!="nomerge": @@ -1797,7 +1810,7 @@ myfavdict[myfavkey]=myfavkey print ">>> Recording",myfavkey,"in \"world\" favorites file..." if not "--fetchonly" in myopts: - portage.writedict(myfavdict,portage.root+portage.WORLD_FILE,writekey=0) + portage.writedict(myfavdict,ROOT(WORLD_FILE),writekey=0) portage.mtimedb["resume"]["mergelist"]=mymergelist[:] @@ -1849,7 +1862,7 @@ y=portage.portdb.findname(x[pkgindex]) if not "--pretend" in myopts: print ">>> emerge ("+str(mergecount)+" of "+str(len(mymergelist))+")",x[pkgindex],"to",x[1] - emergelog(" >>> emerge ("+str(mergecount)+" of "+str(len(mymergelist))+") "+x[pkgindex]+" to "+x[1]) + emergelog(" >>> emerge ("+str(mergecount)+" of "+str(len(mymergelist))+") "+x[pkgindex]+" to "+x[1]()) self.pkgsettings["EMERGE_FROM"] = x[0][:] self.pkgsettings.backup_changes("EMERGE_FROM") @@ -1891,8 +1904,8 @@ sys.exit(1) #dynamically update our database if "--buildpkgonly" not in myopts: - portage.db[portage.root]["bintree"].inject(x[2]) - mytbz2=portage.db[portage.root]["bintree"].getname(x[2]) + portage.db[ROOT()]["bintree"].inject(x[2]) + mytbz2=portage.db[ROOT()]["bintree"].getname(x[2]) short_msg = "emerge: ("+str(mergecount)+" of "+str(len(mymergelist))+") "+x[pkgindex]+" Merge" emergelog(" === ("+str(mergecount)+" of "+str(len(mymergelist))+") Merging ("+x[pkgindex]+"::"+y+")", short_msg=short_msg) @@ -1916,11 +1929,11 @@ #dynamically update our database elif x[0]=="binary": #merge the tbz2 - mytbz2=portage.db[portage.root]["bintree"].getname(x[2]) - if portage.db[portage.root]["bintree"].isremote(x[2]): + mytbz2=portage.db[ROOT()]["bintree"].getname(x[2]) + if portage.db[ROOT()]["bintree"].isremote(x[2]): short_msg = "emerge: ("+str(mergecount)+" of "+str(len(mymergelist))+") "+x[pkgindex]+" Fetch" emergelog(" --- ("+str(mergecount)+" of "+str(len(mymergelist))+") Fetching Binary ("+x[pkgindex]+"::"+mytbz2+")", short_msg=short_msg) - portage.db[portage.root]["bintree"].gettbz2(x[2]) + portage.db[ROOT()]["bintree"].gettbz2(x[2]) if ("--fetchonly" in myopts) or ("--fetch-all-uri" in myopts): continue @@ -1932,20 +1945,20 @@ sys.exit(1) #need to check for errors if "--buildpkgonly" not in myopts: - portage.db[x[1]]["vartree"].inject(x[2]) + portage.db[x[1]()]["vartree"].inject(x[2]) myfavkey=portage.cpv_getkey(x[2]) if (not "--fetchonly" in myopts) and (not "--fetch-all-uri" in myopts) and (myfavkey in favorites): - myfavs=portage.grabfile(myroot+portage.WORLD_FILE) + myfavs=portage.grabfile(myroot(WORLD_FILE)) myfavdict=genericdict(myfavs) mysysdict=genericdict(syslist) #don't record if already in system profile or already recorded - if ("--update" not in myopts or not portage.db[portage.root]["vartree"].dbapi.match(myfavkey)) and \ + if ("--update" not in myopts or not portage.db[ROOT()]["vartree"].dbapi.match(myfavkey)) and \ (not mysysdict.has_key(myfavkey)) and (not myfavdict.has_key(myfavkey)): #we don't have a favorites entry for this package yet; add one myfavdict[myfavkey]=myfavkey print ">>> Recording",myfavkey,"in \"world\" favorites file..." emergelog(" === ("+str(mergecount)+" of "+str(len(mymergelist))+") Updating world file ("+x[pkgindex]+")") - portage.writedict(myfavdict,myroot+portage.WORLD_FILE,writekey=0) + portage.writedict(myfavdict,myroot(WORLD_FILE),writekey=0) if ("noclean" not in portage.features) and (x[0] != "binary"): short_msg = "emerge: ("+str(mergecount)+" of "+str(len(mymergelist))+") "+x[pkgindex]+" Clean Post" @@ -2000,10 +2013,10 @@ mynewargv += [myarg] else: mynewargv += [arg] - os.execv("/usr/lib/portage/bin/emerge", mynewargv) + os.execv("@PORTAGE_BASE@/bin/emerge", mynewargv) if ("--pretend" not in myopts) and ("--fetchonly" not in myopts) and ("--fetch-all-uri" not in myopts): - emergelog(" ::: completed emerge ("+str(mergecount)+" of "+str(len(mymergelist))+") "+x[2]+" to "+x[1]) + emergelog(" ::: completed emerge ("+str(mergecount)+" of "+str(len(mymergelist))+") "+x[2]+" to "+x[1]()) # Unsafe for parallel merges del portage.mtimedb["resume"]["mergelist"][0] @@ -2022,7 +2035,7 @@ if ("--fetchonly" not in myopts) and ("--fetch-all-uri" not in myopts): if (mergecount>0): if retval: - portage.env_update(portage.root) + portage.env_update(ROOT) #by doing an exit this way, --fetchonly can continue to try to #fetch everything even if a particular download fails. @@ -2067,9 +2080,9 @@ return None if dep_type == "binary": - mynewslot=portage.db["/"]["bintree"].getslot(dep_pkg) + mynewslot=portage.db[MYROOT()]["bintree"].getslot(dep_pkg) else: - mynewslot=portage.db["/"]["porttree"].getslot(dep_pkg) + mynewslot=portage.db[MYROOT()]["porttree"].getslot(dep_pkg) mycurpkgs = portage.db[dep_root]["vartree"].dbapi.match(portage.portage_versions.pkgsplit(dep_pkg)[0]) for x in range(len(mycurpkgs)-1, -1, -1): @@ -2109,9 +2122,9 @@ else: if dep_type != "binary": - restrictions = portage.db["/"]["porttree"].dbapi.aux_get(dep_pkg, ["RESTRICT"])[0].split() + restrictions = portage.db[MYROOT()]["porttree"].dbapi.aux_get(dep_pkg, ["RESTRICT"])[0].split() if "fetch" in restrictions: - if portage.db["/"]["porttree"].dbapi.fetch_check(dep_pkg, portage.settings): + if portage.db[MYROOT()]["porttree"].dbapi.fetch_check(dep_pkg, portage.settings): problem_status = green("f") else: problem_status = red("F") @@ -2138,6 +2151,7 @@ summary += slot_status summary += update_status summary += downgrade_status+"]" + summary += "["+dep_root+"]" return summary @@ -2208,9 +2222,9 @@ return "" if dep_type == "binary": - iuse = portage.db["/"]["bintree"].dbapi.aux_get(dep_pkg,["IUSE"])[0].split() + iuse = portage.db[MYROOT()]["bintree"].dbapi.aux_get(dep_pkg,["IUSE"])[0].split() elif dep_type == "ebuild": - iuse = portage.db["/"]["porttree"].dbapi.aux_get(dep_pkg,["IUSE"])[0].split() + iuse = portage.db[MYROOT()]["porttree"].dbapi.aux_get(dep_pkg,["IUSE"])[0].split() else: iuse = [] iuse.sort() @@ -2282,7 +2296,7 @@ def format_overlay(self, mydep): if mydep[0] != "ebuild" or mydep[3] == "nomerge": return "" - filename = portage.db["/"]["porttree"].dbapi.findname(mydep[2]) + filename = portage.db[MYROOT()]["porttree"].dbapi.findname(mydep[2]) dirname = os.path.abspath(os.path.dirname(filename)+"/../..") if dirname in portage.settings['PORTDIR_OVERLAY'].split(): if dirname not in self.overlays: @@ -2344,7 +2358,7 @@ def format_changelog(self, mydep): thispkg = mydep[2] - ebuild_path = portage.db["/"]["porttree"].dbapi.findname(thispkg) + ebuild_path = portage.db[MYROOT()]["porttree"].dbapi.findname(thispkg) if ebuild_path: prevpkg = self.old_version(mydep) if prevpkg: @@ -2530,7 +2544,7 @@ else: global_unmerge=1 - localtree=portage.db[portage.root]["vartree"] + localtree=portage.db[ROOT()]["vartree"] # process all arguments and add all valid db entries to candidate_catpkgs if global_unmerge: if not unmerge_files or "world" in unmerge_files: @@ -2565,7 +2579,7 @@ sp_absx_len = len(sp_absx) - vdb_path = portage.root+portage.VDB_PATH + vdb_path = ROOT(VDB_PATH) vdb_len = len(vdb_path) sp_vdb = vdb_path.split("/") @@ -2579,14 +2593,14 @@ # The Path is shorter... so it can't be inside the vdb. print spabsx print absx - print "\n!!!",x,"cannot be inside "+(portage.root+portage.VDB_PATH)+"; aborting.\n" + print "\n!!!",x,"cannot be inside "+ROOT(VDB_PATH)+"; aborting.\n" return 0 for idx in range(0,sp_vdb_len): if (idx >= sp_absx_len) or (sp_vdb[idx] != sp_absx[idx]): print sp_absx print absx - print "\n!!!",x,"is not inside "+(portage.root+portage.VDB_PATH)+"; aborting.\n" + print "\n!!!",x,"is not inside "+ROOT(VDB_PATH)+"; aborting.\n" return 0 print "="+"/".join(sp_absx[sp_vdb_len:]) @@ -2617,7 +2631,7 @@ if not mymatch: print "\n--- Couldn't find " + white(x) + " to "+unmerge_action+"." continue - mykey=portage.key_expand(portage.portage_dep.dep_getkey(mymatch[0]),portage.db["/"]["vartree"].dbapi) + mykey=portage.key_expand(portage.portage_dep.dep_getkey(mymatch[0]),portage.db[MYROOT()]["vartree"].dbapi) if not pkgmap.has_key(mykey): pkgmap[mykey]={"protected":[], "selected":[], "omitted":[] } if unmerge_action=="unmerge": @@ -2720,13 +2734,13 @@ emergelog("=== Unmerging... ("+y+")") mysplit=y.split("/") #unmerge... - retval=portage.unmerge(mysplit[0],mysplit[1],portage.root,mysettings,unmerge_action not in ["clean","prune"]) + retval=portage.unmerge(mysplit[0],mysplit[1],ROOT,mysettings,unmerge_action not in ["clean","prune"]) if retval: emergelog(" !!! unmerge FAILURE: "+y) else: emergelog(" >>> unmerge success: "+y) #run ldconfig, etc... - portage.env_update(portage.root) + portage.env_update(ROOT) if not numselected: return 0 else: @@ -2734,18 +2748,18 @@ def chk_updated_info_files(): - root=portage.root + root=ROOT infodirs =portage.settings["INFOPATH"].split(":") infodirs+=portage.settings["INFODIR"].split(":") print - if os.path.exists("/usr/bin/install-info"): + if os.path.exists("@INSTALL_INFO@"): regen_infodirs=[] for z in infodirs: if z=='': continue - inforoot=normpath(root+z) + inforoot=normpath(root(z)) if os.path.isdir(inforoot): try: infomtime=os.stat(inforoot)[ST_MTIME] @@ -2788,8 +2802,8 @@ for x in os.listdir(inforoot): if (x[0] == ".") or (x in ["dir","dir.old"]) or (os.path.isdir(inforoot+"/"+x)): continue -# myso=commands.getstatusoutput("LANG=C LANGUAGE=C /usr/bin/install-info --dir-file="+inforoot+"/dir "+inforoot+"/"+x)[1] - mycmd = "LANG=C LANGUAGE=C /usr/bin/install-info --dir-file="+inforoot+"/dir "+inforoot+"/"+x +# myso=commands.getstatusoutput("LANG=C LANGUAGE=C @INSTALL_INFO@ --dir-file="+inforoot+"/dir "+inforoot+"/"+x)[1] + mycmd = "LANG=C LANGUAGE=C @INSTALL_INFO@ --dir-file="+inforoot+"/dir "+inforoot+"/"+x myso=portage_exec.spawn_get_output(mycmd,spawn_type=portage_exec.spawn_bash)[1] existsstr="already exists, for file `" if myso!="": @@ -3095,7 +3109,16 @@ print "\n>>> Updating Portage cache: ", os.umask(0002) cachedir = os.path.normpath(portage.settings.depcachedir) - if cachedir in ["/", "/bin", "/dev", "/etc", "/home", + if cachedir in [MYROOT(""), MYROOT("bin"), + MYROOT("etc"), MYROOT("lib"), + MYROOT("opt"), MYROOT("sbin"), + MYROOT("tmp"), MYROOT("var"), + ROOT(""), ROOT("bin"), + ROOT("etc"), ROOT("lib"), + ROOT("opt"), ROOT("sbin"), + ROOT("tmp"), ROOT("var"), + MYROOT.prefix(), ROOT.prefix(), + "/", "/bin", "/dev", "/etc", "/home", "/lib", "/opt", "/proc", "/root", "/sbin", "/sys", "/tmp", "/usr", "/var"]: print "!!! PORTAGE_CACHEDIR IS SET TO A PRIMARY ROOT DIRECTORY ON YOUR SYSTEM." @@ -3171,7 +3194,7 @@ portage.portageexit() reload(portage) mybestpv=portage.portdb.xmatch("bestmatch-visible","sys-apps/portage") - mypvs=portage.best(portage.db[portage.root]["vartree"].dbapi.match("sys-apps/portage")) + mypvs=portage.best(portage.db[ROOT()]["vartree"].dbapi.match("sys-apps/portage")) chk_updated_cfg_files() @@ -3199,12 +3222,12 @@ print getportageversion() print "=================================================================" print "System uname: "+unameout - if os.path.exists("/etc/gentoo-release"): - portage_exec.spawn("cat /etc/gentoo-release") + if os.path.exists(MYROOT("etc/gentoo-release")): + portage_exec.spawn("cat "+MYROOT("etc/gentoo-release")) else: print "Unknown Host Operating System" - py_vers = string.join(portage.db["/"]["vartree"].dbapi.match("dev-lang/python"), ",") + py_vers = string.join(portage.db[MYROOT()]["vartree"].dbapi.match("dev-lang/python"), ",") py_this = string.strip(string.split(sys.version,"\n")[0]) print "%-20s %s [%s]" % ("Python:",py_vers,py_this) @@ -3232,7 +3255,7 @@ for x in myvars: if portage.portage_dep.isvalidatom(x): - pkg_matches = portage.db["/"]["vartree"].dbapi.match(x) + pkg_matches = portage.db[MYROOT()]["vartree"].dbapi.match(x) pkgs = "" for y in pkg_matches: mycpv = portage.catpkgsplit(y) @@ -3247,7 +3270,7 @@ else: print "%-20s %s" % (x+":", "[NOT VALID]") - libtool_vers = string.join(portage.db["/"]["vartree"].dbapi.match("sys-devel/libtool"), ",") + libtool_vers = string.join(portage.db[MYROOT()]["vartree"].dbapi.match("sys-devel/libtool"), ",") if "--verbose" in myopts: myvars=portage.settings.keys() @@ -3307,7 +3330,7 @@ if (not mycps) or (mycps[0]=="null"): print "!!!",x,"is not a specific cat/pkg-version, skipping..." continue - if portage.db["/"]["vartree"].exists_specific(x): + if portage.db[MYROOT()]["vartree"].exists_specific(x): print "!!! Not injecting",x+"; Package already exists." else: if "--ask" in myopts: @@ -3316,7 +3339,7 @@ print "Quitting." print sys.exit(0) - portage.db["/"]["vartree"].dbapi.cpv_inject(x) + portage.db[MYROOT()]["vartree"].dbapi.cpv_inject(x) print ">>> Injected",x+"." emergelog(" === inject: "+x) elif "unmerge"==myaction or "prune"==myaction or "clean"==myaction: @@ -3368,14 +3391,14 @@ sys.exit(1) alldeps=mydepgraph.mynewgraph.get_all_nodes() - myvarlist=portage.vardbapi(portage.root).cp_all() + myvarlist=portage.vardbapi(ROOT).cp_all() if not syslist: print "!!! You have no system list. Cannot determine system from world." if not worldlist: print "!!! You have no world file. Cannot determine explicit merges." if not myvarlist: - print "!!! You have no installed package tree (%s). This is a problem." % portage.VDB_PATH + print "!!! You have no installed package tree (%s). This is a problem." % ROOT(VDB_PATH) if not alldeps: print "!!! You have no dependencies. Impossible. Bug." @@ -3577,7 +3600,7 @@ if pkgline[0]=="ebuild" and pkgline[3]=="merge": y=portage.portdb.findname(pkgline[2]) tmpsettings = portage.config(clone=portage.settings) - retval=portage.doebuild(y,"digest",portage.root,tmpsettings,edebug,("--pretend" in myopts)) + retval=portage.doebuild(y,"digest",ROOT,tmpsettings,edebug,("--pretend" in myopts)) mydepgraph.merge(mydepgraph.altlist()) if portage.mtimedb.has_key("resume"): Index: bin/env-update =================================================================== RCS file: /cvsroot/portage/bin/env-update,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- bin/env-update 4 Mar 2005 10:29:00 -0000 1.1.1.1 +++ bin/env-update 9 Mar 2005 16:16:28 -0000 1.2 @@ -1,11 +1,11 @@ -#!/usr/bin/python -O +#! @PYTHON@ -O # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /cvsroot/portage/bin/env-update,v 1.1.1.1 2005/03/04 10:29:00 haubi Exp $ +# $Header: /cvsroot/portage/bin/env-update,v 1.2 2005/03/09 16:16:28 haubi Exp $ import os,sys os.environ["PORTAGE_CALLER"] = "env-update" -sys.path = ["/usr/lib/portage/pym"]+sys.path +sys.path = ["@PORTAGE_BASE@/pym"]+sys.path import portage portage.env_update(portage.root) Index: bin/env-update.sh =================================================================== RCS file: /cvsroot/portage/bin/env-update.sh,v retrieving revision 1.1.1.1 retrieving revision 1.5 diff -u -r1.1.1.1 -r1.5 --- bin/env-update.sh 4 Mar 2005 10:29:00 -0000 1.1.1.1 +++ bin/env-update.sh 21 Mar 2005 14:56:09 -0000 1.5 @@ -1,7 +1,7 @@ -#!/bin/bash +#! @BASH@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /cvsroot/portage/bin/env-update.sh,v 1.1.1.1 2005/03/04 10:29:00 haubi Exp $ +# $Header: /cvsroot/portage/bin/env-update.sh,v 1.5 2005/03/21 14:56:09 haubi Exp $ ############################################ ############################################ @@ -20,9 +20,9 @@ export MAKELINKS=1 fi export ROOT="${ROOT:=/}" -[[ ${ROOT} == */ ]] || export ROOT="${ROOT}/" +[[ ${ROOT}${AFFIX} == */ ]] || export AFFIX="${AFFIX}/" -export ENVDIR="${ROOT}etc/env.d" +export ENVDIR="${ROOT}${AFFIX}etc/env.d" mkdir -p ${ENVDIR} chmod 755 ${ENVDIR} specials=" @@ -33,13 +33,13 @@ ADA_INCLUDE_PATH ADA_OBJECTS_PATH LDPATH PATH MANPATH ROOTPATH PRELINK_PATH PRELINK_PATH_MASK PYTHON_PATH" -export LDSOCONF="${ROOT}etc/ld.so.conf" +export LDSOCONF="${ROOT}${AFFIX}etc/ld.so.conf" -export PRELINKCONF="${ROOT}etc/prelink.conf" -defaultprelinkpaths=":/bin:/sbin:/usr/bin:/usr/sbin:/lib:/usr/lib" +export PRELINKCONF="${ROOT}${AFFIX}etc/prelink.conf" +defaultprelinkpaths=":/${AFFIX}/bin:/${AFFIX}/sbin:${PREFIX}/bin:${PREFIX}/sbin:/${AFFIX}/lib:${PREFIX}/lib" -export PROFILEENV="${ROOT}etc/profile.env" -export CSHENV="${ROOT}etc/csh.env" +export PROFILEENV="${ROOT}${AFFIX}etc/profile.env" +export CSHENV="${ROOT}${AFFIX}etc/csh.env" # make sure we aren't tricked with previous 'my_envd_' variables unset $(set | grep '^my_envd_' | cut -d= -f1) @@ -140,7 +140,7 @@ if [[ "${OLD_LDPATH}" != "${my_envd_LDPATH}" ]] ; then cat << EOF > ${LDSOCONF} # ld.so.conf autogenerated by env-update; make all changes to -# contents of /etc/env.d directory +# contents of /${AFFIX}etc/env.d directory ${my_envd_LDPATH//:/ } EOF @@ -181,7 +181,7 @@ cat << EOF > ${PRELINKCONF} # prelink.conf autogenerated by env-update; make all changes to -# contents of /etc/env.d directory +# contents of /${AFFIX}etc/env.d directory ${defaultprelinkpaths//:/ -l } ${envdprelinkpaths//:/ @@ -195,17 +195,18 @@ # RUN EXTERNAL PROGRAMS NOW ############################################ -echo ">>> Regenerating ${ROOT}etc/ld.so.cache..." +set -xv +echo ">>> Regenerating ${ROOT}${AFFIX}etc/ld.so.cache..." if [[ ${MAKELINKS} -eq 0 ]] ; then - (cd / ; /sbin/ldconfig -X -r ${ROOT} >& /dev/null) + (cd / ; /@affix@sbin/ldconfig -X -r ${ROOT}${AFFIX} >& /dev/null) else - (cd / ; /sbin/ldconfig -r ${ROOT} >& /dev/null) + (cd / ; /@affix@sbin/ldconfig -r ${ROOT}${AFFIX} >& /dev/null) fi cat << EOF > ${PROFILEENV} # THIS FILE IS AUTOMATICALLY GENERATED BY env-update. # DO NOT EDIT THIS FILE. CHANGES TO STARTUP PROFILES -# GO INTO /etc/profile NOT /etc/profile.env +# GO INTO /${AFFIX}etc/profile NOT /${AFFIX}etc/profile.env $(set | grep '^my_envd_' | sed -e 's:^my_envd_:export :') EOF @@ -213,9 +214,9 @@ cat << EOF > ${CSHENV} # THIS FILE IS AUTOMATICALLY GENERATED BY env-update. # DO NOT EDIT THIS FILE. CHANGES TO STARTUP PROFILES -# GO INTO /etc/csh.cshrc NOT /etc/csh.env +# GO INTO /${AFFIX}etc/csh.cshrc NOT /${AFFIX}etc/csh.env $(set | grep '^my_envd_' | sed -e 's:^my_envd_\([[:alpha:]_][[:alnum:]_]*\)=:setenv \1 :') EOF -[[ ${ROOT} == / ]] && /sbin/depscan.sh +[[ ${ROOT}${AFFIX} == / ]] && /sbin/depscan.sh Index: bin/etc-update =================================================================== RCS file: /cvsroot/portage/bin/etc-update,v retrieving revision 1.1.1.1 retrieving revision 1.5 diff -u -r1.1.1.1 -r1.5 --- bin/etc-update 4 Mar 2005 10:29:00 -0000 1.1.1.1 +++ bin/etc-update 25 Mar 2005 09:41:48 -0000 1.5 @@ -1,7 +1,7 @@ -#!/bin/bash +#! @BASH@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /cvsroot/portage/bin/etc-update,v 1.1.1.1 2005/03/04 10:29:00 haubi Exp $ +# $Header: /cvsroot/portage/bin/etc-update,v 1.5 2005/03/25 09:41:48 haubi Exp $ # Author Brandon Low # @@ -12,7 +12,7 @@ export PORTAGE_CALLER="etc-update" -if [ $(/usr/lib/portage/bin/portageq envvar USERLAND) = BSD ] ; then +if [ $(@PORTAGE_BASE@/bin/portageq envvar USERLAND) = BSD ] ; then function sed() { gsed "$@"; } fi @@ -22,7 +22,7 @@ # First strip off comment lines, then grab the configuration # item. If there's more than one of the same configuration item, # then allow the last setting to take precedence. - cut -d'#' -f1-1 /etc/etc-update.conf | \ + cut -d'#' -f1-1 /@affix@etc/etc-update.conf | \ sed -ne "s/^ *$item *= *\([\"']\{0,1\}\)\(.*\)\1/\2/p" |sed -e '$p;d' } @@ -57,7 +57,7 @@ if [ ! -e "${rpath}/${rfile}" ] || [ ! -e "${rpath}/${rfile:10}" ]; then MATCHES=0 else - diff -Bbua ${rpath}/${rfile} ${rpath}/${rfile:10} | egrep '^[+-]' | egrep -v '^[+-][\t ]*#|^--- |^\+\+\+ ' | egrep -qv '^[-+][\t ]*$' + diff -Bbua ${rpath}/${rfile} ${rpath}/${rfile:10} | @EGREP@ '^[+-]' | @EGREP@ -v '^[+-][\t ]*#|^--- |^\+\+\+ ' | @EGREP@ -qv '^[-+][\t ]*$' MATCHES=$? fi elif [[ -z `diff -Nua ${rpath}/${rfile} ${rpath}/${rfile:10}| @@ -359,8 +359,8 @@ mkdir ${TMP} || die "failed mkdir command!" 1 # I need the CONFIG_PROTECT value -CONFIG_PROTECT=$(/usr/lib/portage/bin/portageq envvar CONFIG_PROTECT) -CONFIG_PROTECT_MASK=$(/usr/lib/portage/bin/portageq envvar CONFIG_PROTECT_MASK) +CONFIG_PROTECT=$(@PORTAGE_BASE@/bin/portageq envvar CONFIG_PROTECT) +CONFIG_PROTECT_MASK=$(@PORTAGE_BASE@/bin/portageq envvar CONFIG_PROTECT_MASK) # load etc-config's configuration EU_AUTOMERGE=`get_config eu_automerge` Index: bin/find-requires =================================================================== RCS file: /cvsroot/portage/bin/find-requires,v retrieving revision 1.1.1.1 retrieving revision 1.3 diff -u -r1.1.1.1 -r1.3 --- bin/find-requires 4 Mar 2005 10:29:00 -0000 1.1.1.1 +++ bin/find-requires 25 Mar 2005 09:41:48 -0000 1.3 @@ -1,7 +1,7 @@ -#!/bin/sh +#! /bin/sh # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /cvsroot/portage/bin/find-requires,v 1.1.1.1 2005/03/04 10:29:00 haubi Exp $ +# $Header: /cvsroot/portage/bin/find-requires,v 1.3 2005/03/25 09:41:48 haubi Exp $ # note this works for both a.out and ELF executables # it also auto-generates requirment lines for shell scripts @@ -10,7 +10,7 @@ filelist=`sed "s/['\"]/\\\&/g"` exelist=`echo $filelist | $XARGS file | grep ":.*executable" | cut -d: -f1 ` -scriptlist=`echo $filelist | $XARGS file | egrep ":.* (commands|script) " | cut -d: -f1 ` +scriptlist=`echo $filelist | $XARGS file | @EGREP@ ":.* (commands|script) " | cut -d: -f1 ` liblist=`echo $filelist | $XARGS file | grep ":.*shared object" | cut -d : -f1 ` for f in $exelist; do Index: bin/fix-db.py =================================================================== RCS file: /cvsroot/portage/bin/fix-db.py,v retrieving revision 1.1.1.1 retrieving revision 1.3 diff -u -r1.1.1.1 -r1.3 --- bin/fix-db.py 4 Mar 2005 10:29:00 -0000 1.1.1.1 +++ bin/fix-db.py 19 Mar 2005 20:55:23 -0000 1.3 @@ -1,17 +1,17 @@ -#!/usr/bin/python +#! @PYTHON@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /cvsroot/portage/bin/fix-db.py,v 1.1.1.1 2005/03/04 10:29:00 haubi Exp $ +# $Header: /cvsroot/portage/bin/fix-db.py,v 1.3 2005/03/19 20:55:23 haubi Exp $ import os,sys,re -sys.path = ["/usr/lib/portage/pym"]+sys.path +sys.path = ["@PORTAGE_BASE@/pym"]+sys.path from stat import * from output import * -from portage import lockfile,unlockfile,VDB_PATH,root +from portage import lockfile,unlockfile,MYROOT,ROOT,VDB_PATH -mylog = open("/var/log/emerge_fix-db.log", "a") +mylog = open(MYROOT("var/log/emerge_fix-db.log"), "a") def writemsg(msg): if msg[-1] != '\n': msg += "\n" @@ -21,7 +21,7 @@ mylog.flush() def fix_global_counter(value): - myf = open("/var/cache/edb/counter") + myf = open(MYROOT(CACHE_PATH+"/counter")) newvalue = value+1000 myf.write(str(newvalue)) myf.flush() @@ -33,14 +33,14 @@ times = {} try: - real_counter = long(open("/var/cache/edb/counter").read()) + real_counter = long(open(MYROOT(CACHE_PATH+"/counter")).read()) except SystemExit, e: raise # This needs to be propogated except: writemsg("ERROR: Real counter is invalid.\n") real_counter = 0 -vardbdir = root+VDB_PATH+"/" +vardbdir = ROOT(VDB_PATH+"/") for cat in os.listdir(vardbdir): catdir = vardbdir+cat+"/" if not os.path.isdir(catdir): Index: bin/fixdbentries =================================================================== RCS file: /cvsroot/portage/bin/fixdbentries,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- bin/fixdbentries 4 Mar 2005 10:29:00 -0000 1.1.1.1 +++ bin/fixdbentries 9 Mar 2005 16:16:28 -0000 1.2 @@ -1,7 +1,7 @@ -#!/bin/bash +#! @BASH@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /cvsroot/portage/bin/fixdbentries,v 1.1.1.1 2005/03/04 10:29:00 haubi Exp $ +# $Header: /cvsroot/portage/bin/fixdbentries,v 1.2 2005/03/09 16:16:28 haubi Exp $ # Script to adjust the contents of the DB entries after a package move. # Fairly straight forward... ./movedbentry 'from/here' 'to/here' /over/here Index: bin/fixpackages =================================================================== RCS file: /cvsroot/portage/bin/fixpackages,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- bin/fixpackages 4 Mar 2005 10:29:00 -0000 1.1.1.1 +++ bin/fixpackages 9 Mar 2005 16:16:28 -0000 1.2 @@ -1,11 +1,11 @@ -#!/usr/bin/python +#! @PYTHON@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /cvsroot/portage/bin/fixpackages,v 1.1.1.1 2005/03/04 10:29:00 haubi Exp $ +# $Header: /cvsroot/portage/bin/fixpackages,v 1.2 2005/03/09 16:16:28 haubi Exp $ import os,sys os.environ["PORTAGE_CALLER"]="fixpackages" -sys.path = ["/usr/lib/portage/pym"]+sys.path +sys.path = ["@PORTAGE_BASE@/pym"]+sys.path import portage Index: bin/fixvardbentries =================================================================== RCS file: /cvsroot/portage/bin/fixvardbentries,v retrieving revision 1.1.1.1 retrieving revision 1.4 diff -u -r1.1.1.1 -r1.4 --- bin/fixvardbentries 4 Mar 2005 10:29:00 -0000 1.1.1.1 +++ bin/fixvardbentries 21 Mar 2005 12:40:28 -0000 1.4 @@ -1,7 +1,7 @@ -#!/usr/bin/python -O +#! @PYTHON@ -O # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /cvsroot/portage/bin/fixvardbentries,v 1.1.1.1 2005/03/04 10:29:00 haubi Exp $ +# $Header: /cvsroot/portage/bin/fixvardbentries,v 1.4 2005/03/21 12:40:28 haubi Exp $ import os import sys @@ -141,7 +141,7 @@ return True -vardb = "/var/db/pkg/" +vardb = "/@affix@var/db/pkg/" changed = False for cat in os.listdir(vardb): if os.path.isdir(vardb+cat): Index: bin/fixvirtuals =================================================================== RCS file: /cvsroot/portage/bin/fixvirtuals,v retrieving revision 1.1.1.1 retrieving revision 1.3 diff -u -r1.1.1.1 -r1.3 --- bin/fixvirtuals 4 Mar 2005 10:29:00 -0000 1.1.1.1 +++ bin/fixvirtuals 19 Mar 2005 20:55:23 -0000 1.3 @@ -1,20 +1,21 @@ -#!/usr/bin/python -O +#! @PYTHON@ -O # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /cvsroot/portage/bin/fixvirtuals,v 1.1.1.1 2005/03/04 10:29:00 haubi Exp $ +# $Header: /cvsroot/portage/bin/fixvirtuals,v 1.3 2005/03/19 20:55:23 haubi Exp $ import os,sys -sys.path = ["/usr/lib/portage/pym"]+sys.path +sys.path = ["@PORTAGE_BASE@/pym"]+sys.path import portage +from portage import MYROOT, CACHE_PATH if portage.secpass!=2: print "fixvirtuals: root access required." sys.exit(1) newvirts={} -myvirts=portage.grabdict("/var/cache/edb/virtuals") -myprovides=portage.db["/"]["vartree"].get_all_provides() +myvirts=portage.grabdict(MYROOT(CACHE_PATH+"/virtuals")) +myprovides=portage.db[MYROOT()]["vartree"].get_all_provides() for myvirt in myprovides.keys(): newvirts[myvirt]=[] @@ -30,4 +31,4 @@ except: newvirts[myvirt].append(pkg) -portage.writedict(newvirts,"/var/cache/edb/virtuals") +portage.writedict(newvirts,MYROOT(CACHE_PATH+"/virtuals")) Index: bin/fowners =================================================================== RCS file: /cvsroot/portage/bin/fowners,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- bin/fowners 4 Mar 2005 10:29:00 -0000 1.1.1.1 +++ bin/fowners 9 Mar 2005 16:16:28 -0000 1.2 @@ -1,7 +1,7 @@ -#!/bin/bash +#! @BASH@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /cvsroot/portage/bin/fowners,v 1.1.1.1 2005/03/04 10:29:00 haubi Exp $ +# $Header: /cvsroot/portage/bin/fowners,v 1.2 2005/03/09 16:16:28 haubi Exp $ if [ ${#} -lt 2 ] ; then echo "${0}: at least two arguments needed" Index: bin/fperms =================================================================== RCS file: /cvsroot/portage/bin/fperms,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- bin/fperms 4 Mar 2005 10:29:00 -0000 1.1.1.1 +++ bin/fperms 9 Mar 2005 16:16:28 -0000 1.2 @@ -1,7 +1,7 @@ -#!/bin/bash +#! @BASH@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /cvsroot/portage/bin/fperms,v 1.1.1.1 2005/03/04 10:29:00 haubi Exp $ +# $Header: /cvsroot/portage/bin/fperms,v 1.2 2005/03/09 16:16:28 haubi Exp $ if [ ${#} -lt 2 ] ; then echo "${0}: at least two arguments needed" Index: bin/g-cpan.pl =================================================================== RCS file: /cvsroot/portage/bin/g-cpan.pl,v retrieving revision 1.1.1.2 retrieving revision 1.5 diff -u -r1.1.1.2 -r1.5 --- bin/g-cpan.pl 21 Mar 2005 09:47:18 -0000 1.1.1.2 +++ bin/g-cpan.pl 21 Mar 2005 12:40:28 -0000 1.5 @@ -1,7 +1,7 @@ -#!/usr/bin/perl -w +#! @PERL@ -w # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /cvsroot/portage/bin/g-cpan.pl,v 1.1.1.2 2005/03/21 09:47:18 haubi Exp $ +# $Header: /cvsroot/portage/bin/g-cpan.pl,v 1.5 2005/03/21 12:40:28 haubi Exp $ # History: @@ -101,8 +101,8 @@ my @ebuild_list; # Set up global paths -my $TMP_DEV_PERL_DIR = '/var/db/pkg/dev-perl'; -my $MAKECONF = '/etc/make.conf'; +my $TMP_DEV_PERL_DIR = '/@affix@var/db/pkg/dev-perl'; +my $MAKECONF = '/@affix@etc/make.conf'; my ( $OVERLAY_DIR, $PORTAGE_DIR, $PORTAGE_DEV_PERL, $PORTAGE_DISTDIR ) = get_globals(); # Create the ebuild in PORTDIR_OVERLAY, if it is defined and exists @@ -339,7 +339,7 @@ $md5digest = Digest::MD5->new->addfile(*DIGIFILE)->hexdigest; close(DIGIFILE); } else { - ($md5digest = qx(/usr/bin/md5sum $localfile)) =~ s/^(.*?)\s.*$/$1/s; + ($md5digest = qx(@MD5SUM@ $localfile)) =~ s/^(.*?)\s.*$/$1/s; } my $md5string = sprintf "MD5 %s %s %d", $md5digest, $base, @@ -387,9 +387,9 @@ # let's not beat around the bush here, make.conf isn't the # only place these variables can be defined - $OVERLAY_DIR=qx(/usr/lib/portage/bin/portageq portdir_overlay); - $PORTAGE_DIR=qx(/usr/lib/portage/bin/portageq portdir); - $PORTAGE_DISTDIR=qx(/usr/lib/portage/bin/portageq distdir); + $OVERLAY_DIR=qx(@PORTAGE_BASE@/bin/portageq portdir_overlay); + $PORTAGE_DIR=qx(@PORTAGE_BASE@/bin/portageq portdir); + $PORTAGE_DISTDIR=qx(@PORTAGE_BASE@/bin/portageq distdir); chomp $OVERLAY_DIR; chomp $PORTAGE_DIR; @@ -400,11 +400,11 @@ } unless ( length $PORTAGE_DIR && -d $PORTAGE_DIR ) { - $PORTAGE_DIR = "/usr/portage"; + $PORTAGE_DIR = "@prefix@/portage"; } unless ( length $PORTAGE_DISTDIR && -d $PORTAGE_DISTDIR ) { - $PORTAGE_DISTDIR = "/usr/portage/distfiles"; + $PORTAGE_DISTDIR = "@prefix@/portage/distfiles"; } # Finally, set the dev-perl dir explicitly Index: bin/isolated-functions.sh =================================================================== RCS file: /cvsroot/portage/bin/isolated-functions.sh,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- bin/isolated-functions.sh 4 Mar 2005 10:29:00 -0000 1.1.1.1 +++ bin/isolated-functions.sh 9 Mar 2005 16:16:28 -0000 1.2 @@ -1,6 +1,6 @@ # Copyright 1999-2004 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 -# $Header: /cvsroot/portage/bin/isolated-functions.sh,v 1.1.1.1 2005/03/04 10:29:00 haubi Exp $ +# $Header: /cvsroot/portage/bin/isolated-functions.sh,v 1.2 2005/03/09 16:16:28 haubi Exp $ # Internal logging function, don't use this in ebuilds elog_base() { @@ -30,7 +30,7 @@ local pri= local tag= - if [ -x /usr/bin/logger ] + if [ -x "@LOGGER@" ] then pri="$1" tag="$2" @@ -38,7 +38,7 @@ shift 2 [ -z "$*" ] && return 0 - /usr/bin/logger -p "${pri}" -t "${tag}" -- "$*" + @LOGGER@ -p "${pri}" -t "${tag}" -- "$*" fi return 0 Index: bin/md5check.py =================================================================== RCS file: /cvsroot/portage/bin/md5check.py,v retrieving revision 1.1.1.1 retrieving revision 1.3 diff -u -r1.1.1.1 -r1.3 --- bin/md5check.py 4 Mar 2005 10:29:00 -0000 1.1.1.1 +++ bin/md5check.py 19 Mar 2005 20:55:23 -0000 1.3 @@ -1,14 +1,15 @@ -#!/usr/bin/python -O +#! @PYTHON@ -O # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /cvsroot/portage/bin/md5check.py,v 1.1.1.1 2005/03/04 10:29:00 haubi Exp $ +# $Header: /cvsroot/portage/bin/md5check.py,v 1.3 2005/03/19 20:55:23 haubi Exp $ import os,sys,string os.environ["PORTAGE_CALLER"]="mirror" os.environ["FEATURES"]="mirror cvs" -sys.path = ["/usr/lib/portage/pym"]+sys.path +sys.path = ["@PORTAGE_BASE@/pym"]+sys.path import portage +from portage import MYROOT from threading import * from output import red,green,blue,bold from random import shuffle @@ -27,17 +28,17 @@ col_list = [] hugelist = [] -for mycp in portage.db["/"]["porttree"].dbapi.cp_all(): - hugelist += portage.db["/"]["porttree"].dbapi.cp_list(mycp) +for mycp in portage.db[MYROOT()]["porttree"].dbapi.cp_all(): + hugelist += portage.db[MYROOT()]["porttree"].dbapi.cp_list(mycp) hugelist.sort() for mycpv in hugelist: pv = string.split(mycpv, "/")[-1] - newuri = portage.db["/"]["porttree"].dbapi.aux_get(mycpv,["SRC_URI"])[0] + newuri = portage.db[MYROOT()]["porttree"].dbapi.aux_get(mycpv,["SRC_URI"])[0] newuri = string.split(newuri) - digestpath = portage.db["/"]["porttree"].dbapi.findname(mycpv) + digestpath = portage.db[MYROOT()]["porttree"].dbapi.findname(mycpv) digestpath = os.path.dirname(digestpath)+"/files/digest-"+pv md5sums = portage.digestParseFile(digestpath) Index: bin/md5check.sh =================================================================== RCS file: /cvsroot/portage/bin/md5check.sh,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- bin/md5check.sh 4 Mar 2005 10:29:00 -0000 1.1.1.1 +++ bin/md5check.sh 9 Mar 2005 16:16:28 -0000 1.2 @@ -1,7 +1,7 @@ -#!/bin/bash +#! @BASH@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /cvsroot/portage/bin/md5check.sh,v 1.1.1.1 2005/03/04 10:29:00 haubi Exp $ +# $Header: /cvsroot/portage/bin/md5check.sh,v 1.2 2005/03/09 16:16:28 haubi Exp $ # pipe in the data. Index: bin/mirror.py =================================================================== RCS file: /cvsroot/portage/bin/mirror.py,v retrieving revision 1.1.1.1 retrieving revision 1.3 diff -u -r1.1.1.1 -r1.3 --- bin/mirror.py 4 Mar 2005 10:29:00 -0000 1.1.1.1 +++ bin/mirror.py 19 Mar 2005 20:55:23 -0000 1.3 @@ -1,7 +1,7 @@ -#!/usr/bin/python -O +#! @PYTHON@ -O # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /cvsroot/portage/bin/mirror.py,v 1.1.1.1 2005/03/04 10:29:00 haubi Exp $ +# $Header: /cvsroot/portage/bin/mirror.py,v 1.3 2005/03/19 20:55:23 haubi Exp $ # Defines the number of threads carrying out the downloading. maxsems=5 @@ -9,9 +9,10 @@ import os,sys,string os.environ["PORTAGE_CALLER"]="mirror" os.environ["FEATURES"]="mirror cvs" -sys.path = ["/usr/lib/portage/pym"]+sys.path +sys.path = ["@PORTAGE_BASE@/pym"]+sys.path import portage +from portage import MYROOT from threading import * from output import red,green,blue,bold from random import shuffle @@ -106,8 +107,8 @@ destdir = portage.settings["DISTDIR"][:] hugelist = [] -for mycp in portage.db["/"]["porttree"].dbapi.cp_all(): - hugelist += portage.db["/"]["porttree"].dbapi.cp_list(mycp) +for mycp in portage.db[MYROOT()]["porttree"].dbapi.cp_all(): + hugelist += portage.db[MYROOT()]["porttree"].dbapi.cp_list(mycp) shuffle(hugelist) mycount = -1 @@ -120,10 +121,10 @@ if ((mycount % 20) == 0): sys.stdout.write("\nCompleted: %s\n" % mycount) sys.stdout.flush() - newuri = portage.db["/"]["porttree"].dbapi.aux_get(mycpv,["SRC_URI"])[0] + newuri = portage.db[MYROOT()]["porttree"].dbapi.aux_get(mycpv,["SRC_URI"])[0] newuri = string.split(newuri) - digestpath = portage.db["/"]["porttree"].dbapi.findname(mycpv) + digestpath = portage.db[MYROOT()]["porttree"].dbapi.findname(mycpv) digestpath = os.path.dirname(digestpath)+"/files/digest-"+pv md5sums = portage.digestParseFile(digestpath) Index: bin/newbin =================================================================== RCS file: /cvsroot/portage/bin/newbin,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- bin/newbin 4 Mar 2005 10:29:00 -0000 1.1.1.1 +++ bin/newbin 9 Mar 2005 16:16:28 -0000 1.2 @@ -1,7 +1,7 @@ -#!/bin/bash +#! @BASH@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /cvsroot/portage/bin/newbin,v 1.1.1.1 2005/03/04 10:29:00 haubi Exp $ +# $Header: /cvsroot/portage/bin/newbin,v 1.2 2005/03/09 16:16:28 haubi Exp $ if [ -z "${T}" ] || [ -z "${2}" ] ; then echo "Nothing defined to do." Index: bin/newconfd =================================================================== RCS file: /cvsroot/portage/bin/newconfd,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- bin/newconfd 4 Mar 2005 10:29:00 -0000 1.1.1.1 +++ bin/newconfd 9 Mar 2005 16:16:28 -0000 1.2 @@ -1,7 +1,7 @@ -#!/bin/bash +#! @BASH@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /cvsroot/portage/bin/newconfd,v 1.1.1.1 2005/03/04 10:29:00 haubi Exp $ +# $Header: /cvsroot/portage/bin/newconfd,v 1.2 2005/03/09 16:16:28 haubi Exp $ if [ -z "${T}" ] || [ -z "${2}" ] ; then echo "Nothing defined to do." Index: bin/newdoc =================================================================== RCS file: /cvsroot/portage/bin/newdoc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- bin/newdoc 4 Mar 2005 10:29:00 -0000 1.1.1.1 +++ bin/newdoc 9 Mar 2005 16:16:28 -0000 1.2 @@ -1,7 +1,7 @@ -#!/bin/bash +#! @BASH@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /cvsroot/portage/bin/newdoc,v 1.1.1.1 2005/03/04 10:29:00 haubi Exp $ +# $Header: /cvsroot/portage/bin/newdoc,v 1.2 2005/03/09 16:16:28 haubi Exp $ if [ -z "${T}" ] || [ -z "${2}" ] ; then echo "Nothing defined to do." Index: bin/newenvd =================================================================== RCS file: /cvsroot/portage/bin/newenvd,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- bin/newenvd 4 Mar 2005 10:29:00 -0000 1.1.1.1 +++ bin/newenvd 9 Mar 2005 16:16:28 -0000 1.2 @@ -1,7 +1,7 @@ -#!/bin/bash +#! @BASH@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /cvsroot/portage/bin/newenvd,v 1.1.1.1 2005/03/04 10:29:00 haubi Exp $ +# $Header: /cvsroot/portage/bin/newenvd,v 1.2 2005/03/09 16:16:28 haubi Exp $ if [ -z "${T}" ] || [ -z "${2}" ] ; then echo "Nothing defined to do." Index: bin/newexe =================================================================== RCS file: /cvsroot/portage/bin/newexe,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- bin/newexe 4 Mar 2005 10:29:00 -0000 1.1.1.1 +++ bin/newexe 9 Mar 2005 16:16:28 -0000 1.2 @@ -1,7 +1,7 @@ -#!/bin/bash +#! @BASH@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /cvsroot/portage/bin/newexe,v 1.1.1.1 2005/03/04 10:29:00 haubi Exp $ +# $Header: /cvsroot/portage/bin/newexe,v 1.2 2005/03/09 16:16:28 haubi Exp $ if [ -z "${T}" ] || [ -z "${2}" ] ; then echo "Nothing defined to do." Index: bin/newinitd =================================================================== RCS file: /cvsroot/portage/bin/newinitd,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- bin/newinitd 4 Mar 2005 10:29:00 -0000 1.1.1.1 +++ bin/newinitd 9 Mar 2005 16:16:28 -0000 1.2 @@ -1,7 +1,7 @@ -#!/bin/bash +#! @BASH@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /cvsroot/portage/bin/newinitd,v 1.1.1.1 2005/03/04 10:29:00 haubi Exp $ +# $Header: /cvsroot/portage/bin/newinitd,v 1.2 2005/03/09 16:16:28 haubi Exp $ if [ -z "${T}" ] || [ -z "${2}" ] ; then echo "Nothing defined to do." Index: bin/newins =================================================================== RCS file: /cvsroot/portage/bin/newins,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- bin/newins 4 Mar 2005 10:29:00 -0000 1.1.1.1 +++ bin/newins 9 Mar 2005 16:16:28 -0000 1.2 @@ -1,7 +1,7 @@ -#!/bin/bash +#! @BASH@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /cvsroot/portage/bin/newins,v 1.1.1.1 2005/03/04 10:29:00 haubi Exp $ +# $Header: /cvsroot/portage/bin/newins,v 1.2 2005/03/09 16:16:28 haubi Exp $ if [ -z "${T}" ] || [ -z "${2}" ] ; then echo "Error: Nothing defined to do." Index: bin/newlib.a =================================================================== RCS file: /cvsroot/portage/bin/newlib.a,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- bin/newlib.a 7 Mar 2005 10:51:02 -0000 1.1.1.1 +++ bin/newlib.a 9 Mar 2005 16:16:28 -0000 1.2 @@ -1,7 +1,7 @@ -#!/bin/bash +#! @BASH@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /cvsroot/portage/bin/newlib.a,v 1.1.1.1 2005/03/07 10:51:02 haubi Exp $ +# $Header: /cvsroot/portage/bin/newlib.a,v 1.2 2005/03/09 16:16:28 haubi Exp $ if [ -z "${T}" ] || [ -z "${2}" ] ; then echo "Error: Nothing defined to do." Index: bin/newlib.so =================================================================== RCS file: /cvsroot/portage/bin/newlib.so,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- bin/newlib.so 7 Mar 2005 10:51:02 -0000 1.1.1.1 +++ bin/newlib.so 9 Mar 2005 16:16:28 -0000 1.2 @@ -1,7 +1,7 @@ -#!/bin/bash +#! @BASH@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /cvsroot/portage/bin/newlib.so,v 1.1.1.1 2005/03/07 10:51:02 haubi Exp $ +# $Header: /cvsroot/portage/bin/newlib.so,v 1.2 2005/03/09 16:16:28 haubi Exp $ if [ -z "${T}" ] || [ -z "${2}" ] ; then echo "Error: Nothing defined to do." Index: bin/newman =================================================================== RCS file: /cvsroot/portage/bin/newman,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- bin/newman 4 Mar 2005 10:29:00 -0000 1.1.1.1 +++ bin/newman 9 Mar 2005 16:16:28 -0000 1.2 @@ -1,7 +1,7 @@ -#!/bin/bash +#! @BASH@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /cvsroot/portage/bin/newman,v 1.1.1.1 2005/03/04 10:29:00 haubi Exp $ +# $Header: /cvsroot/portage/bin/newman,v 1.2 2005/03/09 16:16:28 haubi Exp $ if [ -z "${T}" ] || [ -z "${2}" ] ; then echo "Nothing defined to do." Index: bin/newsbin =================================================================== RCS file: /cvsroot/portage/bin/newsbin,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- bin/newsbin 4 Mar 2005 10:29:00 -0000 1.1.1.1 +++ bin/newsbin 9 Mar 2005 16:16:28 -0000 1.2 @@ -1,7 +1,7 @@ -#!/bin/bash +#! @BASH@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /cvsroot/portage/bin/newsbin,v 1.1.1.1 2005/03/04 10:29:00 haubi Exp $ +# $Header: /cvsroot/portage/bin/newsbin,v 1.2 2005/03/09 16:16:28 haubi Exp $ if [ -z "${T}" ] || [ -z "${2}" ] ; then echo "Nothing defined to do." Index: bin/pkgmerge =================================================================== RCS file: /cvsroot/portage/bin/pkgmerge,v retrieving revision 1.1.1.1 retrieving revision 1.3 diff -u -r1.1.1.1 -r1.3 --- bin/pkgmerge 4 Mar 2005 10:29:00 -0000 1.1.1.1 +++ bin/pkgmerge 19 Mar 2005 20:55:23 -0000 1.3 @@ -1,10 +1,10 @@ -#!/usr/bin/python +#! @PYTHON@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /cvsroot/portage/bin/pkgmerge,v 1.1.1.1 2005/03/04 10:29:00 haubi Exp $ +# $Header: /cvsroot/portage/bin/pkgmerge,v 1.3 2005/03/19 20:55:23 haubi Exp $ import sys,os,string -sys.path = ["/usr/lib/portage/pym"]+sys.path +sys.path = ["@PORTAGE_BASE@/pym"]+sys.path import portage,xpak Index: bin/pkgmerge.new =================================================================== RCS file: /cvsroot/portage/bin/pkgmerge.new,v retrieving revision 1.1.1.1 retrieving revision 1.3 diff -u -r1.1.1.1 -r1.3 --- bin/pkgmerge.new 4 Mar 2005 10:29:00 -0000 1.1.1.1 +++ bin/pkgmerge.new 19 Mar 2005 20:55:23 -0000 1.3 @@ -1,10 +1,10 @@ -#!/usr/bin/python +#! @PYTHON@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /cvsroot/portage/bin/pkgmerge.new,v 1.1.1.1 2005/03/04 10:29:00 haubi Exp $ +# $Header: /cvsroot/portage/bin/pkgmerge.new,v 1.3 2005/03/19 20:55:23 haubi Exp $ import os,string,sys -sys.path = ["/usr/lib/portage/pym"]+sys.path +sys.path = ["@PORTAGE_BASE@/pym"]+sys.path import portage,xpak Index: bin/pkgname =================================================================== RCS file: /cvsroot/portage/bin/pkgname,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- bin/pkgname 4 Mar 2005 10:29:00 -0000 1.1.1.1 +++ bin/pkgname 9 Mar 2005 16:16:28 -0000 1.2 @@ -1,10 +1,10 @@ -#!/usr/bin/python +#! @PYTHON@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /cvsroot/portage/bin/pkgname,v 1.1.1.1 2005/03/04 10:29:00 haubi Exp $ +# $Header: /cvsroot/portage/bin/pkgname,v 1.2 2005/03/09 16:16:28 haubi Exp $ import sys -sys.path = ["/usr/lib/portage/pym"]+sys.path +sys.path = ["@PORTAGE_BASE@/pym"]+sys.path import portage Index: bin/portage_gpg_update.sh =================================================================== RCS file: /cvsroot/portage/bin/portage_gpg_update.sh,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- bin/portage_gpg_update.sh 4 Mar 2005 10:29:00 -0000 1.1.1.1 +++ bin/portage_gpg_update.sh 9 Mar 2005 16:16:28 -0000 1.2 @@ -1,6 +1,6 @@ -#!/bin/bash +#! @BASH@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /cvsroot/portage/bin/portage_gpg_update.sh,v 1.1.1.1 2005/03/04 10:29:00 haubi Exp $ +# $Header: /cvsroot/portage/bin/portage_gpg_update.sh,v 1.2 2005/03/09 16:16:28 haubi Exp $ -wget -O - http://www.gentoo.org/proj/en/devrel/roll-call/userinfo.xml | sed 's:.*\(0x[0-9a-fA-F]\+\)[^0-9a-fA-F].*:\1:gp;d' | xargs gpg -vvv --no-default-keyring --no-permission-warning --homedir /usr/portage/metadata --keyring "gentoo.gpg" --keyserver subkeys.pgp.net --recv-keys &> gpg.log +@WGET@ -O - http://www.gentoo.org/proj/en/devrel/roll-call/userinfo.xml | @SED@ 's:.*\(0x[0-9a-fA-F]\+\)[^0-9a-fA-F].*:\1:gp;d' | xargs @GPG@ -vvv --no-default-keyring --no-permission-warning --homedir @prefix@/portage/metadata --keyring "gentoo.gpg" --keyserver subkeys.pgp.net --recv-keys &> gpg.log Index: bin/portageq =================================================================== RCS file: /cvsroot/portage/bin/portageq,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- bin/portageq 4 Mar 2005 10:29:00 -0000 1.1.1.1 +++ bin/portageq 9 Mar 2005 16:16:28 -0000 1.2 @@ -1,10 +1,10 @@ -#!/usr/bin/python -O +#! @PYTHON@ -O # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /cvsroot/portage/bin/portageq,v 1.1.1.1 2005/03/04 10:29:00 haubi Exp $ +# $Header: /cvsroot/portage/bin/portageq,v 1.2 2005/03/09 16:16:28 haubi Exp $ import sys -sys.path = ["/usr/lib/portage/pym"]+sys.path +sys.path = ["@PORTAGE_BASE@/pym"]+sys.path import portage,types, portageq @@ -15,7 +15,7 @@ # def usage(): - rev="$Revision: 1.1.1.1 $" + rev="$Revision: 1.2 $" ver=rev.split(' ')[1] print ">>> Portage information query tool -- version "+ver print ">>> Usage: portageq [