diff options
author | 2003-12-25 03:06:09 +0000 | |
---|---|---|
committer | 2003-12-25 03:06:09 +0000 | |
commit | bc49162da3e6820a7ddd1992e6065aa339cfa237 (patch) | |
tree | 4c9911c4fec7b9a3b9c22d6d68b22f13d84e7104 | |
parent | Added OVERLAY directories display for --verbose. (diff) | |
download | portage-cvs-bc49162da3e6820a7ddd1992e6065aa339cfa237.tar.gz portage-cvs-bc49162da3e6820a7ddd1992e6065aa339cfa237.tar.bz2 portage-cvs-bc49162da3e6820a7ddd1992e6065aa339cfa237.zip |
Lots of little fixes. SANDBOX_READ/WRITE for PORTAGE_TMPDIR.
use() can take '!foo' negations. pkg_setup doesn't die on non-zero.
portage-2.0.50_pre9
-rw-r--r-- | ChangeLog | 20 | ||||
-rwxr-xr-x | bin/ebuild.sh | 39 | ||||
-rwxr-xr-x | bin/emerge | 4 | ||||
-rwxr-xr-x | bin/etc-update | 2 | ||||
-rwxr-xr-x | bin/quickpkg | 42 | ||||
-rw-r--r-- | pym/getbinpkg.py | 2 | ||||
-rw-r--r-- | pym/portage.py | 6 | ||||
-rw-r--r-- | pym/xpak.py | 5 |
8 files changed, 89 insertions, 31 deletions
@@ -1,8 +1,24 @@ # ChangeLog for Portage; the Gentoo Linux ports system # Copyright 2000-2003 Gentoo Technologies, Inc.; Distributed under the GPL v2 -# $Id: ChangeLog,v 1.503 2003/12/25 02:42:28 nakano Exp $ +# $Id: ChangeLog,v 1.504 2003/12/25 03:06:09 carpaski Exp $ - 25 Dec 2003; Masatomo Nakano <nakano@gentoo.org> emerge: Added OVERLAY +*portage-2.0.50_pre9 (24 Dec 2003): API change + enhancements + + 24 Dec 2003; Nicholas Jones <carpaski@gentoo.org> ebuild.sh: Added + PORTAGE_TMPDIR to SANDBOX_READ/WRITE to ensure it works. SpanKY's + patch for use negation added (use !foo). pkg_setup doesn't die on + a non-zero exit status. + + 24 Dec 2003; Nicholas Jones <carpaski@gentoo.org> emerge: using os.uname + instead of calling out to uname. + + 24 Dec 2003; Nicholas Jones <carpaski@gentoo.org> quickpkg: Added SpanKY's + patch for delayed exit/error conditions. + + 24 Dec 2003; Nicholas Jones <carpaski@gentoo.org> xpak.py: chdir's added + to the getcwd fix for missing dirs. + + 24 Dec 2003; Masatomo Nakano <nakano@gentoo.org> emerge: Added OVERLAY directories display for --verbose. *portage-2.0.50_pre8 (24 Dec 2003): API change + enhancements diff --git a/bin/ebuild.sh b/bin/ebuild.sh index 254fe41..44dc9cc 100755 --- a/bin/ebuild.sh +++ b/bin/ebuild.sh @@ -1,11 +1,11 @@ #!/bin/bash # Copyright 1999-2003 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/ebuild.sh,v 1.150 2003/12/24 09:29:04 carpaski Exp $ +# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/ebuild.sh,v 1.151 2003/12/25 03:06:09 carpaski Exp $ SANDBOX_PREDICT="${SANDBOX_PREDICT}:/proc/self/maps" -SANDBOX_WRITE="${SANDBOX_WRITE}:/dev/shm" -SANDBOX_READ="${SANDBOX_READ}:/dev/shm" +SANDBOX_WRITE="${SANDBOX_WRITE}:/dev/shm:${PORTAGE_TMPDIR}" +SANDBOX_READ="${SANDBOX_READ}:/dev/shm:${PORTAGE_TMPDIR}" if [ "$*" != "depend" ] && [ "$*" != "clean" ]; then @@ -90,18 +90,37 @@ esyslog() { } use() { + local u="${1}" + local neg=0 + if [ "${u:0:1}" == "!" ]; then + u="${u:1}" + neg=1 + fi local x for x in ${USE}; do - if [ "${x}" == "${1}" ]; then - if [ -r /dev/fd/1 ]; then - tty --quiet < /dev/stdout || echo "${x}" + if [ "${x}" == "${u}" ]; then + if [ ${neg} -eq 1 ]; then + return 1 else - echo "${x}" + if [ -r /dev/fd/1 ]; then + tty --quiet < /dev/stdout || echo "${x}" + else + echo "${x}" + fi + return 0 fi - return 0 fi done - return 1 + if [ ${neg} -eq 1 ]; then + if [ -r /dev/fd/1 ]; then + tty --quiet < /dev/stdout || echo "${x}" + else + echo "${x}" + fi + return 0 + else + return 1 + fi } has() { @@ -457,7 +476,7 @@ dyn_setup() fi fi fi - pkg_setup || die "pkg_setup function failed; exiting." + pkg_setup } dyn_unpack() { @@ -1,7 +1,7 @@ #!/usr/bin/python -O # Copyright 1999-2003 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/emerge,v 1.241 2003/12/25 02:42:28 nakano Exp $ +# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/emerge,v 1.242 2003/12/25 03:06:09 carpaski Exp $ import os,sys os.environ["PORTAGE_CALLER"]="emerge" @@ -356,7 +356,7 @@ def getportageversion(): gccver = getgccversion() - unameout=commands.getstatusoutput("uname -r")[1] + unameout=os.uname()[2] return "Portage " + portage.VERSION +" ("+profilever+", "+gccver+", glibc-"+glibcver+", "+unameout+")" diff --git a/bin/etc-update b/bin/etc-update index 615cc7b..b30e070 100755 --- a/bin/etc-update +++ b/bin/etc-update @@ -8,7 +8,7 @@ # Leo Lipelis <aeoo@gentoo.org> # Karl Trygve Kalleberg <karltk@gentoo.org> # -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/etc-update,v 1.14 2003/12/24 09:29:04 carpaski Exp $ +# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/etc-update,v 1.15 2003/12/25 03:06:09 carpaski Exp $ export PORTAGE_CALLER="etc-update" diff --git a/bin/quickpkg b/bin/quickpkg index 5a9d3de..03f2582 100755 --- a/bin/quickpkg +++ b/bin/quickpkg @@ -2,7 +2,7 @@ # Copyright (C) 2001 - Terry Chan # Copyright 2002-2003 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/quickpkg,v 1.8 2003/07/22 16:54:10 vapier Exp $ +# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/quickpkg,v 1.9 2003/12/25 03:06:09 carpaski Exp $ # This script tries to quickly create a Gentoo binary package using the # /var/db/pkg/category/pkg/* files @@ -14,17 +14,19 @@ if [ "`whoami`" != "root" ] ; then echo "You must run this as root" exit 1 fi + +export PORTAGE_DB="/var/db/pkg" if [ -z $1 ] ; then echo "QUICKPKG ver 1.2" echo "USAGE: quickpkg <list of pkgs>" echo " a pkg can be of the form:" - echo " - /var/db/pkg/<CATEGORY>/<PKG-VERSION>/" + echo " - ${PORTAGE_DB}/<CATEGORY>/<PKG-VERSION>/" echo " - single depend-type atom ..." echo " if portage can emerge it, quickpkg can make a package" echo " for exact definitions of depend atoms, see ebuild(5)" echo echo "EXAMPLE:" - echo " quickpkg /var/db/pkg/net-www/apache-1.3.27-r1" + echo " quickpkg ${PORTAGE_DB}/net-www/apache-1.3.27-r1" echo " package up apache, just version 1.3.27-r1" echo " quickpkg apache" echo " package up apache, all versions of apache installed" @@ -43,7 +45,7 @@ source /sbin/functions.sh # $2 = category do_pkg() { MYDIR="${PORTAGE_TMPDIR}/portage-pkg/$1" - SRCDIR="/var/db/pkg/$2/$1" + SRCDIR="${PORTAGE_DB}/$2/$1" ebegin "Building package for $1" ( @@ -84,8 +86,9 @@ do_pkg() { } # here we parse the parameters given to use on the cmdline +export PKGERROR="" export PKGSTATS="" -for x in $@ ; do +for x in "$@" ; do # they gave us full path if [ -e ${x}/CONTENTS ] ; then @@ -97,19 +100,36 @@ for x in $@ ; do else DIRLIST="`portageq match / ${x}`" if [ -z "${DIRLIST}" ] ; then - eerror "could not find anything to match ${x}" - exit 1 + eerror "Could not find anything to match '${x}'; skipping" + export PKGERROR="${PKGERROR} ${x}" + continue fi for d in ${DIRLIST} ; do pkg="`echo ${d} | cut -d/ -f2`" cat="`echo ${d} | cut -d/ -f1`" - do_pkg ${pkg} ${cat} + if [ -f "${PORTAGE_DB}/${cat}/${pkg}/CONTENTS" ] ; then + do_pkg ${pkg} ${cat} + elif [ -d "${PORTAGE_DB}/${cat}/${pkg}" ] ; then + ewarn "Package '${cat}/${pkg}' was injected; skipping" + else + eerror "Unhandled case (${cat}/${pkg}) !" + eerror "Please file a bug at http://bugs.gentoo.org/" + exit 10 + fi done fi done -[ -z "${PKGSTATS}" ] \ - && eerror "No packages found" \ - || echo $'\n'"$(einfo Packages now in ${PKGDIR}:)${PKGSTATS}" +if [ -z "${PKGSTATS}" ] ; then + eerror "No packages found" + exit 1 +else + echo $'\n'"$(einfo Packages now in ${PKGDIR}:)${PKGSTATS}" +fi +if [ ! -z "${PKGERROR}" ] ; then + ewarn "The following packages could not be found:" + ewarn "${PKGERROR}" + exit 2 +fi diff --git a/pym/getbinpkg.py b/pym/getbinpkg.py index 3699f17..8d4aea7 100644 --- a/pym/getbinpkg.py +++ b/pym/getbinpkg.py @@ -1,7 +1,7 @@ # getbinpkg.py -- Portage binary-package helper functions # Copyright 2003 Gentoo Technologies, Inc. # Distributed under the GNU Public License v2 -# $Id: getbinpkg.py,v 1.3 2003/12/24 09:29:04 carpaski Exp $ +# $Id: getbinpkg.py,v 1.4 2003/12/25 03:06:09 carpaski Exp $ from output import * import htmllib,HTMLParser,string,formatter,sys,os,xpak,time,tempfile,cPickle diff --git a/pym/portage.py b/pym/portage.py index 2ffd3a7..8ba30ba 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -1,9 +1,9 @@ # portage.py -- core Portage functionality # Copyright 1998-2003 Daniel Robbins, Gentoo Technologies, Inc. # Distributed under the GNU Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/pym/portage.py,v 1.361 2003/12/24 09:29:04 carpaski Exp $ +# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/pym/portage.py,v 1.362 2003/12/25 03:06:09 carpaski Exp $ -VERSION="2.0.50_pre5" +VERSION="2.0.50_pre8" import sys,string,os,re,types,shlex,shutil,xpak,fcntl,signal import time,cPickle,atexit,grp,traceback,commands,pwd,cvstree,copy @@ -3007,7 +3007,7 @@ def dep_check(depstring,mydbapi,mysettings,use="yes",mode=None,myuse=None): #up until here, we haven't needed to look at the database tree if mysplit==None: - return [0,"Parse Error (parenthesis mismatch?)"] + return [0,"Parse Error (parentheses mismatch?)"] elif mysplit==[]: #dependencies were reduced to nothing return [1,[]] diff --git a/pym/xpak.py b/pym/xpak.py index c955ca0..b84fc74 100644 --- a/pym/xpak.py +++ b/pym/xpak.py @@ -1,7 +1,7 @@ # # # -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/pym/xpak.py,v 1.10 2003/11/28 13:27:16 carpaski Exp $ +# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/pym/xpak.py,v 1.11 2003/12/25 03:06:09 carpaski Exp $ # The format for a tbz2/xpak: # @@ -57,6 +57,7 @@ def xpak(rootdir,outfile=None): try: origdir=os.getcwd() except: + os.chdir("/") origdir="/" os.chdir(rootdir) mylist=[] @@ -194,6 +195,7 @@ def xpand(myid,mydest): try: origdir=os.getcwd() except: + os.chdir("/") origdir="/" os.chdir(mydest) myindexlen=len(myindex) @@ -333,6 +335,7 @@ class tbz2: try: origdir=os.getcwd() except: + os.chdir("/") origdir="/" a=open(self.file,"r") if not os.path.exists(mydest): |