From d9fc4acc572c6647a4f27b838d35d27d805d190e Mon Sep 17 00:00:00 2001 From: Jason Stubbs Date: Sun, 28 Aug 2005 08:37:44 +0000 Subject: [PATCH] Migration (without history) of the current stable line to subversion. svn path=/main/branches/2.0/; revision=1941 --- ChangeLog | 3076 ++++++++ ChangeLog.000 | 4288 +++++++++++ TODO | 60 + bin/archive-conf | 101 + bin/chkcontents | 62 + bin/clean_locks | 36 + bin/dispatch-conf | 311 + bin/dobin | 28 + bin/doconfd | 15 + bin/dodir | 8 + bin/dodoc | 23 + bin/doenvd | 15 + bin/doexe | 26 + bin/dohard | 13 + bin/dohtml | 159 + bin/doinfo | 21 + bin/doinitd | 15 + bin/doins | 53 + bin/dojar | 54 + bin/dolib | 41 + bin/dolib.a | 7 + bin/dolib.so | 7 + bin/doman | 52 + bin/domo | 26 + bin/dopython | 23 + bin/dosbin | 27 + bin/dosed | 22 + bin/dosym | 13 + bin/ebuild | 61 + bin/ebuild.sh | 1868 +++++ bin/emake | 14 + bin/emerge | 3213 +++++++++ bin/emerge-webrsync | 141 + bin/emerge.orig | 3227 +++++++++ bin/env-update | 11 + bin/env-update.sh | 221 + bin/etc-update | 407 ++ bin/find-requires | 44 + bin/fix-db.py | 175 + bin/fixdbentries | 20 + bin/fixpackages | 14 + bin/fowners | 15 + bin/fperms | 15 + bin/md5check.py | 102 + bin/md5check.sh | 31 + bin/mirror.py | 167 + bin/newbin | 13 + bin/newconfd | 13 + bin/newdoc | 13 + bin/newenvd | 13 + bin/newexe | 13 + bin/newinitd | 13 + bin/newins | 13 + bin/newlib.a | 13 + bin/newlib.so | 13 + bin/newman | 13 + bin/newsbin | 13 + bin/pemerge.py | 44 + bin/pkgmerge | 59 + bin/pkgmerge.new | 84 + bin/pkgname | 17 + bin/portage_gpg_update.sh | 6 + bin/portageq | 256 + bin/prepall | 39 + bin/prepalldocs | 33 + bin/prepallinfo | 9 + bin/prepallman | 12 + bin/prepallstrip | 11 + bin/prepinfo | 45 + bin/preplib | 25 + bin/preplib.so | 10 + bin/prepman | 46 + bin/prepstrip | 48 + bin/quickpkg | 148 + bin/regenworld | 93 + bin/repoman | 1522 ++++ bin/xpak | 14 + cnf/dispatch-conf.conf | 36 + cnf/etc-update.conf | 71 + cnf/make.conf | 319 + cnf/make.conf.alpha | 305 + cnf/make.conf.amd64 | 316 + cnf/make.conf.arm | 313 + cnf/make.conf.hppa | 322 + cnf/make.conf.ia64 | 284 + cnf/make.conf.mac | 6 + cnf/make.conf.mips | 302 + cnf/make.conf.ppc | 335 + cnf/make.conf.ppc64 | 320 + cnf/make.conf.s390 | 284 + cnf/make.conf.sparc | 320 + cnf/make.conf.x86 | 319 + cnf/make.conf.x86-fbsd | 310 + cnf/make.globals | 67 + make-man-tarball.sh | 13 + man/alternatives.eclass.5 | 59 + man/check-kernel.eclass.5 | 53 + man/check-reqs.eclass.5 | 55 + man/cvs.eclass.5 | 80 + man/dispatch-conf.1 | 93 + man/distutils.eclass.5 | 39 + man/ebook.eclass.5 | 75 + man/ebuild.1 | 184 + man/ebuild.5 | 837 +++ man/emerge.1 | 555 ++ man/env-update.1 | 28 + man/etc-update.1 | 40 + man/eutils.eclass.5 | 176 + man/fixheadtails.eclass.5 | 32 + man/flag-o-matic.eclass.5 | 84 + man/font.eclass.5 | 64 + man/fortran.eclass.5 | 53 + man/games.eclass.5 | 119 + man/horde.eclass.5 | 51 + man/libtool.eclass.5 | 48 + man/make.conf.5 | 395 ++ man/perl-module.eclass.5 | 66 + man/portage.5 | 588 ++ man/python.eclass.5 | 82 + man/quickpkg.1 | 56 + man/repoman.1 | 127 + man/rpm.eclass.5 | 37 + man/ruby.eclass.5 | 47 + man/ssl-cert.eclass.5 | 54 + man/stardict.eclass.5 | 34 + man/subversion.eclass.5 | 59 + man/tla.eclass.5 | 52 + man/toolchain-funcs.eclass.5 | 112 + man/versionator.eclass.5 | 53 + man/vim-plugin.eclass.5 | 86 + man/vim.eclass.5 | 56 + pym/cvstree.py | 295 + pym/dcdialog.py | 412 ++ pym/dispatch_conf.py | 162 + pym/emergehelp.py | 370 + pym/getbinpkg.py | 541 ++ pym/output.py | 167 + pym/portage.py | 7452 ++++++++++++++++++++ pym/portage.py.orig | 7427 +++++++++++++++++++ pym/portage_checksum.py | 134 + pym/portage_const.py | 48 + pym/portage_contents.py | 161 + pym/portage_data.py | 85 + pym/portage_db_anydbm.py | 64 + pym/portage_db_cpickle.py | 79 + pym/portage_db_flat.py | 113 + pym/portage_db_template.py | 174 + pym/portage_db_test.py | 21 + pym/portage_dep.py | 155 + pym/portage_exception.py | 163 + pym/portage_exec.py | 215 + pym/portage_file.py | 62 + pym/portage_gpg.py | 149 + pym/portage_localization.py | 21 + pym/portage_locks.py | 360 + pym/portage_util.py | 459 ++ pym/xpak.py | 384 + qa/iuse/iuse.sh | 20 + qa/iuse/iuse2.py | 58 + spec/emerge.syntax | 1149 +++ src/bsd-flags/PKG-INFO | 10 + src/bsd-flags/chflags.c | 161 + src/bsd-flags/setup.cfg | 6 + src/bsd-flags/setup.py | 24 + src/python-missingos/ChangeLog | 16 + src/python-missingos/PKG-INFO | 10 + src/python-missingos/README | 15 + src/python-missingos/missingos.c | 120 + src/python-missingos/setup.cfg | 8 + src/python-missingos/setup.py | 24 + src/sandbox-1.1/ChangeLog | 265 + src/sandbox-1.1/Makefile | 81 + src/sandbox-1.1/canonicalize.c | 173 + src/sandbox-1.1/create-localdecls | 115 + src/sandbox-1.1/getcwd.c | 511 ++ src/sandbox-1.1/libctest.c | 7 + src/sandbox-1.1/libsandbox.c | 1383 ++++ src/sandbox-1.1/sandbox.bashrc | 8 + src/sandbox-1.1/sandbox.c | 863 +++ src/sandbox-1.1/sandbox.h | 68 + src/sandbox-1.1/sandbox_futils.c | 513 ++ src/sandbox-dev/ChangeLog | 91 + src/sandbox-dev/Makefile | 62 + src/sandbox-dev/canonicalize.c | 194 + src/sandbox-dev/create-localdecls | 95 + src/sandbox-dev/libctest.c | 6 + src/sandbox-dev/libsandbox.c | 1214 ++++ src/sandbox-dev/sandbox.bashrc | 8 + src/sandbox-dev/sandbox.c | 816 +++ src/sandbox-dev/sandbox.h | 69 + src/sandbox-dev/sandbox_futils.c | 352 + src/sandbox/Makefile | 30 + src/sandbox/libsandbox.c | 873 +++ src/sandbox/problems/Makefile | 31 + src/sandbox/problems/libsandbox_emacsbug.c | 34 + src/sandbox/problems/libsandbox_muttbug.c | 24 + src/sandbox/problems/sandbox_dev_fd_foo.c | 42 + src/sandbox/problems/sandbox_muttbug.c | 43 + src/sandbox/sandbox.bashrc | 8 + src/sandbox/sandbox.c | 921 +++ src/tbz2tool.c | 228 + tabcheck.py | 6 + tarball.sh | 58 + 203 files changed, 60349 insertions(+) create mode 100644 ChangeLog create mode 100644 ChangeLog.000 create mode 100644 TODO create mode 100755 bin/archive-conf create mode 100755 bin/chkcontents create mode 100755 bin/clean_locks create mode 100755 bin/dispatch-conf create mode 100755 bin/dobin create mode 100755 bin/doconfd create mode 100755 bin/dodir create mode 100755 bin/dodoc create mode 100755 bin/doenvd create mode 100755 bin/doexe create mode 100755 bin/dohard create mode 100755 bin/dohtml create mode 100755 bin/doinfo create mode 100755 bin/doinitd create mode 100755 bin/doins create mode 100755 bin/dojar create mode 100755 bin/dolib create mode 100755 bin/dolib.a create mode 100755 bin/dolib.so create mode 100755 bin/doman create mode 100755 bin/domo create mode 100755 bin/dopython create mode 100755 bin/dosbin create mode 100755 bin/dosed create mode 100755 bin/dosym create mode 100755 bin/ebuild create mode 100755 bin/ebuild.sh create mode 100755 bin/emake create mode 100755 bin/emerge create mode 100755 bin/emerge-webrsync create mode 100755 bin/emerge.orig create mode 100755 bin/env-update create mode 100755 bin/env-update.sh create mode 100755 bin/etc-update create mode 100755 bin/find-requires create mode 100755 bin/fix-db.py create mode 100755 bin/fixdbentries create mode 100755 bin/fixpackages create mode 100755 bin/fowners create mode 100755 bin/fperms create mode 100755 bin/md5check.py create mode 100755 bin/md5check.sh create mode 100755 bin/mirror.py create mode 100755 bin/newbin create mode 100755 bin/newconfd create mode 100755 bin/newdoc create mode 100755 bin/newenvd create mode 100755 bin/newexe create mode 100755 bin/newinitd create mode 100755 bin/newins create mode 100755 bin/newlib.a create mode 100755 bin/newlib.so create mode 100755 bin/newman create mode 100755 bin/newsbin create mode 100755 bin/pemerge.py create mode 100755 bin/pkgmerge create mode 100755 bin/pkgmerge.new create mode 100755 bin/pkgname create mode 100755 bin/portage_gpg_update.sh create mode 100755 bin/portageq create mode 100755 bin/prepall create mode 100755 bin/prepalldocs create mode 100755 bin/prepallinfo create mode 100755 bin/prepallman create mode 100755 bin/prepallstrip create mode 100755 bin/prepinfo create mode 100755 bin/preplib create mode 100755 bin/preplib.so create mode 100755 bin/prepman create mode 100755 bin/prepstrip create mode 100755 bin/quickpkg create mode 100755 bin/regenworld create mode 100755 bin/repoman create mode 100755 bin/xpak create mode 100644 cnf/dispatch-conf.conf create mode 100644 cnf/etc-update.conf create mode 100644 cnf/make.conf create mode 100644 cnf/make.conf.alpha create mode 100644 cnf/make.conf.amd64 create mode 100644 cnf/make.conf.arm create mode 100644 cnf/make.conf.hppa create mode 100644 cnf/make.conf.ia64 create mode 100644 cnf/make.conf.mac create mode 100644 cnf/make.conf.mips create mode 100644 cnf/make.conf.ppc create mode 100644 cnf/make.conf.ppc64 create mode 100644 cnf/make.conf.s390 create mode 100644 cnf/make.conf.sparc create mode 100644 cnf/make.conf.x86 create mode 100644 cnf/make.conf.x86-fbsd create mode 100644 cnf/make.globals create mode 100755 make-man-tarball.sh create mode 100644 man/alternatives.eclass.5 create mode 100644 man/check-kernel.eclass.5 create mode 100644 man/check-reqs.eclass.5 create mode 100644 man/cvs.eclass.5 create mode 100644 man/dispatch-conf.1 create mode 100644 man/distutils.eclass.5 create mode 100644 man/ebook.eclass.5 create mode 100644 man/ebuild.1 create mode 100644 man/ebuild.5 create mode 100644 man/emerge.1 create mode 100644 man/env-update.1 create mode 100644 man/etc-update.1 create mode 100644 man/eutils.eclass.5 create mode 100644 man/fixheadtails.eclass.5 create mode 100644 man/flag-o-matic.eclass.5 create mode 100644 man/font.eclass.5 create mode 100644 man/fortran.eclass.5 create mode 100644 man/games.eclass.5 create mode 100644 man/horde.eclass.5 create mode 100644 man/libtool.eclass.5 create mode 100644 man/make.conf.5 create mode 100644 man/perl-module.eclass.5 create mode 100644 man/portage.5 create mode 100644 man/python.eclass.5 create mode 100644 man/quickpkg.1 create mode 100644 man/repoman.1 create mode 100644 man/rpm.eclass.5 create mode 100644 man/ruby.eclass.5 create mode 100644 man/ssl-cert.eclass.5 create mode 100644 man/stardict.eclass.5 create mode 100644 man/subversion.eclass.5 create mode 100644 man/tla.eclass.5 create mode 100644 man/toolchain-funcs.eclass.5 create mode 100644 man/versionator.eclass.5 create mode 100644 man/vim-plugin.eclass.5 create mode 100644 man/vim.eclass.5 create mode 100644 pym/cvstree.py create mode 100644 pym/dcdialog.py create mode 100644 pym/dispatch_conf.py create mode 100644 pym/emergehelp.py create mode 100644 pym/getbinpkg.py create mode 100644 pym/output.py create mode 100644 pym/portage.py create mode 100644 pym/portage.py.orig create mode 100644 pym/portage_checksum.py create mode 100644 pym/portage_const.py create mode 100644 pym/portage_contents.py create mode 100644 pym/portage_data.py create mode 100644 pym/portage_db_anydbm.py create mode 100644 pym/portage_db_cpickle.py create mode 100644 pym/portage_db_flat.py create mode 100644 pym/portage_db_template.py create mode 100644 pym/portage_db_test.py create mode 100644 pym/portage_dep.py create mode 100644 pym/portage_exception.py create mode 100644 pym/portage_exec.py create mode 100644 pym/portage_file.py create mode 100644 pym/portage_gpg.py create mode 100644 pym/portage_localization.py create mode 100644 pym/portage_locks.py create mode 100644 pym/portage_util.py create mode 100644 pym/xpak.py create mode 100644 qa/iuse/iuse.sh create mode 100755 qa/iuse/iuse2.py create mode 100755 spec/emerge.syntax create mode 100644 src/bsd-flags/PKG-INFO create mode 100644 src/bsd-flags/chflags.c create mode 100644 src/bsd-flags/setup.cfg create mode 100755 src/bsd-flags/setup.py create mode 100644 src/python-missingos/ChangeLog create mode 100644 src/python-missingos/PKG-INFO create mode 100644 src/python-missingos/README create mode 100644 src/python-missingos/missingos.c create mode 100644 src/python-missingos/setup.cfg create mode 100755 src/python-missingos/setup.py create mode 100644 src/sandbox-1.1/ChangeLog create mode 100644 src/sandbox-1.1/Makefile create mode 100644 src/sandbox-1.1/canonicalize.c create mode 100755 src/sandbox-1.1/create-localdecls create mode 100644 src/sandbox-1.1/getcwd.c create mode 100644 src/sandbox-1.1/libctest.c create mode 100644 src/sandbox-1.1/libsandbox.c create mode 100644 src/sandbox-1.1/sandbox.bashrc create mode 100644 src/sandbox-1.1/sandbox.c create mode 100644 src/sandbox-1.1/sandbox.h create mode 100644 src/sandbox-1.1/sandbox_futils.c create mode 100644 src/sandbox-dev/ChangeLog create mode 100644 src/sandbox-dev/Makefile create mode 100644 src/sandbox-dev/canonicalize.c create mode 100755 src/sandbox-dev/create-localdecls create mode 100644 src/sandbox-dev/libctest.c create mode 100644 src/sandbox-dev/libsandbox.c create mode 100644 src/sandbox-dev/sandbox.bashrc create mode 100644 src/sandbox-dev/sandbox.c create mode 100644 src/sandbox-dev/sandbox.h create mode 100644 src/sandbox-dev/sandbox_futils.c create mode 100644 src/sandbox/Makefile create mode 100644 src/sandbox/libsandbox.c create mode 100644 src/sandbox/problems/Makefile create mode 100644 src/sandbox/problems/libsandbox_emacsbug.c create mode 100644 src/sandbox/problems/libsandbox_muttbug.c create mode 100644 src/sandbox/problems/sandbox_dev_fd_foo.c create mode 100644 src/sandbox/problems/sandbox_muttbug.c create mode 100644 src/sandbox/sandbox.bashrc create mode 100644 src/sandbox/sandbox.c create mode 100644 src/tbz2tool.c create mode 100755 tabcheck.py create mode 100755 tarball.sh diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 000000000..bc90eadcd --- /dev/null +++ b/ChangeLog @@ -0,0 +1,3076 @@ +# ChangeLog for Portage; the Gentoo Linux ports system +# Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL v2 +# $Id: ChangeLog,v 1.796.2.146 2005/08/20 17:24:30 jstubbs 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. + + 21 Aug 2005; Jason Stubbs bin/ebuild.sh: Skip protecting + ownership of symlinks. Patch by truedfx #94199 + + 14 Aug 2005; Mike Frysinger bin/prepstrip: + Don't try to strip if `file` failed #102499 by Daniel Drake. + + 10 Aug 2005; Mike Frysinger bin/quickpkg: + Call gawk instead of awk so non-GNU systems work #102050 by Stephen Bennett. + Also clean up the script a bit. + + 08 Aug 2005; Brian Harring bin/ebuild.sh: + fixed bug #101035 , basically checking pipestatus during unpack for + piped unpacks. + + 07 Aug 2005; Mike Frysinger bin/ebuild.sh: + Add support for unpacking rar archives. + + 04 Aug 2005; Brian Harring bin/emerge: + bug 64585, sanity check on cache cleansing. + + 04 Aug 2005: Brian Harring bin/emerge: + It's not perfect, but a fix for bug #96410. A better fix would be + to get the categories limiter out of settings... + + 29 Jul 2005; Mike Frysinger bin/doman: + Back port from portage HEAD: + Remove old unused options (-x11/-gnome/-kde/etc...) and cleanup. + + 04 Jul 2005; Mike Frysinger + bin/ebuild-default-functions.sh: + Fix gnuconfig find expression #93363 by TGL. + + 23 Jun 2005; Mike Frysinger + bin/ebuild-default-functions.sh: + Update the scanelf RUNPATH check to abort on null paths. + + 17 Jun 2005; Mike Frysinger bin/repoman: + Report exit status if gpg failed to return with 0. + + 14 Jun 2005; Marius Mauch man/portage.5: + Remove references to non-existant $PORTDIR/profiles/use.mask and revert + the "fix" for bug 87173. + + 13 Jun 2005; Mike Frysinger bin/ebuild.sh: + Use the %p output modifier instead of %F so we don't have to update the + output by removing all the $D references. + + 29 May 2005; Jason Stubbs bin/ebuild.sh: Made + /etc/profile.env sourced regardless of USERLAND. Made copying of config.sub + and config.guess --force'd as they are sometimes u-w. Replaced a if/else of + chgrp root/wheel with chgrp 0. + + 29 May 2005; Jason Stubbs bin/emerge: Moved the system + package unmerge check after slots are checked and removed the countdown for + when --ask is specified. Added a chdir to the removal of old cache call so + that there are no errors due to userpriv and being in a non-portage-readable + directory. + + 29 May 2005; Jason Stubbs bin/etc-update: Moved the + temporary work dir from /tmp/$$ to ${PORTAGE_TMPDIR}/$$. + + 29 May 2005; Jason Stubbs bin/prepinfo bin/prepman: + Reordered the -{min,max}depth and -name arguments to find so that warnings + are not produced. + + 29 May 2005; Jason Stubbs pym/portage.py: Added support + for FreeBSD's ldconfig. Fixed an incorrect chown of BUILD_PREFIX instead of + PORT_LOGDIR. + + 29 May 2005; Mike Frysinger bin/ebuild.sh bin/prepstrip: + Backport scanelf QA checks from HEAD. + + 25 May 2005; Brian Harring bin/ebuild.sh: Bug 93293, + die + stat_perms issues. Tweaked do_stat definition so it's one time instead + of ongoing also. + + 19 May 2005; Jason Stubbs pym/portage.py: Disabled + userpriv as a user globally instead of only in fetch. + + 19 May 2005; Jason Stubbs bin/emake: Made the + make command configurable but defaulted to "make". + + 19 May 2005; Jason Stubbs bin/emerge: Fixed an + issue that would cause binary package reinstalls when IUSE disagreed. + + 19 May 2005; Jason Stubbs bin/repoman: Fixed an + issue where the portage version wasn't appended to the commit message + when specified on the command line. Fixed the detection of files above + the package level during Manifest generation. + + 19 May 2005; Jason Stubbs pym/portage.py: Renamed + the userpriv FEATURE to userfetch for the fetch() phase and fixed a bug + where privileges would try to be dropped even as non-root. Fixed a bug + where files were attempted to be fetched when only a manifest recreation + is requested. + + 17 May 2005; Jason Stubbs pym/portage.py: Stopped + attempting to fetch files when only the manifest is being generated. + +*portage-2.0.51.22 (15 May 2005): Maintainence Release + + 15 May 2005; Jason Stubbs bin/dodoc: Removed the dodoc + new testing features from head's version of dodoc. + + 15 May 2005; Jason Stubbs bin/emerge: Made --newuse + take priority over --usepkg. + + 15 May 2005; Jason Stubbs bin/repoman: Added HOMEPAGE + to the list of vars that must be defined. Restored detection of the + digest.partial check. Made a commit message required. + + 15 May 2005; Jason Stubbs pym/portage.py: Fixed the + definition of PYTHONPATH in env_update(). Fixed the handling of quotes in + env_update(). + + 13 May 2005; Jason Stubbs cnf/dispatch-conf.conf + bin/dispatch-conf: Removed the pager config option and made if part of the + diff command option. + + 13 May 2005; Jason Stubbs bin/dodoc: Backported vapier's + fix for 0-byte files causing a spurious "file not found" error. + + 13 May 2005; Jason Stubbs bin/emerge: Remove --verbose + and --tree from options when using --resume as the combination is currently + broken. + + 13 May 2005; Jason Stubbs bin/repoman: Added three new + checks on ebuild's PROVIDEs. Optimized out a lot of unnecessary aux_get() + calls. Modified to commit an unsigned Manifest before committing the signed + one to help ensure broken digests don't make it to rsync. + + 13 May 2005; Jason Stubbs pym/portage.py: Added SCCS to + the list of directories to ignore when ignorecvs is set in cacheddir. Drop + priveleges during fetch when userpriv is set. Added message display when + changing permissions on ccache dirs. + + 06 May 2005; Brian Harring bin/ebuild: fix portage_util + import on osx. + + 05 May 2005; Jason Stubbs bin/etc-update: Fixed the + regex and added locale overrides to the use of cut as per bug #91159. + + 05 May 2005; Jason Stubbs cnf/make.globals: Made + CONFIG_PROTECT default to /etc only as packages are augmenting it via env.d + where necessary. + + 05 May 2005; Jason Stubbs bin/emerge: Reverted deletion + of apparently unused code as it was being used in the case of --noreplace. + + 04 May 2005; Marius Mauch bin/g-cpan.pl, man/g-cpan.pl.1: + removed g-cpan.pl as it's now a standalone tool. + + 02 May 2005; Jason Stubbs pym/portage.py: Added back + support for ~* and * in package.keywords as it got dropped at some point. + +*portage-2.0.51.21 (01 May 2005): Maintainence Release + + 01 May 2005; Jason Stubbs bin/ebuild.sh: Fixed an + inverse logic bug in the setting of ccache size. + + 01 May 2005; Jason Stubbs : Removed g-cpan.pl as it + is now maintained externally. Removed other old and/or unmaintained + scripts. + + 01 May 2005; Jason Stubbs pym/portage.py: Dropped + confmem from 16 previous files down to 1 previous file so that upgrading + and downgrading behaves in terms of config files. + + 01 May 2005; Jason Stubbs pym/portage.py: Added + checking of overlays for package.mask, categories and others. + + 01 May 2005; Jason Stubbs bin/ebuild.sh: Skip testing + if has already been performed (indicated by .tested) + + 01 May 2005; Jason Stubbs pym/portage.py: Removed + debugging information and added a fix for merging a symlink to a + directory over a file. + + 01 May 2005; Jason Stubbs cnf/make.globals: Added + a basic CONFIG_PROTECT setting for those users who use only binary + packages and don't have a portage tree. + + 29 Apr 2005; Jason Stubbs bin/doman: Added Mike's + patch to broaden the accepted man pages from [1-8n] to [0-9n](|f|p|pm) + + 29 Apr 2005; Jason Stubbs bin/emerge pym/portage.py: + Added an implementation for the emerge config action and a supporting + method findname on the vardbapi class. + + 29 Apr 2005; Jason Stubbs man/portage.5: Removed + invalid example from portage.keywords. + + 29 Apr 2005; Jason Stubbs bin/emerge: Drop privs + when doing cache cleansing after syncing. + + 29 Apr 2005; Jason Stubbs pym/portage.py: Fixed + several issues with userpriv. + + 29 Apr 2005; Jason Stubbs bin/ebuild.sh: Made the + autoconfig feature non-optional. + + 29 Apr 2005; Jason Stubbs pym/portage.py: Removed + running of depscan.sh from env-update. + + 29 Apr 2005; Jason Stubbs pym/portage.py: Applied + solar's patches from bug #90720 that allow most ebuild operations to work + as any user in the portage group. + + 29 Apr 2005; Jason Stubbs pym/portage.py: Fixed a bug + that would cause an empty CBUILD to be defined if CHOST is not defined. + + 29 Apr 2005; Jason Stubbs cnf/make.globals.*: Removed + the now deprecated arch-specific make.globals files. + + 29 Apr 2005; Jason Stubbs bin/dispatch-conf + pym/dispatch-conf.py: Fixed a typo with the added merge option. Added + hard-coded default merge option so that dispatch-conf can be used to do + a line by line of dispatch-conf.conf. + + 29 Apr 2005; Jason Stubbs bin/ebuild.sh: Updated econf + to use LOCAL_EXTRA_ECONF rather than EXTRA_ECONF directly, as noted by + eradicator. Removed the forced resizing of ccache when CCACHE_SIZE is + undefined. + + 29 Apr 2005; Jason Stubbs bin/emerge: Fixed bug in + --info during sorting when two versions have only differing -r component. + Ported Brian's regen method to --metadata for faster updates. + + 29 Apr 2005; Jason Stubbs bin/repoman: Fixed an + off-by-one indexing into a list during scanning for Manfiest commits. + + 29 Apr 2005; Jason Stubbs pym/portage.py: Fixed a bug + in the checking of whether sandbox is usable when usersandbox is enabled. + Combined u+w and g+w mods on ccache dir into the one exec. Added missing g+s + mods on ccache dir, which was causing mods at each check. Moved mtime check + in aux_get so that it applies to updating from the metadata cache as well. + Relocated the fix for mynewcat outside of the loop to prevent needless + re-calculation. Added debugging code for bug #71787. + + 24 Apr 2005; Masatomo Nakano pym/portage.py + Fixed undefined value causing traceback when moving package in binarytree. + +*portage-2.0.51.20 (23 Apr 2005): Maintainence Release + + 23 Apr 2005; Jason Stubbs pym/portage_const.py: + Adjusted sandbox path to match the external sandbox. + + 23 Apr 2005; Jason Stubbs bin/repoman: Added a 3 second + delay after a failed Manifest commit. Fixed bug where files at the category + level were being treated as packages. + + 23 Apr 2005; Jason Stubbs pym/portage.py portage_util.py + portage_db_cpickle.py: Replaced HIGHEST_PROTOCOL with it's equivalent -1 to + ensure python-2.2 compatibility. Added back ChangeLog and metadata.xml to + Manifest generation for portage compatibility. + + 21 Apr 2005; Jason Stubbs pym/portage.py: Adding + setting of CBUILD to CHOST if it is not set. Fixed getmaskingstatus to + choose an arch-based keyword over -*. + + 21 Apr 2005; Jason Stubbs bin/ebuild.sh: Removed + stale code from dyn_setup. + + 19 Apr 2005; Brian Harring pym/portage_db_flat.py: + Correction for string method name, again, danke to swegener. + + 19 Apr 2005; Jason Stubbs bin/ebuild: Added a missing + import of portage_util. + + 19 Apr 2005; Jason Stubbs pym/portage.py: Fixed my + assumption that ChangeLog and metadata.xml will exist during digest creation. + + 17 Apr 2005; Brian Harring pym/portage.py: eclass cache + touche up, mtime wasn't being properly checked (thanks to swegener for catching + it). + + 17 Apr 2005; Jason Stubbs pym/portage_exec.py + pym/portage.py: Added checks to see if the sandbox is executable and disabled + when it isn't. + + 17 Apr 2005; Jason Stubbs bin/dispatch-conf + cnf/dispatch-conf.conf pym/dispatch-conf.py: Made the merge command + configurable. Fixed a bug that caused conflicts to make their way into the + final configuration file. Made the config archive dir automatically created + if there is nothing in the way. + + 17 Apr 2005; Jason Stubbs pym/output.py: Reverted the + feature to make use of screen titles. + + 17 Apr 2005; Jason Stubbs bin/emerge: Made detection + of --ask capability use stdin instead of stdout. + + 15 Apr 2005; Jason Stubbs pym/portage.py: Removed + ChangeLog and metadata.xml from Manifest creation and checking. Quietened + failed mtimedb writes. Added patch to allow fetching to read-only DISTDIR. + Added logic to detect changing between userpriv and non-userpriv and + update the ccache permissions at each change. + + 15 Apr 2005; Jason Stubbs cnf/make.globals*: Removed + vars not directly related to portage. Architecture specific ones are going + into the relevant profiles. USE_ORDER and CONFIG_PROTECT* will likely be + going into base. + + 14 Apr 2005; Jason Stubbs pym/portage.py: Applied + patch from #69763 to allow fetching to a read-only distfiles dir. + + 13 Apr 2005; Jason Stubbs bin/repoman: Downgraded + the nesteddie check to a warning as it sometimes has false positives. + + 13 Apr 2005; Jason Stubbs cnf/make.conf*: Removed + size estimation of PORTDIR. + + 13 Apr 2005; Jason Stubbs pym/portage.py: Added + verification of package.provided contents. Fixed a bug with an incorrect + error on binary package category moves. Fixed a small bug that would + cause a crash on an invalid PRELINK_PATH_MASK. Added signal handling of + SIGPIPE. Added deep fixing of permissions on CCACHE_DIR when changing + between userpriv states. + + 13 Apr 2005; Jason Stubbs bin/emerge: Added sorting to + versions listed in emerge info output. + + 13 Apr 2005; Jason Stubbs man/emerge.1: Removed --inject + documentation. + + 12 Apr 2005; Jason Stubbs bin/emerge: Added --nocolor + option courtesy of Jason Cooper on gentoo-user@g.o. + + 12 Apr 2005; Jason Stubbs bin/repoman: Fixed the date + parsing of repoman to allow ranged and single years beginning 1999. #85242 + + 12 Apr 2005; Jason Stubbs pym/portage.py: Added + pusedict optimization. #85786 + + 12 Apr 2005; Jason Stubbs bin/emerge: Fixed emerge to + always add packages to world unless --oneshot is specified. + + 12 Apr 2005; Jason Stubbs bin/dispatch-conf: + Replaced shutil.movefile() calls for python-2.2 compatibility. + + 12 Apr 2005; Jason Stubbs bin/portageq pym/portage.py: + Utilized PORTAGE_CALLER to only print profile deprecation noticies when + emerge first starts up. + + 12 Apr 2005; Jason Stubbs bin/repoman: + Limited digest.assumed and ebuild.allmasked (by default) to scans at + the package level only. Removed IUSE from required variables. Fixed + duplicate reporting of required variables. Adjusted size limit of + files/* to 20480 bytes. Fixed allmasked check. Removed reinitialization + of each profile at every usage. + + 12 Apr 2005; Jason Stubbs pym/portage.py: Fixed + spelling error. Removed code from portdbapi.gvisible that was only + utilized by repoman's (broken) allmasked check. + + 03 Apr 2005; Jason Stubbs bin/emerge: Modified to + ignore blockers when using --buildpkgonly. + + 02 Apr 2005; Jason Stubbs pym/portage.py: + Made autouse calculated only at import time to ensure that use flags + from dep calculation are the same as those used at build time. + + 02 Apr 2005; Jason Stubbs pym/portage_dep.py: + Fixed a bug where a return type was a tuple instead of a list in + paren_reduce(). + + 23 Mar 2005; Jason Stubbs bin/dispatch-conf: + Removed the -a argument from all diff usage. + + 08 Mar 2005; Brian Harring pym/portage.py: + Tweak to ensure restrict is dumped to the env, with PORTAGE_RESTRICT + being dumped also. + + 06 Mar 2005; Jason Stubbs bin/emerge: Added a check + to make sure the file exists before working with it, when called with an + ebuild path. #84102 + +*portage-2.0.51.19 (04 Mar 2005): Maintainence Release + + 02 Feb 2005; Jason Stubbs pym/portage.py: Fixing + ferringb's fix by adding the full scope of normpath. + + 02 Mar 2005; Nicholas Jones pemerge.py: Add it back + since I seem to have removed it by changing/refreshing dirs at some point. + + 01 Mar 2005; Brian Harring pym/portage.py: bug 83712, + a lovely normalized path bug in eclass_cache resulting in false positives on + eclass cache staleness... + + 01 Mar 2005; Brian Harring bin/prepman: bug 83704, + prepman getting stupid about gzip'ing already bzip2'd man pages. + + 01 Mar 2005; Jason Stubbs bin/emerge: Expanded + syslist during the unmerge phase so that all packages listed in system + are correctly checked and warned against. #83670 + +*portage-2.0.51.18 (28 Feb 2005): Maintainence Release + + 28 Feb 2005; Jason Stubbs pym/portage.py: Added a + -* to updated FEATURES before saving back to the env. #79566 + + 27 Feb 2005; Jason Stubbs pym/portage.py: Added back + sorting of the final list from portdbapi.cp_all() so that emerge regen + is ordered correctly. + +*portage-2.0.51.17 (26 Feb 2005): Maintainence Release + + 26 Feb 2005; Nicholas Jones *: Darwin userland patch + from Kito (bug 82312). Adjusted a couple bits like the file was installed + with message and etc-update's USERLAND check per Jason suggestion. + + 26 Feb 2005; Nicholas Jones portage_data.py: Added + the 'gnu' suffix check for the BSD/GNU people. (bug 80018) + + 26 Feb 2005; Nicholas Jones pym/xpak.py: Added in a + method to get both the data and index segments for use with the other memory + based functions. + + 21 Feb 2005; Brian Harring pym/portage.py: So yeah. + Don't fool with the eclass_cache.porttree ordering unless you understand that + it -must- match bash's inherit order (where overlays override portdir). + + 15 Feb 2005; Jason Stubbs emerge: Disabled the cache + update output when using --quiet. #81678 + + 15 Feb 2005; Jason Stubbs make.conf*: Added + warning with regard to changing CHOST. #81007 + + 13 Feb 2005; Jason Stubbs make.conf*: Added warning + with regard to changing PORTDIR and /etc/make.profile. + + 13 Feb 2005; Jason Stubbs portage.py: Fixed the global + features usage in the config class and made sure that any adjustments are + propogated back to the env. + + 13 Feb 2005; Jason Stubbs chflags.c: Replaced stat + call with an lstat call in lhasproblems as the calling code expects the + function to operate directly on symlinks. + +*portage-2.0.51.16 (06 Feb 2005): Maintainence Release + BSD chflags + + 06 Feb 2005; Nicholas Jones portage.py, src/chflags: + Addition of BSD chflags support (from spb@gentoo.org). Wrapped all the + calls within a check for the modules existance so we can reduce any problems + due to a failing or missing module. Internally renamed it bsd_chflags. + + 06 Feb 2005; Jason Stubbs bin/ebuild.sh: Completed + renaming of "maketest" to "test". RESTRICT supports both. #77446 + + 06 Feb 2005; Jason Stubbs pym/output.py: Added checking + of whether stderr is a tty before changing xterm titles. #73824 + + 05 Feb 2005; Jason Stubbs bin/emerge: Added removal of + --tree and --changelog upon a restart of emerge. Added --ask support to + emerge metadata. + + 05 Feb 2005; Jason Stubbs pym/portage.py: Removed the + requisite that a profile must depend on ">=sys-apps/portage-2.0.51" to be + able to use package.mask. + + 05 Feb 2005; Jason Stubbs bin/repoman pym/portage.py: + Removed the disabling of PORTDIR_OVERLAY from portage.py and added code to + repoman to set PORTDIR to the current directory's repo unless it doesn't + contain a profiles directory. If that is the case, PORTDIR is kept and + PORTDIR_OVERLAY is set to the current overlay -only-. + + 03 Feb 2005; Brian Harring pym/portage.py: bug 80506, + fixed RESTRICT="(no|)userpriv". + + 31 Jan 2005; Brian Harring pym/portage.py: Spanky pointed + a bug assuming the intermediate directories for WORLD_FILE existed already. + + 30 Jan 2005; Brian Harring bin/ebuild.sh: Update from + eradicator, bug #75420. Multilib stuff. :) + + 30 Jan 2005; Brian Harring bin/prepman: Fixing bug + #79788. Some screwy syntax for a find call was screwing up gzip'ing of man + pages for osx boxes. + + 30 Jan 2005; Jason Stubbs emerge emerge.1: Added short + -N option for --newuse. Moved virtuals updating for packages that are about + to be installed so that the update happens after the virtuals within that + package's direct dependencies are resolved. Made the blocking message + slightly easier to understand. Added a suggestion to run emerge with --newuse + before running depclean. + + 30 Jan 2005; Jason Stubbs etc-update: Removed the + unsetting of various options that happens when using graphical mode. + + 30 Jan 2005; Jason Stubbs quickpkg: Added -h and --help + options. + + 30 Jan 2005; Jason Stubbs repoman: Added patch to call + xmllint directly on metadata.xml rather than piping it. This prevents the + need (and possible failure) to escape quote characters. + + 30 Jan 2005; Jason Stubbs portage.py: Fixed a bug with + calculations using PRELINK_PATH_MASK where paths matching those in + PRELINK_PATH_MASK were not removed. + + 28 Jan 2005; Brian Harring portage_db_flat.py: removed + the portage_locks locking that was added, using a different strategy reliant + on rename. Basically, for a pull- you open the file. If that fails, then + the cache lacks that entry. If it succeeds, you do your stat calls (to get + mtime) against the -file handle-, via fstat. You can read from that inode + without issue, but do not assume that that inode is the still accessible via + another open call (it may've been updated since). Pushes are accomplished + via writing everything to a temp file, then renaming that file to the correct + name- chmod/chown/utime calls need to be done prior to the rename. + So, if a pull is ongoing while a push starts up and finishes, the pull still + is accessing the old cache entry- worst case scenario, it goes and reupdates + the cache entry. This is acceptable, since the overhead from using a seperate + lockfile is much more costly (in some cases, a difference of 3m to 20m). + Normal cases, roughly 13% improvement. + + 24 Jan 2005; Nicholas Jones portage.py: Fixed the + fetch/nofetch RESTRICT bug introduced in -r14. Completely disable overlay + when calling from repoman. + + 24 Jan 2005; Nicholas Jones ebuild.sh: Test print out + fix. + + 19 Jan 2005; Brian Harring ebuild.sh: Quick change to + features=autoconfig, avoiding an extra subshell. + +*portage-2.0.51-r14 (15 Jan 2005): Stable Candidate + + 18 Jan 2005; Nicholas Jones ebuild.sh: Unset IFS + after entering the for loop for bashrc's. The IFS setting applies to the + source command and messes up the assumptions about bash scripts and IFS. + + 18 Jan 2005; Jason Stubbs portage.py emerge-webrsync: + Fixed the bash syntax error in emerge-webrsync as per #77941. Fixed the + blocking virtuals bug as per #78201. Removed the warning about negations + and reapplied negations to profile virtuals. + + 17 Jan 2005; Nicholas Jones portage.py: Prevented + negations from applying in virtuals and provided a warning. + + 16 Jan 2005; Nicholas Jones repoman: Fix to match up + to the namespace changes in portage. + + 16 Jan 2005; Nicholas Jones portage.py: Patch from a + bug report on a traceback that occurs when re-digesting a file without any + distfiles but with a preexisting digest. + + 16 Jan 2005; Nicholas Jones *.py: Added a cvs_id_str + to each portage module so we can account for them easily. Added printing + of those versions on a 'emerge -d info'. Cleaned up the * imports in the + modules so there shouldn't be any namespace pollution left. + +*portage-2.0.51-r13 (15 Jan 2005): Testing for virtuals changes + + 15 Jan 2005; Nicholas Jones portage.py: Adjusted the + virtuals handling into an advanced for of what Jason started using promotion + instead of blanket settings. Removed the user_profile dir completely when + using repoman via a new user_profile_dir variable that is stored on creation. + Split the getvirtuals() call into two pieces so that setinst() can also + recreate the virtuals properly when modifying the vartree. + + 15 Jan 2005; Nicholas Jones portage_util.py: Modified + the stack_dictlist function to handle '-*' and do it in the proper order. + + 13 Jan 2005; Nicholas Jones portage.py, emerge: + Adjusted the version handling for portage so that we can use CVS versions + and ignore the restarts when using livecvsportage. + + 13 Jan 2005; Nicholas Jones repoman: Added the + portage/repoman version used to the commit messages. + + 13 Jan 2005; Jason Stubbs pym/portage.py: Fixed the + reverse ordering of profile virtuals before installed virtuals stacking. + Turn a reference assignment into a copy to fix a bug where digesting would + not include files that were already fetched previously. Added information + about which package is causing an error to some aux_get() errors. + +*portage-2.0.51-r11 (13 Jan 2005): Cleanup + + 13 Jan 2005; Nicholas Jones cnf/*: Updates for the + OSUOSL -> distfiles.gentoo.org changeover. Addition of PORTAGE_TMPFS to + the config files. + + 13 Jan 2005; Nicholas Jones portage.py: Fix for a + typo in the primaryuri index. + +*portage-2.0.51-r10 (11 Jan 2005): Cleanup + + 12 Jan 2005; Nicholas Jones repoman: Fixed the + namespace collision in the time module and calls. + + 11 Jan 2005; Nicholas Jones ebuild.sh: Fixes for the + libdir patch -- libtool can't handle "usr//lib". + + 10 Jan 2005; Nicholas Jones portage.py: Made maketest + enable 'test' in features. Marked a couple more negative flags for restrict. + Made tmpfs checking a little smarter and let us enable /dev/shm by default. + + 10 Jan 2005; Nicholas Jones output.py: Fixed the + colors and overscore problems. Added a larger section and better code + for generating colors and effects -- Unused at the moment. Added a patch + that included screen title handling. + + 10 Jan 2005; Nicholas Jones repoman: Rewrite the + datetime code to use time.gmtime() instead so python2.2 works still. + + 10 Jan 2005; Nicholas Jones regenworld: Made it work + with cascade profiles by using the proper system reference. + + 10 Jan 2005; Nicholas Jones emerge: Fix for the gcc + hardened version printing. Moved the stdin close on rsync down below the + rsync part to allow --ask to work. + + 10 Jan 2005; Nicholas Jones ebuild.sh: Die if unpack + is not given any files to unpack. Modification for the no_inst stuff to be + less crazy with the echo redirection stuff. + + 08 Dec 2005; Jason Stubbs ebuild.sh: Moved the "true" to + the end of the dyn_clean() function. + + 06 Dec 2005; Jason Stubbs ebuild.sh: Added eradicator's + multilib-strict patch, which allows checking and failing if binaries are + about to be installed into an incorrect directory. The feature is configured + via the MUTLILIB_STRICT_DIRS and MULTILIB_STRICT_DENY and has no effect if + either they are not defined or the feature is not enabled. + + 04 Dec 2005; Jason Stubbs ebuild.sh: Added removal of + the .packaged and .tested files to the clean stage. Adjusted cleaning of the + temp dir to include the directory as well, rather than only the files + therein. Added a check and appropriate removal of the entire scratch dir if + it is empty at the end of the clean phase. + + 04 Dec 2005; Jason Stubbs portage.py: Turned the + primaryuri global counter into separate counters per file, so that urls + are inserted at the appropriate places. + + 04 Dec 2005; Jason Stubbs portage.py: Adjusted virtuals + stacking so that /etc/portage/virtuals is stacked on top of the profile + virtuals (including the custom /etc/portage/profile), reordered the list + of installed virtuals to match that of the combined profile virtuals and + then stacked the installed virtuals on top of those. Also added back the + deprecation notice. + + 04 Dec 2005; Jason Stubbs emerge: Added code to + "emerge info" to summarise variables that aren't set rather than hide them. + + 02 Dec 2005; Jason Stubbs dolib ebuild.sh preplib: + Applied eradicator's libdir patch for multilib support. #75420 + + 02 Dec 2005; Jason Stubbs ebuild.sh: Added support for + INSTALL_MASK. #67190 + + 02 Dec 2005; Jason Stubbs portage.py portage_util.py: + Added support for the "source" keyword to make.conf. #74842 + + 02 Dec 2005; Jason Stubbs ebuild.sh: Adjusted autoconfig + to work on ${WORKDIR} instead of ${S} and modified output. #72360 + Added notice on econf failure to include config.log (if it exists) into any + bug report. #75268 Don't prepend "/" to CONF_LIBDIR if it already begins + with "/" #75523 + + 02 Dec 2005; Jason Stubbs emerge: Don't update info dirs + if noinfo FEATURE is enabled. #76378 + + 02 Dec 2005; Jason Stubbs emerge: Set the processing of + profiles/info_vars to only include those which have been set to some value. + #75920 + + 02 Dec 2005; Jason Stubbs repoman: Modified header check + to use the year of the mtime of the ebuild rather than the current year. + + 24 Dec 2004; Jason Stubbs portage.py: Removed assumption + that /etc/make.profile/make.defaults must exist for configdict["defaults"] to + be populated (and thus ARCH prepended to USE). + + 23 Dec 2004; Jason Stubbs portage.py: Adjusted fetching + on digest creation such that any preexisting digest entries are used, but + fetching and digesting occurs for all SRC_URI entries otherwise. + + 22 Dec 2004; Jason Stubbs portage.py: Removed the + virtuals deprecation notice as the "preferred" location does not yet + provide the required behaviour. + + 14 Dec 2004; Nicholas Jones doins: Fix and notices + for $D handling. + + 14 Dec 2004; Nicholas Jones ebuild.sh: spb's chflags + adjustment for dyn_clean. stat_perms() overhaul for bsd and ppc. + + 14 Dec 2004; Nicholas Jones webrsync: TMPDIR is + used properly and a tar-failure fix. + + 14 Dec 2004; Nicholas Jones portage.py: RESTRICT + changes -- nomirror and mirror are now the same (use 'mirror') -- lmirror + is a temporary way to sidestep mirror restrictions -- primaryuri makes + portage attempt to retrieve from the source mirror before falling back to + other mirrors (corrects behavior some impose for 'mirror'). + + 14 Dec 2004; Nicholas Jones portage_db_flat.py: Do + not fail when we're on a readonly FS and we're only reading (lockfiles). + + 09 Dec 2004; Marius Mauch bin/ebuild.sh: + change LDFLAGS to CFLAGS for the setXid check. + + 05 Dec 2004; Nicholas Jones pym/portage.py: swegener + made quite a find in portdbapi.cpv_exists, the comparison on the tuple + returned by findname2 always evaluated true. + +*portage-2.0.51-r8 (03 Dec 2004): Cleanup + + 03 Dec 2004; Nicholas Jones repoman: A patch to + handle stray digests. + + 03 Dec 2004; Nicholas Jones portage.py: Patches to + fix the matching bug #73136 and the '-atom' profile bug #73167. + +*portage-2.0.51-r7 (01 Dec 2004): Cleanup + + 01 Dec 2004; Nicholas Jones sandbox: updated with + ferringb's code for the pids file overrun issue. + + 01 Dec 2004; Jason Stubbs repoman: Reverted repoman + profile selection to previous behaviour. Kept verbosity, but modified + messages according to the behaviour. + +*portage-2.0.51-r5/6 (30 Nov 2004): Cleanup + + 29 Nov 2004; Nicholas Jones portage.py: Added a + (backport?) missing return to treewalk. + + 29 Nov 2004; Nicholas Jones cnf/*: Removed the + prozilla references. Adjusted the default mirrors to a gentoo round- + robin. + + 29 Nov 2004; Nicholas Jones portage_exec.py: Modified + the magic constants to be os.access calls. + + 29 Nov 2004; Nicholas Jones portage.py: A few XXX + comments. Removed 'aumtime' from the global space. Removed the virtuals + code that created an empty and unused virtuals file in /var/cache/edb. + + 29 Nov 2004; Nicholas Jones emerge: Added a few XXX + comments to bad code/calls. Adjusted emerge info so that it can read more + variables and atoms to print out from the portage tree. + + 29 Nov 2004; Nicholas Jones ebuild.sh: Fixed/Backport + the changes to stat_perms so that it works. Fixed the read commands. + + 10 Nov 2004; Brian Harring bin/ebuild.sh: + dyn_install was attempting to be helpful and chown files owned + by portage, resulting in suid/sgid being stripped. bug #56129. + + 07 Nov 2004; Brian Harring portage.py: buggy + logic in listdir w/ ignorecvs, rewrote. (#70170). + + 07 Nov 2004; Jason Stubbs dispatch-conf: Moved back + to the version of dispatch-conf that was released (due to python-2.2 + compatibility) and fixed a small type in that version. #70282 + +*portage-2.0.51-r4 (05 Nov 2004): Internal Release + + 05 Nov 2004; Jason Stubbs doins: Added vapier's fix + for doins changing existing directory permissions. #69896 + + 04 Nov 2004; Jason Stubbs tbz2tool.c: Added vapier's + fix for tbz2tool on ia64. #70001 + + 03 Nov 2004; Brian Harring portage_dep.py: Bug in + paren_reduce where it was returning a tuple (supposed to return a list). + + 03 Nov 2004; Jason Stubbs dispatch-conf: Simplified + the temp file creation and usage. + + 03 Nov 2004; Jason Stubbs portage.py: Fixed issues + with PROVIDE calculation by flattening the dep array. #32114 + + 02 Nov 2004; Jason Stubbs portage.py: Updated + ExtractKernelVersion() to support 2.6.9's new localversion. #67804 + Reordered a cache update and a return statement so that the cache is + actually updated in ververify. #69523 + + 02 Nov 2004; Jason Stubbs ebuild.sh: Turned off + shell option extglob as it interferes with the g++ QA interceptor. #69690 + + 02 Nov 2004; Jason Stubbs portage.py: Fixed a bug + where a broken symlink blocking the installation of a regular file would + cause a traceback. #69672 + + 02 Nov 2004; Jason Stubbs quickpkg: Applied vapier's + fix for processing file names that contain spaces. #36997 Applied + vapier's fix for parallel quickpkg's writing to a single log file. #37270 + + 29 Oct 2004; Jason Stubbs emerge: Fixed issue where + emerge adds package to world when --onlydeps is specified. #69260 + Fixed issue where emerge was adding packages to world when --uprade is + specified even if the package is already installed. #69287 Fixed logic + in path/to/ebuild check so that symlinks do not cause false positives. + + 29 Oct 2004; Jason Stubbs dispatch-conf: Added usata's + fix for mac-os compatibility. #69304 + + 29 Oct 2004; Jason Stubbs getbinpkg.py: Reversed the + logic of ftp passive-mode selection. #69371 + + 29 Oct 2004; Brian Harring portage.py: config.reset + was pruning vars out of backupenv on each reset call. #69388 + + 28 Oct 2004; Jason Stubbs emergehelp.py: Fixed up + some incorrect descriptions. Added documentation for new and changed + functionality. Removed documentation for deprecated options. + + 28 Oct 2004; Jason Stubbs getbinpkg.py: Added missing + substitution of ${FILE} in resume command. #69068 + + 28 Oct 2004; Jason Stubbs repoman: Fixed aux_get error + due to calling getfetchlist() when an ebuild no longer exists. #69051 + + 28 Oct 2004; Jason Stubbs emerge: Removed a duplicate + loop from the userquery function. #69020 + + 27 Oct 2004; Jason Stubbs dispatch-conf: Moved temp file + creation into a safe directory under /tmp. Made the log file a configurable + option that is disabled by default. + + 26 Oct 2004; Jason Stubbs portage.py: Added a check to + portdbapi.fetchcheck to account for a missing digest. + + 26 Oct 2004; Brian Harring portage_exec.py, bin/ebuild: + bug with the path lookup code (added find_binary func for upcoming additions), + and bin/ebuild was bailing due to a missing portage_util import. + + 25 Oct 2004; Jason Stubbs portage.py: Wrapped entire + lock-holding section of fetch() in a try-finally to ensure that the lock + file gets released regardless of exception. + + 25 Oct 2004; Jason Stubbs etc-update: Added patch + from #48218 to continue on to next file when answering "no" to the + interactive replace prompt of menu option -3. + + 25 Oct 2004; Jason Stubbs emerge: Fixed the space/tab + usage through the spinner_msgs definition. Removed COMPILER from emerge info + output. + + 25 Oct 2004; Jason Stubbs portage.py: Converted + config.pkeywordsdict from {atom:[keyword]} to {cp:{atom:[keyword]}} to + prevent a lot of unnecessary calculation. + + 24 Oct 2004; Jason Stubbs emerge: Added a percentage + counter to the cache update phase based on patch from #68694 + + 24 Oct 2004; Jason Stubbs portage.py: + s/macos/ppc-macos/ change. + + 24 Oct 2004; Jason Stubbs portage_locks.py + portage_db_flat.py: Fixed a couple of race conditions with regard to + stating files. + + 23 Oct 2004; Jason Stubbs portage.py portage_util.py: + Added syntax checking for package.mask, package.unmask and packages files. + + 23 Oct 2004; Jason Stubbs dohtml: Reimplemented the + option processing to remove the dependency on optparse. + + 23 Oct 2004; Jason Stubbs repoman: Made the invalid + profile slightly more intelligable and got rid of the duplicate. Moved + the profile KEYWORDS.invalid failure so that it only occurs if the + corresponding KEYWORD is valid. + + 23 Oct 2004; Jason Stubbs portage.py: Added settings + parameter to dep_virtual as the virtuals can now change during dep graph + creation. #68220 + + 23 Oct 2004; Jason Stubbs repoman: Changed repoman to + use the first stable profile found for each arch listed in profiles.desc + rather than the last profile listed. Added notification on any invalid + profile in profiles.desc. Made exception into a repoman error where a + ebuild is using a keyword for which no profile can be found. + + 23 Oct 2004; Jason Stubbs repoman: Fixed traceback in + repoman on invalid LICENSE syntax. + + 22 Oct 2004; Brian Harring ebuild.sh: silencing use/has. + + 22 Oct 2004; Jason Stubbs emerge: Added python version + to "emerge info" output. + +*portage-2.0.51-r2 (20 Oct 2004): Everyone loves finding bugs in stable! + + 20 Oct 2004; Nicholas Jones emerge: Fixed the result + checking when ebuilds are called -- this removes the continuing-after failure + big discovered by AMD64 today. + + 20 Oct 2004; Jason Stubbs emerge: Fixed a bug where + users were warned against emerging by path when a file/dir exists of the + same name of the package to be merged. #68372 Added an warning with delay + when emerging an ebuild that is masked. Added a check on PORTAGE_GPG_DIR + which removes "gpg" from FEATURES on an invalid settings. #68387 + +*portage-2.0.51 (20 Oct 2004): Everyone loves stable! + + 19 Oct 2004; Nicholas Jones portage.5: patch included + to fix a few typos. + + 19 Oct 2004; Nicholas Jones g-cpan.pl patch included + that doesn't recreate inherently-created ebuilds. + + 20 Oct 2004; Jason Stubbs repoman: Added check for + digest entries that aren't used within the corresponding ebuild's SRC_URI. + + 20 Oct 2004; Jason Stubbs emerge: Added support for + EMERGE_WARNING_DELAY defaulting it to 10. Changed all the hardcoded delays + to use it. Needed for the catalyst guys as it includes a number of unmerges + of system packages. + + 20 Oct 2004; Jason Stubbs emerge: Changed the + /path/to/ebuild warning. Added a check on what ebuild is chosen and + a failure if it doesn't match what was specified. Added the same for + /path/to/tbz2. + +*portage-2.0.51_rc10 (19 Oct 2004): Potential Final #1. + + 19 Oct 2004; Nicholas Jones emerge: Visual acuity + enhancements. Fixed all the spaces in the option handling. + + 19 Oct 2004; Nicholas Jones emerge.1: Updated for + 'f' and 'S'. + + 19 Oct 2004; Nicholas Jones getbinpkg.py: Potential + fix for a missing dict key. + + 19 Oct 2004; Nicholas Jones portage.py: Prelink + tempfile per pid. + + 18 Oct 2004; Nicholas Jones *.py: Added a protocol + change for cPickles to make them more efficient (binary). + + 18 Oct 2004; Nicholas Jones sandbox: Fixes for some + incorrect indexes that cause some boxes to have very random issues. + + 18 Oct 2004; Nicholas Jones portage_locks.py: Reverted + the lock code to the lockf()+hardlock version as the new code has some + inexplicable incompatibility with NFS. + + 18 Oct 2004; Nicholas Jones portage_exception.py: Added + a couple exceptions pretaining specifically to packages and digests. + + 18 Oct 2004; Nicholas Jones portage_checksum.py: Now + takes care of missing files better for the partial-digest handling. + + 18 Oct 2004; Nicholas Jones portage.py: Fixed up some + of the output lines to use writemsg instead of print. Adjusted the fetch + code to handle partial-digests. digestCreate can substitute in old digest + entries now for missing files -- the assumption is that they are correct. + Portage no longer downloads all parts when FEATURES=cvs is enabled, but + does require a complete digest to commit, whether it was created piecewise + or en masse. Added 'fetch_check' to portdbapi which helps with with emerge's + pretend output for Fetch-Restriction. + + 18 Oct 2004; Nicholas Jones repoman: Added in support + for partial-digests -- It complains, downloads, and adjusts. Sorted the QA + categories to make them easier to scan. + + 18 Oct 2004; Nicholas Jones emerge: Added -F to force + all URIs to be downloaded. Added in a green, lowercase 'f' when the fetch + restriction is satisfied for pretend. Added Kevin Quinn's patch for some + prepstrip sanity and friendliness regarding TEXTRELs. + + 18 Oct 2004; Nicholas Jones ebuild.sh: Added a message + about use/useq/usev. CCACHE_DIR and CCACHE_SIZE are now properly exported. + + 17 Oct 2004; pym/portage.py: + Added a followSymlinks parameter to listdir() as otherwise it gets stuck in + an infinite loop when it encounters self-referencing symlinks, this behavior + was exhibited by the collision-protect feature. + + 17 Oct 2004; Brian Harring portage-locks.py: Tweaked + unlockfile, no point in attempting to relock the file for deletion, if you're + not deleting the lockfile (basically moved locking w/in if unlinkfile). + + 17 Oct 2004; Jason Stubbs emerge portage_locks.py: + Added more information to the --inject deprecation notice. Removed the sleep + call from unlockfile as it severely affects performance (apparently only + under some schedulers) + + 16 Oct 2004; Brian Harring portage_locks.py: Corrected + a bug involving unlocking + lockf. + + 12 Oct 2004; Brian Harring portage_exec.py: spawn_sandbox + wasn't passing the opt_name down to spawn, it now does. + + 11 Oct 2004; Jason Stubbs; emerge: Reverted back to + previous command line parsing code as --search options were being mishandled. + + 11 Oct 2004; Nicholas Jones portage.py: Fix for the + SHA1 digest slipout and the exec missing/broken binary traceback. + + 11 Oct 2004; Nicholas Jones pym/*: See below. + + 11 Oct 2004; Jason Stubbs bin/*: Added catching and + propogating of SystemExit exception to all blanket exception handlers. + + 11 Oct 2004; Jason Stubbs repoman: Fixed repoman LICENSE + check to accept || () conditions. + +*portage-2.0.51_rc8 (10 Oct 2004): RC + Lock cleanup, Happy RC #4 + + 10 Oct 2004; Nicholas Jones emerge: Added in close() + calls to ensure that control-C gets intercepted by portage instead of the + children. Added in a re-raise for the SysExit exception inside of the + regen and metadata targets. + + 10 Oct 2004; Nicholas Jones cnf/make.conf*: + benno@nietvergeten.nl's touchups to make.conf files. + + 10 Oct 2004; Nicholas Jones sandbox/*: Includes one + of solar's patches to fix up potential holes in sandbox. + + 10 Oct 2004; Nicholas Jones portage_exec.py: Added + a cleanup routine. + + 10 Oct 2004; Nicholas Jones portage.py: A could cwd + fixes and removed the compat-writing for digests. + + 10 Oct 2004; Nicholas Jones md5check/mirror: brought + them more up to date for the digest changes. + + 10 Oct 2004; Nicholas Jones emerge: Moved the imports + around to ensure that portage.py gives output on failure instead of emerge + just dying. Added '-1' as a short for oneshot. Added shorter messages for + the titlebar. Fixed signal handling more -- Emerge sets up a handler that + calls to portageexit() before quitting normally. + + 10 Oct 2004; Nicholas Jones ebuild.sh: Changed around + the tarvars to make them STAR friendly. Added ECONF_SOURCE as a way to move + econf out of the source directory and into a new build directory -- it + defines the path to configure, not the command. Added CTARGET support. Added + an rm for the infodir entries installed by autoconf so they don't kill what + portage regens and vice versa. + + 10 Oct 2004; Nicholas Jones doins: Added Spanky's + recursion patch. + + 10 Oct 2004; Nicholas Jones dolib: Added Spanky's + symlink fix and condensed dolib*. + + 10 Oct 2004; Nicholas Jones doman: Added Spanky's + i18n patch. + + 08 Oct 2004; Brian Harring portage_exec.py: Removed + the portage_exec.spawn_bash call for tee logging- instead, transferred in + some code that does path lookups (closer to the older portage.spawn call). + Path lookup by default is on, but can be disabled via path_lookup=False. + + 08 Oct 2004; Brian Harring portage_locks.py: Reverted + to using flock by default- if it fails (unavailable), -then- use lockf, then + hardlink. + + 07 Oct 2004; Jason Stubbs portage.py: Updated + portdbapi.getfetchsizes function for new digestParseFile return values. + + 05 Oct 2004; Jason Stubbs quickpkg: Fixed bug whereby + creating a package from within /var/db/pkg/cat and specifying pkg would + create a broken package. + + 05 Oct 2004; Jason Stubbs emerge: Modified output for + slotted installations. #26139 + + 05 Oct 2004; Jason Stubbs emerge: Refactored argv + processing a little bit and made "emerge rsync" to emerge rsync with notice + and "emerge --rsync" to emerge --sync with notice. + + 05 Oct 2004; Nicholas Jones portage_util.py: grabfile + now handles a compat_level option for comment-based compatability changes -- + This feature is for migration only and is thus transitory. + + 05 Oct 2004; Nicholas Jones portage_exception: Added + a DigestException which is a SignatureException. + + 05 Oct 2004; Nicholas Jones perform_checksum.py: Added + a perform_all() and verify_all() functions that handle the new dict of hashes + that digestParse returns -- It creates hashes for all the listed/known + formats or verifies them all returning a tuple of ok,reason. + + 05 Oct 2004; Nicholas Jones portage.py: Cleared up + a few system-package import-alls (stat,commands) -- If it breaks something, + they can fix their code -- They are standard modules. Removed the import + for select, as it appears nowhere in usage. Changed the portage_data import. + Added exithandler() back into usage, it was disabled -- Also corrected it's + handling. Unified the digest-parsing code and made it into an intelligable + dict instead of the fixed format. Merged digest functions and added SHA1 + (arbitrary) handling in a new COMPAT mode using comments until we get the + handling transitioned into common usage. digestCreateLines() handles the + compatibility line values, and grabfile() has a compat-level handler. + + 05 Oct 2004; Nicholas Jones man/*: Random touchups. + + 04 Oct 2004; pym/portage.py: Added fix for config + protection failure when destination is a symlink. #13007 + + 04 Oct 2004; bin/repoman: Added detection of multiple + overlays to repoman. + + 04 Oct 2004; bin/repoman: Added repoman check + for DEPEND-syntax following LICENSEs. + + 03 Oct 2004; pym/emergehelp.py: + Add --metadata documentation to --help output. + + 03 Oct 2004; cnf/*, man/emerge.1, man/make.conf.5, + man/portage.5, pym/emergehelp.py: + Changed documentation to use --action instead of action (bug #2365). + Also changed ufed references in make.conf to use the correct category. + +*portage-2.0.51_rc7 (30 Sep 2004): RC + Lock cleanup, Happy RC #3 + + 30 Sep 2004; Nicholas Jones emerge: Rsync fix part 2 + for the distfiles, local, and packages directory unlinks. + + 30 Sep 2004; Nicholas Jones emerge-webrsync: Fix for + the missing md5sum causing failure to download. Fixed up a couple messages. + Modified the local rsync line. + + 30 Sep 2004; Nicholas Jones portage.py: Make more of + the chown calls friendly. More output on strange exceptions in aux_get. + + 30 Sep 2004; Nicholas Jones portage_db_template.py: + Added some more putput to the corruption message. + + 29 Sep 2004; Jason Stubbs output.py: Added unicode-rxvt + to the list of legal term types. #65762 + + 28 Sep 2004; Jason Stubbs etc-update: Added patch to + use gsed on BSD from bug 60721. + +*portage-2.0.51_rc6 (26 Sep 2004): RC + Lock cleanup, Happy RC #2 + + 26 Sep 2004; Nicholas Jones emerge: Restart fix for + the -a into execv code. + + 26 Sep 2004; Nicholas Jones portage_locks.py: Fixed + a traceback for Fat32 users. + +*portage-2.0.51_rc5 (26 Sep 2004): RC + Lock cleanup, Happy RC #1 + + 26 Sep 2004; Nicholas Jones portage_data.py: Fixed + the BSD lchown issues. + + 26 Sep 2004; Nicholas Jones portage.py: Added the + selinux secure dirs patch. + + 26 Sep 2004; Nicholas Jones emerge: Modified the + spinner again, --nospinner provides a basic ticker of one '.' per 100, + normal spinner is the twirly one, and the FEATURES=candy spinner is a + scrolly message. + + 26 Sep 2004; Nicholas Jones portage_locks.py: Fixed it. + Discovered that the hardlocks were failing due to the creation of the lock + prior to the link operation which was due to the NFS fcntl lock failure. + + 26 Sep 2004; Jason Stubbs pym/portage.py: Added + support for per profile package.mask. Included check of packages file + to ensure that the profile depends on an adequate portage version. + +*portage-2.0.51_rc4 (26 Sep 2004): RC + Lock cleanup + + 26 Sep 2004; Nicholas Jones bin/clean_locks: A new + tool to aid in the maintainence of hardlock-based locks. It can clean + all locks from a directory or just the ones pertinent to the running host. + + 26 Sep 2004; Nicholas Jones emerge: Updated the + spinner. + + 26 Sep 2004; Nicholas Jones cnf/*: Added distlocks + as a default feature. Added comments on distlocks and maketest and gpg. + + 26 Sep 2004; Nicholas Jones portage_locks.py: Lots + of changes. Corrected the lockfile code to be an IOError. Added some + helper functions to reduce duplication in the hardlink code. Added a + callback to a cleanup function registered with atexit to ensure we clean + locks up on normal terminations. Fixed the code to actually work on most + NFS systems and hopefully have the fallback (INODE test) working on + very broken systems. Added a cleanup function that is interfaced through + the clean_locks script and the registered atexit call. + +*portage-2.0.51_rc3 (26 Sep 2004): And we have another Release Candidate! + + 26 Sep 2004; Nicholas Jones emerge: Modified the + spinner. + + 26 Sep 2004; Nicholas Jones portage_db_flat.py: Fixed + a lockfile descriptor leak due to duplicated lock calls. + + 26 Sep 2004; Nicholas Jones portage_lock.py: Added + more cleanup to the lockfile descriptors. + +*portage-2.0.51_rc2 (25 Sep 2004): And we have another Release Candidate! + + 25 Sep 2004; Nicholas Jones portage_db_flat.py: Fix + for typos. + + 25 Sep 2004; Nicholas Jones portage_locks.py: Changed + all the calls to lockf which wraps fcntl. Made the chown on the locks + optional -- if it fails, it'll be annoying, but there's a message. Added + code to perform the hardlink-shuffle which uses hardlinks as a locking + mechanism (NFSv2 needs this). + + 25 Sep 2004; Nicholas Jones portage_db_flat.py: + Added locking around the file creation to ensure atomicity. + + 25 Sep 2004; Nicholas Jones portage_localization.py: + A little spot to provide the '_' function and examples and future code. + + 25 Sep 2004; Nicholas Jones portage_file.py: Added + the module to contain file/directory functions that are useful. Additional + function 'makedirs' handles creation of directories with recursive perms. + + 25 Sep 2004; Nicholas Jones getbinpkg.py: Fixed the + exception handling to not traceback. + + 25 Sep 2004; Nicholas Jones etc-update: Typo fix. + + 25 Sep 2004; Nicholas Jones emerge: Caused the + binary metadata downloading to be a little more verbose. Fixed the + sync command's arguments so that it deletes top level files. + + 25 Sep 2004; Nicholas Jones portage.py: Added + Cretin's patch for prelink blacklists. Increased the verbosity of the + 'mylines' output to let people know what files are affected with nulls. + Added a workaround for a race condition that somehow exists inside of + auxget when there is heavy lockfile contention -- Must be a lockfile + cleanup issue. + + 25 Sep 2004; Jason Stubbs emerge: Modified env_update + to always run ldconfig if makelinks is True, in order to ensure that + missing symlinks are created. Added logic to treewalk to check if package + is being downgraded and only run env_update with makelinks=False in that + case. (#54655) + + 24 Sep 2004; Jason Stubbs emerge: Added the removal + of --ask from argv when restarting after an emerge of portage. (#47379) + + 21 Sep 2004; Jason Stubbs portage_util.py: Changed + varexpand to convert '\'-prepended newline chars to space rather than '\n'. + + 21 Sep 2004; Nicholas Jones portage.py: Fixed the + bintree ebuild locating. Removed the virts_p debug/bug statements. + + 21 Sep 2004; Nicholas Jones portage_checksum: Added + a fix for checksum tracebacks that tracebacked. + + 21 Sep 2004; Nicholas Jones ebuild.sh: Added more + variables to vardb. + + 21 Sep 2004; Jason Stubbs emerge: Added (slightly + modified) patch from bug 64682. + + 16 Sep 2004; Jason Stubbs portage.py: Modified + getmaskingstatus() to use settings.prevmaskdict rather than reading packages + directly in support of cascading profiles. + +*portage-2.0.51_rc1 (25 Sep 2004): And we have a Release Candidate! + + 15 Sep 2004; Nicholas Jones ebuild: On merge, disable + the noauto feature explicitly. + + 15 Sep 2004; Nicholas Jones portage.py: Fixed the + 'missing ebuild' for uninstalls of packages not in the tree. + + 15 Sep 2004; Nicholas Jones man/*: Started adding + to the documentation in order to break it an make it look funny. Added a + couple entries for missing concepts like 'inherit' and 'useq' and 'hasq'. + Cleared up a few things here and there with usage. Added in the metadata + target for emerge. + +*portage-2.0.51_pre24 (14 Sep 2004): Last _pre before docs and rc/stable. + + 14 Sep 2004; Nicholas Jones repoman: Extra handling + for weird CVS/Repository info on OSX. + + 14 Sep 2004; Nicholas Jones emerge: Fixed a traceback + in traceback handling where a value was trying to be extracted from an + exception. Handled the case where a binary package does not have an ebuild + in a tree or overlay and the verbose overlay output requires it. Change to + the CVS checkouts for emerge sync, moved the -P immediately after the co. + + 14 Sep 2004; Nicholas Jones portage_exception.py: + Added in some spacing between related exception groups. + + 14 Sep 2004; Nicholas Jones portage.py: Changed a bunch + of lines unnecessarily to start getting the locale strings ready -- I'll + probably have bugs due to this because I've been doing dumb things like + that recently. + + 14 Sep 2004; Nicholas Jones man/*: Fixed ka0ttic's + email address. + + 14 Sep 2004; Brian Harring bin/ebuild.sh: Removed + the ${T}/successful logic, it's no longer needed. Existed only for the + $0 "$@" 2>&1 | tee $PORTAGE_LOG trickery, which is now handled via + portage_exec.spawn. + + 13 Sep 2004; Nicholas Jones portage.py: Fix for empty + categories/portage-tree causing a traceback. + +*portage-2.0.51_pre23 (11 Sep 2004): Fixes and stuff. + + 11 Sep 2004; Nicholas Jones portage.py: Another fix + to the virtuals/use code -- It wasn't using treeVirtuals. + +*portage-2.0.51_pre22 (11 Sep 2004): Fixes and stuff. + + 11 Sep 2004; Jason Stubbs portage.py: Fixed breakage + in cacheddir changes upon stat'ing a broken symlink. + + 11 Sep 2004; Jason Stubbs portage.py: Fixed missing + check in autouse function. Fixed out-of-bounds exception on catpkgsplit + tuple access in vardbapi.move_ent. Changed to manual stat calls in cacheddir. + + 10 Sep 2004; Nicholas Jones portage.py: Removed the + circular deps of vardbapi and config. + +*portage-2.0.51_pre21 (09 Sep 2004): Fixes and stuff. + + 09 Sep 2004; Nicholas Jones portage.py: Possible fix + for autouse() that will prevent recursion and locks. + +*portage-2.0.51_pre210 (09 Sep 2004): (pre-pre release for 21) + + 09 Sep 2004; Nicholas Jones archive-conf: Added patch + so that it runs. + + 09 Sep 2004; Nicholas Jones dispatch-conf: Added patch + to die when rcs isn't installed but is required by options. + + 09 Sep 2004; Nicholas Jones ebuild.sh: Solar's checks + for suid bind issues. + + 09 Sep 2004; Nicholas Jones fixvardbentries: Updated + to Jason's current script. + + 09 Sep 2004; Nicholas Jones g-cpan.pl: Added a fix + to store the ebuilds in a defined overlay. + + 09 Sep 2004; Nicholas Jones output.py: Added all + xterm* terms to the title-list. + + 09 Sep 2004; Nicholas Jones portage.py: Fixed the + cascade/stack functions -- use.defaults is fully line-incremental now. + Removed a lot of cruft commented-code. Added an ebuild-mover into the + entry move functions. + + 09 Sep 2004; Nicholas Jones portage_util.py: Placed + the lex code into a try/except so we can add the filename into the error + that is passed back from shlex. + + 08 Sep 2004; Brian Harring portage.py: Modified + config.__init__(clone=1) so that profiles list is preserved, allowing for + all profile's bashrc's to be sourced. + + 06 Sep 2004; Brian Harring portage.py: Fixed + fetch logic for when DISTDIR isn't writable, but the file is fully + fetched already (#62985). + + 05 Sep 2004; Brian Harring portage.py ebuild.sh: + Added use flag support to RESTRICT; usual syntax. + + 04 Sep 2004; Nicholas Jones portage_data.py: Added + FreeBSD as a BSD-type OS and merged the Darwin branch with them. + + 04 Sep 2004; Nicholas Jones portage_contents.py: The + parsing portion of a persistent contents file parser that can return the + owner of a particular file or directory by parsing (and storing) data from + the contents files. + + 04 Sep 2004; Nicholas Jones portage_const.py: Added + LOCALE_DATA_PATH to the constants for future gettext (internal) support. + + 04 Sep 2004; Nicholas Jones output.py: Fixed the + title changes to no clear the icon title. + + 04 Sep 2004; Nicholas Jones prepman: No longer + gzip's symlinks -- This needs to gain 'target changed' logic. + + 01 Sep 2004; Brian Harring pym/portage.py: + Cleaned up the imports, cutting down on from blah import *, instead + importing only what is strictly needed for backards compatability. + + 01 Sep 2004; Brian Harring pym/portage_exec.py: + Nick caught this- changed setgid/setuid order so it works. + + 01 Sep 2004; Brian Harring pym/portage.py: + Added Michael Stewart's patch correcting optional args being specified + via position- bug #61881. + + 01 Sep 2004; Brian Harring pym/portage.py, + pym/portage_exec.py, pym/portage_checksum.py: Restructured spawn + so that we don't have two versions; all spawn calls trace back to + portage_exec.spawn, either through spawn_bash or spawn_sandbox. + portage_exec.spawn is strictly an os.execve wrapper now, so bash + doesn't have to be involved unless desired (if desired use spawn_bash). + + 31 Aug 2004; Brian Harring bin/emerge: Debug + print statement left in global scope, corrected it. + + 31 Aug 2004; Nicholas Jones portage_checksum.py: + Solar's patch to check if prelink binary exists prior to executing it. + + 31 Aug 2004; Nicholas Jones portage_checksum.py: + Only prelink-check when requested -- This is only valid for merge/unmerge + operations -- Also happens to fix the access violations in portageq. + + 31 Aug 2004; Nicholas Jones portage.py: Adjustments + for the prelink-check changes. + + 31 Aug 2004; Nicholas Jones portage_exception.py: + Made the exceptions more hierarchial. Yes, I'm aware I can't speel. + + 30 Aug 2004; Brian Harring bin/repoman: Added + solar's patch to make the file.size check display the size of the + offender. + + 30 Aug 2004; Brian Harring pym/portage.py, + pym/portage_util.py: Removed -all- duplicate function definitions between + portage_util and portage. This is just -begging- for a bug where + portage.py's definitions are fixed, but portage_util isn't. + If you're moving code out of portage.py (good thing) please yank the def + from portage.py. Especially if you're importing everything from new + home of the module. + + 30 Aug 2004; Jason Stubbs pym/emerge: Added python 2.2 + compatibility fix. (#62128) Added fix to fail nicely on missing + /etc/gentoo-release. (#62149) + + 30 Aug 2004; Jason Stubbs pym/portage.py: Fixed two + bugs in bindbapi.aux_get() preventing retrieval of information about tbz2s. + + 26 Aug 2004; Brian Harring bin/etc-update: minor + tweak to etc-update to support single quotes in /etc/etc-update.conf + bug (#56785). Added Mamoru Komachi (usata)'s fix for osx (#60721). + + 26 Aug 2004; Brian Harring pym/portage.py, + pym/portage_exec.py, bin/ebuild.sh: Removed the PORT_LOGDIR $0 $* | tee + hack, and re-implemented it using spawn. Spawn has been extended so that + fd_pipes can receive a dict of fd # -> fd, and optionally be nonblocking + via returnpid. portage.spawn has support for a logfile optional arg- if + specified, spawn logs stdout/stderr via tee -i -a to the specified file. + Note portage_exec.spawn doesn't currently support this option. + + 25 Aug 2004; pym/portage.py, +pym/portage_checksum.py, + pym/portage_gpg.py, -pym/portage_md5.py: + renamed portage_md5 to portage_checksum which includes support for sha1. + + 24 Aug 2004; Brian Harring bin/ebuild.sh: Tweak to + dyn_test to check if $S exists prior to cd'ing to it. + + 24 Aug 2004; Brian Harring pym/portage.py: Fixed a + traceback issues in dblink.treewalk when collision-protect is active. + Also added specific check/complaint for PORT_LOGDIR='' to the config class, + since it should either not be set, or something non-null- a null + PORT_LOGDIR triggers a traceback in doebuild do to an attempted chmod. + + 23 Aug 2004; Brian Harring pym/portage.py: Added a + macos ranlib hack; dblink.mergeme by default resets each files mtime, which + makes static archives merged to the fs worthless (linker notes the files + mtime differs from an internal mtime, and bails). This closes out bug + (#58848), and will be obsoleted when refcounts are used instead of mtime + + md5. + + 21 Aug 2004; Brian Harring bin/ebuild.sh: Expanded + CONF_LIBDIR support, so it honors --prefix set values. (#61060) + + 19 Aug 2004; Marius Mauch bin/repoman: Added + FEATURES and USE to the readonly variable check. + + 17 Aug 2004; Brian Harring pym/portage_data.pym: + Adding missing imports. + + 17 Aug 2004; Brian Harring bin/repoman: Minor + tweak to make repoman detect the repolevel correctly in overlays. + (#60298). + +*portage-2.0.51_pre20 (16 Aug 2004): Fixes and Public Readiness & GPG + + 16 Aug 2004; Nicholas Jones portage.py: Fixed the + imports and new modules so that the API remains constant. + + 16 Aug 2004; Nicholas Jones portage_exec.py: Created + for external operations and calls. Presently contains spawn. Mostly for + prevention of circular imports. + + 16 Aug 2004; Nicholas Jones portage_md5.py: using + the spawn call from portage_exec.py to avoid the circular import. + + 16 Aug 2004; Brian Harring bin/repoman: Fixed a + traceback related to file.size and --fix, added compatability tweaks for + xmllint. + + 16 Aug 2004; Nicholas Jones emerge: Fixed the lock + handling and unique_array calls. + +*portage-2.0.51_pre19 (16 Aug 2004): Fixes and Public Readiness & GPG + + 16 Aug 2004; Nicholas Jones ebuild.sh: Add predict + for gpg verification. + + 16 Aug 2004; Nicholas Jones portage.py: Fixed the + lock code to use the external module. + + 16 Aug 2004; Nicholas Jones portage_gpg.py: Fixed + the writing operations and access violations. + + 16 Aug 2004; Nicholas Jones portage_locks.py: Fixed + the code so it acutally works and is used. + + 16 Aug 2004; Nicholas Jones portage_md5.py: Fixed + the lock calls. + +*portage-2.0.51_pre18 (16 Aug 2004): Fixes and Public Readiness & GPG + + 16 Aug 2004; Nicholas Jones dolib*: Added LV's + CONF_LIBDIR patch to help out the 32/64 bit lib migrations. + + 16 Aug 2004; Nicholas Jones ebuild.sh: CONF_LIBDIR + patch updates. Added a possible fix for the export issues in environment. + + 16 Aug 2004; Nicholas Jones prepall/lib: CONF_LIBDIR + + 16 Aug 2004; Nicholas Jones portage.py: Adjusted the + manifest/gpg code to reduce the output on missing sigs. Changed the GPG + homedir to the PORTAGE_GPG_DIR instead of using rsync for the keyring -- + This requires manual intervention. + + 16 Aug 2004; Nicholas Jones sandbox: Added the 32/64 + paths in for 32/64 lib migrations. + + 16 Aug 2004; Brian Harring pym/cvstree.py + pym/portage.py: Round #2 of ignorecvs, now w/ sane regex goodness and an + addition to digest(gen|check) to use the same cvs filter for Manifests. + (#46070). + + 15 Aug 2004; Nicholas Jones emerge: message fix for + packages.provided. + + 15 Aug 2004; Nicholas Jones repoman: Made file.size + a warning for the time being. + + 15 Aug 2004; Nicholas Jones cvstree.py: Removed the + auto-ignore regex as it is broken AND it breaks Manifests due to excess + files allowed into them. + + 15 Aug 2004; Nicholas Jones emerge: A couple changes + to the select_dep exception handling for the signing code. + + 15 Aug 2004; Nicholas Jones env-update.sh: Added + Spanky's env-update shell script version. + + 15 Aug 2004; Nicholas Jones portage.py: Moved more + code into seperate modules. Added support for Manifest verification and + usage of 'gpg' 'strict' 'severe' to enable various condition responses. + + 15 Aug 2004; Nicholas Jones portage_const.py: Moved + all constants to this module. (All uppercase defines) + + 15 Aug 2004; Nicholas Jones portage_data.py: Contains + all calculated information. uid/gid info. system-specific values. All probed + information should go here. + + 15 Aug 2004; Nicholas Jones portage_exception.py: + Added many exceptions for the GPG verification code. Added many general + exceptions to help differentiate from explicit portage exceptions and + those issued by python. + + 15 Aug 2004; Nicholas Jones portage_gpg.py: Handling + of gpg verification code and keyring management/trust. + + 15 Aug 2004; Nicholas Jones portage_locks.py: Moved + the lock code out of portage.py. + + 15 Aug 2004; Nicholas Jones portage_md5.py: Moved the + MD5 calculation code out of portage.py. + + 15 Aug 2004; Nicholas Jones portage_util.py: Moved + writemsg and unique_array into portage_util. + + 13 Aug 2004; Brian Harring bin/ebuild.sh: Added + support for ECONF_LIBDIR; if it isn't defined, then --libdir isn't + passed to the configure script. If it is defined, then the configure + script gets --libdir=/usr/${ECONF_LIBDIR}. + + 13 Aug 2004; Brian Harring pym/cvstree.py: + Added robbat2's patch to ignore files that cvs ignores. (#46070). + + 13 Aug 2004; Brian Harring bin/ebuild.sh: Shifted + the add* sandbox function definitions to before profile.bashrc srcing. + As bug #60147 demonstrated, profiles occasionally need to adjust + SANDBOX_WRITE (current case being for /usr/lib64/{conftest,cf}). + + 13 Aug 2004; Brian Harring bin/emerge: Related to + bug #60256, adjusted format_size so that is always returns a string. + + 13 Aug 2004; Jason Stubbs bin/emerge: + Relocated blocker checking code to before pkgsettings.setcpv() is called + on it in depgraph.create() + + 13 Aug 2004; Brian Harring pym/portage.py: + Tweaked lockfile, so it attempts a non-blocking lock_ex first, then + states it's waiting on lock blar, then attempts a blocking lock. This + will be useful for informing the user why portage seems to have hung, + and good for debugging. + + 13 Aug 2004; Brian Harring bin/emerge-webrsync: + Added support for snapshot md5sum's (mirrors now carry them). + This is used to ensure the fetched snapshot is sane; if it's sane, + then we reuse it for sync'ing. This nulls the -n option, so it's been + removed. Closes out #15990, but no longer automatically forcing a refetch. + Refetches are only forced if the md5 is invalid. + + 12 Aug 2004; Brian Harring pym/portage.py: + Cleaned up fetch a bit more, saner error messages when unable to + write to DISTDIR. + + 12 Aug 2004; Jason Stubbs bin/emerge: + Fixed the fix for the earlier traceback on installed package not being + in PORTDIR to remove duplicate work. + + 11 Aug 2004; Brian Harring bin/ebuild.sh: + Added FEATURES="autoconfig" support. (#55476) + + 11 Aug 2004; Brian Harring pym/portage.py: + Added check to lockfile and fetch, if file already is owned by + portage group, don't try and chown it. This will close #60079. + + 10 Aug 2004; Brian Harring bin/emerge: Fixed a + traceback issue, an ebuild is no longer in the tree, but is installed + and needs to be used in the depgraph- the problem was, emerge + assumed the ebuild was in porttree's db, when vartree should be used + if the package is known to be installed. + + 10 Aug 2004; Brian Harring pym/portage.py: + Killed a couple of corner cases for non-root fetch and lockfile calls. + + 10 Aug 2004; Brian Harring pym/portage.py + bin/ebuild.sh: Add check to ensure that install phase has been + ran prior to qmerge phase being attempted. This can happen + when the user is using ebuild to step through the phases. + Corrected bug in listdir where it would return None, rather then + []- all callee's expect a returned list, not None. Same for ftype, + cause's a tb if you just haphazardly rely on cachedir's return. + + 09 Aug 2004; Brian Harring pym/portage.py: + Leave /var/tmp with it's own permissions, chowning/chmoding just + /var/tmp/portage (#37521). + + 09 Aug 2004; Brian Harring bin/ebuild.sh + pym/portage.py: Corrected bug in profile.bashrc support, added aliases + for saving/restoring IFS (remove_path_entry and profile.bashrc loop + adjust IFS temporarily). Closes #59749. + + 08 Aug 2004; Brian Harring dispatch-conf: + Converted os.rename calls to shutil.move; the former can't cross fs's, + the latter can. (#46148) + + 07 Aug 2004; Nicholas Jones portage.py: Fixed the + cache updates so that an env-update forces ld updating. + + 07 Aug 2004; Jason Stubbs pym/portage.py + pym/portage_dep.py: Added a new parameter to use_reduce so that !arch? + checks can be adhered to even when matchall=1 and arch is not is masklist. + + 07 Aug 2004; Jason Stubbs pym/portage.py + pym/portage_dep.py: Added profile masked use flags to repoman check. + Moved || refactoring to a separate function. Reworked use_reduce logic + into simpler sections. + + 05 Aug 2004; Brian Harring pym/portage_dep.py: + What can I say, I can't get enough of bug (#59574). + I'm operating under the assumption there still is a bug in the + use_reduce logic, soo I've left a fairly massive amount of debugging + code in place that's currently disabled. It's *very* useful for + tracking exactly what/how use_reduce decides on a operator node. + + 05 Aug 2004; Brian Harring pym/portage.py: + I introduced a bug in the previous commit, basically + portage.settings.archlist list of arch keywords was being actively + pruned by repoman as it stepped through arches for dep checking. + Basically, needed to make a copy of archlist rather then using the + actual archlist object. Should be the final issue for (#59574). + + 05 Aug 2004; Brian Harring pym/portage.py: Fix + in the same area, if use="all" (repoman wants -every use flag- checked), + it should call use_reduce w/ matchall set appropriately. (#59574) + + 05 Aug 2004; Brian Harring pym/portage.py: And... + repoman's arch check got hosed again. The code in dep_check for + building a masklist was incorrect, 3 line fix. (#59574) + +*portage-2.0.51_pre17 (03 Aug 2004): Fixes and Public Readiness + + 03 Aug 2004; Nicholas Jones portage_dep.py: Again + fixed the || exceptions to understand nested legal || statements. + +*portage-2.0.51_pre16 (03 Aug 2004): Fixes and Public Readiness + + 04 Aug 2004; Nicholas Jones ebuild.sh: Changed the + virtual/glibc references to virtual/libc. + + 04 Aug 2004; Nicholas Jones prepman: No longer runs + gzip on .keep files. + + 04 Aug 2004; Nicholas Jones getbinpkg.py: Added in + an active/passive option for FTP connections -- Requires the appending of + an asterisk to the HOST portion of the ftp string to use active connections. + + 04 Aug 2004; Nicholas Jones make.conf*: Updates for + the active-connection ftp option. + + 04 Aug 2004; Nicholas Jones emergehelp.py: Removed + the bin/ version and replaced it with a duplicated pym/ version. + + 03 Aug 2004; Brian Harring pym/portage.py: + Added check to ensure /var/tmp/portage's permissions were sane. (#56665) + + 03 Aug 2004; Brian Harring bin/repoman: Added + explicit check for missing files directory, rather then ignoring it. + Also added an explicit commit-time check for CVS/Entries being sane. + (#57141). + + 03 Aug 2004; Brian Harring bin/repoman: reworked + the qacats definition so that the type of bug that borked emerge help is + no longer possible. + + 03 Aug 2004; Brian Harring pym/portage.py, + bin/emerge: Corrected emerge --fetch-all-uri issues, now works. Basically, + FEATURES="cvs" emerge -f blar == emerge --fetch-all-uri blar. The fetch + option handling in emerge could use some cleanup. + + 03 Aug 2004; Brian Harring pym/portage.py: Ongoing + cleanup in emerge -fp; this corrects a minor naggle affecting previous + releases, where emerge -fp would still attempt to do md5 checks on files. + + 03 Aug 2004; Brian Harring pym/portage.py: Corrected + logic for fetch(..., ..., use_locks=1,listonly=1) attempting to use locks, + when fetch is just printing the src_uri's. (#59394). + + 03 Aug 2004; Brian Harring bin/repoman: Corrected the + borkage I introduced into repoman's help option- it was throwing a traceback + due to file.executable's key name being typoed. + + 03 Aug 2004; Nicholas Jones portage_dep.py: Enhanced + the invalid depend string identification for || (and &&) strings. + +*portage-2.0.51_pre15 (03 Aug 2003): Fixes and Public Readiness + + 03 Aug 2004; Brian Harring bin/repoman: Corrected + typo, trying to remove .backup_metadata.dtd rather then metadata.dtd. + + 03 Aug 2004; Nicholas Jones portage_dep.py: Changing + from dep_opconvert to use_reduce introduced a bug due to how OR'd lists are + managed by the remaining dep handling functions -- Fixed by emulating the + format in use_reduce. + + 02 Aug 2004; Brian Harring bin/repoman, pym/portage.py: + Added local caching of metadata.dtd, to prevent flaky connections from + flagging a packages metadata.xml as invalid due to xmllint failing to fetch + metadata.dtd. Simplified version of patch in (#57210). + + 02 Aug 2004; Brian Harring bin/ebuild.sh, + pym/portage.py: Added support for src'ing a profile bashrc. Fex, if + /etc/make.profile/profile.bashrc exists, it is sourced prior to ebuild.sh + defining any of it's functions. (#58415). + + 02 Aug 2004; Brian Harring bin/emerge-webrsync: General + cleanup; uses the make.conf defined FETCHCOMMAND for fetching (fixing #57887), + runs emerge metadata after a successful sync also. + +*portage-2.0.51_pre14 (02 Aug 2003): Fixes and Public Readiness + + 02 Aug 2004; Nicholas Jones do*: Added exit calls + on failures and changed the install to use short options for BSD compat. + + 02 Aug 2004; Nicholas Jones ebuild.sh: unset + GLOBIGNORE added. Echo out the confingure command from econf. Moved the + maketest code to dyn_preinst so it didn't force-run maketest. Added a + patch for keyword expansion (requires portage-2.0.51 for use). + + 02 Aug 2004; Nicholas Jones emerge: --fetch-all-uri + added to force all URIs to be downloaded (works like features=cvs). libc + version printing enhancements. Fixed the binary package selection in an + alt ROOT. Headers and libtool added to info. --ask removed on a resume. + + 02 Aug 2004; Nicholas Jones prepstrip: Change ewarn + to echos to stderr with beeps. + + 02 Aug 2004; Nicholas Jones repoman: Added to the + OK message output for issues that fail. + + 02 Aug 2004; Nicholas Jones make.conf: Typo correction + patch added. + + 02 Aug 2004; Nicholas Jones output.py: Added kterm + to the titlebar terminals. + + 02 Aug 2004; Nicholas Jones portage.py: Added a message + regarding the location of the virtuals file (move to /etc/portage/profile). + Added a invalid-mirror message and a missing URI message for fetching. Added + the selinux sandbox patch. Removed the old dep_opconvert call as all ?: + syntax is gone. + + 02 Aug 2004; Nicholas Jones portage_dep.py: Fixed the + use_reduce code to properly handle negative requirements on masked flags. + + 02 Aug 2004; Nicholas Jones tbz2tool.c: Made all the + comments to C style. + + 02 Aug 2004; Nicholas Jones libsandbox: Code from + Seth Robertson that tracked down all adjuct flags for read operations that + did not invoke a write operation. + + 01 Aug 2004; Masatomo Nakano bin/emerge: Added + message about ._cfg* files after emerge sync. + + 01 Aug 2004; Masatomo Nakano pym/portage.py: Modified + updating /etc/portage/package.* logic to see CONFIG_PROTECT and + CONFIG_PROTECT_MASK. + + 01 Aug 2004; Marius Mauch bin/emerge: + Added a warning for `emerge /path/to/ebuild` + + 01 Aug 2004; Marius Mauch bin/emerge: + Fixing broken logic for the `emerge rsync` deprecation notice (it only showed + up on `emerge --rsync`). + + 01 Aug 2004; Brian Harring pym/portage.py bin/emerge: + Fixed the lockfile/unlockfile functions so that they correctly support having + an int passed in (the fd #), or having a file object passed in. Corrected + lockfile so that the lock is owned by portage group, with g+w permissions + (this is needed since sudo emerge blar can bail, leaving a stale lock that + non-root usage cannot remove). Added locking to emerge's emergelog function, + preventing log messages from potentially getting mixed together. Added check + to fetch function to complain if unable to write to DISTDIR (previously the + fetcher just bailed, stepping through each src_uri). Added lockfiles for + fetching/md5ing of the src- these lockfiles are stored in a subdirectory + (locks_in_subdir=".locks") if specified, and locking is controlled via + use_locks (defaults to on). emerge -f no longer requires root/sudo to run + (ebuild never had this restriction). (#42969) + + 31 Jul 2004; Jason Stubbs pym/portage.py bin/emerge: + Removed USE-based SLOT support. Removed uselist from getslot methods. + + 29 Jul 2004; Brian Harring bin/repoman: Added check for + files over 20k in a packages files directory. file.size, repoman treats it + as a a failure. Added the repoman manpage entries for file.size, and + file.executable (I missed file.executable earlier). + + 28 Jul 2004; Masatomo Nakano pym/portage.py: Fixed a bug + emerge doesn't pkg_setup() with -k/-K option. (#25152) + + 28 Jul 2004; Masatomo Nakano pym/portage.py: + Added ._cfg* file for updating /etc/portage/packages.* during global + update. + + 28 Jul 2004; Masatomo Nakano bin/emergehelp.py, + man/emerge.1: Added explanation of --newuse to manpage/help. + Added information of --verbose to manpage. + + 27 Jul 2004; Jason Stubbs pym/portage.py: + Reversed the order of profile virtuals (dirVirtuals) so that a cascading + profile's virtuals are stacked in the correct order. + + 26 Jul 2004; Brian Harring bin/emerge: + Removed the `which blah` calls- A) stage1 lacks which, B) which searches + $PATH- all sane shells do this already when handed a command that + isn't absolute path. These which calls were used in + commands.getstatusoutput() calls, which starts up a shell with + the arg passed to the shell, so "`which blar` args" isn't needed. + + 26 Jul 2004; Brian Harring bin/repoman: + Added file.executable check- ebuilds, digests, Manifest, ChangeLog, and + metadata.xml don't need the executable bit set. CVS preserves it upon + commit, so we do the check prior to commit. (#55647) + + 26 Jul 2004; Brian Harring bin/emerge: + Removed the hardcoding of uname for emerge info, using which to find it + instead. + + 26 Jul 2004; Brian Harring bin/repoman: + Added check to ensure manifest recommit is at least possible when + committing, and corrected handling of CVS/Root files for OSX machines. + Removed readline import, doesn't seem to be used at all. + + 26 Jul 2004; Jason Stubbs bin/emerge pym/portage.py: + Refactored slot code into portage.py to remove usage off portage_dep. + + 25 Jul 2004; Brian Harring bin/dohtml: + Corrected a bug in dohtml where it was unable to install files with a space + in their name (#58258) + + 25 Jul 2004; Jason Stubbs bin/emerge pym/portage.py: + Deprecated --inject and added support for package.provided in both the + profiles and /etc/portage/profile directory. + + 24 Jul 2004; Jason Stubbs bin/emerge pym/portage.py: + Added USE flag based SLOT support. + + 24 Jul 2004; Jason Stubbs bin/emerge pym/portage.py: + Added USE flag based PROVIDE support. (#32114) + + 24 Jul 2004; Jason Stubbs src/sandbox-1.1/libsandbox.c: + Fixed lchown sandbox bug. (#58084) + + 23 Jul 2004; Brian Harring bin/repoman: Corrected a + false positive on the ebuild.nesteddie check. Basically it wasn't looking + to see if the line was active or not (fex # (die), bash skips, but repoman + caught). Aside from that, that check is still capable of missing multiline + ebuild.nesteddie instances. (#33011) + + 22 Jul 2004; Brian Harring bin/ebuild.sh: Re-enabled + binary QA interceptors, with a minor twist- the QA_INTERCEPTORS is used to + specify what QA interceptors will be defined. These functions are no longer + saved in the ebuild's stored env (exist *only* in depend phase), and have been + expanded to identify if it's the ebuild, or eclass that's triggering the QA + Notice (#54652). The interceptors behaviour when the binary is missing has + been corrected to correctly output "missing command $bin: args". + + 21 Jul 2004; Masatomo Nakano bin/emerge: Fixed bug + which blocks a package itself with -U option. + + 20 Jul 2004; Masatomo Nakano bin/repoman: Fixed + profile cache problem. (#43601, #56170) + + 20 Jul 2004; Marius Mauch bin/ebuild.sh: + added usev() and hasv() as complement to useq() and hasq(). + + 18 Jul 2004; Brian Harring bin/repoman: Corrected + ebuild.allmasked check, so that it checks for an available version across all + arches, rather then the last arch processed. Typo fixed also- bugs #57356 and + #57068. + + 17 Jul 2004; Jason Stubbs bin/repoman: Added patch from + #49126 that makes repoman check that a USE flag from use.local.desc applies + to the packages that make use of it. + + 14 Jul 2004; Marius Mauch bin/emerge: + added a deprecation warning for --upgradeonly + + 14 Jul 2004; Marius Mauch bin/etc-update: + Added a hint to etc-update so people that don't know what to do don't use -3 + or -5 by accident. + + 12 Jul 2004; Jason Stubbs bin/emerge: + Adjusted masked binary checking code to exclude --usepkgonly. + + 10 Jul 2004; Jason Stubbs man/portage.5: + Adjusted documentation for user use.mask to match implementation. + +*portage-2.0.51_pre13 (09 Jul 2004): Fixes and Public Readiness + + 21 Jun 2004; Nicholas Jones portage.py: Included + ferringb's logic fix for the repoman code. Fix that prevents vardb from + using all files and directories in the vardb as keys instead of only the + proper ones. Code touchups. + + 21 Jun 2004; Nicholas Jones prepstrip: Fixes that + result in BSD compat and split the regex -- find doesn't do extended. + + 21 Jun 2004; Nicholas Jones emerge: included a uname + fix for bsd. Added --fetch-all-uri as a way to get all URIs downloaded for + a package regardless of conditionals. + + 21 Jun 2004; Nicholas Jones ebuild.sh: Moved the + declaration of ebuild_phase toward the top. + + 09 Jul 2004; Jason Stubbs bin/emerge: + Fixed incorrect assignment of depgraph.mydbapi[] objects. + + 07 Jul 2004; Marius Mauch bin/repoman: + Solved a big memory problem in repoman where a full scan required several + gigabytes, caused by apparently unused objects. + + 04 Jul 2004; Jason Stubbs bin/emerge pym/portage.py: + Fixed issue that allowed installed virtuals to overide user virtuals. + + 03 Jul 2004; Jason Stubbs bin/emerge: Added masked + package removal to binpkg candidates before getting the best. (#55871) + + 01 Jul 2004; Jason Stubbs pym/portage.py: + Fixed exception catching on module import. + + 27 Jun 2004; Jason Stubbs bin/repoman: + Fixed year (2003 -> 2004) in copyright lines. + + 27 Jun 2004; Marius Mauch pym/portage.py: + Added a check for symlinked dirs to the collision-protect code so it doesn't + double-check files in symlinked dirs with wrong pathnames. + + 26 Jun 2004; Masatomo Nakano bin/regenworld: Fixed + regenworld. It always failed without -h or --help. + + 26 Jun 2004; Masatomo Nakano bin/emerge: Added more + messages when emerge fails due to masked package. + + 26 Jun 2004; Jason Stubbs portage.py: + Added pkgsplit check on values returned by vardbapi.cpv_all() + + 26 Jun 2004; Jason Stubbs repoman: Removed a stray dot. + + 25 Jun 2004; Jason Stubbs repoman: Changed CVS + header regex to "Gentoo Foundation" + +*portage-2.0.51_pre12 (21 Jun 2003): Fixes + + 21 Jun 2004; Nicholas Jones emerge: Removed the + extra spawn of portageq as sandbox handles the python pyo's accesses now. + + 21 Jun 2004; Nicholas Jones portage.py: Fixes for + the HOME issues. Correction of permissions from 6770 to 2770. + + 21 Jun 2004; Masatomo Nakano pym/portage.py: + Fixed problem that 'emerge something' would install all depeneded pkgs + even if they are already installed. + +*portage-2.0.51_pre11 (21 Jun 2004): Fixes + + 21 Jun 2004; Nicholas Jones portage.py: Disabled the + URL encoding for BINHOST as it will take a lot of work to get it right. + Execve try/except added to handle missing binaries and such. Changed the + default HOME to be TMPDIR/homedir. Try/except on db close operations. Add + in missing unlocks. Hacked in the /var/lib/portage in a chroot fix. + + 21 Jun 2004; Nicholas Jones emerge: Added more info + into the profile for the stacked profiles. + + 21 Jun 2004; Nicholas Jones ebuild.sh: The userland + fixes for *BSD. QA Notice fix for IUSE verbosity on global scope stuff. + Missing quote fix for QA intercepters. Return 0 in the use_* functions. + Removed AA from the readonly list. + + 21 Jun 2004; Nicholas Jones dohtml: Karl's update + which is mostly a rewrite. + + 21 Jun 2004; Jason Stubbs bin/emerge: + Modified emerge to build up a fakedb regardless of 'empty' in params, + and to incrementally add any packages added to the dep graph. + (#1343, #8810, #54608) + + 20 Jun 2004; Masatomo Nakano bin/repoman: + Fixed problem which fails to detect IUSE value. (#21544) + + 20 Jun 2004; Masatomo Nakano bin/emerge: + Added an exception code for broken timestamp.chk. (#54380) + + 20 Jun 2004; Jason Stubbs pym/ebuild.sh: Adjusted + returns for use_with and use_enable to only return 1 on invalid usage. + + 20 Jun 2004; Masatomo Nakano pym/portage.py: + Fixed problems that portage doesn't block with --update option(#52377) + and fail to block virual packages(#52506). + + 20 Jun 2004; Masatomo Nakano pym/portage.py: + Fixed CONFIG_PROTECT/CONFIG_PROTECT_MASK in /etc/csv.env(#51646). + + 20 Jun 2004; Masatomo Nakano bin/ebuild.sh: + Added error message when pkg_config is not defined. (#51167) + + 14 Jun 2004; Jason Stubbs pym/portage.py: + Fixed bug in portdbapi.aux_get where a problem ebuild would cause a lock + to not be released. + + 09 Jun 2004; Marius Mauch bin/emerge: + Changed emerge --info to reflect libc versions other than glibc. + + 08 Jun 2004; Marius Mauch pym/portage.py: + Added the collision-protect feature that prevents packages from + overwriting files they don't own. Has to be enabled with + FEATURES=collision-protect as it needs more testing before it + can be enabled by default (bug #28228). + + 05 Jun 2004; Marius Mauch bin/ebuild.sh: + Fix rpm support by changing rpm to rpmbuild (bug #13508). + + 05 Jun 2004; Marius Mauch bin/regenworld: + Added a --help message ro regenworld (bug #37539). + + 03 Jun 2004; Jason Stubbs portage.py: Fixed bug #52720 + and restored patch for a 35% drop in dep calc time. + +*portage-2.0.51_pre10 (02 Jun 2003): Fixes + + 02 Jun 2004; Nicholas Jones portage.py: Added MANPATH + to the colon_seperated list -- parsing code NEEDS TO BE FIXED. * and ~* + matches allowed for package.use for arch-development -- ~* implies *. + + 02 Jun 2004; Nicholas Jones emerge: Fix for a new + typo in the logger function that prevented emerge.log from being written. + + 02 Jun 2004; Nicholas Jones ebuild.sh: make test + only occurs when enabled in FEATURES and not in RESTRICT -- defaults OFF. + Added ferringb's local B_* fix for eclasses. Made db vars readonly via bash + for non-depend phases after the global scope. + + 02 Jun 2004; Jason Stubbs pym/portage.py: Reverted + adjusted made to config.setcpv on 18 May 2004 due to bug #52720. + + 01 Jun 2004; Marius Mauch bin/repoman,bin/regenworld: + only messages about broken log entries in regenworld when called with + --debug. Fix signing stuff in repoman. + +*portage-2.0.51_pre9 (22 May 2003): Speedups and bug fixes + + 22 May 2004; Nicholas Jones portage_db_template.py: + Added in last-three caching for db modules. Ensuring that keys are strings. + + 22 May 2004; Nicholas Jones portage_db_cpickle.py: Fix + that ensures the Unpickler works properly. + + 22 May 2004; Nicholas Jones portage.py: Updates for + environment files ordering in ebuild.sh. Added in normalize_path to handle + the really annoying "'//' is a legal prefix" issue with os.path.normpath. + Applied normalize_path to cacheddir() so that the keys match and we have + more cache hits and better performance. Added statistics to to cacheddir + available with noise=2. Do not return a blocker when doing a zerolist. + Fixed the stacking functions to properly order the incrementals and apply + the removals forward. Changed all string.atoi() to int(). Added in the + selinux changes for spawning the fetch command. Added a patch that allows + ebuild.sh to display 'validcommands'. close_caches() added to allow atexit + to close all the DB connections. close_portdbapi_cache() handles the global + that has all db instances -- This avoids problems with the API nulling the + internal links. Adjusted the db handling for sync() calls and removed some + object duplication db calls. + + 22 May 2004; Nicholas Jones getbinpkg.py: Fix for HTTP + redirects (301 and 302) so that the redirect opens a new connection to the + move-location server -- This allows us to redirect to a different machine. + + 22 May 2004; Nicholas Jones emerge: For iuse output we + now ensure that the correct db is referenced. The worldfile additions do not + occur when a packages is new and updates are not being performed. Patch to + add binutils to the emerge info. + + 22 May 2004; Nicholas Jones ebuild.sh: Rearranged the + sourcing of the profiles and the special environment files. Added src_test + as an optional test method -- Some packages are extremely dumb and need to + be prevented from using this via RESTRICT. + + 18 May 2004; Jason Stubbs portage.py: Minor speed + improvement in config.setcpv preventing a useless regenerate + + 18 May 2004; Jason Stubbs portage.py: Reversed the + order of config.getvirtuals' stack_dictlist call for correct ordering. + +*portage-2.0.51_pre8 (16 May 2003): Big cleanups & Ebuild QA Stuff. + + 16 May 2004; Nicholas Jones portage_exception.py: New + file containing portage exceptions. Added 'CorruptionError' for the db code. + + 16 May 2004; Nicholas Jones portage_util.py: New file + that contains utility functions. Allows db_modules to use portage functions + without a circular dependency. CODE IS DUPLICATED and needs to be fixed in + portage.py to use this new module. grab*, getconfig, varexpand, pickle_*, + ReadOnlyConfig + + 16 May 2004; Nicholas Jones portage_db_*: Modules + do not have an __init__ any longer -- module_init() is called by the + template after loading the config and setting the 5 variables inside of + the class. self.config is a ReadOnlyConfig object which is just a dict + that you can't write to. Throws CorruptionError when the read functions + return exceptions. + + 16 May 2004; Nicholas Jones portage.py: Reversed the + virtuals order so it matches the documented format. When an ebuild does not + exist, we now raise a KeyError with a useful string. 'couple minutes' changed + to 'couple of minutes' for Seemant. ;) + + 16 May 2004; Nicholas Jones prepstrip, ebuild.5, + repoman.1: Typo corrections/text replacements. + + 16 May 2004; Nicholas Jones emerge: Added deprecation + notice to 'emerge rsync' to favor 'emerge sync'. Modified the emerge.log + code to not change permissions on the files beyond what is necessary -- NEEDS + TO BECOME AN ADDITIVE FUNCTION. Produce a warning instead of a traceback + when an ebuild does not exist for -U. + + 16 May 2004; Nicholas Jones ebuild.sh: Touched up the + logging stuff at the top. Removed extra_functions.sh. src_compile additions + so that it can run make without having a config file requirement. + + 16 May 2004; Nicholas Jones dobin,dosbin: Removed the + duplicated stripping from the helper tools. + + 09 May 2004; Jason Stubbs pym/portage_dep.py: + fixed bug in use_reduce that caused returned list to be flattened. + + 30 Apr 2004; Marius Mauch bin/ebuild.sh: + modified ebuild.sh error message on seemants and roger55s request. + +*portage-2.0.51_pre7 (26 Apr 2003): Big cleanups & Ebuild QA Stuff. + + 25 Apr 2004; Nicholas Jones portage.py: Fixed masking + problems due to the new stacking functions and empty-value stripping. + +*portage-2.0.51_pre6 (25 Apr 2003): Big cleanups & Ebuild QA Stuff. + + 25 Apr 2004; Nicholas Jones ebuild.sh: Dropped selinux + from the IUSE complainer list. + + 25 Apr 2004; Nicholas Jones repoman: Made it use the + constants defined in portage.py for the world file. + + 25 Apr 2004; Nicholas Jones portage.py: Modifications + so that the virtuals are incremented in the proper order and reversed the + final values so that the first virtual is the 'best' one. Try to put the + INHERITED variable back into the environment before calling out to portage. + This makes the ECLASS QA notices actually valid. + +*portage-2.0.51_pre5 (25 Apr 2003): Big cleanups & Ebuild QA Stuff. + + 25 Apr 2004; Nicholas Jones portage.py: Fixed name + of the world file constant. Fixed the virtuals loading and vartree creation + circular dep with a repitition hack. Fixed the virtuals loading function so + that it doesn't destroy the virtuals before saving them. + + 25 Apr 2004; Nicholas Jones emerge: Fixed all the + references to the world file to use portage constants. Made the verbose + output for use flags call unique array to make sure values aren't duped. + + 25 Apr 2004; Nicholas Jones ebuild.sh: Typo fix for + inherited, and removed the delay. + +*portage-2.0.51_pre4 (25 Apr 2003): Big cleanups & Ebuild QA Stuff. + + 25 Apr 2004; Nicholas Jones portage.py: Creation of + a great number of 'constants' that were hard coded in various places and + now are created in a cascaded style, for the most part. Exception handling + for the loading of modules added along with verbose messages about the + exception being handled for user info. PRIVATE_PATH is a new constant that + points to the new directory we will be using for portage internal data -- + It is a secure directory that only group portage may write, read, and scan. + PORTAGE_CACHEDIR is deprecated -- The real cache directory is FHS and is a + constant -- The dep cache is named specifically now as 'PORTAGE_DEPCACHEDIR'. + + **Changed the stacking functions** so they are quite a bit more sane -- They + still need a little help though -- stack_* functions are now used to stack + specific types instead of using grab_stacked "super functions" -- The naming + is a little rough but intelligable. + + **VIRTUALS modification** The /var/cache/edb/virtuals file is unnecessary + as portage now loads the provides from the vartree itself. /etc/portage + may have a virtuals file that stacks on top of the var and profile virtuals. + This also entails the removal of the virtual-file handling code (yay!). + + 25 Apr 2004; Nicholas Jones emerge: Fix for the name + change for PORTAGE_CACHEDIR to PORTAGE_DEPCACHEDIR. + + 25 Apr 2004; Nicholas Jones ebuild.sh: Added checks + to ensure that use flags are properly mentioned in IUSE. Adjusted the QA + Interceptors (function overrides for common app names) to make sure they + don't interfere in weird cases -- Relying on 'type -p' now. Eclasses are + checked for illegal inheritance modes (conditional-based). Increased the + cache lines for an entry -- Added 'PROVIDE' and 8 empties. + + 22 Apr 2004; Marius Mauch bin/repoman: + added a CVS Header check to repoman + + 20 Apr 2004; Marius Mauch pym/portage.py: + fix for getmaskingreason if the mask isn't in PORTDIR's package.mask (#48447) + + 17 Apr 2004; Masatomo Nakano repoman: Fixed for + python-2.2 compatibility. + +*portage-2.0.51_pre3 (13 Apr 2003): Cleanups and small features. + + 13 Apr 2004; Nicholas Jones portage_db_*: Fixed the + permissions issues regarding the umask problems with DB vars. + + 13 Apr 2004; Nicholas Jones portage.py: Fix for the + import urllib call that was misspelled for PORTAGE_BINHOST. Genone's patch + that allows FETCHCOMMAND_${PROTOCOL}. getmaskingreadon() from genone's + package.mask display patch. + + 13 Apr 2004; Nicholas Jones output.py: For some reason + people have a problem with my bad spelling of semi-common colors, so I added + in requested changes for the color 'fuchsia'. + + 13 Apr 2004; Nicholas Jones cnf/make.conf: Comment + fixes for the CHOST line. FEATURES modification. + + 13 Apr 2004; Nicholas Jones dispatch-conf.conf: Removed + the 'a' option. + + 13 Apr 2004; Nicholas Jones emerge: Catagory searches + added if search is prefixed with '@'. jstubbs/spider's fix for binary use + flag passing problems worked in. Genone's patch for package.mask comment + display. Patch to display warnings when unmerging system packages worked in. + + 13 Apr 2004; Nicholas Jones ebuild.sh: Quieted up + some output for use/has internally. Added a patch for the help output. + Added functionality to pass down IUSE from eclasses. Made several variables + readonly inside of ebuilds: + P PN PV PVR PR A AA D EBUILD EMERGE_FROM O PPID FILESDIR EBUILD_PHASE + +*portage-2.0.51_pre2 (11 Apr 2003): Release Fixes + + 11 Apr 2004; Nicholas Jones emerge: Portage can now + match categories if the search is prefixed with an '@' -- @app-portage will + list all packages in app-portage... '@portage' will match all in app-portage + and will match anything with portage in the title -- It's still a regex. + + 11 Apr 2004; Nicholas Jones ebuild.sh: nostrip in + RESTRICT now enables DEBUGBUILD -- stripping and related functionality + needs to get cleaned up better. + + 11 Apr 2004; Masatomo Nakano etc-update, ebuild.sh: + Fixed infinity loop in etc-update(#19144). Fixed glob problem in + ebuild.sh(#37066). Fixed deleting build-info problem with + FEATURES="keepwork"(#29044). + + 10 Apr 2004; Nicholas Jones portage.py: Includes the + deadlock breaks marked with 'XXX:' to indicate where fixes are needed. Added + HTTP encoding to PORTAGE_BINHOST with checks and fallbacks. Fallback for + dbkey settings spawned from ebuild. Exception handling for db classes in + the case of random corruption. jstubb's fix for the dep code to handle + empty lists, added a notice about that being rude. + + 10 Apr 2004; Nicholas Jones ebuild.sh: Made more QA + notices and made them slightly more pretty 'QA Notice:'. Made the depend + phase trap less violent -TERM not -KILL. + + 10 Apr 2004; Masatomo Nakano repoman: Added IUSE missings + a check(#21544). + + 10 Apr 2004; Marius Mauch tarball.sh, pym/portage.py: + Fixing broken regexp in fixdbentries() (bug 46096), changing version + number. + + 10 Apr 2004; Masatomo Nakano repoman: Fixed unsafety + temporary file name(#44455). + + 09 Apr 2004; Masatomo Nakano portage.py: Fixed + reorder ld.so.conf bug(#44028). Portage should skip not existing DIR + during unmerge(#25339). + + 09 Apr 2004; Masatomo Nakano repoman: Added + jstubbs's patch to add a check invalid DEPEND format to repoman. + This should fix #36857. + + 09 Apr 2004; Masatomo Nakano emerge, portage.py, + output.py: Fixed some bugs. See #45164, #24299, #34967. + + 01 Apr 2004; Masatomo Nakano portage.py: Fixed + virtuals in reverse order(jstubbs's patch and my fix). + This should close #45468. + + 20 Mar 2004; Nicholas Jones portage_db_*: Updated + all the db modules to be current and correct and updated the testing code + to make sure everything is working properly. + + 20 Mar 2004; Nicholas Jones ebuild: Fix for traceback + and incorrent ROOT variable when using an alternate root and hand-merging. + + 20 Mar 2004; Nicholas Jones ebuild.sh: Exported the + sandbox variables so that they work. + + 20 Mar 2004; Nicholas Jones emerge: Enhancements for + binary downloads -- proper selection for virtuals, etc... Proper slot + handling for pretend output with binaries. + + 20 Mar 2004; Nicholas Jones prepman: symlink fix. + + 20 Mar 2004; Nicholas Jones prepstrip: Added the + readelf PIC code for the TEXTREL stuff. + + 20 Mar 2004; Nicholas Jones portage.py: Removed some + functions: evaluate, dep_listcleanup, dep_getjiggy. Made inheritance for + profiles relative from the profile's directory instead of from the profile's + base directory. OBSOLETING two functions dep_parenreduce and dep_opreduce in + favor of the new code in portage_dep paren_reduce and use_reduce. dep_zapdeps + got an overhaul for much more intelligent selection of packages and virtual + handling during depgraph generation. Binary tree enhancements and selection + enhancements. bindbapi created to do aux_get on binaries. isInjected added + to vardbapi to get injected status. SRC_URI uses the new portage_dep code + to handle strings now -- nesting should would flawlessly and FEATURES=cvs + should get _all_ files. + + 20 Mar 2004; Nicholas Jones portage_db_cpickle.py: + Added pickle loading safety. + + 20 Mar 2004; Nicholas Jones portage_dep: Temp home + for the dep resolution code that will be moving from portage.py and emerge + until we get the modular structure set up. + + 17 Mar 2004; Masatomo Nakano ebuild.sh, emerge, + portage.py, portage_db_anydbm.py, portage_db_cpickle.py, + portage_db_flat.py, portage_db_template.py: + Improved handling cache files on multi portage trees. + Fixed 'BAD COUNTER' error when emerge --inject. (#41062) + Added ferringb's patch to avoid sed command. (#40819) + + 12 Mar 2004; Marius Mauch bin/repoman: + repoman: Added a readonly-variable-assignment check (#44424) + + 06 Mar 2004; Masatomo Nakano repoman, portage.py: + Fixed some repoman/portage bugs. repoman shouldn't use /etc/portage/* + files. repoman shouldn't use PORTDIR_OVERLAY(#11335). repoman should use + each arch profile dir(#43601). portage didn't handle virtual dependency + with version (>=virtual/package-1.0) in some places. + + 05 Mar 2004; Marius Mauch bin/emerge: + Trivial fix for emerge -pv if the download size is a long. + + 03 Mar 2004; Marius Mauch bin/repoman, + pym/portage.py: + Fixing the "letter before endversion" bug (#17172). Replacing + keywords.desc with arch.list in repoman (#35398). FEATURES=strict + is now sufficient for Manifest validation (#41292). + + 01 Mar 2004; Marius Mauch bin/emerge, + bin/emergehelp.py, man/emerge.1: + Updated docs for --update and removed the "help" action (wasn't working + anyway). + + 29 Feb 2004; Masatomo Nakano portage.py: Fixed + wrong USE in 'emerge info'. This should fix #34260. + + 27 Feb 2004; Masatomo Nakano emerge: Fixed info dir + regeneration produces errors with a non-C locale and misleading error + message. This should fix #41872,#24299. + + 27 Feb 2004; Masatomo Nakano emerge, emergehelp.py, + emerge.1: Added genone's patch for man/help of --tree option. + + 27 Feb 2004; Masatomo Nakano ebuild.sh: Removed + /usr/share directory in ${D} when it's empty. This should close #42312. + + 26 Feb 2004; Masatomo Nakano emerge: Added new option + --newuse. This option is to rebuild a package whose USE has been changed. + + 22 Feb 2004; Masatomo Nakano emerge, portage.py: speedup + when /etc/portage/package.keywords is defined. Moved loading + /etc/portage/package.* processs to config class. This should fix #41520. + + 19 Feb 2004; Masatomo Nakano portage.py: + Fixed CATEGORY value after preinst phase. This should close #6414. Fixed + nested dependency problem and cleaned up dep_zapdeps function. + This bug happened with DEPEND='|| ( cat_a/pkg_a flag? ( cat_b/pkg_b ) )'. + This should close #41869. + + 13 Feb 2004; Masatomo Nakano portage.py: Fixed parsing + SRC_URI bug when FEATURES="cvs". This should close #16159. + + 12 Feb 2004; Masatomo Nakano emerge, pym/portage.py: + TGL's patch for correction package size when emerge -v. -- Fixed + use.default bug. It occurs when package in use.default exists in system + and it's virtual package. This should close #40831. + + 12 Feb 2004; Masatomo Nakano emerge: Fixed + --ask bugs. It breaks with "--clean". It also breaks when blocker + exists. This should close #39865. + + 12 Feb 2004; Masatomo Nakano emerge: Fixed + --ask bug with --changelog. This should close #41293. + + 11 Feb 2004; Masatomo Nakano emergehelp.py: Added + help of F flag with emerge --pretend. This should close #28253. + + 11 Feb 2004; Masatomo Nakano pym/portage.py: Fixed + ccache dir permission problem with FEATURES="userpriv". + This should fix #22125. + +*portage-2.0.50-r1 (09 Feb 2003): Release Fixes + + 09 Jan 2004; Nicholas Jones portage.py: Fix the config + code so that it doesn't fail when the profile does not exist -- allows + sync'ing without a tree like it should. Parser returns an exception with + the parse error now for getconfig(). TGL's patch for another cache issue + in class config. Modified the /etc/make.profile message. Fix for the + "eclass does not exist" messages on sync. + + 09 Jan 2004; Nicholas Jones repoman: Fix the repopath + so that it cna be run outside of cvs repos. + + 09 Jan 2004; Nicholas Jones ebuild.sh: Add portage's + pym path to SANDBOX_PREDICT to stunt any further .pyc/.pyo problems. Add + nofetch to the 'successful' kill list to stop the $T definition woes. + + 08 Feb 2004; Masatomo Nakano repoman: repoman should + read each arch virtual file. This should close #40813. + + 08 Feb 2004; Masatomo Nakano emerge: Fixed -s/-S + bug. "Latest version installed:" was incorrect. This should fix #40847 + + 08 Feb 2004; Masatomo Nakano portage.py: Fixed ldconfig + bug. emerge didn't ldconfig after removing library directory. + This should fix #40694. + +*portage-2.0.50 (06 Feb 2003): Release -- API change, cleanups, speedups + + 06 Jan 2004; Nicholas Jones *: repoman got a quick fix + from genone. Ed's fix for ask/pretend. Made sure that emerge force-updated + the eclass cache before trying to update all the metadata. masking type + patch from Genone. masking info patch and regenworld patch added. + +*portage-2.0.50_pre22 (04 Feb 2003): Cleanups and stablizing + + 04 Feb 2004; Nicholas Jones ebuild.sh: TGL's fixes + for exec/child/wait problems. Unset GREP_OPTIONS GREP_COLOR. has() and use() + no longer attempt to determine if they are to be quiet or noisy -- They + default to noisy -- useq() and hasq() are the non-verbose versions. + EBUILD_PHASE set to add a hack-ish way around global scope calls in + eclasses -- NOTHING SHOULD BE CALLED IN THE GLOBAL SCOPE. Touchup to the + inherit() code that should finally allow the removal of the ECLASS and + INHERITED settings. Removed tty (use/has) calls. Removed dirname calls -- + portage.py handles setting the dbkey filename now. + + 04 Feb 2004; Nicholas Jones emerge: Ed Catmur's + (with a little TGL added in) patch for --ask. Added a 'metadata' target + that skips the sync and only updates the cache. FEATURES="getbinpkg" added. + TGL's exit code fixes. Fixed match code for -S so it doesn't complain about + specific and double versions. Unmerge via dbpath fix. Rewrote rsync's + options that supports --verbose and --quiet operation now and can force + checksumming all files using --debug. Sort the files in the cache update + so it's a little more predictable. + + 04 Feb 2004; Nicholas Jones prepstrip: changed + --strip-debug to --strip-unneeded. + + 04 Feb 2004; Nicholas Jones getbinpkg.py: Updates to + enable HTTP/HTTPS authentication. + + 04 Feb 04; Nicholas Jones portage.py: best_from_dict + added to grab the best entry from set of dicts using a list of the keys for + priority. jstubb's patch to fix listdir -- splits it into a cache and list + setup. jstubb's patch for varexpand to handle $VAR better. Latexer's patch + for KernelVersion code to use Makefiles instead of the version.h. Modules + are loaded from /etc/portage/modules or defaults, whichever works. Fixed + the /etc/make.profile-is-missing traceback. Spawn can be given 3 pipes to + redirect stdin,stdout,stderr to specific outputs, terminals, or files. + TGL's patch for cache functions in portage.py so that they do not cache at + inappropriate times. PORTAGE_TMPFS is now used if set as a temporary file + operation area -- recommended to actually be a ramfs/tmpfs filesystem for + speed. Genone enhanced the deprecated profile patch. + + 31 Jan 2004; Masatomo Nakano emerge: Fixed --skipfirst + bug. This closes #36880. + + 29 Jan 2004; Masatomo Nakano emerge: TGL's patch + for imporving overlay verbose. This closes #39765. + + 27 Jan 2004; Masatomo Nakano portage.py: Fixed + autouse bug. autouse were ignored. + + 21 Jan 2004; Nicholas Jones emerge: Output failed + cache updates during emerge sync. + + 21 Jan 2004; Nicholas Jones *: VDB_PATH fixes. + + 21 Jan 2004; Nicholas Jones portage.py: Only use + custom profiles when not called by repoman. ROOT never changes profile + roots, only custom/system profiles var/cache/edb/virtuals. Sandbox fix + where sandbox was creating an invalid logfile (not giving a summary) + due to a '/' in SANDBOX_LOG. Turned down the Lockfile output. Double + check the INCOMPLETE MERGE identifications as it can be caused by cache. + + 24 Jan 2004; emerge: Improved timestamp check + when 'emerge sync'. Added catching amiguous error when unmerge. + This closes #24325. + + 23 Jan 2004; emerge, portage.py: Fixed 2 bugs. + Portage doesn't read local virtuals file, which happens on only cvs + version. package is blocked by itself. + + 21 Jan 2004; Nicholas Jones portage.py, emerge: + Fix from genone for emerge's direct reading of packages and his patch + that also adds in /etc/portage/profile as a stacked profile. + + 21 Jan 2004; Nicholas Jones portage.py: Completed + inheritence capabilities for portage.config reading some files. Moved a + copy of the getvirtuals() function into settings to handle multiple + profiles properly. + +*portage-2.0.50_pre17/18/19 (21 Jan 2004): Modules for DBs and quick fixes + + 21 Jan 2004; Nicholas Jones *: Moved all references + to var/db/pkg to portage.VDB_PATH --- This will change again -- NEED TO + BE MOVED INTO A PATH/CONSTANTS SETUP. + + 21 Jan 2004; Nicholas Jones dosed: Quick fix for + the basename missing/misplaced issue. + + 21 Jan 2004; Nicholas Jones ebuild.sh: Added + /dev/console to PREDICT to attempt a workaround for a serial console + bug. dbkey is now set through portage.py/doebuild to allow for modular + db code. + + 21 Jan 2004; Nicholas Jones emerge: regen doesn't + require root anymore. Edited the timestamp check to be a little more + friendly -- delete the portdir timestamp and it won't use the alternate. + Fix some permission settings. Added some warnings in for cachedirs that + are very likely to ruin your system. Cleaned out some of the eclass code + that isnt valid any longer. + + 21 Jan 2004; Nicholas Jones portageq: Added vdb_path + as a target to get the db directory. Quickpkg uses this. + + 21 Jan 2004; Nicholas Jones portage.py: Added + load_mod() -- grabs a class/function from a module and passes it back + without loading the module into the global scope. Added unique_array() + which eliminates duplicates from an array. grab_stacked() operates like + the other grab* and getconfig functions, but takes a filename and a set + of paths that it will apply incrementally or clobbers -- for profile + inheritance. getconfig no longer exits on non-existance returns None. + Class config now should be passed a profile path and a set of incremental + values instead of using the globals -- defaults to using the globals + presently and print an error message. Adding support for module configs + as a set of strings 'class.subclass.objectmodule':'module.to.use.object' + for load_mod and the database modules. Profile inheritance started. Killed + the eclass() super-function and replaced it with class eclass_cache that + is visible and conceptually simpler -- Also uses the plugable modules. + Cleaned out the sync calls for the DBs. MASSIVE simplification of the + aux_get code -- removed memory-caching in favor of system cache (actually + faster in all cases so far -- P100 and P4-2.2G). Lockfile usage around the + cachefile. + + 21 Jan 2004; Nicholas Jones portage_db_*: Updated + the API a little but to have permissions set properly. A little more + reorganization and removed the keycount checks. + + 21 Jan 2004; Masatomo Nakano emerge: download size + should not be displayed when the package is nomerge with --tree. + + 20 Jan 2004; Masatomo Nakano portage.py: Reverted + ambiguity package fix in cpv_expand(). + + 20 Jan 2004; Masatomo Nakano emerge: Moved + backup timestamp.chk file from portage tree to PORTAGE_TMPDIR. + + 20 Jan 2004; Masatomo Nakano emerge: Reverted the + backing up the timestamp.chk fix. + + 20 Jan 2004; Masatomo Nakano emerge: Improved the + list of --tree by TGL's patch. This should close #38070. + + 20 Jan 2004; Masatomo Nakano emerge: Removed debug + message without --debug. This should close #23840. + + 19 Jan 2004; Masatomo Nakano emerge: Improved + timestamp check of rsync. This should close #37403. + + 19 Jan 2004; Masatomo Nakano portage.py: Improved + regeneration ld.so.cache. This should close #37858. + + 19 Jan 2004; Masatomo Nakano emerge: Fixed bug which + emerge doesn't block same package but different version. + (example: DEPEND="! portage.py: + Modified cpv_expand() to check package.mask. This should close #38592. + + 19 Jan 2004; Masatomo Nakano portage.py: Escaped + regualar expression for replace entry in fixdbentries(). + + 18 Jan 2004; Masatomo Nakano portage.py: + Fixed AUTOCLEAN delay problem in .50pre* by TGL's patch. This close + #38189. Fixed unmerge failture bug when 'ebuild foo-1.0.0 unmerge'. + These close #38189, #38366 + + 18 Jan 2004; Masatomo Nakano emerge, portage.py: + Fixed "ebuild /foo/bar-1.0.0.ebuild unmerge" and "emerge bar-1.0.0 unmerge" + problems. This should close #38420. + + 17 Jan 2004; Masatomo Nakano portage.py: Fixed + "!<=" style block problem. Fixed symlink with absolute path + problem in treewalk(). + +*portage-2.0.50_pre16 (13 Jan 2004): Quick Fixes -- ~arch version + + 13 Jan 2004; Nicholas Jones portage.py: Removed an + unnecessary depend call that double eclass-using ebuild's cache regen + time. + +*portage-2.0.50_pre15 (12 Jan 2004): Quick Fixes -- ~arch version + + 12 Jan 2004; Nicholas Jones portage.py: Unmerge + traceback fix. + +*portage-2.0.50_pre14 (12 Jan 2004): Quick Fixes -- ~arch version + + 12 Jan 2004; Nicholas Jones emerge: Fix for + traceback on '-S'. + + 12 Jan 2004; Nicholas Jones repoman: Fix for + traceback on --help. + + 12 Jan 2004; Nicholas Jones sandbox: Fix for + sandboxpids.tmp file accesses. + + 12 Jan 2004; Nicholas Jones portage.py: Sandbox, as + above. Catch invalid package names and print a sane message about it. + +*portage-2.0.50_pre13 (11 Jan 2004): Fixes + + 11 Jan 2004; Nicholas Jones cnf/*: Updated the + Advanced masking section to aid the reduction of user complaints and + requests for unreasable usage of ACCEPT_KEYWORDS. + + 11 Jan 2004; Nicholas Jones portage.py: A counter + fix was fixed to actually check the counters of all CP versions to ensure + the new counter is higher than all existing ones. Modified the dblink + class to have class lockfiles for the db and tmpdb dirs as well as lock + other files before editing. Reorganization of the merge code in dblink + so that the tmpdb is filled immediately after preinst and prior to the + actual FS merging -- COUNTER and CONTENTS go directly into the tmpdb + and not into the infodir. + +*portage-2.0.50_pre11/12 (09 Dec 2003): repoman/binpkg/exit conditions + + 09 Jan 2004; Nicholas Jones emerge: getbinpkgonly + fixes for emerge -G world, should behave properly now instead of using + ebuild masks. Only downloads immediately before a merge -- fetchonly now + applies to binary packages. + + 08 Jan 2004; Masatomo Nakano repoman: Ignore other + arches check in repoman when --ignore-other-arches(-I). + +*portage-2.0.50_pre10 (06 Dec 2003): API change + enhancements + + 06 Jan 2004; Nicholas Jones ebuild.sh: Fix for + dyn_preinst being called before IMAGE was set -- IMAGE is now valid + in pkg_preinst. Added suidctl for SELinux. + + 06 Jan 2004; Nicholas Jones emerge: Added -P to + initial cvs checkout. + + 06 Jan 2004; Nicholas Jones quickpkg: Fix for + the 'tar up /' problem. + + 06 Jan 2004; Nicholas Jones portage.py: Caught a + traceback generated by bad depend atoms for repoman. Fixes from genone + for package.*. Fixed the checks for doebuild calls in treewalk that was + ignoring exit conditions for ebuilds. + + 04 Jan 2004; Masatomo Nakano repoman: Added PDEPEND + dependency check. This closes #24796 + + 04 Jan 2004; Masatomo Nakano repoman, portage.py: + Added new dependency check to repoman. This closes #36887. + + 03 Jan 2004; Masatomo Nakano emerge: Modified + to specific port number in emerge sync. This closes #36994 + + 02 Jan 2004; Masatomo Nakano portage.py: Fixed + a problem that emerge doesn't block package when it's required. + It happens in .50_pre*. + + 02 Jan 2004; Masatomo Nakano portage.py: Fixed + issue with getsize() when --debug. + + 02 Jan 2004; Masatomo Nakano portage.py: Fixed + issue with virtual. This closes bug #9050, #22225, #29499. + + 01 Jan 2004; Masatomo Nakano ebuild, emerge, portage.py: + Fixed issue with not cleaning up temp directory. This closes bug #34967. + + 31 Dec 2003; Masatomo Nakano emerge: + Fixed 'emerge sync' issue which continuously connects to same host. + + 31 Dec 2003; Nicholas Jones emerge: Found the line + that was causing the package dir to be printed... It was a spawn call. + + 31 Dec 2003; Nicholas Jones portage.py: Fix for + the symlink corruption in the db from the movefile() bug. + + 29 Dec 2003; Masatomo Nakano portage.py: + Fixed bug which emerge stops when no denpendencies exist in || ( ) + by USE flags. This closes #36568. + + 29 Dec 2003; Masatomo Nakano emerge, portage.py: + Added an ambiguity package check when emerge. This closes bug #22700. + +*portage-2.0.50_pre9 (24 Dec 2003): API change + enhancements + + 24 Dec 2003; Nicholas Jones 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 emerge: using os.uname + instead of calling out to uname. + + 24 Dec 2003; Nicholas Jones quickpkg: Added SpanKY's + patch for delayed exit/error conditions. + + 24 Dec 2003; Nicholas Jones xpak.py: chdir's added + to the getcwd fix for missing dirs. + + 24 Dec 2003; Masatomo Nakano emerge: Added OVERLAY + directories display for --verbose. + +*portage-2.0.50_pre8 (24 Dec 2003): API change + enhancements + + 22 Dec 2003; Nicholas Jones ebuild.sh: Added + /proc/self/maps to SANDBOX_PREDICT, and /dev/shm to read/write. + + 22 Dec 2003; Nicholas Jones emerge: Added automake + and autoconf versions to the output of emerge info. + + 22 Dec 2003; Nicholas Jones etc-update: Added + edit merged file option -- defaults to EDITOR var or "nano -w". + + 22 Dec 2003; Nicholas Jones portage.py: Use + os.uname instead of calling out to uname which might not exist. + +*portage-2.0.50_pre7 (22 Dec 2003): API change + enhancements + + 22 Dec 2003; Nicholas Jones ebuild.sh: patch to + quote most of the path operators that might involve spaces. + + 22 Dec 2003; Nicholas Jones portage.py: Fix for + invalid entries in package.keywords. Character chopping on mirrors + fixed again. + + 21 Dec 2003; Masatomo Nakano bin/ebuild, bin/emerge, + pym/portage.py: Changed to show disabled USE flags from use.mask when + using emerge -vp. And fixed use.mask issue. + + 20 Dec 2003; Nicholas Jones portage.py: Rewrote + match_from_list -- Simplified and made pkgcmp and match_from_list + properly compare package names. + + 20 Dec 2003; Nicholas Jones repoman: Fix for mysigs + traceback when signing. + + 20 Dec 2003; Nicholas Jones portage.py: Added + PYTHONPATH to the specials list -- created a colon_seperated list. + Fixed reset() in class config so that you can specify keeping the + pkg dictionary when resetting the values. + + 19 Dec 2003; Masatomo Nakano repoman: Added check + whether "ebuild foo.ebuild digest" succeeds. + + 19 Dec 2003; Nicholas Jones portage.py: Fix for + pkg settings being maintained after an unmerge. + + 19 Dec 2003; Nicholas Jones pym/portage_db_*: Moved + to using cPickle instead of marshal. More standardization of the API. + + 18 Dec 2003; Masatomo Nakano repoman: Added virtual + dependency check on each arch. + + 17 Dec 2003; Nicholas Jones portage.py: Fixed a + permission issue involving $T and userpriv. Lockfile touchup. + + 17 Dec 2003; Nicholas Jones portage_db_*: Added + templates and db for cache interfaces. Presently have a anydbm and a + flat file interface working. See the test for operations. + + 15 Dec 2003; Nicholas Jones emerge: Added a call + to portageq that causes python to create optimized modules prior to it + ending up inside the sandbox. Added more output and logging to sync. + + 15 Dec 2003; Nicholas Jones prepstrip: 'tree' is not + the same as 'true'. + + 15 Dec 2003; Nicholas Jones portage.py: invalid + settings in package.keywords caused a traceback -- fixed with error message. + +*portage-2.0.50_pre1 (12 Dec 2003): API change + enhancements + + 10 Dec 2003; Nicholas Jones chkcontents: Uses portage + functions to do md5sum calcs. + + 10 Dec 2003; Nicholas Jones ebuild.sh: Removed try() + as it isn't used, and was deprecated for a long while. Genone's fetching + size display added for --verbose. License display added. Added a little + debug for IUSE so we can figure out the binary package --verbose IUSE + issues that are randomly reported. XXXXXXXXXXXXXXXXXXX's 'buildsyspkg' + patch for building only system packages into tbz2s. Unmerge fix for new + settings instances. RSYNC_RATELIMIT added. + + 10 Dec 2003; Nicholas Jones portage.py: ADA path + variables added to specials for env_update. Error messaeg correction for + make.defaults syntax errors. Unmerge now uses the environment file, if it + exists, to get the complete environment back to perform unmerge operations. + load_infodir() uses pkg settings completely now. Fixed the passing of + settings in unmerge and dblink. Fixed an issue regarding unlinking lockfiles + while inside of a sandbox. + + 09 Dec 2003; Nicholas Jones ebuild.sh, *.sh: + Moved helper scripts into bin/functions and made them sourceable -- they + now will die in cases where sub-parts fail. dodoc and keepdir are now + recursive-capable. + + 09 Dec 2003; Nicholas Jones emerge: emerge.log now + set as portage:portage with 0660 perms. --debug now enables tracebacks + for dep generation instead of moving code out of the try block. + + 09 Dec 2003; Nicholas Jones g-cpan.pl: rac's patch + to get arch list from portage's list of arches in the profiles. + + 09 Dec 2003; Nicholas Jones repoman: Moved a bit of + the existing gpg code around -- it might work as is, but requires 'sign' + in features. Fixed a potential for repoman to miss updates that should + get a new manifest and commit. Fixed digest/manifest generation for + non-packagedir runs of repoman. + + 09 Dec 2003; Nicholas Jones emergehelp.py, make.conf, + getbinpkg.py: Message touch ups. + + 09 Dec 2003; Nicholas Jones portage.py: load_infodir() + uses pkg settings now instead of env and backup. Genone's custom mirror + patch included. Added some missing 'strict' flags for recursion in digest*(). + Refixed the invalidentry stuff that was lost across patch merges. Fix for + pkg-keywords from genone included. Genone's deprecated profile patch for + reporting to a user that their current profile is deprecated. Message about + missing arch.list instead of spouting invalid keywords messages. + + 08 Dec 2003; Masatomo Nakano repoman: + Added all arch dependency check. This closes bug #24160. + + 07 Dec 2003; Masatomo Nakano emerge,portage.py: + Fixed bugs. 1.--debug doesn't work 2.Portage breaks files + in /var/db/*/*. 3.No stop if dependency problem happens. + They are only cvs version problems. + + 01 Dec 2003; Masatomo Nakano emerge: Fixed bug which + always remakes info dir file. + + 29 Nov 2003; Masatomo Nakano portage.py: Fixed issue with + ebuild name rule. Fixed typo with variable name. + This closes bug #17172,#34666 + + 29 Nov 2003; Masatomo Nakano emerge: Fixed issue with + lacking the "setting" argument for pkgmerge() + + 29 Nov 2003; Masatomo Nakano emerge: fixed rsync bug. + This closes bug #34660. + + 28 Nov 2003; Nicholas Jones portage.py: Migration + to non-global settings started -- class config has new functionality and + is locked after portage is finished initializing -- changes cannot be made + to the global instance of config 'settings' -- reset() is now functional, + setcpv() loads PKGUSE from /etc/portage/package.use, load_infodir() loads + all small files (under 4k) from the vardb directory of an installed package + so that operations have the same post* settings as they had at merge time. + Begin modifications to spawn() to allow for files/pipes to be used for + IO instead of using getstatusoutput which does not take an environment + parameter like execve(). check_config_instance() ensures that the provided + parameter is a 'class config' instance -- for ensuring that everything is + being passed properly with the changes. Fix for the local FS mirror issue + where it removed the first '/' instead of the last one. doebuild() cleanups + for readability and pkguse enhancements -- also remove getstatusoutput() + usage for depend so that we don't have to modify the active environment. + Fix for symlink mtime values returned from movefile. (Nakano) SLOTMOVE + added to global update functionality to fix some issues where a package + suddenly must become slotted. portdbapi takes a root parameter instead + of using settings. Slightly more useful output from depend. binarytree() + now takes a pkgdir instead of using settings. Portage will now die if + ebuild.sh exits on a signal. + + Moved some functions around and renamed them for general use -- derived + from match2 in class portagetree: + match_to_list() find all atoms in a list that match a given package. + best_match_to_list() determines the most specific match. Needs work. + match_from_list() find all packages in a list that match a given atom. + + 28 Nov 2003; Nicholas Jones emerge: Fixed an issue + with searchdesc wanting root permissions if run as non-root. Migrated to + the non-global config class. EMERGE_FROM added for the dyn_preinst patch + -- Indicates if a merge is occuring from an ebuild or from a binary. Patch + for rsync timestamp checking from Nakano. + + 28 Nov 2003; Nicholas Jones ebuild.sh: Save PKGUSE. + Pebeneto's patch for dyn_preinst and SELinux added as a fix for binary + and ebuild merges. Added a kill for portage during the depend phase so + that portage will actually die if you control-C. + + 28 Nov 2003; Nicholas Jones *: MASSIVE set of changes + to start using locally defined 'class config' instances. This allows us to + start working on some parallelism among other things. Created this way: + mysettings = portage.config(clone=portage.settings) + + The Following functions now take a 'config' parameter: + spawn(), fetch(), digestgen(), digestcheck(), spawnebuild(), doebuild(), + merge(), dep_opconvert(), dep_check(), dblink.__init__() + + package.keywords is now implemented curtasy of genone/max. PKGUSE was + rewritten for the global config killing and is also included. X11 man + pages now found and zipped correctly. SYS.PATH fixes for the python + migration -- issue actually only shows up on 2.2 systems because of how + compiled modules are used if found regardless of the original source's + existance. + + 28 Nov 2003; Nicholas Jones tabcheck.py: An easier + way to make sure that all the python stuff is correctly using tabs and + not mixing spaces. + + 28 Nov 2003; Nicholas Jones xpak, xpak.py: Fixes + to ensure that it works if the current dir is missing and that the python + path gets set properly. + + 22 Nov 2003; Daniel Robbins portage.py: Fixed + calls in vartree method to invalidentry().... made them call call + self.dbapi.invalidentry() (there were multiple wrong method calls.) + + 10 Nov 2003; Nicholas Jones md5check.py: Checks all + digests and SRC_URIs for filenames and associated MD5s. Reports collisions + between versions/packages, missing, and extra lines in digests. + +*portage-2.0.49-r17/18 (10 Nov 2003): Fixes + + 10 Nov 2003; Nicholas Jones *: Changed portage to + be the first path in sys.path for all python scripts. Also enabled + optimizations from the scripts to ensure everything imported is built + for speed. ebuild: applied fix for the '//' root breaking the db[]. + prepstrip: etdyn quickfix + + 10 Nov 2003; Nicholas Jones portage.py: fix for + RESTRICT=nouserpriv. GENTOO_MIRRORS can have paths set to take files + from. Fixes for mishandled cache data regarding *pkgsplit(). Fixes for + '*' being returned as part of a package split. An 'invalidentry()' fix + for a traceback. Nakano's fixes for virtual removals not working properly, + sandbox violations during pkg_nofetch, || depend selection. Genone's + fixpackages speedup. + + 10 Nov 2003; Nicholas Jones ebuild.sh: PORTAGE_TMPDIR + fix for distcc. Variable passing bug patch for export_functions. Exit 1 + added for nofetch to stop sandbox violation. Nakano's --tree patch added. + Improved the unmerge messages to denote what kind of unmerge fails. Info + pages regex pattern adjusted to allow most any name for a page. + + 10 Nov 2003; Nicholas Jones repoman: genone's xml + linting additions. + + 01 Nov 2003; Robin H. Johnson pym/cvstree.py: + fix bug #32071, by properly escaping a string to not be a regex. Checked + thru entire *.py tree and found this is the only mis-use of strings that + need to be escaped. + + 31 Oct 2003; Daniel Robbins portage.py: /lib/modules + now gets "unmerge protection." This is half of the config protection + functionality. It means that anything in /lib/modules will not be deleted + when a package is unmerged (often automatically when a user merges a + kernel module ebuild for a new kernel.) This solves the "my module + disappeared!" issue. This closes bug #1477. + + 31 Oct 2003; Daniel Robbins emerge: Should no longer + spit out wacky "!!! no match found" warnings when auto-cleaning. + + 30 Oct 2003; Daniel Robbins portage.py: Only run + depscan.sh if it exists on disk. This allows Portage to run inside a stage1 + where /sbin/depscan.sh doesn't exist. + + 30 Oct 2003; Daniel Robbins portage.py: Applied fix to + allow multi-level "use? ( )" in SRC_URI, closing bug #16159. + +*portage-2.0.49-r15/16 (21 Oct 2003): Fixes + + 21 Oct 2003; Nicholas Jones fix-db.py: was broken + for python2.3 -- fixed now. + + 21 Oct 2003; Nicholas Jones portage.py: Added + lockfiles to prelink md5 checks. Fixed caching bug where cache objects + were passed back as pointers instead of copies. Added 'invalidentry' + function to handle lockfiles -- It tests/deletes them using unlockfile. + Added fix-db.py to the 'databases is broken' messages. + + 21 Oct 2003; Nicholas Jones ebuild.sh: added CDPATH + to unset. SELinux fix for sandbox. + diff --git a/ChangeLog.000 b/ChangeLog.000 new file mode 100644 index 000000000..06895ac4d --- /dev/null +++ b/ChangeLog.000 @@ -0,0 +1,4288 @@ +# ChangeLog for Portage; the Gentoo Linux ports system +# Copyright 1999-2004 Gentoo Foundation; Distributed under the GPL v2 +# $Id: ChangeLog.000,v 1.3 2004/10/04 13:58:57 vapier Exp $ + + *** THIS IS FOR ARCHIVAL PURPOSES ONLY -- DO NOT MODIFY *** + *** THIS IS FOR ARCHIVAL PURPOSES ONLY -- DO NOT MODIFY *** + *** THIS IS FOR ARCHIVAL PURPOSES ONLY -- DO NOT MODIFY *** + *** THIS IS FOR ARCHIVAL PURPOSES ONLY -- DO NOT MODIFY *** + *** THIS IS FOR ARCHIVAL PURPOSES ONLY -- DO NOT MODIFY *** + *** THIS IS FOR ARCHIVAL PURPOSES ONLY -- DO NOT MODIFY *** + *** THIS IS FOR ARCHIVAL PURPOSES ONLY -- DO NOT MODIFY *** + *** THIS IS FOR ARCHIVAL PURPOSES ONLY -- DO NOT MODIFY *** + *** THIS IS FOR ARCHIVAL PURPOSES ONLY -- DO NOT MODIFY *** + + 21 Jan 2004; Nicholas Jones ebuild.sh: TGL's fixes + for exec/child/wait problems. Unset GREP_OPTIONS GREP_COLOR. has() and use() + no longer attempt to determine if they are to be quiet or noisy -- They + default to noisy -- useq() and hasq() are the non-verbose versions. + EBUILD_PHASE set to add a hack-ish way around global scope calls in + eclasses -- NOTHING SHOULD BE CALLED IN THE GLOBAL SCOPE. Touchup to the + inherit() code that should finally allow the removal of the ECLASS and + INHERITED settings. Removed tty (use/has) calls. Removed dirname calls -- + portage.py handles setting the dbkey filename now. + + 21 Jan 2004; Nicholas Jones emerge: Ed Catmur's + (with a little TGL added in) patch for --ask. Added a 'metadata' target + that skips the sync and only updates the cache. FEATURES="getbinpkg" added. + TGL's exit code fixes. Fixed match code for -S so it doesn't complain about + specific and double versions. Unmerge via dbpath fix. Rewrote rsync's + options that supports --verbose and --quiet operation now and can force + checksumming all files using --debug. Sort the files in the cache update + so it's a little more predictable. + + 21 Jan 2004; Nicholas Jones prepstrip: changed + --strip-debug to --strip-unneeded. + + 21 Jan 2004; Nicholas Jones getbinpkg.py: Updates to + enable HTTP/HTTPS authentication. + + 21 Jan 2004; Nicholas Jones portage.py: best_from_dict + added to grab the best entry from set of dicts using a list of the keys for + priority. jstubb's patch to fix listdir -- splits it into a cache and list + setup. jstubb's patch for varexpand to handle $VAR better. Latexer's patch + for KernelVersion code to use Makefiles instead of the version.h. Modules + are loaded from /etc/portage/modules or defaults, whichever works. Fixed + the /etc/make.profile-is-missing traceback. Spawn can be given 3 pipes to + redirect stdin,stdout,stderr to specific outputs, terminals, or files. + TGL's patch for cache functions in portage.py so that they do not cache at + inappropriate times. PORTAGE_TMPFS is now used if set as a temporary file + operation area -- recommended to actually be a ramfs/tmpfs filesystem for + speed. Genone enhanced the deprecated profile patch. + + 31 Jan 2004; Masatomo Nakano emerge: Fixed --skipfirst + bug. This closes #36880. + + 29 Jan 2004; Masatomo Nakano emerge: TGL's patch + for imporving overlay verbose. This closes #39765. + + 27 Jan 2004; Masatomo Nakano portage.py: Fixed + autouse bug. autouse were ignored. + + 21 Jan 2004; Nicholas Jones emerge: Output failed + cache updates during emerge sync. + + 21 Jan 2004; Nicholas Jones *: VDB_PATH fixes. + + 21 Jan 2004; Nicholas Jones portage.py: Only use + custom profiles when not called by repoman. ROOT never changes profile + roots, only custom/system profiles var/cache/edb/virtuals. Sandbox fix + where sandbox was creating an invalid logfile (not giving a summary) + due to a '/' in SANDBOX_LOG. Turned down the Lockfile output. Double + check the INCOMPLETE MERGE identifications as it can be caused by cache. + + 24 Jan 2004; emerge: Improved timestamp check + when 'emerge sync'. Added catching amiguous error when unmerge. + This closes #24325. + + 23 Jan 2004; emerge, portage.py: Fixed 2 bugs. + Portage doesn't read local virtuals file, which happens on only cvs + version. package is blocked by itself. + + 21 Jan 2004; Nicholas Jones portage.py, emerge: + Fix from genone for emerge's direct reading of packages and his patch + that also adds in /etc/portage/profile as a stacked profile. + + 21 Jan 2004; Nicholas Jones portage.py: Completed + inheritence capabilities for portage.config reading some files. Moved a + copy of the getvirtuals() function into settings to handle multiple + profiles properly. + +*portage-2.0.50_pre17/18/19 (21 Jan 2004): Modules for DBs and quick fixes + + 21 Jan 2004; Nicholas Jones *: Moved all references + to var/db/pkg to portage.VDB_PATH --- This will change again -- NEED TO + BE MOVED INTO A PATH/CONSTANTS SETUP. + + 21 Jan 2004; Nicholas Jones dosed: Quick fix for + the basename missing/misplaced issue. + + 21 Jan 2004; Nicholas Jones ebuild.sh: Added + /dev/console to PREDICT to attempt a workaround for a serial console + bug. dbkey is now set through portage.py/doebuild to allow for modular + db code. + + 21 Jan 2004; Nicholas Jones emerge: regen doesn't + require root anymore. Edited the timestamp check to be a little more + friendly -- delete the portdir timestamp and it won't use the alternate. + Fix some permission settings. Added some warnings in for cachedirs that + are very likely to ruin your system. Cleaned out some of the eclass code + that isnt valid any longer. + + 21 Jan 2004; Nicholas Jones portageq: Added vdb_path + as a target to get the db directory. Quickpkg uses this. + + 21 Jan 2004; Nicholas Jones portage.py: Added + load_mod() -- grabs a class/function from a module and passes it back + without loading the module into the global scope. Added unique_array() + which eliminates duplicates from an array. grab_stacked() operates like + the other grab* and getconfig functions, but takes a filename and a set + of paths that it will apply incrementally or clobbers -- for profile + inheritance. getconfig no longer exits on non-existance returns None. + Class config now should be passed a profile path and a set of incremental + values instead of using the globals -- defaults to using the globals + presently and print an error message. Adding support for module configs + as a set of strings 'class.subclass.objectmodule':'module.to.use.object' + for load_mod and the database modules. Profile inheritance started. Killed + the eclass() super-function and replaced it with class eclass_cache that + is visible and conceptually simpler -- Also uses the plugable modules. + Cleaned out the sync calls for the DBs. MASSIVE simplification of the + aux_get code -- removed memory-caching in favor of system cache (actually + faster in all cases so far -- P100 and P4-2.2G). Lockfile usage around the + cachefile. + + 21 Jan 2004; Nicholas Jones portage_db_*: Updated + the API a little but to have permissions set properly. A little more + reorganization and removed the keycount checks. + + 21 Jan 2004; Masatomo Nakano emerge: download size + should not be displayed when the package is nomerge with --tree. + + 20 Jan 2004; Masatomo Nakano portage.py: Reverted + ambiguity package fix in cpv_expand(). + + 20 Jan 2004; Masatomo Nakano emerge: Moved + backup timestamp.chk file from portage tree to PORTAGE_TMPDIR. + + 20 Jan 2004; Masatomo Nakano emerge: Reverted the + backing up the timestamp.chk fix. + + 20 Jan 2004; Masatomo Nakano emerge: Improved the + list of --tree by TGL's patch. This should close #38070. + + 20 Jan 2004; Masatomo Nakano emerge: Removed debug + message without --debug. This should close #23840. + + 19 Jan 2004; Masatomo Nakano emerge: Improved + timestamp check of rsync. This should close #37403. + + 19 Jan 2004; Masatomo Nakano portage.py: Improved + regeneration ld.so.cache. This should close #37858. + + 19 Jan 2004; Masatomo Nakano emerge: Fixed bug which + emerge doesn't block same package but different version. + (example: DEPEND="! portage.py: + Modified cpv_expand() to check package.mask. This should close #38592. + + 19 Jan 2004; Masatomo Nakano portage.py: Escaped + regualar expression for replace entry in fixdbentries(). + + 18 Jan 2004; Masatomo Nakano portage.py: + Fixed AUTOCLEAN delay problem in .50pre* by TGL's patch. This close + #38189. Fixed unmerge failture bug when 'ebuild foo-1.0.0 unmerge'. + These close #38189, #38366 + + 18 Jan 2004; Masatomo Nakano emerge, portage.py: + Fixed "ebuild /foo/bar-1.0.0.ebuild unmerge" and "emerge bar-1.0.0 unmerge" + problems. This should close #38420. + + 17 Jan 2004; Masatomo Nakano portage.py: Fixed + "!<=" style block problem. Fixed symlink with absolute path + problem in treewalk(). + +*portage-2.0.50_pre16 (13 Jan 2004): Quick Fixes -- ~arch version + + 13 Jan 2004; Nicholas Jones portage.py: Removed an + unnecessary depend call that double eclass-using ebuild's cache regen + time. + +*portage-2.0.50_pre15 (12 Jan 2004): Quick Fixes -- ~arch version + + 12 Jan 2004; Nicholas Jones portage.py: Unmerge + traceback fix. + +*portage-2.0.50_pre14 (12 Jan 2004): Quick Fixes -- ~arch version + + 12 Jan 2004; Nicholas Jones emerge: Fix for + traceback on '-S'. + + 12 Jan 2004; Nicholas Jones repoman: Fix for + traceback on --help. + + 12 Jan 2004; Nicholas Jones sandbox: Fix for + sandboxpids.tmp file accesses. + + 12 Jan 2004; Nicholas Jones portage.py: Sandbox, as + above. Catch invalid package names and print a sane message about it. + +*portage-2.0.50_pre13 (11 Jan 2004): Fixes + + 11 Jan 2004; Nicholas Jones cnf/*: Updated the + Advanced masking section to aid the reduction of user complaints and + requests for unreasable usage of ACCEPT_KEYWORDS. + + 11 Jan 2004; Nicholas Jones portage.py: A counter + fix was fixed to actually check the counters of all CP versions to ensure + the new counter is higher than all existing ones. Modified the dblink + class to have class lockfiles for the db and tmpdb dirs as well as lock + other files before editing. Reorganization of the merge code in dblink + so that the tmpdb is filled immediately after preinst and prior to the + actual FS merging -- COUNTER and CONTENTS go directly into the tmpdb + and not into the infodir. + +*portage-2.0.50_pre11/12 (09 Dec 2003): repoman/binpkg/exit conditions + + 09 Jan 2004; Nicholas Jones emerge: getbinpkgonly + fixes for emerge -G world, should behave properly now instead of using + ebuild masks. Only downloads immediately before a merge -- fetchonly now + applies to binary packages. + + 08 Jan 2004; Masatomo Nakano repoman: Ignore other + arches check in repoman when --ignore-other-arches(-I). + +*portage-2.0.50_pre10 (06 Dec 2003): API change + enhancements + + 06 Jan 2004; Nicholas Jones ebuild.sh: Fix for + dyn_preinst being called before IMAGE was set -- IMAGE is now valid + in pkg_preinst. Added suidctl for SELinux. + + 06 Jan 2004; Nicholas Jones emerge: Added -P to + initial cvs checkout. + + 06 Jan 2004; Nicholas Jones quickpkg: Fix for + the 'tar up /' problem. + + 06 Jan 2004; Nicholas Jones portage.py: Caught a + traceback generated by bad depend atoms for repoman. Fixes from genone + for package.*. Fixed the checks for doebuild calls in treewalk that was + ignoring exit conditions for ebuilds. + + 04 Jan 2004; Masatomo Nakano repoman: Added PDEPEND + dependency check. This closes #24796 + + 04 Jan 2004; Masatomo Nakano repoman, portage.py: + Added new dependency check to repoman. This closes #36887. + + 03 Jan 2004; Masatomo Nakano emerge: Modified + to specific port number in emerge sync. This closes #36994 + + 02 Jan 2004; Masatomo Nakano portage.py: Fixed + a problem that emerge doesn't block package when it's required. + It happens in .50_pre*. + + 02 Jan 2004; Masatomo Nakano portage.py: Fixed + issue with getsize() when --debug. + + 02 Jan 2004; Masatomo Nakano portage.py: Fixed + issue with virtual. This closes bug #9050, #22225, #29499. + + 01 Jan 2004; Masatomo Nakano ebuild, emerge, portage.py: + Fixed issue with not cleaning up temp directory. This closes bug #34967. + + 31 Dec 2003; Masatomo Nakano emerge: + Fixed 'emerge sync' issue which continuously connects to same host. + + 31 Dec 2003; Nicholas Jones emerge: Found the line + that was causing the package dir to be printed... It was a spawn call. + + 31 Dec 2003; Nicholas Jones portage.py: Fix for + the symlink corruption in the db from the movefile() bug. + + 29 Dec 2003; Masatomo Nakano portage.py: + Fixed bug which emerge stops when no denpendencies exist in || ( ) + by USE flags. This closes #36568. + + 29 Dec 2003; Masatomo Nakano emerge, portage.py: + Added an ambiguity package check when emerge. This closes bug #22700. + +*portage-2.0.50_pre9 (24 Dec 2003): API change + enhancements + + 24 Dec 2003; Nicholas Jones 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 emerge: using os.uname + instead of calling out to uname. + + 24 Dec 2003; Nicholas Jones quickpkg: Added SpanKY's + patch for delayed exit/error conditions. + + 24 Dec 2003; Nicholas Jones xpak.py: chdir's added + to the getcwd fix for missing dirs. + + 24 Dec 2003; Masatomo Nakano emerge: Added OVERLAY + directories display for --verbose. + +*portage-2.0.50_pre8 (24 Dec 2003): API change + enhancements + + 22 Dec 2003; Nicholas Jones ebuild.sh: Added + /proc/self/maps to SANDBOX_PREDICT, and /dev/shm to read/write. + + 22 Dec 2003; Nicholas Jones emerge: Added automake + and autoconf versions to the output of emerge info. + + 22 Dec 2003; Nicholas Jones etc-update: Added + edit merged file option -- defaults to EDITOR var or "nano -w". + + 22 Dec 2003; Nicholas Jones portage.py: Use + os.uname instead of calling out to uname which might not exist. + +*portage-2.0.50_pre7 (22 Dec 2003): API change + enhancements + + 22 Dec 2003; Nicholas Jones ebuild.sh: patch to + quote most of the path operators that might involve spaces. + + 22 Dec 2003; Nicholas Jones portage.py: Fix for + invalid entries in package.keywords. Character chopping on mirrors + fixed again. + + 21 Dec 2003; Masatomo Nakano bin/ebuild, bin/emerge, + pym/portage.py: Changed to show disabled USE flags from use.mask when + using emerge -vp. And fixed use.mask issue. + + 20 Dec 2003; Nicholas Jones portage.py: Rewrote + match_from_list -- Simplified and made pkgcmp and match_from_list + properly compare package names. + + 20 Dec 2003; Nicholas Jones repoman: Fix for mysigs + traceback when signing. + + 20 Dec 2003; Nicholas Jones portage.py: Added + PYTHONPATH to the specials list -- created a colon_seperated list. + Fixed reset() in class config so that you can specify keeping the + pkg dictionary when resetting the values. + + 19 Dec 2003; Masatomo Nakano repoman: Added check + whether "ebuild foo.ebuild digest" succeeds. + + 19 Dec 2003; Nicholas Jones portage.py: Fix for + pkg settings being maintained after an unmerge. + + 19 Dec 2003; Nicholas Jones pym/portage_db_*: Moved + to using cPickle instead of marshal. More standardization of the API. + + 18 Dec 2003; Masatomo Nakano repoman: Added virtual + dependency check on each arch. + + 17 Dec 2003; Nicholas Jones portage.py: Fixed a + permission issue involving $T and userpriv. Lockfile touchup. + + 17 Dec 2003; Nicholas Jones portage_db_*: Added + templates and db for cache interfaces. Presently have a anydbm and a + flat file interface working. See the test for operations. + + 15 Dec 2003; Nicholas Jones emerge: Added a call + to portageq that causes python to create optimized modules prior to it + ending up inside the sandbox. Added more output and logging to sync. + + 15 Dec 2003; Nicholas Jones prepstrip: 'tree' is not + the same as 'true'. + + 15 Dec 2003; Nicholas Jones portage.py: invalid + settings in package.keywords caused a traceback -- fixed with error message. + +*portage-2.0.50_pre1 (12 Dec 2003): API change + enhancements + + 10 Dec 2003; Nicholas Jones chkcontents: Uses portage + functions to do md5sum calcs. + + 10 Dec 2003; Nicholas Jones ebuild.sh: Removed try() + as it isn't used, and was deprecated for a long while. Genone's fetching + size display added for --verbose. License display added. Added a little + debug for IUSE so we can figure out the binary package --verbose IUSE + issues that are randomly reported. XXXXXXXXXXXXXXXXXXX's 'buildsyspkg' + patch for building only system packages into tbz2s. Unmerge fix for new + settings instances. RSYNC_RATELIMIT added. + + 10 Dec 2003; Nicholas Jones portage.py: ADA path + variables added to specials for env_update. Error messaeg correction for + make.defaults syntax errors. Unmerge now uses the environment file, if it + exists, to get the complete environment back to perform unmerge operations. + load_infodir() uses pkg settings completely now. Fixed the passing of + settings in unmerge and dblink. Fixed an issue regarding unlinking lockfiles + while inside of a sandbox. + + 09 Dec 2003; Nicholas Jones ebuild.sh, *.sh: + Moved helper scripts into bin/functions and made them sourceable -- they + now will die in cases where sub-parts fail. dodoc and keepdir are now + recursive-capable. + + 09 Dec 2003; Nicholas Jones emerge: emerge.log now + set as portage:portage with 0660 perms. --debug now enables tracebacks + for dep generation instead of moving code out of the try block. + + 09 Dec 2003; Nicholas Jones g-cpan.pl: rac's patch + to get arch list from portage's list of arches in the profiles. + + 09 Dec 2003; Nicholas Jones repoman: Moved a bit of + the existing gpg code around -- it might work as is, but requires 'sign' + in features. Fixed a potential for repoman to miss updates that should + get a new manifest and commit. Fixed digest/manifest generation for + non-packagedir runs of repoman. + + 09 Dec 2003; Nicholas Jones emergehelp.py, make.conf, + getbinpkg.py: Message touch ups. + + 09 Dec 2003; Nicholas Jones portage.py: load_infodir() + uses pkg settings now instead of env and backup. Genone's custom mirror + patch included. Added some missing 'strict' flags for recursion in digest*(). + Refixed the invalidentry stuff that was lost across patch merges. Fix for + pkg-keywords from genone included. Genone's deprecated profile patch for + reporting to a user that their current profile is deprecated. Message about + missing arch.list instead of spouting invalid keywords messages. + + 08 Dec 2003; Masatomo Nakano repoman: + Added all arch dependency check. This closes bug #24160. + + 07 Dec 2003; Masatomo Nakano emerge,portage.py: + Fixed bugs. 1.--debug doesn't work 2.Portage breaks files + in /var/db/*/*. 3.No stop if dependency problem happens. + They are only cvs version problems. + + 01 Dec 2003; Masatomo Nakano emerge: Fixed bug which + always remakes info dir file. + + 29 Nov 2003; Masatomo Nakano portage.py: Fixed issue with + ebuild name rule. Fixed typo with variable name. + This closes bug #17172,#34666 + + 29 Nov 2003; Masatomo Nakano emerge: Fixed issue with + lacking the "setting" argument for pkgmerge() + + 29 Nov 2003; Masatomo Nakano emerge: fixed rsync bug. + This closes bug #34660. + + 28 Nov 2003; Nicholas Jones portage.py: Migration + to non-global settings started -- class config has new functionality and + is locked after portage is finished initializing -- changes cannot be made + to the global instance of config 'settings' -- reset() is now functional, + setcpv() loads PKGUSE from /etc/portage/package.use, load_infodir() loads + all small files (under 4k) from the vardb directory of an installed package + so that operations have the same post* settings as they had at merge time. + Begin modifications to spawn() to allow for files/pipes to be used for + IO instead of using getstatusoutput which does not take an environment + parameter like execve(). check_config_instance() ensures that the provided + parameter is a 'class config' instance -- for ensuring that everything is + being passed properly with the changes. Fix for the local FS mirror issue + where it removed the first '/' instead of the last one. doebuild() cleanups + for readability and pkguse enhancements -- also remove getstatusoutput() + usage for depend so that we don't have to modify the active environment. + Fix for symlink mtime values returned from movefile. (Nakano) SLOTMOVE + added to global update functionality to fix some issues where a package + suddenly must become slotted. portdbapi takes a root parameter instead + of using settings. Slightly more useful output from depend. binarytree() + now takes a pkgdir instead of using settings. Portage will now die if + ebuild.sh exits on a signal. + + Moved some functions around and renamed them for general use -- derived + from match2 in class portagetree: + match_to_list() find all atoms in a list that match a given package. + best_match_to_list() determines the most specific match. Needs work. + match_from_list() find all packages in a list that match a given atom. + + 28 Nov 2003; Nicholas Jones emerge: Fixed an issue + with searchdesc wanting root permissions if run as non-root. Migrated to + the non-global config class. EMERGE_FROM added for the dyn_preinst patch + -- Indicates if a merge is occuring from an ebuild or from a binary. Patch + for rsync timestamp checking from Nakano. + + 28 Nov 2003; Nicholas Jones ebuild.sh: Save PKGUSE. + Pebeneto's patch for dyn_preinst and SELinux added as a fix for binary + and ebuild merges. Added a kill for portage during the depend phase so + that portage will actually die if you control-C. + + 28 Nov 2003; Nicholas Jones *: MASSIVE set of changes + to start using locally defined 'class config' instances. This allows us to + start working on some parallelism among other things. Created this way: + mysettings = portage.config(clone=portage.settings) + + The Following functions now take a 'config' parameter: + spawn(), fetch(), digestgen(), digestcheck(), spawnebuild(), doebuild(), + merge(), dep_opconvert(), dep_check(), dblink.__init__() + + package.keywords is now implemented curtasy of genone/max. PKGUSE was + rewritten for the global config killing and is also included. X11 man + pages now found and zipped correctly. SYS.PATH fixes for the python + migration -- issue actually only shows up on 2.2 systems because of how + compiled modules are used if found regardless of the original source's + existance. + + 28 Nov 2003; Nicholas Jones tabcheck.py: An easier + way to make sure that all the python stuff is correctly using tabs and + not mixing spaces. + + 28 Nov 2003; Nicholas Jones xpak, xpak.py: Fixes + to ensure that it works if the current dir is missing and that the python + path gets set properly. + + 22 Nov 2003; Daniel Robbins portage.py: Fixed + calls in vartree method to invalidentry().... made them call call + self.dbapi.invalidentry() (there were multiple wrong method calls.) + + 10 Nov 2003; Nicholas Jones md5check.py: Checks all + digests and SRC_URIs for filenames and associated MD5s. Reports collisions + between versions/packages, missing, and extra lines in digests. + +*portage-2.0.49-r17/18 (10 Nov 2003): Fixes + + 10 Nov 2003; Nicholas Jones *: Changed portage to + be the first path in sys.path for all python scripts. Also enabled + optimizations from the scripts to ensure everything imported is built + for speed. ebuild: applied fix for the '//' root breaking the db[]. + prepstrip: etdyn quickfix + + 10 Nov 2003; Nicholas Jones portage.py: fix for + RESTRICT=nouserpriv. GENTOO_MIRRORS can have paths set to take files + from. Fixes for mishandled cache data regarding *pkgsplit(). Fixes for + '*' being returned as part of a package split. An 'invalidentry()' fix + for a traceback. Nakano's fixes for virtual removals not working properly, + sandbox violations during pkg_nofetch, || depend selection. Genone's + fixpackages speedup. + + 10 Nov 2003; Nicholas Jones ebuild.sh: PORTAGE_TMPDIR + fix for distcc. Variable passing bug patch for export_functions. Exit 1 + added for nofetch to stop sandbox violation. Nakano's --tree patch added. + Improved the unmerge messages to denote what kind of unmerge fails. Info + pages regex pattern adjusted to allow most any name for a page. + + 10 Nov 2003; Nicholas Jones repoman: genone's xml + linting additions. + + 01 Nov 2003; Robin H. Johnson pym/cvstree.py: + fix bug #32071, by properly escaping a string to not be a regex. Checked + thru entire *.py tree and found this is the only mis-use of strings that + need to be escaped. + + 31 Oct 2003; Daniel Robbins portage.py: /lib/modules + now gets "unmerge protection." This is half of the config protection + functionality. It means that anything in /lib/modules will not be deleted + when a package is unmerged (often automatically when a user merges a + kernel module ebuild for a new kernel.) This solves the "my module + disappeared!" issue. This closes bug #1477. + + 31 Oct 2003; Daniel Robbins emerge: Should no longer + spit out wacky "!!! no match found" warnings when auto-cleaning. + + 30 Oct 2003; Daniel Robbins portage.py: Only run + depscan.sh if it exists on disk. This allows Portage to run inside a stage1 + where /sbin/depscan.sh doesn't exist. + + 30 Oct 2003; Daniel Robbins portage.py: Applied fix to + allow multi-level "use? ( )" in SRC_URI, closing bug #16159. + +*portage-2.0.49-r15/16 (21 Oct 2003): Fixes + + 21 Oct 2003; Nicholas Jones fix-db.py: was broken + for python2.3 -- fixed now. + + 21 Oct 2003; Nicholas Jones portage.py: Added + lockfiles to prelink md5 checks. Fixed caching bug where cache objects + were passed back as pointers instead of copies. Added 'invalidentry' + function to handle lockfiles -- It tests/deletes them using unlockfile. + Added fix-db.py to the 'databases is broken' messages. + + 21 Oct 2003; Nicholas Jones ebuild.sh: added CDPATH + to unset. SELinux fix for sandbox. + +*portage-2.0.49-r13/14 (10 Oct 2003): Fixes + + 10 Oct 2003; Nicholas Jones *: Full adaptations + for python2.3 implemented. Installation setup for /usr/lib/portage/pym + instead of site-packages. Fix for Old-Instance unmerging which stopped + happening due to changed path names. Binaries shouldn't merge under + fetchonly. + +*portage-2.0.49-r11/12 (08 Oct 2003): Internal Only. + +*portage-2.0.49-r10 (08 Oct 2003): Fixes + + 08 Oct 2003; Nicholas Jones portage.py: Fixed a + seemingly random traceback involving lockfiles -- Categories weren't + being created before a lockfile was attempted in the category directory. + More enhancements to aid migration to python-2.3. Added writemsg() as + a general function for outputting information -- Takes an argument that + is interpreted as debug level and prints synchronisly to stderr. Yanked + domenu pending a GLEP. + +*portage-2.0.49-r9 (07 Oct 2003): Fixes + + 07 Oct 2003; Nicholas Jones portage.py: Atomic lock + updates and self.create() fixes. Counter enhancements. + +*portage-2.0.49-r8 (05 Oct 2003): + + 05 Oct 2003; Nicholas Jones *: Changed #! line to + use /usr/bin/python to aid in migration. + + 05 Oct 2003; Nicholas Jones ebuild.sh: More use/has + output fixups. + + 05 Oct 2003; Nicholas Jones emerge: General cleanups. + Added in baselayout info to emerge info. --skipfirst isn't a persistent + option on resume anymore. + + 05 Oct 2003; Nicholas Jones fix-db.py: New script to + aid in diagnosing and eventually fixing /var/db issues. It makes almost no + modifications at the moment. + + 05 Oct 2003; Nicholas Jones prepstrip: Addition of + a condition for etdyn binaries -- they list as shared objects but aren't. + + 05 Oct 2003; Nicholas Jones repoman: Added non-cvs + patch -- repoman can be used outside of cvs trees for scanning/checking. + Added a masking fix for packages that use 'arch?' dependencies. Permission + fix on stats pickle. + + 05 Oct 2003; Nicholas Jones portage.py: Subversion + directories are ignored along with CVS in listdir() when ignorecvs is set. + USE_EXPAND is fixed. Global and package counter fixes. ATOMIC VARDB moves + are now implemented -- Still need a way to recover broken operations. + Counter functions are now implemented in dbapi only. vardbapi now implements + aux_get for all possible files listed in the package's info directory. New + functions: lockfile()/lockdir(), unlockfile()/unlockdir(). + +*portage-2.0.49-r7 (26 Sep 2003): Binary package fixes + spacing issues. + + 26 Sep 2003; Nicholas Jones emerge.sh: Spacing fixes + for tab/space mixes. glob fix for getgccversion(). + + 26 Sep 2003; Nicholas Jones portage.py: Fix for binary + use flag tb. + + 26 Sep 2003; Nicholas Jones xpak.py: Fix for scan() + tb when file is invalid or shorter than XPAK header length. + +*portage-2.0.49-r6 (23 Sep 2003): SELinux, DistCC, and pretend output fixes. + + 23 Sep 2003; Nicholas Jones ebuild.sh: selinux context + fixes -- using ${T} now. DISTCC_DIR added by default and given an addwrite. + + 23 Sep 2003; Nicholas Jones emerge: gccversion() added + to help distcc and the version checking calls that break distcc permissions. + Fix for create() and the useflag passing from binary packages. When using + pkgs, is_newer_ver_installed() no longer trashes ebuild names. Don't look + for fetch restrictions with binary packages. Included a modified patch that + shows only in-slot versions for packages during pretend output -- In-slot + now shows up exactly as a single-slot package would -- New slots show up + as new packages -- proper output. Killed debug for everything except regen + which now shows the deps being regenerated. Fixed regen to ignore keywords + just like sync does already... should fix a few missing cache entry problems + on rsync1 and speed up sync times all around. + + 23 Sep 2003; Nicholas Jones portage.py: Additions for + distcc support. + + +*portage-2.0.49-r5 (19 Sep 2003): Fixes + + 19 Sep 2003; Nicholas Jones ebuild.sh: Make + DISTCC_DIR set if not defined. + + 19 Sep 2003; Nicholas Jones emerge: Fix for -U + introduced bugs with Str+None tracebacks. Mild change to log info -- Added + short pkgname before ebuild. Eclassdb changes and flush/save calls. + + 19 Sep 2003; Nicholas Jones portage.py: Unregister + signal handling after receiving the signal and resend the signal we got. + Run depscan during env-update. Migrated eclass stuff into it's own pickle. + Code for moving /var/cache/edb/dep into a pickle for each category added -- + disabled via hardcoded value presently. Removed some try blocks in favor + of detecting the cause of an error first -- Hopefully gives a little speed + up. Cache fixes and useful output added. A tbz2 moving bug where an error + was printed about files the destination existing already is now fixed. The + dircache is cleared on every unmerge now, to ensure the cache does not + interfere. bzip2 is spawned with the quiet flag now. Update list is sorted + for proper year/quarter order now. -arch isn't an invalid keywork anymore. + Generic pickle reading and writing functions added. + +*portage-2.0.49-r4 (10 Sep 2003): Fixes + + 10 Sep 2003; Nicholas Jones *: Added the facility + to incorporate binary package use flags when calculating deps. Changes in + -r2 and -r3 included quick fixes to SELinux code and the addition of + LINGUAS to USE_EXPAND. + +*portage-2.0.49-r1 (25 Aug 2003): Fixes + + 25 Aug 2003; Nicholas Jones emerge: -K traceback fix. + Made fetchonly quit traversing the merge code after fetching. + + 25 Aug 2003; Nicholas Jones portage.py: Removed + auxcache saving code -- A few bugs and caching problems need to be resolved. + Moved a block of code in aux_get inside of an existing conditional -- Should + provide a small speedup. + +*portage-2.0.49 (22 Aug 2003): GRP downloading, Selinux, General Fixes + + 22 Aug 2003; Nicholas Jones portage.py: Make + auxcache saving more friendly. + +*portage-2.0.49_pre20/21 (20 Aug 2003): Fixes + security enhancements + + 20 Aug 2003; Nicholas Jones portage.py: Fix for + auxcache saving. + +*portage-2.0.49_pre19 (20 Aug 2003): Fixes + security enhancements + + 20 Aug 2003; Nicholas Jones *: Updates to Wayne's + modifications on dispatch-conf. + + 20 Aug 2003; Nicholas Jones ebuild.sh: sfperms + added to strip permissions if set in features. selinux context support. + Nakano's cleanups for unmerge output. Added distcc and ccache versions + into emerge info's output. 'autoaddcvs' FEATURE is documented in make.conf. + + 20 Aug 2003; Nicholas Jones portage.py: Selinux code + added. No longer traceback on cp_list for categories. Added in a patch to + use a pickle for auxcache storing. Should help slow IO boxes. + +*portage-2.0.49_pre18 (15 Aug 2003): Fixes. + + 15 Aug 2003; Nicholas Jones ebuild.sh: Nakano's + fix for a glob expansion bug on a tar call. + + 15 Aug 2003; Nicholas Jones emerge: Nakano's fixes + for exiting on a signal and incorrect output for the unmerge screen. + + 15 Aug 2003; Nicholas Jones portage.py: Added in + patch to shuffle thirdparty mirrors. Nakano's fixes for digests+fetching + bugs/messages/errors. Virtual stripping fix. + + 15 Aug 2003; Nicholas Jones *: Fix to emerge -V + and related output. Typo fixes. Parent thread no longer drops root in + userpriv. 'autoaddcvs' feature now determines if portage will auto-add + files to cvs. Virtuals fix for an empty key line. Added user categories + file as /etc/portage/categories. + +*portage-2.0.49_pre17 (30 Jul 2003): Resuming/wget GRP, Sandbox updates + + 30 Jul 2003; Nicholas Jones *: GRP updates to + use RESUMECOMMAND to determine how to download GRP binaries. Adjustments + to the portage.spawn() code to try and speed it up by eliminating the + copy phase (copy-on-write forking). Massive messages for corrupt FS issues. + Movefile() checks to ensure we actually complete the moves. Killed the + broken pipe message for tbz2 extraction. + +*portage-2.0.49_pre16 (29 Jul 2003): Touchups + + 29 Jul 2003; Nicholas Jones *: Clean up the debug + output and quickfix downloading tbz2s. + +*portage-2.0.49_pre15 (29 Jul 2003): Fixes + + 29 Jul 2003; Nicholas Jones repoman: imported time. + + 29 Jul 2003; Nicholas Jones emerge: Corrected the + logic used to determine whether a package or an ebuild is used when given + the option. + + 29 Jul 2003; Nicholas Jones portage.py: Changed a + lot of calls using 'print' into sys.stderr.write() calls. Added try/except + around the source lstat to catch funky errors where the file doesn't really + exist -- Presents descriptions to users about what to do. Added more catches + for movefile() calls to ensure it dies on failures. Changed the tbz2 + extraction call to stop the 'cat: broken pipe' message. + +*portage-2.0.49_pre14/48-r7 (24 Jul 2003): Fixes and getbinpkg caching + + 22 Jul 2003; Nicholas Jones *: Typo fixes for + the ECLASS_DEPTH comparisons in ebuild.sh. Traceback fixes for blocking + packages in depclean and in pretend. Caching added to getbinpkg code -- + generation of cache supported, but cachefile is staticly located. Langs + patch from Nakano in bug #9988 included. + +*portage-2.0.49_pre13 (22 Jul 2003): Fixes + + 22 Jul 2003; Nicholas Jones doman: Doesn't gzip + .keep files now. + + 22 Jul 2003; Nicholas Jones ebuild.sh: USERLAND + fix. ** ECLASS depth tracker and additions to the new depend code. ** + + 22 Jul 2003; Nicholas Jones emerge: Fetch restriction + now adds a red F to the pretend output. Made the blockers message better. + Added 'local' to rsync excludes to allow the category to be added for admins. + + 22 Jul 2003; Nicholas Jones portage.py: Fixed a TB + caused by a missing 'strict' reference --- Needs to be fixed better. Fixed + a typo in the populate code for bintree/getbinpkg. + +*portage-2.0.49_pre11 (16 Jul 2003): GRP, General, VIDEO_CARDS/INPUT_DEVICES + + 16 Jul 2003; Nicholas Jones quickpkg: SpanKY's + friendly edition now included. + + 16 Jul 2003; Nicholas Jones portage.py: USE_EXPAND + support for expanding bash variables into USE --- VIDEO_CARDS="blah" + USE="video_cards_blah". Added a notice about fetching metadata so you + can see that it's happening. + + 16 Jul 2003; Nicholas Jones make.globals*: Added + default CHUNKSIZE for binhosts. Added defaults for USE_EXPAND which is + used to expand variables into USE from the give names. + + 16 Jul 2003; Nicholas Jones *: Debug removal. + +*portage-2.0.49_pre10 (16 Jul 2003): GRP and General Fixes + + 16 Jul 2003; Nicholas Jones *: + Quick fix for a breakage in the GRP --getbinpkg code. + +*portage-2.0.49_pre9 (16 Jul 2003): GRP and General Fixes + + 16 Jul 2003; Nicholas Jones ebuild.sh: add + LDFLAGS and ASFLAGS. Exports are only done if vars are already set. + + 16 Jul 2003; Nicholas Jones emerge: Added support for + --getbinpkg and --getbinpkgonly --- GRP complement. Fixes for blocking- + not-working bug + + 16 Jul 2003; Nicholas Jones repoman: Patch to detect + incomplete digests. + + 16 Jul 2003; Nicholas Jones portage.py: ebuild fetch + now checks md5sums (run from ebuild). Support for getbinpkg. + + 16 Jul 2003; Nicholas Jones xpak.py: Added more in- + memory operations support. + + 16 Jul 2003; Nicholas Jones getbinpkg.py: Supporting + code for binary package retrieval. + +*portage-2.0.48-r2 (29 Jun 2003): Fixes and Multiple Overlays + + 29 Jun 2003; Nicholas Jones ebuild.sh: Fixed the + commands for tar. + + 29 Jun 2003; Nicholas Jones emerge: Mode the chdir + to fix the spanky bugs down to post_emerge to fix the "can't merge an + ebuild file with an absolute path" bug. + + 29 Jun 2003; Nicholas Jones portage.py: Added function + suffix_array(array,suffix) which takes an array and adds suffix to the end + of each element. Added 'cd / ;' into the getstatusoutput() calls to ldconfig. + Added a check so that portage doesn't try to add files/dir from a non-cvs + directory. Added 'manifest' target to ebuild/portage to only adjust the + manifest. Added Multiple overlay support -- Should be fairly thorough -- + needs more debug though. Fixed portdbapi::new_protect_filename(). + +*portage-2.0.48-r2 (29 Jun 2003): Cleanups and Fixes (testing) + + 29 Jun 2003; Nicholas Jones ebuild.sh: Lots of + consistency cleanups. Added more files to the var/db data for future + use. Added more die conditions to failure points. Fixed/Hacked a fix + into the inherit-not-dieing problem. Set TMPDIR and TMP globally. Added + notice for multiple inheritance. Fixed inheritance problem with multiple + inheritance clobbering previous list of eclasses. Basic support for + multiple overlays added to ebuild.sh. + + 29 Jun 2003; Nicholas Jones emerge: SRC_URI fix for + 'rm /etc/*' problem. Spanky bug: chdir to / to avoid problems when merging + from inside a builddir that gets deleted. + + 29 Jun 2003; Nicholas Jones etc-update: Added notice + for symlinks in cfg_prot setups. + + 29 Jun 2003; Nicholas Jones repoman: complain if + FEATURES=cvs not set. + + 29 Jun 2003; Nicholas Jones portage.py: Added in + a work around for the 'USE=+useflag' users. Added support for nouserpriv + via RESTRICT. Fix the bug with ROOTs with no previous file causing a TB + from counter_tick(). Make symlinks follow config_protect just like normal + files. + + 10 Jun 2003; Daniel Robbins ebuild.sh, portage.py, + various commands in bin/, cnf/make.conf.mac, cnf/make.globals.mac: + Added preliminary Mac OS X/BSD support. + + 06 Jun 2003; Daniel Robbins ebuild.sh: new eclass + dependency implementation to totally isolate eclass dependency tweaks + from in-ebuild dependency tweaks. eclasses now absolutely do not touch + DEPEND and RDEPEND. Any dependencies added by eclasses are transferred + to another variable and added in to DEPEND and RDEPEND after the entire + ebuild has been processed, and after RDEPEND has optionally inherited a + value from DEPEND due to it being unset. The result of this change is + that inherit statements no longer need to be placed strategically in an + ebuild so that they are after the DEPEND and RDEPEND, and fix a host of + other eclass mis-use/side-effect bugs. + +*portage-2.0.48-r1 (29 May 2003): Touchups. + + 29 May 2003; Nicholas Jones ebuild.sh: Quick fixes + to a couple of rare bugs. Added some quoting to $S. Removed the DISTCC + hosts variable. Moved build-info's creation around so that it actually + works for non-portage-compiled merges. + + 29 May 2003; Nicholas Jones repoman: Quick fix for + the files-dir-not-added lack of notification. Added in a fix for a possible + security problem with the repoman commit messages and symlink-attacks. + + 29 May 2003; Nicholas Jones cnf/*: Added in a diff + from 'Danny' that contained a SYNC cleanup and expanded explanation. :) + + 29 May 2003; Nicholas Jones output.py: Fixed the + TitleBar and unset TERM issues. + + 29 May 2003; Nicholas Jones portage.py: Added new + functions to aid in determining virtuals. cpv_all() added to dbapi -- it + displays all versions instead of just package names -- cp_all() now calls + this function to gain it's data. get_provide() and get_all_provides() added + to collect PROVIDE info from vartree packages. getallcpv() added to vartree + to reference the dbapi call. Always set ignoring errors on findname now. + Cleaned up the virtuals-trimming code. Don't mention the fixpackages script + if the user doesn't have any packages. + +*portage-2.0.48 (20 May 2003): Cleanups Release. + + 20 May 2003; Nicholas Jones emerge: Tiny cleanups. + Fixed the profile information in emerge -V for symlinks that have a + trailing '/' in them. Fix 'emerge -s' filesize lookups to use a new + function finddigest() from dbapi. + + 20 May 2003; Nicholas Jones emergehelp.py: Updated. + + 20 May 2003; Nicholas Jones etc-update: Small + fixups for pager issues. Made the nothing-to-do exit message 'happier'. + + 20 May 2003; Nicholas Jones extra-functions.sh: + Beat the debian-utils requirement out of the functions. Prefers them, + but falls back to already-existing tools otherwise. + + 20 May 2003; Nicholas Jones fixpackages: 75% + overhaul to match the new handling of update code. + + 20 May 2003; Nicholas Jones quickpkg: Understands + "--help" as an option now. + + 20 May 2003; Nicholas Jones man/*: Simple updates. + + 20 May 2003; Nicholas Jones portage.py: fetch() + now calculates md5sums when doing a fetchonly. finddigest() added for + finding digests -- gets overlay digests if existing. Binary packages + are only updated when explicitly requested via fixpackages as a command + or a FEATURES setting. Clear the dircache after portage initializes to + reduce memory consumption. + +*portage-2.0.48_pre6 (12 Apr 2003): General cleanups and fixes. + + 12 May 2003; Nicholas Jones portage.py: Additions + to better handle overlay ebuilds with regard to metadata cache. aux_get + calls findname2() which returns (location,in_overlay) -- findname() is + a wrapper for findname2(). Extra debugging fixes for findname() issues. + + 12 May 2003; Nicholas Jones ebuild.sh: Code + cleanups and a chgrp/chown pass to move all portage-owned files to + root ownership -- Two pass to leave specific-group and specific-owner + settings alone. + + 12 May 2003; Nicholas Jones emerge: code cleanups + and comment touchups. + + 12 May 2003; Nicholas Jones emergehelp.py: Updates + for --debug, --digest, and --skipfirst. + + 12 May 2003; Nicholas Jones g-cpan.pl: Added more + arches to the KEYWORDS. Made it copy files back to distfiles. + + 12 May 2003; Nicholas Jones prepstrip: Removed ${D} + from the outputted filenames during stripping. + + 12 May 2003; Nicholas Jones man/* cnf/*: + documentation updates. + +*portage-2.0.48_pre5 (29 Apr 2003): Cleanups and polish. + + 29 Apr 2003; Nicholas Jones portage.py: Another + typo fix. + +*portage-2.0.48_pre4 (28 Apr 2003): Cleanups and polish. + + 28 Apr 2003; Nicholas Jones portage.py: Quick fix + for a traceback/typo in the 'emerge -C' code. + +*portage-2.0.48_pre3 (28 Apr 2003): Cleanups and polish. + + 28 Apr 2003; Nicholas Jones portage.py: listdir() + now takes care of non-existance errors instead of propagating them --- can + take EmptyOnError=1 as a param to return [] instead of None. All calls to + portage's listdir() have been updated to the new conventions. listdir() + ignores .# files from cvs now when ignorecvs=1 is set. Fixes for another + world-depleting bug. If findname() is passed a virtual, it now informs + the user to report a bug, instead of weird tracebacks. Added code in + dblink::unmerge() to remove stale virtual entries when set under trimworld. + + 28 Apr 2003; Nicholas Jones etc-update: enabled the + diff pager again. + + 28 Apr 2003; Nicholas Jones emerge: --changelog + implies --pretend. Spelling fixes. Added --skipfirst to allow the first + package in a resume operation to be skipped over --- allows -e to rebuild + almost everything, even under weird circumstances. Located another missed + world-file-depleting bug in unmerge() calls. Included a patch to fix an + off-by-one bug in depclean. + + 27 Apr 2003; Nicholas Jones portage.py: Fix for + listdir() running on a non-existant dir -- returns None. Sets generated + files to the portage group -- Manifest & digests. Some coloring additions. + Handling of 'strict' features added. TEMPORARY addition of 'manifest' USE + flag so this can go mainstream now. Fixes in doebuild() to get unmerge + working again for ebuild. Debug code added to findname to help figuring + out the seemingly random tracebacks -- suspect is pkgsplit(). Unmasking + code for package.mask added in -- works just like mask, and can override + specific versions or ranges -- One per line: /etc/portage/package.unmask. + Security fix for python cPickle code -- mtimedb could create arbitrary + execution of code bug. Global update notices/info. Fixes for loops over + listdir() that depended upon raised errors to determine code flow. + + 27 Apr 2003; Nicholas Jones cvstree.py: Added in + 'removed' status checks. + + 27 Apr 2003; Nicholas Jones repoman: Added in more + cvs checks. /space/cvsroot is now complained about. + + 27 Apr 2003; Nicholas Jones emerge: Added in + PORTAGE_CALLER support to identify it as a 'do_update()' candidate. + + 27 Apr 2003; Nicholas Jones dodoc: Check sizes to + prevent 0 byte files from being added. + +*portage-2.0.48_pre2 (10 Apr 2003): Digests & Repoman + + 16 Apr 2003; Nicholas Jones repoman: Added CVS/Root + checks to ensure Manifests will be correct. Fixed local use-flag bug. + Commented out the no-stable code, as it can't be implemented well as is. + + 16 Apr 2003; Nicholas Jones prepstrip: Fixed a + problem where files were not being stripped. + + 16 Apr 2003; Nicholas Jones ebuild.sh: Added in + a call to 'make -n' when under the --debug flag. + +*portage-2.0.48_pre1 (10 Apr 2003): Digests & Repoman + + 10 Apr 2003; Nicholas Jones prepstrip: fix it so + that it actually strips and provides reasonable info. + + 10 Apr 2003; Nicholas Jones repoman: Added short + option for pretend. Added pretend capability to the majority of the + commit code. Bug fix for local IUSE code. Added in support for removed + cvs files. + + 10 Apr 2003; Nicholas Jones portage.py: Changed + 'manifest' to 'Manifest'. Removed the requirement that Manifests exist -- + complain about it, but only die if 'strict' is set. + +*portage-2.0.47-r15 (09 Apr 2003): New digests/manifests, touchups. + + 09 Apr 2003; Nicholas Jones bin/*: Fixes for Cross- + compiling. + + 09 Apr 2003; Nicholas Jones repoman: Quick touchups + in the category- and repository-level manifest calls. + + 09 Apr 2003; Nicholas Jones cnf/*: Added/sync'd + PORTAGE_NICENESS. + + 09 Apr 2003; Nicholas Jones portage.py: Fixed hole + in the listdir code that occured on cache expiration in the -r14 changes. + +*portage-2.0.47-r14 (09 Apr 2003): + + 09 Apr 2003; Nicholas Jones bin/*: Removed DEBUGBUILD + in favor of FEATURES/RESTRICT settings of nostrip. + + 09 Apr 2003; Nicholas Jones ebuild: Removed root + restriction so that digests can be made as non-root. + + 09 Apr 2003; Nicholas Jones emerge: Added niceness + + 09 Apr 2003; Nicholas Jones repoman: Added the + nostable/allmasked check in. Small cleanups. Move to 'manifests' instead + of enhanced digests. Added filters on $Id and $Header. Fixed commitmsg + and added short options. + + 09 Apr 2003; Nicholas Jones cvstree.py: More features + added. pathdata() provides dir or file info. isadded() gives cvs status. + + 09 Apr 2003; Nicholas Jones portage.py: listdir() + enhancements. Debug removal. Broke up the digest creation functions to + make them a little more generic. Added manifest code into the digest + calls. Moved code in doebuild() around to allow for non-root calls for + devs and repoman. Added 'PORTAGE_CALLER' env var to prevent repeated + running of unnecessary functions. + +*portage-2.0.47-r13 (02 Apr 2003): Fixes & Security -- Repoman+Digests + + 02 Apr 2003; Nicholas Jones emerge: Added debug to + the dep selection code in depgraph. + + 02 Apr 2003; Nicholas Jones cvstree.py: Added new + module to handle cvs information without having to ask 'cvs status' many + times to determine file locations. + + 02 Apr 2003; Nicholas Jones repoman: Major fix ups + to ease the introduction of enhanced digests. Intelligent cvs queries + and use of the new cvstree module for information about files in the tree. + Auto-digests, auto-fetches trivial cvs changes, detects changelogs that + exist but have not been added to cvs, and detects '*' in KEYWORDS. + + 02 Apr 2003; Nicholas Jones *: A typo fix or two. + prepstrip: fixup for sed's issues with '\000' (made it \001). + +*portage-2.0.47-r12 (27 Mar 2003): Fixes & Security -- Repoman+Digests + + 27 Mar 2003; Nicholas Jones portage.py: Moved all + initialization error messages to stderr.write() calls so that the output + doesn't get mixed will called data. Added a warning about not being in + the portage group. Color touchups. Digest path fixups. + + 27 Mar 2003; Nicholas Jones repoman: Significant + additions to the commit code to nicely handle the changes for enhanced + digests. Added --commitmsg and --commitmsgfile flags to allow easier + scripting. Added a REPOMAN environment variable to prevent portage from + running do_updates(). Added 'grouplist' which makes groupings of subparts + from a list of parts. Added do* functions to manage the recursion into + the dirs of the repository. + + 27 Mar 2003; Nicholas Jones xpak.py: Change from + lstat to stat... We're not concerned with links. Return 0 on not found. + + 27 Mar 2003; Nicholas Jones portageq: added new + functions: best_visible, mass_best_visible, all_best_visible. + + 27 Mar 2003; Nicholas Jones emerge: Added '--digest' + to force recreation of digests from the command line. Fixed portage version + comparisions for the 'update portage please' notices. + + 27 Mar 2003; Nicholas Jones ebuild.sh: Added an + extra rm of the 'successful' file. + + 26 Mar 2003; Alain Penders portageq: added + mass_best_version method to help GUIs resolve best versions. + +*portage-2.0.47-r11 (22 Mar 2003): Fixes & Security -- Winding up 2.0 series. + + 22 Mar 2003; Nicholas Jones portage.py: listdir() + now is capable of recursive calls and listing only files. Used in new + additions to digestgen() and digestcheck() for ebuilds and files/* -- + listdir(dir,recursive=0,filesonly=0). Digests now must contain all files + from files/ and also the ebuild -- non-archives are prefixed with '/'. + Full tbz2 fixes are now implemented... They can take a while to perform + so status thingies are provided. update_ents() provides a batch-update + as it would take rediculous amounts of time otherwise. + + 22 Mar 2003; Nicholas Jones : fixpackages calls + portageexit() to save the mtimedb state so it actually works. :) + + 22 Mar 2003; Nicholas Jones emerge: Added + 'xtermTitle' calls to emergelog to set the title during phases of merging. + Added more emergelog calls to provide more specific information. + + 22 Mar 2003; Nicholas Jones : Added two scripts to + aid portage. 'fixdbentries' takes (old, new, path) and does an inteligent + sed on all the db entries that should be changed. Used by global moves and + in the tbz2 fixes. 'fixpackages' expires the updates timestamp and reloads + portage to force do_updates() to run. Added missing Header lines. + + 22 Mar 2003; Nicholas Jones xpak.py: Correct off-by-8 + bug in last commit. infosize does not contain the full size... Offset + begins _after_ the marker -- Added xpaksize for complete offset from EOF. + + 22 Mar 2003; Nicholas Jones portage.py: Fix for + die-on-wheel-group-missing bug. The logfiles don't cause the counter + to be incremented and now match the merged package's COUNTER value. + get_counter_tick_core(root) does not increment the counter. Sandbox is + now working in all enabled cases, instead of just usersandbox. /var/db + and binaries (assuming they are RW) are now updated to contain the proper + info --- Added a 'fixdbentries' script to perform the updates to the data, + and added a 'move_ent' function to class binarytree (not fakedbapi). Added + a 'ebuild does not exist' error for the case of ebuilds in a wrongly named + directory. Added a notice for invalid tbz2's. Removed the 'make.defaults' + missing notice :-/. Duplicated the bintree creation so that it would be + available for do_update(). Catch when 'updates' is missing from mtimedb. + + 22 Mar 2003; Nicholas Jones output.py: Added xterm + title bar function to set the titles... xtermTitle(mystring). Only set + if using color and terminal is [axE]term. + + 22 Mar 2003; Nicholas Jones repoman: Additions + courtesy of Gerk and Vladamir... Checks all portage variables. Runs + a check against invalid (but still parsable) syntax errors in names. + Checks for invalid IUSE from use.desc and use.local.desc. Checks that + licenses are valid. Checks for legal keywords with a default set or + keywords.desc, if available. 'missingvar' tests moved to aux_get() calls. + + 22 Mar 2003; Nicholas Jones prepstrip: Added test + to allow cross-compile-stripping to work properly. Rewrite the script to + be whitespace-aware and recursively process directories at level 1. + + 22 Mar 2003; Nicholas Jones prepallstrip: Removed + all code from this script and made it a call to "prepstrip $D". + + 22 Mar 2003; Nicholas Jones g-cpan.pl: Add in chomps + for the portageq calls. + + 22 Mar 2003; Nicholas Jones emerge: Allow + --fetchonly of block'd packages. + + 22 Mar 2003; Nicholas Jones ebuild.sh: Cleanups and + corrections for sandbox which has been disabled and broken for a couple + revisions now. use_{enable,with} die messages removed as they are in sub- + shells when used and won't kill the merge --- Moved to echo >&2. + + 21 Mar 2003; Nicholas Jones xpak.py: Updates to make + the xpak code self-sustaining. Added basic documentation to the functions + and a description of the format in the comments at the top of the module. + +*portage-2.0.47-r10 (13 Mar 2003): Fixes -- Winding up 2.0 series. + + 13 Mar 2003; Nicholas Jones portage.py: Less strict + check of permissions when fixing permissions for userpriv -- only requires + 02070 and group portage instead of 02770 for check. + + 13 Mar 2003; Nicholas Jones g-cpan.pl: Fix to the + call to portageq. + + 13 Mar 2003; Nicholas Jones etc-update: Fix for + deleted files in a CONFIG_PROTECT situation. + + 13 Mar 2003; Nicholas Jones emerge: fix for keepwork + and keeptemp ** MUST ENSURE THAT CLEAN CLEANS BEFORE A FULL MERGE. + + 12 Mar 2003; Nicholas Jones emerge: Added more + conditions on rsync -- Proper error detection. Rsync failures will not + cause a cache regeneration. Portage no longer considers masked portages + candidates for 'An update to portage'. + +*portage-2.0.47-r9 (10 Mar 2003): Fixes -- cvs-src, ebuild.sh, repoman + + 10 Mar 2003; Nicholas Jones make.conf*: Adjusted + the LOGDIR message and change the default location to /var/log/portage. + + 10 Mar 2003; Nicholas Jones repoman: One more fix + for the PORTDIR setting -- '/usr/portage' was matching '/usr/portage.cvs'. + + 10 Mar 2003; Nicholas Jones etc-update: Added the + capability to automerge all files in the list -- with out without prompts. + + 10 Mar 2003; Nicholas Jones emerge: Added messages + on failure to create a depgraph -- Helps with bad DEPEND detection. Made + 'emerge sync' stop if it fails, and not update cache. + + 10 Mar 2003; Nicholas Jones ebuild.sh: added an + external extra_functions.sh file with extra functions for portage -- + it is flag-o-matic and pieces of eutils presently. Removed libdir/incdir + from einstall(). Added 'keepwork' to keep the source code after a package + is merged. Removed the 'local' declaration of ROOT in dyn_install() -- + this fixes has_version in src_install(). Fixed the sourcing of environment + so that variables are peristent across stages of a merge. Removed the + SANDBOX vars from the environment file, as that upsets SANDBOX. + + 10 Mar 2003; Nicholas Jones portage.py: Fixes to + permission problems with cvs-src and ccache (removed nested try's). Log + counter fix -- One log per package now. + +*portage-2.0.47-r8 (02 Mar 2003): Fixes -- cvs-src, ebuild.sh, repoman + + 02 Mar 2003; Nicholas Jones *: Fixes to eclass + errors and messages -- raise on not found. emerge --debug works for + ebuilds with syntax errors now -- needs better implimentation though, + debug=0 in params can't be used due to scope limits. + + 28 Feb 2003; Nicholas Jones *: reorg ebuild.sh again + to ensure that aliases are expanded properly. Repoman now determines the + proper PORTDIR to set when loading portage to scan the cvs tree. portage.py + fixes for cvs-src permission problems with userpriv. + +*portage-2.0.47-r7 (27 Feb 2003): Quick fix for eerror() problem. + +*portage-2.0.47-r6 (26 Feb 2003): Drop deprecated warnings for new syntax. + + 26 Feb 2003; Alain Penders emerge: Drop deprecated + warnings for new syntax. Don't make people switch to the new syntax + until it's agreed on by everyone. + +*portage-2.0.47-r5 (26 Feb 2003): Wicked Fast, BugFree v3.1, UserPriv + + 26 Feb 2003; Nicholas Jones *: Update docs and help + again to drop --system and --world, and pull them from emerge's command + line. General cleanups. + + 26 Feb 2003; Nicholas Jones emerge/portage.py: Fixes + to the cache directory permissions -- all dirs are properly owned by group + portage now. Add CCACHE_SIZE setting so we set a value for ccache. If the + dirs are set to the wrong perms, make sure they get changed recursively. + + 26 Feb 2003; Nicholas Jones ebuild.sh: Rearraged the + code blocks so that they are easier to follow -- no more code in between + functions. All code follows function definitions now. + +*portage-2.0.47-r4 (25 Feb 2003): Wicked Fast, BugFree v3, UserPriv + + 25 Feb 2003; Nicholas Jones *: Update docs and help + to match the deprecation of actions without '--' preceding them. + + 25 Feb 2003; Nicholas Jones portage.py: Message + updates. Fix secpass for portage user. Set PORTAGE_GID for ebuild.sh to + use regardless of GID in use (wheel/portage). Only try and delete things + in PORTAGE_TMPDIR if we have perms to do it... see secpass note. Moved the + cachedir creation after settings in created so that we can use spawn instead + of system for the calls to 'chown/chmod -R'. Fix the note on make.defaults. + Fix for the 404 catcher in the fetch code. + + 25 Feb 2003; Nicholas Jones emerge: Move all actions + into '--action' form -- Notify of deprecated usages. Moved the functions + from the top of emerge down below the command line parser for readability. + Kill FEATURES=noauto if we're running emerge -- it can break things. Make + -U imply -u so people aren't confused. --debug now enables all debug + variables in portage. Fix wheel/portage group requirements messages. Get + the current portage version when doing rsync via the portage tree's files + and not the loaded cache so that it is aware of changes immediately instead + of the next run. + + 25 Feb 2003; Nicholas Jones ebuild.sh: Try to change + to good a good path at the start of the ebuild to prevent operations from + happening in places like home. After the ebuild's install phase, check to + see if any unsafe perm combo's exist and die if they do. Fix permissions + on the cachedir as we're changing them to root:portage. &> on environment + file prevented it from actually creating the file -- changed to 2>. Change + 'true' to 'exit 0' to be a bit more explicit about what we're doing. + + 24 Feb 2003; Alain Penders repoman: Added nested/sub-shell + die testing. + + 23 Feb 2003; Alain Penders : Added bin/portageq tool to + provide access to portage internal information without using APIs that + are changing. All tools that currently access portage information by + importing portage.py and poking around in it should switch to using this + tool instead. Changed some tools in bin/ to use it, so those won't break + either. + +*portage-2.0.47-r3 (17 Feb 2003): Wicked Fast, BugFree v2, UserPriv + + 22 Feb 2003; Nicholas Jones bin/: added dispatch-conf + and db-fix.pl to the bins. Looking at dispatch-conf to replace etc-update + written by Jeremy Wohl (bug 14079). db-fix.pl is a rescue tool that Blizzy + wrote up to recreate/repair counter files in the DB -- shouldn't be needed + anymore as portage fixes the counter at every load of the counter, but we + will hang on to it just in case. + + 22 Feb 2003; Nicholas Jones portage.py: moved the + wheelgid references to portage_gid references. Wheel is being deprecated. + Added notice to baselayout message that group portage controls everything + now. Killed the BASH_ENV settings -- moved the reference to /etc/portage/ + in case it's desired in some way -- This fixes AROUND ONE HUNDRED reports + on 2.0.47-r2. Try/catch invalid tbz2's -- should fix a couple bad tarball + bugs. Make the prelink call spawn'd without sandbox. buildpkg/userpriv + fix via actionmap (Jasmin Buchert; bug 16106). + + 22 Feb 2003; Nicholas Jones emerge: --upgradeonly + added from jrray's patch; added some slot handling. --deep got a short + flag 'D'. 'info' can be run by non-root. '--quiet' kills all but package + names on searches. Basic slot detection added to the pretend output so + that it doesn't always say downgrade. Ignore block list when fetching. + Can use RSYNC_EXCLUDEFROM to select a from for rsync to --exclude-from; + (Michael Sterrett; Bug 15882). 'emerge rsync' deletes the dbcachedir + before it begins updates. Catch exceptions during rsync cache regen. + + 22 Feb 2003; Nicholas Jones ebuild.sh: General fixes + to the spelling of things. 'cd $PORT_TMPDIR' corrected to the actual vars + name. Stripping distcc from PATH if it is there before portage sets it. + Same with ccache. If we try to compile with out unpacking, complain. Make + sure to chown files to user portage. + + 22 Feb 2003; Nicholas Jones cnf/*: CFLAGS notes, + pentium4 breaks things. Added more descriptions for FEATURES. Added + RSYNC_EXCLUDEFROM description. + + 22 Feb 2003; Nicholas Jones *: Updates to the + copyright headers. + +*portage-2.0.47-r2 (17 Feb 2003): Wicked Fast, BugFree, UserPriv + + 18 Feb 2003; Alain Penders portage-2.0.47-r2.ebuild: + If $PORTAGE_TEST is set, skip the beeps/delay messages. Needed to make + the regression test scripts bearable :-) + + 17 Feb 2003; Nicholas Jones portage.py: Fixed the + depcache code once again -- ebuild and cache were never set to the same + mtimes. Removed last os.system() call. + + 17 Feb 2003; Nicholas Jones repoman: catdir fix. + Added 'emerge-webrsync' from gentoolkit so users can use snapshots on + initial installs. + + 17 Feb 2003; Nicholas Jones emergehelp.py: Updated + it to the current calls and conventions. Added comments about etc-update + and emerge-webrsync. + + 17 Feb 2003; Nicholas Jones emerge: Changed the + search code around to use compiled re's instead of .lower() searches. + Trivial touchups in spacing. Only write worldfile if not --pretend. Fix + losing-packages-to-be-merged during merge bug. Allow options to change + in a --resume call so that --buildpkg and such may be added. + + 17 Feb 2003; Nicholas Jones ebuild.sh: Added a + PREROOTPATH to allow special paths to be added prior to root and ebuild's + required pathes. ${S} is now generated prior to sourcing an ebuild so + that it is available in the ebuild at source-time, as opposed to in the + phases. + +*portage-2.0.47-r1 (16 Feb 2003): Wicked Fast + UserPriv + + 16 Feb 2003; Nicholas Jones portage.py: Changed a + few os.system calls to spawn calls. Added userpriv in features check to + spawn. HOME is now placed in BUILD_PREFIX/homedir when userpriv is enabled. + Valid command for doebuild() moved to the top of the function. Reorganized + the directory creation code in doebuild(). HOME is cleaned for every merge + if in userpriv. LOG_COUNTER fix for the per-ebuild logs -- Only one value + is used per $PF now. + + 16 Feb 2003; Nicholas Jones emerge: Adjusted options + to remove --autoclean and make it on-by-default unless killed in FEATURES + with 'noclean'. Removed debug for --resume. Added RSYNC_TIMEOUT as some + dialup and other users are experiencing problems with rsync never finishing + a connection. Added check at the end of an rsync to notify the user when + a new version of portage is available. Added --pretend capability/fix to + the --resume code. No resume data and a --resume is no longer a failure. + + 16 Feb 2003; Nicholas Jones ebuild.sh: Updates to + logic of ${T}/successful handling to allow proper cleaning. dyn_clean() + will do a recursive dir removal after cleaning specific files. Recursive + chown removed. CCACHE_DIR handled in portage.py now. Removed a few comments + and unnecessary checks. + + 16 Feb 2003; Nicholas Jones cnf/*: added comments + on FEATURES=noclean,noauto,userpriv,usersandbox + + 15 Feb 2003; Nicholas Jones emerge: Alain changed + the .config() call in the search class to a .settings[] -- Speedup. + + 14 Feb 2003; Nicholas Jones portage.py: Added + resume to mtimedbkeys. + + 14 Feb 2003; Nicholas Jones emerge: --columns + flag to support column output in --pretend. --resume support added + to restart portage with the package list with which it stopped -- data + is stored in mtimedb. Added '--verbose' to 'emerge info' to display + all variables in settings. + + 13 Feb 2003; Nicholas Jones ebuild.sh: Fix to + distcc and ccache to prevent them from calling themselves if they + catch themselves in the path -- double path problem. + + 13 Feb 2003; Nicholas Jones portage.py: Fixes to + the aux_get() code for metacache updates to eclass deps. Debug output + removal. + + 13 Feb 2003; Nicholas Jones emerge: More fixes + to the calls to aux_get() for metacache code. Rearranged the option and + action arrays. Added --nospinner flag. + + 13 Feb 2003; Nicholas Jones emerge: Reorg of flags. + Addition of --noconfmem to prevent portage from yanking already-merged + config files. Extra message in --version about missing gcc and sourcing + /etc/profile to get it. Yanked the majority of the rsync cachedb update + code -- Moved it to aux_get. + + 13 Feb 2003; Nicholas Jones portage.py: Typo fixes. + aux_get() now has a metacachedb param for using metadata cache over the + initial call to doebuild() -- Should speed up rsync users regen time. + Added support for --noconfmem via settings["NOCONFMEM"] in treewalk(). + Added sys.exit(1) on failure to move files during merge. Comment + realignment. + + 11 Feb 2003; Nicholas Jones portage.py: Fix the + depcache code by adding in a missing stat call after regeneration. + Call portageexit() in exithandler() so that mtimedb gets written out + on cancelled runs. Add in --quiet option. Currently only kills the + processing messages on emerge regen. + + 11 Feb 2003; Nicholas Jones ebuild.sh: Fix the + eclass code to remove the double inherits cause by eclasses managing + that on their own. + +*portage-2.0.46-r12 (07 Feb 2003): Fixups + + 07 Feb 2003; Nicholas Jones portage.py: Move + logdir check/generation code so that it's created before 'clean'. Fix + the usemask/archkeys bug and a related bug with the var enabled. Fix + to movefile() code to ensure symlinks are handled properly. + + 07 Feb 2003; Nicholas Jones ebuild.sh: Make per- + ebuild logs use the counter to get a chronological list instead of a + timestamp based one. + + 07 Feb 2003; Nicholas Jones emerge: If a package + is requested to be updated but is not merged, still add it to world. + + 07 Feb 2003; Nicholas Jones *: Update to help. + Mostly comments on --verbose. Clarification on make.conf* mirrorselect. + +*portage-2.0.46-r11 (04 Feb 2003): Fixups + + 04 Feb 2003; Nicholas Jones ebuild.sh: distcc + fixups along with ccache fixups from the bug 13897 effort. Added more + varaibles to the build data output. Allow CC/CXX to be set if they are + not set in environment. + + 04 Feb 2003; Nicholas Jones portage.py: Removed an + unnecessary call to os.unlink() in movefile that resulted in it failing + when moving files across devices. HTML 404 catcher -- if the distfile is + a reasonable size, and it's got .*(not found|404).* in it + it will be deleted and the next mirror persued. + +*portage-2.0.46-r10 (03 Feb 2003): Feature/Function Cleanups + + 03 Feb 2003; Nicholas Jones portage.py: Added + quotes to fallback checksum code to ensure it works on space-containing + filenames. Error message added in writedict. Worldfile-depleeting bug + fixed -- 'emerge -e world'+AUTOCLEAN would cause every package in world + to be removed from the worldfile to be removed. + + 03 Feb 2003; Nicholas Jones make.conf: updated the + commentary about AUTOCLEAN. + + 03 Feb 2003; Nicholas Jones etc-update: Added in + automerge functionality for trivial changes. Comments and whitespace + are just merged without asking when it's enabled. + + 03 Feb 2003; Nicholas Jones emerge: redundant cmd + line flags warning. Show enabled/disabled USE flags on -vp (Masatomo + Nakano). Missing changelog fix for --changelog. Added an rsync timeout + of 60 seconds and a message on fail due to timeout. + + 03 Feb 2003; Nicholas Jones ebuild.sh: CC/CXX fix + to override profile.env settings. FEATURES=distcc support to get past + profile.env's CC settings/lockdown. If CBUILD is defined, it is appended + to econf's output in a --build= statement. Added .unpacked marker to + the unpack code to ensure a proper unpack phase. + + 01 Feb 2003; Nicholas Jones portage.py: Adjusted + the arch.list code to be a general masking setup. /etc/make.profile/ + and /etc/portage/ have use.mask files that are concatenated. On fetch, + if downloader reports failure, then check that filesize ebuild.sh/portage.py: + eclass fixups for newdepend issues where newdepend operates on RDEPEND + prior to it being set to default by ebuild.sh. Repoman fix for multi- + arch failures by excluding /usr/portage/profiles/arch.list entries from + consideration, excluding $ARCH. + +*portage-2.0.46-r9 (14 Jan 2003): portage restart fix + 15 Jan 2003; Nicholas Jones emerge: fixed the + missing tabs from the cvs diff backport. + +*portage-2.0.46-r8 (14 Jan 2003): touchup KV{,ERS} for public stable + +*portage-2.0.46-r7 (14 Jan 2003): Backport from cvs and fixes. + portage-2.0.46* :: EXCUDES ALL PORTIONS RELATING SPECIFICALLY TO USERPRIV + + 14 Jan 2003; Nicholas Jones portage.py: Persistant + KV and KVERS on depend calls. Sandbox violation of do_upgrade() caught. + + 14 Jan 2003; Nicholas Jones emerge: --buildpkg + touchups and forward porting of some of 2.0.46-r6. Restart on -r0/proper + versions of portage due to VERSION not matching pkgsplit output fixed. + + 14 Jan 2003; Nicholas Jones ebuild.sh: 20% speedup + in dep generation by removing all external app calls. Moved KVERS to + portage to make it persistent during dep calls. Other code moved into + conditionals based on $*!=depend. chmod's swaped with umask. + + 11 Jan 2003; Jack Morgan cnf/make.conf.sparc: + updated make.conf.sparc to add CFLAGS for sparc32 and sparc64 + + 08 Jan 2003; Nicholas Jones bin/g-cpan.pl: + Added from bug 3450 -- Creates and merges perl module ebuilds on-the-fly + from cpan and merges them. + + 08 Jan 2003; Mark Guertin cnf/make.conf.ppc: + updated make.conf.ppc to remove G3 options for CFLAGS and other + small tweaks + +*portage-2.0.47 (06 Jan 2003): UserPriv + + 06 Jan 2003; Nicholas Jones portage.py: + Forced HOME to BUILD_PREFIX regardless of user. Added in a 'rm -Rf' notice + to readonly-fs/Full-Disk notices. Disabled the usepkg on buildpkg function + of portage. digraph.hasallzeros() added -- Determines if tree is zero depth. + + 06 Jan 2003; Nicholas Jones cnf/*: Added in the + PORT_LOGDIR option and description. Also added a GENTOO_MIRRORS section + back into the make.conf* files so that users are aware that they need to + specify ibiblio. Killed the linefeeds in the sparc conf. + + 06 Jan 2003; Nicholas Jones emerge: options and + actions fixup. Added new short options and long options. --buildpkgonly + now works and restricts the process to deplists of zero depth. Updated + the help for portage, and created a seperate shorthelp function with + the terse, options-only, versions of the regular help. Fixed the env_update + call after --fetchonly runs. + + 06 Jan 2003; Nicholas Jones ebuild.sh: + touchups to the user priv and logging code to kill the invalid user + messages when portage:portage doesn't exist on the system. + +*portage-2.0.47_pre4 (03 Jan 2003): UserPriv Works + Per-Ebuild logging + + 04 Jan 2003; Nicholas Jones portage.py: + tokenize() fixups to remedy the || reduce problems. + + 04 Jan 2003; Nicholas Jones prepall: + Fixup for '//' problem. + + 03 Jan 2003; Nicholas Jones ebuild.sh: + Support for per-ebuild logging via PORT_LOGDIR variable. ebuild.sh + now can do usermode compiles _and_ maintain the enviroment with a + few minor restrictions like changing portage variables. + +*portage-2.0.47_pre3 (02 Jan 2003): Forward port of fixes & New fixes + + 02 Jan 2003; Nicholas Jones emerge: + tbz2 handling improved -- checks current, pkgdir/All/x, pkgdir/x. + -r0 removal on current ver to stop people from complaining about it. + More info added to 'emerge info' output. + + 02 Jan 2003; Nicholas Jones portage.py: + Spaces in filenames fix for prelink-capable systems. Exception caused + by invalid or unsatisfiable '||' dependancies caught and warned about. + auxdbkey order fix. dbcachedir now ensures a '/' before the cache dir. + + 02 Jan 2003; Nicholas Jones prep*: + Fixes from Azarah to make the included files more proper. + + 26 Dec 2002; Phil Bordelon man/emerge.1: + Added documentation of the --deep option. + +*portage-2.0.46-r5 (30 Dec 2002): Touchups and sparc confs + + 30 Dec 2002; Nicholas Jones *: + fix for prelink unmerge problems. small touches to outputs. + sparc configs added. Azarah's fixups for the prep* scripts. + Changes to 'emerge info' output. tbz2 prefixes PKGDIR/All if the + tbz2 doesn't exist in the current dir. + +*portage-2.0.46-r3 (24 Dec 2002): Backport of fixes in 2.0.47_pre2 + +*portage-2.0.47_pre2 (24 Dec 2002): Feature: userpriv compiles + + Tokenizer fixup courtasy of Evgeny Roubinchtein. unalias -a in ebuild.sh. + Moved the help() to emergehelp.py. prepallman fixup for missed symlinks. + More info provided for portage-user-missing message. FEATURES=sandboxuser + not provides sandbox in compile phase along with userpriv. mtimedb + exception should actually be caught now. + +*portage-2.0.47_pre1 (21 Dec 2002): Feature: userpriv compiles + + 21 Dec 2002; Nicholas Jones *: + ebuild.sh: portage user setup. dyn_setup is always run before calls to + unpack,compile,install. emerge: infodirs cleanup, traceback on invalid + dir fix. Proper regen on info change. portage.py: uid/gid discovery and + check code. PRELINK_PATH and PRELINK_PATH_MASK added and renamed. Made + HOME set to BUILD_PREFIX when HOME is unset. Patched in UserPriv compile + code and checks and complaints to ensure smooth integration. Reorganized + chown calls to ensure things get set right for userpriv and not. Sandbox: + UID check to prevent non-root errors patched in. + +*portage-2.0.46-r2 (18 Dec 2002): Feature Stable Release Prelink + Bug Fixes + + 18 Dec 2002; Nicholas Jones portage.py, emerge: + Traceback fix for blocking packages in the restart check in emerge. Added + missing import for commands in portage.py. + +*portage-2.0.46 (18 Dec 2002): Feature Stable Release Prelink + Bug Fixes + + 18 Dec 2002; Nicholas Jones portage.py: + PRELINK_MASK adds ignore paths for prelink.conf. Error message + adjustments for appearance/readability. auxdbkey changes. + + 18 Dec 2002; Nicholas Jones emerge: + --changelog displays changelogs of packages on update. gcc version + fix for --version. Missing indent in masked output corrected. Some + color additions. Prelink code removed -- Users can do it instead. + + 18 Dec 2002; Nicholas Jones ebuild.sh: + use_{enable,with}() work now. Rearranged auxdbkeys again. + + 17 Dec 2002; Martin Schlemmer bin/ebuild.sh: + Regenerate /lib/cpp and /usr/bin/cc in pkg_setup if they are not + files to ease the broken pkg_postrm() some gcc have. + +*portage-2.0.46_pre2 (15 Dec 2002): Feature Prerelease: prelink + + 15 Dec 2002; Nicholas Jones emerge/portage.py: + Fixups. PRELINK_MASK code. 'prelink -af' in post_emerge(). + + 15 Dec 2002; Mark Guertin cnf.make.conf.ppc: + updated incorrect CFLAG option and appended -mabi=altivec info + +*portage-2.0.46_pre1 (15 Dec 2002): Feature Prerelease: prelink + + 15 Dec 2002; Nicholas Jones portage.py: Counter + fixups. Prelink code. + + 15 Dec 2002; Nicholas Jones bin/f*: Made them + loop over multiple files instead of just doing one. + + 13 Dec 2002; Nicholas Jones emerge/portage.py: + Added disabled prelink code. Needs a little more work. Gave portage the + ability to restart on upgrades to the portage version. Ebuilds for prior + versions will intentionally die on upgrade. USE=build disables it so + bootstrap isn't affected. + +*portage-2.0.45-r5 (13 Dec 2002): Feature addition: PDEPEND+fixes + + 13 Dec 2002; Nicholas Jones emerge/portage.py: + Added restart on portage upgrade code and adjusted ebuild to accomplish + this until version matches -r5. + +*portage-2.0.45-r4 (11 Dec 2002): Feature addition: PDEPEND + + 11 Dec 2002; Nicholas Jones ebuild.sh/portage.py: + Added [CDEPEND, PDEPEND, REBUILD] to auxdbkeys and updated ebuild.sh. + Prevented autoclean on fetchonly. + + 11 Dec 2002; Nicholas Jones emerge: + Added support for PDEPEND. Rewrote some dep handling variables for + readability and ease of use. + +*portage-2.0.45-r3 (09 Dec 2002): Touchups. + + 09 Dec 2002; Nicholas Jones ebuild.sh: Fixed + use_enable() and use_with() so that they actually work -- also don't + have to specify 2nd parameter, 1st is assumed. + + 09 Dec 2002; Nicholas Jones emerge: Added previous + version/downgrade messages to --pretend. Extra message to notify of dep + calculation failure as bad deps can exit portage without error. + + 09 Dec 2002; Nicholas Jones portage.py: Attempt + at fixing the sandbox-crashes-missing-HOME bug. Added a try/catch around + the virts/'del x' code to prevent tracebacks on boxes without a virtuals + file. + + 06 Dec 2002; Nicholas Jones emerge: Fixed 'xfrom' + variable-used-before-assignment message on masked ebuilds. + + 06 Dec 2002; Nicholas Jones portage.py: Disabled + writes to DBs when sandbox is enabled. + + 03 Dec 2002; Nicholas Jones portage.py: Fixed a + nice bug where python was writing 'L' at the end of long() types for + mtimes. + +*portage-2.0.45 (02 Dec 2002): More bug fixes for stable. + + 02 Dec 2002; Nicholas Jones portage.py, output.py: + Added several color options and functions to output.py. 'DO NOT EDIT' + notices added to .env generated profile settings files. Touchups and + nofetch() call for restricted fetches. Moved some file IO code for + SLOTs into a try/catch. { mtimedb fixups. Eclass aux_get() error fix. + aux_get() error fix via try/catch with magically-missing ebuild when + doing stat on it. Enabled full eclass()/inherit code. Added code to + flushmtimedb() entries by key name. } <-- aux_get() fixups. Made + starttime into a long... time.time() is apparently overflowing int(). + + 02 Dec 2002; Nicholas Jones bin/*: + prep*: Fixed missed man pages and corrected loops to be fairly complete + in the included files. quickpkg: Loop to do each in $@ (Peter Sharp). + + 02 Dec 2002; Nicholas Jones emerge: + Yank '++' from searches and make it '\+\+' so that it works. Reformated + 'all ebuilds are masked' message to be a little more obvious. env_update() + AFTER autoclean... not in autoclean -- Fixes ldconfig issues. Typo fixes. + + 02 Dec 2002; Nicholas Jones ebuild.sh: + Added has(), general use()-like function -- 'has this_thing $VAR' returns + shell true or false. Added has_version(), portage call to determine if + a specified DEPEND-atom is installed -- 'has_version ">=mozilla-1.2"' + returns shell true or false. Added best_version(), portage call to + get the best/most-recently-merged version of a DEPEND-atom statement -- + 'best_version ">=mozilla-1.0"' prints a string. pkg_nofetch() displays + SRC_URIs by default on RESTRICT -- Can be redefined to display custom + messages. die() on unpack() failure added. Courtasy of SpanKY: Added + use_with() and use_enable() for --with-thing and --enable-thing. + 'use_with gd libgd' would print --with-libgd if gd was in USE and + --without-libgd if not. + + 19 Nov 2002; Martin Schlemmer cnf/etc-update.conf: + Add 'menu' config item and note about it needing dev-utils/dialog, as + a lot of users do not know about this nifty feature. + + 14 Nov 2002; Phil Bordelon man/emerge.1: + Cleaned up the more recent edits to the man page to more closely + match the previous format, fix various typos, and so on. Expanded + the REPORTING BUGS section, and made the PACKAGE MASKING part of the + NOTES a stand-alone section. + +*portage-2.0.44 (11 Nov 2002): bug fixes and 1.2 rescue/install setup + + 11 Nov 2002; Nicholas Jones *: + bin/*: fixes for spaces-in-filename issues, lots of quotes added. conf/*: + touched up comments and warning. Added RSYNC_RETRIES. ebuild.sh: exit now + reports the failing ebuild's $CATEGORY/$PF. Added EXTRA_ECONF to econf(). + emake: added EXTRA_EMAKE. emerge: RSYNC_RETRIES curtasy of Christopher + Sharp. Random comment fixes. portage.py: Random touchups. KV extraction + fixup for new ROOTs. ARCH missing in profile fix. Fix for packages/All + missing dir traceback. INFOPATH/INFODIR fix. Added INFOPATH to specials. + portage.py: Touchups to the mtimedb-touching code. Fixes for the broken + os.path.normpath() leading '//' bug. Added a modified chuck of Phoen][x's + dist size patch. + + 09 Nov 2002; Nicholas Jones portage.py: + Fixups for KV. + + 08 Nov 2002; Nicholas Jones emerge: + Fix for missing-glibc-bug in --version. + + 08 Nov 2002; Nicholas Jones portage.py: + Fix for cfgdictfile traceback when ROOT != '/'. Fix for missing kernel + headers -- checks usr/src/linux, then /usr/include, then if merging + from sys-kernel ignore error. + + 07 Nov 2002; Nicholas Jones portage.py: + Fix (part 2) for the USE="-*" arch-missing problem. + + 03 Nov 2002; Nicholas Jones portage.py: + eclass() function uses a caching and cPickle storing method to determine + currency of eclass-derived depcache entries. All previous methods are + already removed. eclass_save() is called via store() now. Stripped some + cruft from aux_get(). Error message touchups. + + 03 Nov 2002; Nicholas Jones emerge: + A couple message touchups. + + 29 Oct 2002; Nicholas Jones emerge: + Moved the autoclean section under the --pretend check so it doesn't flip + out when running '-f'. Preliminary support for binary-only methods. + --usepkgonly (implies --usepkg) to force errors is binaries don't exist. + + 27 Oct 2002; Daniel Robbins new*: changed "&&" to "||" + to provide even better protection against mis-use of these commands. + +*portage-2.0.43 (27 Oct 2002): Bug fix release + + 27 Oct 2002; Nicholas Jones emerge: + AUTOCLEAN="yes" on by default. Added in a clean phase after the merge + phase so clashing library versions do not remain installed when ldconfig + is run. This should close up the symlinks-being-removed bugs. + + 27 Oct 2002; Nicholas Jones cnf/*: + Miscelaneous typo fixes. Added PORTDIR_OVERLAY description in make.conf. + + 26 Oct 2002; J Robert Ray portage.py: + Don't act like the download failed if after successfully downloading + a file its size doesn't match the file size in the digest. Treat + this as a mismatched digest condition instead. + + 26 Oct 2002; Nicholas Jones portage.py: + Reversed the defaults on env_update() so it does a full ldconfig instead + of a non-symlink ldconfig. Fixed the typo in the 'invalid conf' notices. + +*portage-2.0.42 (24 Oct 2002): Bug fix release + + 24 Oct 2002; Nicholas Jones make.defaults.5: + Removed this file. It is horribly out of date and completely + wrong to boot. Users shouldn't be modifying the 3 lines in this file + anyway. They are obvious if you understand conf and defaults. + + 24 Oct 2002; Nicholas Jones emerge: + Added missing return statements to select_dep() that caused unmet packages + to be ignored. Touchups to 'emerge info' and 'emerge --version' output. + Added --delete to --delete-after so that it actually deletes in rsync. + + 24 Oct 2002; Nicholas Jones portage.py: + Warning touchups. Replaced constants (9) to index("INHERITED"). + + 23 Oct 2002; Nicholas Jones bin/new*: + Fix for "running as a root user" bug... code does 'rm -rf /' if + variables aren't defined in environment... That's a bad thing. + + 23 Oct 2002; Nicholas Jones portage.py: + Possible fix for the aux_get() issues and IUSE. + + 22 Oct 2002; Nicholas Jones portage.py: + noauto got lost in some weird conflicts of .38, added it back. + + 22 Oct 2002; Nicholas Jones emerge: + Primitive logging via emergelog(). countdown(N,str) function does N second + countdowns of the action 'str'. Error messages on dependency traceback + via try/except on select_dep(). Removed the 'unavailable' warning. Message + updates. Added logging of basic actions to /var/log/emerge.log. Added + package/to-go counter. 'emerge info' displays a number of useful variables + that is good for bug reports. + + 22 Oct 2002; Nicholas Jones prepallstrip: + Bug 9508, fix for MSB architectures strip. Previous check assumed only + LSB objects could/should be stripped. (*LSB -> *SB) [Joky@#gentoo-sparc] + +*portage-2.0.41 (20 Oct 2002): Bug fix release + + 20 Oct 2002; Nicholas Jones portage.py: + stickies=[] lists the variables that will be kept/used as sticky vars, + not yet implimented. Fixed several relative symlink bugs by adding + abssymlink() to portage to determine real/absolute targets. env_update() + modified to fix bug 9308 symlinks bug. Bug 8348, request for error messages + instead of tracebacks/dies on parse errors, now caught on a per file basis + for system config files, includes descriptive messages. Fix for missing + profile traceback in new prepend'd-arch code. Typo fixes in symlink code. + DISABLED 'KEYWORD="" == available' code, DEFAULT IS MASKED NOW. Major + update to masking code, CONFIG_PROTECT can be layered with _MASKs, and + update_protect() now sets the self.protect* variables. Condensed and + reordered the unmerge code, now checks existance, cfgprotect, then mtimes. + + 20 Oct 2002; Nicholas Jones emerge: + Bug 8767: Added 'buildpkg' to FEATURES to specify always-buildpkg. + Updated the --version output to display profile and gcc version. + Bug 8083: Eliminate spinner when terminal is not a tty. Bug 7688: + fixed search vs. searchdesc differences by adding 'cat/pack' split. + Bug 9308: Symlinks were being killed by ldconfig, fixed by changing + how/when ldconfig was allowed to set symlinks. rsync command touchups, + --delete-after so that a failed rsync won't leave a user + without/with-few packages in portage. More warnings to depclean. + + 20 Oct 2002; Nicholas Jones ebuild.sh: + Added die to gzip in unpack() + + 20 Oct 2002; Nicholas Jones make.conf*: + Added in useful variables and descriptions+warnings of their uses. + + 20 Oct 2002; Nicholas Jones make.globals*: + Added in large "do not edit" message. + + 16 Oct 2002; Nicholas Jones portage.py: + Fixed an mtimes issue. --update on a package might yank non-cfgprot + files during the clean-phase because they didn't have mtimes updated. + + 15 Oct 2002; Nicholas Jones portage.py: + Added 'IUSE' to the auxdbkey list. Fixed random aux_get() errors + caused by random empty files in the dep cache. + + 15 Oct 2002; Nicholas Jones ebuild.sh + Actually committed the --host portion of econf. + + 15 Oct 2002; Martin Schlemmer portage.py, missingos.c: + Remove testsandbox.sh, and comment code in portage.py that still + used it to no real use. Add another '\' to the 'missingos_mknod__doc__' + string in src/python-missingos/missingos.c to fix failure with gcc-3.3. + +*portage-2.0.40 (13 Sep 2002): Bug fix release + + 15 Oct 2002; Nicholas Jones portage.py, emerge: + emerge depclean -- Removes all packages that are not explicitly or + dependency merged. + + 15 Oct 2002; Nicholas Jones ebuild.sh: + depend now prints IUSE. Doesn't do anything with it yet. + unpack() -- unzip silently overwrites files (). + econf() -- now specifies '--host=${CHOST}' + + 15 Oct 2002; Nicholas Jones make.globals: + Touch ups + warning. + + 15 Oct 2002; Brandon Low etc-update: + Make etc-update find all the same CONFIG_PROTECT files as portage + by importing it's settings from portage. + +*portage-2.0.39 (13 Sep 2002): Bug fix release + + 13 Oct 2002; Nicholas Jones portage.py: + Bug 5926 -- If the fetchonly AND pretend flags are specified, then + portage should give a list of all the SRC_URIs so that they can be + downloaded or sent into another app. Made sandbox display name in + 'ps' as '[$PF] sandbox'. + + 13 Oct 2002; Nicholas Jones emerge: + Bug 5926 -- See portage.py for today. (emerge -pf) + Typo fixes. + + 13 Oct 2002; Nicholas Jones ebuild.sh: + Added -q to unzip to make it quiet like the others. + Bug 6033 -- Fix for infinate loop in eclasses in portage overlay. + + 12 Oct 2002; Daniel Robbins portage.py: fix for + doebuild() so that our rsync mirror will contain full digests and not just + partial digests for x86. + + 12 Oct 2002; Nicholas Jones emerge: + Added --progress to rsync. This puts the file progress meters + back on. Users have requested this, and it's not detrimental. + Just creates a lot of output, as the man page says: "It gives + bored users something to look at." + + 12 Oct 2002; Nicholas Jones portage.py: + Bug 6361 -- Added checking on directories to ensure that we can + write to them before we try and traceback. Also added pieces to + functions so that return conditions are propagated back to emerge + so that it actually dies on errors. Message on condition details + restart process. + + 11 Oct 2002; Nicholas Jones make*globals: + Removed the tomcat configs from CONFIG_PROTECT + + 11 Oct 2002; Nicholas Jones doman: + Bug 8208 -- Added flags and auto-location support for 'x' manpages. + Added not-an-man-page message. + + 11 Oct 2002; Nicholas Jones dohtml: + Bug 8208 -- Added 'js' to the include list, and added '-A' as an + append flag. '-a' was a filter-down-to. + + 11 Oct 2002; Nicholas Jones portage.py: + Bug 8964 -- Fix for read-only traceback in digestgen(). + Bug 8949 -- Fix for read-only traceback in doebuild() + Bug 8284 -- Prepend ARCH _after_ use order processing. Prevents -* + from killing the ARCH flag. Bug 7596 -- Set an mtime of 0 into + CONTENTS if the file already exists on the FS. Allows the entry + to be in the CONTENTS file. Condensed the protect/protect-mask + code into one function in class dblink. Revised code to allow + multi-level protects and masks. + + 10 Oct 2002; Nicholas Jones emerge: + Bug 8552 -- typo fixes + + 10 Oct 2002; Mark Guertin cnf/make.conf.ppc : + Fixed type in reccomended CFLAGS for generic ppc (was 02, corrected + to O2) + + 09 Oct 2002; Nicholas Jones portage.py: + Fixed a bug where files less than 2 characters in /etc/env.d + weren't checked correctly, and tracebacked env_update() + + 07 Oct 2002; Martin Schlemmer ebuild.sh: + Also set $TMP, as MDK among distros sets this, and it causes + breakage during bootstrap. This should close bug #8101. + + 07 Oct 2002; Mark Guertin man/ebuild.5 : + Updated the man page to include missing functions in portage + + 05 Oct 2002; Mark Guertin cnf/make.conf cnf/make.conf.ppc: + Fixed typo (missing "/") in make.conf and make.conf.ppc, bug #7944 + + 28 Sep 2002; Daniel Robbins ebuild.sh: remove + deprecated "ld.so" from newdepend. + +*portage-2.0.38 (25 Sep 2002): Bug fix release + + 25 Sep 2002; Daniel Robbins emerge: now "emerge world" + and "emerge system" don't replace packages. This closes bug #8282. + + 21 Sep 2002; Daniel Robbins portage-2.0.38.ebuild: + Added additional perm check for /var/cache/edb/dep dirs and fixed perm + settings in the ebuild's pkg_postinst(); this should close bug #7719. + + 21 Sep 2002; Daniel Robbins portage.py: Added + carpaski's patch to add PF to the sandbox's argv[0], closing bug #8141. + + 19 Sep 2002; Daniel Robbins emerge: tweaked emerge so + that "--pretend" displays don't show "N" all the time. + + 19 Sep 2002; Daniel Robbins ebuild.sh: tweaked help to + not list deprecated options. + + 25 Sep 2002; Maik Schreiber cnf/make.globals, + cnf/make.globals.ppc: Added /opt/jakarta/tomcat/conf to CONFIG_PROTECT. Note + by drobbins: this will be removed soon when this gets moved to an /etc/env.d + file in the tomcat package. + +*portage-2.0.37 (19 Sep 2002): Gentoo Linux 1.4_rc1 version + + 10 Sep 2002; Mark Guertin cnf/make.conf.ppc : Backed down + CFLAGS from -O3 to -O2 on ppc as -O3 has proven to be unreliable on all + PowerPC-based machines + + 09 Sep 2002; Daniel Robbins emerge: new parameterized + create() engine, security pass fixes ("emerge" as non-root doesn't print + "root access required" but shows help instead), emerge --pretend output fixes + ("to /" lines are dropped and only displayed if installation root != "/".) + New (and currently unofficial and undocumented) "--deep" and "--selective" + options that correspond to their respective create() parameters. Using + "--deep" will enable "deep emerging" -- updating all deps even if the parent + doesn't need updating. The new parametrized create() is also much cleaner + than the previous incarnation. + + 09 Sep 2002; Daniel Robbins portage.py: os.chdir() -> + chdir() fix, enhanced fetch() digest corruption handling. + + 06 Sep 2002; Mark Guertin cnf/make.globals.ppc : + Updated make.globals.ppc to reflect new CFLAGS for 1.4 release + +*portage-2.0.36 (04 Sep 2002): Gentoo Linux 1.4_rc1 version + + 04 Sep 2002; Daniel Robbins emerge: "--onlydeps" was + mostly broken since the most recent emerge code restructure. Now fixed, + closing bug #7442. + + 04 Sep 2002: Daniel Robbins etc-update.conf: added + missing etc-update config file. + + 04 Sep 2002: Daniel Robbins portage.py: removed error + detection based on return value for pkg_preinst() and friends when called + from merge() and unmerge(), since the value can be unreliable due to the && + shell construct, depmod -a returning a non-zero value, etc. Also fixed + env_update() to treat CONFIG_PROTECT and CONFIG_PROTECT_MASK correctly. + +*portage-2.0.35 (03 Sep 2002) + + 03 Sep 2002: Daniel Robbins etc-update, + man/etc-update.1: new program for updating config files. + + 03 Sep 2002; Daniel Robbins ebuild.sh: upgraded + inherit() to support $PORTDIR_OVERLAY, closing bug #6033. + + 03 Sep 2002; Daniel Robbins emerge: calls to "cvs" now + use "-z3" compression option, closing bug #5982. + + 03 Sep 2002; Daniel Robbins ebuild.sh: symlinks to + .tbz2's in the $PKGDIR/All directory (from $PKGDIR/$CATEGORY) are now + relative, closing bug #6881. + + 03 Sep 2002; Daniel Robbins ebuild.sh: einstall now + sees "GNUmakefile", closing bug #4895. + + 03 Sep 2002; Daniel Robbins ebuild.sh: typo fixes, + closing bug #7263. + + 03 Sep 2002; Daniel Robbins portage.py: /var/tmp + creation now works even if /tmp already exists, closing bug #7376. + + 02 Sep 2002; Daniel Robbins emerge: fixed a logic error + that resulted in non-root emerge failure. This closes bug #7389. + +*portage-2.0.34 (01 Sep 2002) + + 01 Sep 2002; Daniel Robbins : portage.py, ebuild.sh: + Azarah's ebuildsh() removed, various other little fixes like pkg_preinst and + friends not dying on non-zero return codes. + + 01 Sep 2002; Martin Schlemmer ebuild.sh: add a custom + version of the esyslog() function to fix the "Red Star" bug if no logger is + running. + +*portage-2.0.33_p1 (30 Aug 2002): urgent fix + + 31 Aug 2002; Dan Armak ebuild.sh: comment out the if + clause that only executed inherit() conditional on $PORTAGE_RESTORE_ENV. It + didn't work and broke portage 2.0.33 as far as inheriting ebuilds goes. + +*portage-2.0.33 (30 Aug 2002) + + 30 Aug 2002; Daniel Robbins : some additional clean-ups + for the make.conf(.ppc) files. + + 30 Aug 2002; Daniel Robbins emerge: emerge search would + die when aux_get() raised a KeyError; we now catch and handle this exception. + This closes bug #7280. + + 29 Aug 2002; Daniel Robbins portage.py: fixed typo in + move_ent() code that messed up moving packages into previously non-existant + category directories in /var/db/pkg. + + 30 Aug 2002; Mark Guertin cnf/make.conf.ppc : Updated + cnf/make.conf.ppc with new CFLAGS for 1.4 release + +*portage-2.0.32 (29 Aug 2002) + + 29 Aug 2002; Daniel Robbins emerge: favorites weren't + working since 2.0.30; they're working again now. This closes bug #7225. + + 29 Aug 2002; Phil Bordelon emerge.1: Added a small + blurb regarding what to do when emerge --update [world|system] fails because + of new features such as || and ?. Hopefully this will assuage the fairly + common questions regarding this. + +*portage-2.0.31 (29 Aug 2002) + + 28 Aug 2002; Daniel Robbins portage.py: fixed a config + file protection logic bug detected and identified by Azarah. It basically + broke most config file updates and has been broken for around six months. + Very surprised no one had encountered this issue before. + + 28 Aug 2002; Daniel Robbins emerge: improved error + messages when an unsatisfiable dependency is encountered. Now lets you know + if there are masked packages that would satisfy the dep. + + 28 Aug 2002; Daniel Robbins emerge: emerging .tbz2 + packages and .ebuilds by name now works; this was broken in 2.0.30. + +*portage-2.0.30 (28 Aug 2002) + + 28 Aug 2002; Daniel Robbins portage.py, emerge: rewrote + gettimeval() as cpv_counter() and updated it to handle corrupt COUNTER files, + closing bug #6763. + + 28 Aug 2002; Daniel Robbins emerge: "emerge search" now + displays information for masked packages if possible, closing bug #6823. + + 28 Aug 2002; Daniel Robbins emerge: fixed an old gbevin + bug where "emerge search" wouldn't show packages whose version string was + only one character long, ie. "foo-3". This closes bug #6800. + + 28 Aug 2002; Daniel Robbins portage.py: added a missing + call to flatten() in dep_check(), allowing recursive sublists in dependencies + and SRC_URI variables to work; this closes bugs #7104, #7116, #7122. + + 28 Aug 2002; Daniel Robbins doman: fixed some typos, + closing bug #7152. + + 28 Aug 2002; Daniel Robbins portage.py, emerge: major + work to emerge: reworked the internal code organization to make depgraph code + easier to understand; unified two code paths so that ebuild/.tbz2 choices + when "--usepkg" should now be eternally consistent; tweaked portage.py so + that dep_expand()'s dbapi argument is optional. In the process of all this, + isolated and fixed bug #4508. + + 27 Aug 2002; Martin Schlemmer portage.py: if the dep + cache is stale, it is possible that aux_get() will call doebuild(depend) to + regenerate it again. This call will cause $T to be set to "", which will + break anything that needs $T to be set to a writable location inside the + sandbox, so we need to set $T to a valid value again. + + 27 Aug 2002; Daniel Robbins portage.py: improved error + handling/detection of bad pkgsplit() and catpkgsplit() calls; should close + bug #6803, #6853. + + 26 Aug 2002; Daniel Robbins emerge: fix so that "emerge + prune rsync" doesn't complain that you are trying to rsync and prune at the + same time. This closes bug #6785. + + 26 Aug 2002; Daniel Robbins doman fixes; should work + for pre-gzipped man-pages and man-pages with multiple "."s in their name. + Closes bugs #6770, #6917 + + 25 Aug 2002; Martin Schlemmer emerge: fixed an + indentation problem of the 'else:' at line 1304. + + 20 Aug 2002; Daniel Robbins emerge: removed stray + "DEBUG:" output, closing bug #6732. + +*portage-2.0.29 (18 Aug 2002) + + 18 Aug 2002; Daniel Robbins emerge, portage.py, + ebuild.sh: making some effort to make output cleaner and less cluttered, + particularly with error handling. + + 18 Aug 2002; Daniel Robbins emerge: updated so that + "emerge --inject foo-1.0" fails instead of injecting "null/foo-1.0"; fixed + error in help; "emerge --inject" and "emerge" with no specified files or + package classes prints out a small warning and exits. Closes bug #6353. + + 18 Aug 2002; Daniel Robbins portage.py: movefile() + didn't like bind mounts due to a peculiar quality -- according to their + ST_DEV stat() information, they are on the same filesystem, so rename() + should work, but it doesn't. We now fall back to copy if rename() doesn't + work. Closes bug #6468. + + 18 Aug 2002; Daniel Robbins ebuild.sh: made significant + enhancements and fixes to ebuild.sh's error-handling code. Errors in + src_unpack(), src_compile(), src_install() and others should now be correctly + detected. Also downgraded our use() function since we are not implementing + extended USE functionality. Closes bug #6393. + + 18 Aug 2002; Daniel Robbins portage.py: portdb's + cp_all() now skips "CVS" directories, closing bug #6662. + + 18 Aug 2002; Daniel Robbins portage.py: aux_get(): + exception handler to print informative message when encountering wacky cache + entries that we just can't fix (for some reason.) + + 17 Aug 2002; Daniel Robbins ebuild.sh: removed + deprecated "ld.so" dependency from Dan Armak's newdepend() function. + + 17 Aug 2002; Daniel Robbins portage.py: doebuild() + running in "depend" mode will set $T to "" to prevent a parent's $T from + being inherited; this is important when we run custom portage code from + inside an ebuild (such as pkg_postinst)... it allows dep caching to not + break. Closes bug #6484. + +*portage-2.0.28 (17 Aug 2002) + + 16 Aug 2002; Daniel Robbins emerge: return errors when + two actions like "world" and "system" are specified on the command-line, or + when "system" or "world" are combined with package names. Closes bug #6492. + + 16 Aug 2002; Daniel Robbins portage.py: bad string was + causing pkg_prerm() and pkg_postrm() to not be called; now fixed. This + closes bug #6493. + + 16 Aug 2002; Daniel Robbins emerge: now calls + env-update() after an unmerge() run (to fix library paths, links, etc.) + Closes bug #6511. + + 16 Aug 2002; Daniel Robbins doman: now handles already- + gzipped man pages correctly, closing bug #6544. + + 16 Aug 2002; Daniel Robbins emerge: fixed a bug where a + dep specified on the command-line with --usepkg would use an old package if + it happened to match the dep. Now, it will use the ebuild instead, just like + how deps of deps are treated. + +*portage-2.0.27 (06 Aug 2002) + + 07 Aug 2002; Daniel Robbins portage.py: removed some + beta extended USE functionality to speed up regenerate(); as we are likely + not going to need extended USE for a good while. + + 07 Aug 2002; Daniel Robbins portage.py: ebuild.sh now + supports "config" (pkg_config) again. + + 06 Aug 2002; Dan Armak ebuild.sh: change debug-print() + to exit if $T is not defined, i.e. if emerge is running in dependency + detection mode and isn't actually emerging everything. This fixes bug #4932 + (the "eclass-debug.log is created in /" problem). + + 06 Aug 2002; Nicholas Jones ebuild.sh: Fixed a + case-check problem that prevented tar.Z from being un-tar'd. This closes bug + #6126. + + 06 Aug 2002; Martin Schlemmer portage.py, ebuild.sh: + Remove "setup" from 'sandboxactive' in portage.py, as we are not running + pkg_setup() in a sandbox anymore. Move the restoring of the old env code + to be the first thing in ebuild.sh, just to ensure we dont mess anything + up when greping/awking during saving it. + +*portage-2.0.26 (06 Aug 2002) + + 06 Aug 2002; Daniel Robbins portage.py: on unmerge, + entries are now removed from the world file if 1) the dependency refers to + the cat/pkg being unmerged, and 2) the dependency matches the current version + being unmerged, and 3) unmerging this package will leave no other packages on + this system that will match this world entry. This closes bug #3409. + + 06 Aug 2002; Daniel Robbins portage.py: new global + update support. You can now add an entry to a file in + /usr/portage/profiles/updates/, something like "move x11-base/xfree + x11-base/xfree86". Portage will then update the /var/db/pkg db on user's + boxes so that any xfree packages are renamed to xfree86; it will also update + the world and virtuals files appropriately. We are naming the update files + "3Q-2002", etc. -- for third quarter in 2002. This way, we don't bog + Portage down by having it run through all our directives. It will only look + at update files whose mtimes have changed. Closes bug #4753, #5463, + + 06 Aug 2002; Daniel Robbins ebuild.sh: tweaked Azarah's + environment-saving patch to not be enabled when $T is not defined -- this + closes bug #6070 and should speed up dep calculations too. Also tweaked + ebuild.sh so that pkg_setup() is run *outside* of the sandbox. This is + important because piping stuff around tends to require temp files to be + created; pkg_setup() being in the sandbox prevents this from happening. + + 06 Aug 2002; Martin Schlemmer ebuild.sh : Unset + esave_ebuild_env in esave_ebuild_env(), otherwise the sourced copy messes + saving of the environment. + + 05 Aug 2002; Phil Bordelon emerge.1: Updated the man + page to match the current version of 2.0.25. + + 05 Aug 2002; Phil Bordelon emerge.1: Updated the man + page to match the current version of 2.0.25. + +*portage-2.0.25 (05 Aug 2002) + + 05 Aug 2002; Daniel Robbins src/sandbox/Makefile: + removed -march=i386 added in Azarah's patch; breaks things for PPC, Sparc. + + 05 Aug 2002; Daniel Robbins emerge: logic error fix for + description searching, closing bug #6031. + +*portage-2.0.24 (04 Aug 2002) + + 04 Aug 2002; Daniel Robbins output.py, emerge: rewrote + our output.py module (it was weird) and tweaked emerge so that colorization + will be disabled if NOCOLOR is set to "yes" or "true" *or* if sys.stdout isn't + a tty. This means that if you pipe things to "less", colorization will get + automatically disabled. Yay! This closes bug #5714, + + 04 Aug 2002; Daniel Robbins ebuild.sh: default + src_compile now properly uses "die" instead of "return 1." This closes bug + #2981. + + 04 Aug 2002; Daniel Robbins portage.py: "=foo/bar-1.0*" + now matches "foo/bar-1.0_{alpha|beta|pre|rc}{int}" but not + "foo/bar-1.1_{alpha_beta_pre_rc}{int}". This closes bug #5874; gcc-3.2_pre + is now considered a "3.2" rather than a very late "3.1" when doing "*" + matching. + + 04 Aug 2002; Daniel Robbins ebuild.sh: Applied + carpaski's patch to allow "unpack" to also handle regular .gz or .bz2 files; + in which case the unpacked files are placed directly in ${WORKDIR}. Closing + bug #5867. + + 04 Aug 2002; Daniel Robbins portage.py: tweaked + exithandler() to only do its sandbox clean-up if we happen to be the root + user. Closes bug #5859. + + 04 Aug 2002; Daniel Robbins emerge: search now lists + masked packages correctly. Closes bug #5854 (pending QA verification.) + + 04 Aug 2002; Phil Bordelon emerge.1: The emerge man page + now reflects the fact that emerge sync|rsync always does a --clean now. Also + bumped the release number to 2.0.23. + + 03 Aug 2002; Martin Schlemmer portage.py, emerge.sh, + sandbox.c libsandbox.c: Updated sandbox.c and libsandbox.c to use an internal + env variable, $SANDBOX_ACTIVE to determine if sandbox should really be active + or not. With it only checking $SANDBOX_ON, some instances NOT running in a + sandbox, but that set SANDBOX_ON while an actual sandbox was running, caused + the sandbox to activate for this process. Added in support for a more phased + calls to ebuild.sh again. This is this time done with support to save the + current environment of ebuild.sh to the next call that should handle problems + with pkg_setup() setting env variables. Closes bugs #5853, #5817, #5950. + +*portage-2.0.23 (01 Aug 2002) + + 01 Aug 2002; Daniel Robbins portage.py: + ${ROOT}var/cache/edb and friends will get created if they don't exist, + closing bug #5813. + + 01 Aug 2002; Daniel Robbins emerge: rewrote the emerge + search code, making it fully API-compliant and much more streamlined and + compact. This rewrite should fix the problem where emerge search doesn't + support Portage overlays (bug #5783.) + + 31 Jul 2002; Phil Bordelon emerge.1: Documented the + fact that emerge clean does not remove unslotted ebuilds. Bumped the man + page revision number to 2.0.22. + +*portage-2.0.22 (29 Jul 2002) + + 29 Jul 2002; Daniel Robbins portage.py: fetch() didn't + handle resuming downloads properly when the first attempt aborted + prematurely. The fall back to the alternate location would not resume the + download. This should now be fixed. Closes bug #5655. + + 29 Jul 2002; Daniel Robbins portage.py, ebuild.sh: I + had some code in spawn() from one of Azarah's patches that I forgot to + remove; it caused the sandbox to be disabled all the time. I removed this + code, and then I tweaked ebuild.sh so that the sandbox runs in a "deny by + default" configuration. Before, you could add lines to the main ebuild + (outside of a function) and it would bypass the sandbox; no more. Closes + bugs #5740, #5744. + + 29 Jul 2002; Daniel Robbins emerge: --help and + --version now work for non-root users as they should. --clean has been + deprecated. This closes bug #5658. + +*portage-2.0.21 (28 Jul 2002) + + 28 Jul 2002; Daniel Robbins portage.py, emerge: Added + beta "Portage tree overlay" support. By setting PORTDIR_OVERLAY to point to + a local directory tree, you can cause Portage to look for ebuilds in + PORTDIR_OVERLAY first before consulting the regular PORTDIR. Using this + feature, it's possible to have your PORTDIR set up to rsync but still be able + to have locally-created ebuilds in your PORTDIR_OVERLAY tree. For example, + you would place your ebuild in PORTDIR_OVERLAY/sys-apps/foo/. + + 27 Jul 2002; Daniel Robbins portage.py: another + dep_opconvert() USE-handling bug-fix. Working OK for Azarah now. + + 27 Jul 2002; Daniel Robbins portage.py: small logic + error fix in dep_opconvert() to fix up USE handling. + + 27 Jul 2002; Daniel Robbins emerge: security modes now + work correctly; root access now required for merging. The new security pass + code was missing a check that is now present. + +*portage-2.0.20 (27 Jul 2002) + + 27 Jul 2002; Daniel Robbins portage.py, emerge, + repoman: Rewrote a good deal of our dependency-checking code, including all + of dep_opconvert(). Results? repoman will now auto-enable all USE variables + (even ! use variables will get enabled) resulting in thorough checks of all + specified dependencies. DEPEND="foo? bar : oni" and DEPEND="foo? ( bar oni ) + : ( meep barf )" now works correctly. DEPEND="|| ( foo bar oni )" now works + correctly and will try to satisfy "foo" (the first package) if none are + installed. DEPEND="!foo? ( bar )" now works correctly; it was not working + before. This should generally mean that our dependency system is now working + as expected. + + 27 Jul 2002; Daniel Robbins portage.py: changed + counter_tick() method so that bulk of code is in the counter_tick_code() + helper function; then created a new method for fakedbapi that calls + counter_tick(). This fixes "--emptytree" issues with emerge, since emerge + still expects counter_tick() to exist as a method. + + 27 Jul 2002; Daniel Robbins portage.py, emerge: removed + a DEBUG: print and a stray "raise IndexError" that I used for debugging. + +*portage-2.0.19 (26 Jul 2002) + + 26 Jul 2002; Daniel Robbins portage.py: Portage is now + eclass-friendly when it comes to regenerating cache entries. This closes bug + #4843. + + 26 Jul 2002; Daniel Robbins portage.py, emerge: Closed + bug #5524. Packages "emerge inject"ed will no longer get auto-cleaned + indiscriminantly. Injected packages now have an official COUNTER so that + emerge clean doesn't get confused and schedule the package for removal. Also + modularized and improved the counter-handling functions and changed the + counter update method so that systems with XFS filesystems that die + unexpectedly will no longer get corrupted COUNTER files. This should solve + the an entire class of "my counter is corrupt" issues for XFS users. + + 26 Jul 2002; Daniel Robbins portage.py: added exception + handler to getcontents() so that it will gracefully ignore (with a warning) + corrupt CONTENTS file lines. This closes bug #5464. + + 26 Jul 2002; Daniel Robbins emerge: fixed a single-line + indentation error that resulted in "emerge clean" ignoring some files. This + closes bug #5597,#4364. + + 25 Jul 2002; Daniel Robbins emerge: --noreplace is now + off by default and works again; --onlydeps appears to be working again; and + merge() will merge things as specified in display(), which was not the case + before (I rolled 2.0.18 before fixing a few things I forgot about) + +*portage-2.0.18 (25 Jul 2002) + + 25 Jul 2002; Daniel Robbins portage.py: Close bug + #5580; pkg_setup() now gets called during all build-related stages. + + 24 Jul 2002; Daniel Robbins portage.py, emerge: rewrote + create() function, closing bug #5469. Also added freeze() and melt() methods + to portdbapi to enhance performance. create() is now extensively commented + and even understandable. + + 24 Jul 2002; Daniel Robbins emerge: the "rsync --clean" + option has been deprecated. Cleaning is now on by default, closing bug + #5527. + + 24 Jul 2002; Daniel Robbins portage.py, make.globals: + It should now be safe to do what Spider did in the gconf ebuild and add + CONFIG_PROTECT and CONFIG_PROTECT_MASK to /etc/env.d entries. Both variables + are now incremental, just like USE, and you can use "-path" to turn a path + off, or add CONFIG_PROTECT{_MASK}="path" to *add* a path to the list (this + will not overwrite "parent" settings. Also added "/etc/env.d/" to + CONFIG_PROTECT_MASK in /etc/make.globals. Also, very importantly, /etc/env.d + is now hard-coded into CONFIG_PROTECT_MASK as it was in earlier versions of + Portage and cannot be removed. + + 24 Jul 2002: Daniel Robbins emerge, portage.py: two + fixes; first, I removed xcache.p support from portage.py. The code was + designed based on the false theory that directory mtimes are updated whenever + an object inside that directory is modified. That is not the case -- it + happens when the directory listing itself changes. Also fixed overly verbose + emerge merging error. + + 23 Jul 2002; Phil Bordelon emerge.1: Updated the man + page to match some changes in the latest version of portage, along with some + fixes recommended by drobbins. + +*portage-2.0.17 (23 Jul 2002) + + 23 Jul 2002; Daniel Robbins portage.py: fixed a bug + pointed out by trance -- dep_nomatch() was still using the old (deleted) + match() function. Now it's using a new match() method. + +*portage-2.0.16 (22 Jul 2002) + + 22 Jul 2002; Daniel Robbins portage.py: changed xcache + behavior so that the cache gets totally thrown away when the masks are + updated. Also revamped carpaski's code so we can avoid loading xcache from + disk if we simply plan to throw it away. This necessitated the creation of a + new file in /var/cache/edb: mtimes. This file stores mtimes for various + important filesystem objects. Also added support to not regenerate the GNU + info directory index if the mtime on /usr/share/info has not changed since + previous invocation. + + 22 Jul 2002; Daniel Robbins portage.py, emerge: moved + security handling code from emerge to portage.py; also moved group "wheel" + check to portage.py. Added additional security checks and permissions fixes + to the cache handling functions. + + 22 Jul 2002: Daniel Robbins emerge: fixed a bug + reported by woodchip related to merging packages. When using --usepkg, a + package wouldn't be used if there was a newer unmasked version of the ebuild + available, even if the package in question was the right selection. + + 22 Jul 2002; Daniel Robbins emerge: fixed create() code + and consolidated some functions. My goal is to simplify the emerge code + until it's clean, at which point we can begin adding new features to emerge + like more SLOT-friendly decision making. + + 22 Jul 2002; Daniel Robbins portage.py: was able to + remove 130 or so lines of code by depreciating the match() function (replaced + by the match2() method.) I also rennovated the binarytree code to take + advantage of fakedbapi. + + 22 Jul 2002; Nicholas Jones portage.py: added the + xcache.p fix and updated the version to 2.0.16pre (from 2.0.12) -- Also added + in a try/except inside the store() (atexit) for xcache.p to give hints + instead of tracebacks. + + 22 Jul 2002; Nicholas Jones emerge: added the + description searching code and added a spinner to the search. + + 21 Jul 2002; Phil Bordelon emerge.1: Finished the + rewrite of the emerge man page. + + 21 Jul 2002; Phil Bordelon emerge: Readded the sync + help to the list of help options now that emerge --help sync works again. + +*portage-2.0.15 (16 Jul 2002) + + 15 Jul 2002; Daniel Robbins emake: no longer falls back + to plain old "make" if parallel make fails. I believe it's best to fix the + problem (turn parallel make off in the ebuild) rather than tweak emake to + avoid it. + + 15 Jul 2002; Daniel Robbins emerge: rewrote some code, + cleaning things up and removing redundant functions. Starting to + de-cruftify. + + 15 Jul 2002; Daniel Robbins emerge: fix for permissions + when updating the cache using server-generated entries. + +*portage-2.0.14 (15 Jul 2002) + + 15 Jul 2002; Daniel Robbins ebuild.sh: ccache bug fix; + removed extra "!". Ccache should now get enabled properly. Also, INHERITED + variable is now getting added to the dep cache entries for future + eclass-friendly caching. + + 15 Jul 2002: Daniel Robbins portage.py: Portage now + *persistently* caches xmatch() calculations. This appears to speed things up + but we will need to limit the size of the new xcache.p in future versions of + Portage. + + 15 Jul 2002; Daniel Robbins portage.py, emerge: Portage + now has keyword-based masking enabled. It also has server-side caching + enabled to eliminate "emerge pre-Calculating dependencies... delay" for + end-users. There is now an undocumented "regen" option for emerge that tells + Portage to ensure that all entries in /var/cache/edb/dep are up-to-date. + This is intended mainly for developers, as the server-side caching feature + should ensure that all dep cache entries are up-to-date for end-users. + + 15 Jul 2002; Daniel Robbins repoman: repoman now checks + for ebuilds that generate output as well as ebuilds that return a non-zero + error code when sourced. For this test to detect all failures, you need to + wipe out your /var/cache/edb/dep/* before running repoman. This design quirk + is necessary to preserve existing emerge behavior. + + 13 Jul 2002: Daniel Robbins portage.py: Removed + Azarah's ebuildsh() function as it breaks pkg_setup() again. pkg_setup() + needs to be called as part of the same process as any other ebuil.sh command + so that environment vars set in pkg_setup() are preserved through the rest of + the build process. + + 13 Jul 2002; Daniel Robbins portage.py: changed calling + convention for doebuild("depend"). + + 13 Jul 2002; Daniel Robbins ebuild.sh: removed + erroneous "local dbkeys" that was outside of a function. This fixes some + cache update problems. Added INHERIT to our cache entries so we can + correctly update the cache for eclass ebuilds. + + 12 Jul 2002; Dan Armak make.globals, make.globals.ppc: + remove default KDE2DIR, KDE3DIR settings and comments. The kde eclasses will + now handle the case where they are not defined. This will be used with kde + 3.1 and later, and the difference between their default value and them not + being defined is important. + +*portage-2.0.13 (11 Jul 2002) + + 11 Jul 2002; Daniel Robbins tarball.sh: our tarball + script didn't clean the src/sandbox directory before creating our distribution + tarball. This resulted in src/sandbox/sandbox (the executable) being distributed, + and the "make" in the ebuild thinking everything was up-to-date. The result? + Everyone in the world got a sandbox compiled with gcc 3.1. This has been + fixed, closing bug #4867, #4851. + + 10 Jul 2002; Daniel Robbins portage.py: removed some + bogus code that snuck in. pkg_setup() is no longer called when installing a + tbz2. All tbz2 stuff should be done in pkg_pre/postinst(). + +*portage-2.0.12 (10 Jul 2002) + + 10 Jul 2002; Daniel Robbins ccache support is now + controlled via a "ccache" FEATURES variable, which is enabled in make.globals + my default. ccache support can now be turned off by adding a + FEATURES="-ccache" to /etc/make.conf. Also, CCACHE_DIR correctly detected + and utilized. + + 10 Jul 2002; Daniel Robbins emerge: "emerge --help + rsync" now works correctly and displays rync help rather than rsyncing. This + closes bug #4438, #4629. + + 10 Jul 2002; Daniel Robbins portage.py: Portage now + prints a friendly error if PORTAGE_TMPDIR doesn't exist or is not a + directory. This effectively closes bug #4360. + + 10 Jul 2002; Daniel Robbins emerge: the "inject", + "sync" and "rsync" actions no longer allow "--pretend" or "-p" to be + specified. This closes bug #4352. + + 10 Jul 2002; Daniel Robbins sandbox.c: use realpath() + to expand the PORTAGE_TMPDIR, /var/tmp, /tmp paths. This allows write access + to these directories even if /var or /var/tmp is a symlink, for example. + Without this fix, access to these directories will be denied by the sandbox, + creating a bunch of problems. Closes bugs #4256, #2379, #4625, #2931, #4829. + + 10 Jul 2002; Daniel Robbins megadigest, megadownload, + megatouch, pkgsearch: removed from the bin/ directory; deprecated. + + 10 Jul 2002; Daniel Robbins emerge, quickpkg: remove + hard-coded references to "/usr/portage" in "emerge search", quickpkg. Now + correctly uses PORTDIR instead. Closes bug #4836. + + 10 Jul 2002; Daniel Robbins emerge: emerge now checks + to see if the "wheel" group exists before running; if it doesn't, it exits + with a polite error message. Closes bug #4736. + + 08 Jul 2002; Daniel Robbins portage.py: changed the + unmerge() code so that it doesn't use mtimes to test whether a symlink + should be unmerged, since mtimes and symlinks are weird partners. Instead, + we save unmerging of our symlinks until the end of the code, and unmerge + them only if their target no longer exists. This closes bug #4491. + + 08 Jul 2002; Daniel Robbins portage.py: check whether + ebuild actually exists immediately before running pkg_postint() and + pkg_preinst() from the dblink merge() method. Also change all PKG_TMPDIR + references to PORTAGE_TMPDIR plus suffix, closing bug #4447, #4853. + +*portage-2.0.11 (07 Jul 2002) + + 07 Jul 2002; Daniel Robbins portage.py: rewrote + portdbapi's xmatch() and visible() to fix significant bugs. Logic errors in + both methods caused ~ deps to not work correctly. After the rewrite, + dependency checking is now 44% faster. + + 07 Jul 2002; Daniel Robbins repoman, portage.py: Added + new DEPEND and RDEPEND.badmasked categories to repoman. repoman now checks + dependencies of masked packages using *all* ebuilds, rather than trying to + match them against all visible ebuilds. DEPEND.bad and RDEPEND.bad (used to + be ".unsolvable") now only tally visible ebuilds, not masked ones. + +*portage-2.0.10 (06 Jul 2002) + + 05 Jul 2002; Daniel Robbins portage.py, repoman: Added + new capabilities to repoman -- the ability to detect unsolvable DEPEND and + RDEPEND variables, missing DESCRIPTION, LICENSE, KEYWORDS and SLOT. Fixed + repoman so that adding a comment with quotes in it doesn't break things. + Added a few tiny extensions to portage.py to support the new repoman + features. + + 03 Jul 2002; Martin Schlemmer ebuild.sh: some ebuilds + like gcc do not use $S to build the package in, and this causes generated .la + files (libtool) to contain $WORKDIR in them. We thus export $WORKDIR in + ebuild.sh as well, to go along with fixes to the libtool-portage patch. + + 02 Jul 2002; Daniel Robbins portage.py: pkg_setup() now + gets called before a tbz2 is installed, and pkg_preinst() and postinst() get + called at the right times as well. + + 01 Jul 2002; Phil Bordelon emerge: "emerge --help + rsync" does an rsync instead of printing help. Until this is fixed, I + removed it from the list of detailed help options. + +*portage-2.0.9 (01 Jul 2002) + + 01 Jul 2002; Daniel Robbins Added missing .match() + method to portdbapi. + + 01 Jul 2002; Daniel Robbins portage.py: Added new + operator for dependencies: DEPEND="foo? bar : oni" will use oni if foo isn't + set. Added "||" support back after removing it from my working copy; looks + ok. + + 29 Jun 2002; Daniel Robbins portage.py, make.globals, + make.globals.ppc: internalized definitions of BUILDDIR and PKG_TMPDIR in + order to make things work as expected when one sets PORTAGE_TMPDIR. The new + config file var expansion algorithm made this change necessary. + + 29 Jun 2002; Daniel Robbins portage.py: fix doebuild() + so that pkg_setup() gets called when a .tbz2 package is being built. This + closes bug #3673. + + 29 Jun 2002; Daniel Robbins portage.py: tweaked the + aux_get() code to automatically regenerate cache files if they have the + incorrect number of entries. Added an additional fix to this code on 01 Jul + 2002. + + 29 Jun 2002; Martin Schlemmer portage.py: merge in some + of the missing ld.so.preload fixes again. + + 29 Jun 2002; Daniel Robbins portage.py: new version + with highly-optimized dependency calculation caching, particularly for + portdbapi. Includes new three-level caching portdbapi xmatch() method. + + 27 Jun 2002; Grant Goodyear ebuild.sh: Added keepdir() + function so that it no longer has to be hardcoded in ebuilds. + +*portage-2.0.8 (27 Jun 2002) + + 27 Jun 2002; Daniel Robbins emerge: in an attempt to + provide a predictable release of Portage, I'm reverting the "emerge + --pretend" "fix" in Portage-2.0.6. It ignores custom USE settings when + calculating child deps, which makes things tricky for users. We'll use the + "expected" (old) behavior for now until we have a solution for this USE + issue. + + 27 Jun 2002; Daniel Robbins portage.py: fixed handling + of ! deps in match(), closing bug #4219. Thanks Spidler! + + 27 Jun 2002; Daniel Robbins portage.py: disabled USE + regeneration on reset() for performance purposes. + +*portage-2.0.7 (26 Jun 2002) + + 26 Jun 2002; Daniel Robbins portage.py: add a friendly + error handler for aux_get() so that flaky ebuilds don't cause it to trip up + with a cryptic traceback; users will get a friendly error message instead. + Also, temporarily disable keyword-based masking, since it currently slows + down Portage by quite a bit since it causes a much greater set of ebuilds to + be cached. + +*portage-2.0.6 (25 Jun 2002) + + 25 Jun 2002; Daniel Robbins portage.py: rewrote the + config file code to make things more sane, consistent, and made infinite + loops during variable expansion a thing of the past. This closes bug #3952. + + 25 Jun 2002; Daniel Robbins emerge, portage.py, + ebuild.sh: "emerge --pretend" and "emerge search" now work for the root user + as well as any users in the "wheel" group. emerge will now gracefully exit + if "emerge search" is run by someone not in the "wheel" group. This closes + bug #4121. + + 25 Jun 2002; Martin Schlemmer bin/{dolib.so,preplib.so}: + Also change "strip --strip-unneeded" to "strip --strip-debug" for these. + Look at bugs #2702,#3929,#4027 for more info. + + 25 Jun 2002; Daniel Robbins emerge: "emerge -u" now + correctly scans dependencies of packages, even if they are up-to-date, to + determine if any of their dependencies need updating. Previously, up-to-date + packages were not scanned in this way, which was a bug. + + 24 Jun 2002; Daniel Robbins ebuild.sh: Portage will now + automatically take advantage of ccache if the >=dev-util/ccache-1.9 ebuild is + installed. Removing /var/cache/ccache hole in the sandbox. + +*portage-2.0.5 (24 Jun 2002) + + 23 Jun 2002; Daniel Robbins portage.py: basic keyword- + based masking is now active. New support for KEYWORDS in ebuilds and + ACCEPT_KEYWORDS in profiles. + + 23 Jun 2002; Daniel Robbins conf files: removed + references to non-functional FTP_PROXY and HTTP_PROXY and added a note about + how to use the correct vars (ftp_proxy and http_proxy.) Closes bug #1664. + Also added note about RSYNC_PROXY, closing bug #2332. + + 23 Jun 2002; Daniel Robbins portage.py: removed + "dependency too short" checks which weren't working and were causing deps + like "mc" and "ed" to be rejected as invalid rather than being expanded. + + 23 Jun 2002; Daniel Robbins emerge: upgraded "clean" + code to be more robust, consistent. Closes bug #3967. + +*portage-2.0.4 (20 Jun 2002) + + 20 Jun 2002; Daniel Robbins in the 2.0.4 ebuild itself: + added back tbz2tool symlink which was mistakenly removed. Also changed the + way we compile portage.py stuff so that we remove the previously compiled + files, just in case clock skew cause them to seem more recent than they + really are. Python byte-code compilation moved to pkg_postinst() + + 20 Jun 2002; Daniel Robbins portage.py: fixed up the + fetch() code so that invalid digests don't cause a traceback. + + 20 Jun 2002; Daniel Robbins portage.py: some of the new + transplanted virtuals code assumed that profiledir was set, which is not + required. This code has now been fixed to not make that assumption. + +*portage-2.0.3 (20 Jun 2002) + + 20 Jun 2002; Daniel Robbins portage.py: fixed two typos + pointed out by stroke and g2boojum. These fix unmerge and some aspect of + virtuals handling, which was previously causing a traceback. + + 19 Jun 2002; Daniel Robbins emerge: emerge -eup world + now will ignore world entries if it isn't really installed locally; in 2.0.1, + --emptytree would auto-enable all world entries, leading to inconsistent + package lists between --emptytree and without. + +*portage-2.0.2 (19 Jun 2002) + + 19 Jun 2002; Daniel Robbins make.conf.ppc, + make.globals.ppc: integrated these files into our sources. + + 19 Jun 2002; Daniel Robbins portage.py: fixed a bug + where ROOT="" would not get properly converted to ROOT="/". + + 18 Jun 2002; Daniel Robbins emerge: Portage 2.0+ has + fixed "!" depend matching support, but some code in emerge was designed to + anticipate the incorrect behavior. This emerge code has been fixed to work + correctly. This closes my part of bug #3834. + + 18 Jun 2002; Daniel Robbins portage.py, emerge: fixed + bug #2444, where emerge fails when "--emptytree" and "--onlydeps" are used at + the same time. + + 18 Jun 2002; Daniel Robbins portage.py, emerge: new + fakedbapi for doing emptytree calculations; emptytree upgrades in emerge. + "emerge -upe world" now works correctly, accounting for items in the world + profile. Yay! Bugs #3832 and #1911 fixed. + + 18 Jun 2002; Daniel Robbins portage.py, emerge: + Integrated new aux_get() method into our portdbapi. aux_get() provides a + standardized way to get cached information about ebuilds, and is now fully + integrated into Portage and emerge search. + + 18 Jun 2002; Daniel Robbins portage.py: fixed a bug + where dep_nomatch() was testing for None rather than a "zero" condition, + causing dep_nomatch() to choke on match()'s [] return value. + + 17 Jun 2002; Daniel Robbins emerge: added an exception + handler to catch invalid regular expressions and avoid a traceback. + + 17 Jun 2002; Daniel Robbins sandbox.c: added + /var/cache/ccache to sandbox "write ok" list, closing bug #3028. + +*portage-2.0.1 (16 Jun 2002) + + 16 Jun 2002; Daniel Robbins portage.py, emerge: fixed a + virtuals expansion bug that would cause virtuals to be consulted too early. + +*portage-2.0 (16 Jun 2002) + + 16 Jun 2002; Daniel Robbins portage.py, ebuild.sh, + emerge: turbo-ified Portage, new Portage db API and many other fixes. + Unmerging now works again (bug introduced several releases ago.) I + originally wanted to hold off on releasing 2.0, but since several major bugs + are fixed, we need to get these fixes out to our users ASAP. We will be + releasing 2.1 in about a week which should include additional refinements. + + 16 Jun 2002; Daniel Robbins repoman: New repoman + commit/check QA tool for developers. + + 10 Jun 2002; Dan Armak make.conf: Update the ibiblio + mirror path; it is now www.ibiblio.org/pub/Linux/distributions/gentoo. + + 10 Jun 2002; Martin Schlemmer ebuild.sh : Some users have + $TMPDIR to a custom dir in their home ...this will cause sandbox errors with + some ./configure scripts or libtool, so set it to $T. + + 10 Jun 2002; Martin Schlemmer portage.py : Merge in the + ld.so.preload changes. Also updated spawn() to only run sandbox if + buildphase is one of clean, unpack, compile or install. This should fix the + handler not detecting some instances of sandbox running. Updated ebuildsh() + to set buildphase="" on spawn exit. + + 10 Jun 2002; Martin Schlemmer + portage.py.ldsopreload,testsandbox.sh : Add support to test if another + sandbox is running, if so dont delete /etc/ld.so.preload on kill. I did not + commit this to portage.py, as it is a bit more changes than we originally + though. + + 05 Jun 2002; Daniel Robbins portage.py: doebuild() now + has proper logic for digest generation. Digest will now get regenerated if + "ebuild digest" is run, even if "digest" is in FEATURES. + + 04 Jun 2002; Daniel Robbins emerge: fixed typo in + "inject" documentation. + + 02 Jun 2002; Martin Schlemmer bin/dosym: changed the + command used from "ln -sf" to "ln -snf" as it created a symlink in the target + directory if the linkname already existed (only if the target is a + directory). Im guessing this should be fixed in the python merged code if + symlinks are not unlinked before the new is merged into place .. will add a + bug later. + +*portage-1.9.14 (01 Jun 2002) + + 01 Jun 2002; Daniel Robbins portage.py: when a file to + be merged is identical to the one currently on disk (using the md5 test), we + now at least correctly update the target's mtime and atime so that cleaning + will work correctly. + + 27 May 2002; Daniel Robbins bin/do*: changed "return"s + to "exit 1". Closes bug #3078. + +*portage-1.9.13 (21 May 2002) + + 21 May 2002; Grant Goodyear emerge.1: Updated man page. + Thanks to carpaski@twobit.net. + + 20 May 2002; Daniel Robbins emerge: a fix for dep + regeneration; stale dep cache entries should now be properly regenerated. + +*portage-1.9.12 (16 May 2002) + + 16 May 2002; Daniel Robbins portage.py: the settings + for A and AA were swapped; this has now been fixed, closing bug #1634. + + 15 May 2002; Daniel Robbins portage.py: fixed up some + quirks in the new fetch code which were reported by Wout Mertens. Thanks + Wout! + +*portage-1.9.11 (13 May 2002) + + 13 May 2002; Daniel Robbins portage.py: addition of + third-party mirroring code. "mirror://sourceforge/foo.tar.gz" will use the + /usr/portage/profiles/thirdpartymirrors file to define the mirror it will + download from. Multiple mirrors for a single keyword can be specified on a + single line. This code was based on the good work of Ryan Phillips. + + 13 May 2002; Daniel Robbins portage.py: (entry on behalf + of jnelson) -- we now have new KV detection/setting code that uses + /usr/src/linux/include/linux/version.h to determine the kernel version -- the + right way of doing things. KV is set to "" if the kernel is not available or + not configured. + + 13 May 2002; Daniel Robbins emerge: "abspath[x]" => + "abspath(x)" typo fix. Also added 2-liner to allow for "emerge unmerge" to + specify "foo/bar-1.0" rather than requiring "=foo/bar-1.0." Also fixed + problems when specifying the names of actual ebuilds in /var/db/pkg to + unmerge. + +*portage-1.9.9 (06 May 2002) ?? + + 08 May 2002; Daniel Robbins portage.py: An empty + USE_ORDER (due to an out-of-date /etc/make.globals) would cause USE to always + be empty. I added a reasonable default USE_ORDER if USE_ORDER is not found + in any of the config files, fixing this problem. + + 06 May 2002; Daniel Robbins emerge: post bug #1841 + cleanups; converted from .hasnode() to .dep_match() (correct) in + getworldlist(). + +*portage-1.9.8 (06 May 2002) + + 06 May 2002; Daniel Robbins emerge: 2 fixes that seemed + to get fried/zapped: bug #1841 and fixing an emerge sync error code to be + more understandable. + +*portage-1.9.7 (06 May 2002) + + 06 May 2002; Daniel Robbins portage.py, emerge: initial + bunch of robustness/error-handling fixes. Emerge should now report a + comprehensible error message for errors in DEPEND and RDEPEND rather than + giving a traceback. Fixed dep_depreduce() to catch errors rather than + passing them on to dep_bestmatch() (which doesn't check for errors and + assumes correct input) + + 02 May 2002; Daniel Robbins portage.py: typo fix for + S_ISFIFO call; thanks woodchip! + +*portage-1.9.6 (02 May 2002) + + 02 May 2002; Daniel Robbins make.conf: SYNC variable + correctly set to use our DNS round-robin system (rsync.gentoo.org). + +*portage-1.9.6_pre2 (01 May 2002) + + 01 May 2002; Daniel Robbins portage.py: config file + protection upgrade; we now record md5sums of previously-merged config protect + files in /var/cache/edb/config; we use this information to avoid merging + files that have been merged by us before (if it is safe to do so). This + doesn't solve the problem of rolling back to a previously-merged version of + a config file; we need to add cvs headers to every config file to get that + to work. + +*portage-1.9.6_pre1 (01 May 2002) + + 01 May 2002; Daniel Robbins emerge: added "inject" + capability to artificially satisfy a dep -- for situations when you don't + want Portage to do it for you because you've taken care of it already. + + 01 May 2002; Daniel Robbins portage.py, emerge: totally + rewrote emerge's unmerge code. The original code (added by Bevin) was a bit + too cryptic and "big" for my taste. Also added two new capabilities to + portage.py's vartree: .getslot() and .gettimeval(). getslot() returns the + slot value of a cat/pkg-v, if any, and gettimeval() returns a "time value" + (based on mtime/COUNTER value) that can be used to determine the order in + which packages got merged. The purpose of these improvements were to revamp + the existing Portage code that could only unmerge a db entry if there was a + corresponding ebuild file. This conflicted with the ability to "inject" + packages (see above), so it needed to be changed. Also fixed some bugs along + the way. + + 01 May 2002; Daniel Robbins ebuild.sh: einstall now + accepts arguments, closing bug #2275. Thanks seemant! :) + + 01 May 2002; Daniel Robbins make.globals: switch SYNC + var from cvs.gentoo.org to rsync.gentoo.org, and gentoo-x86-portage to + gentoo-portage. + + 30 Apr 2002; Daniel Robbins emerge: now checks for + errors (caused by bad deps) returned by create() and syscreate(). + +*portage-1.9.5 (29 Apr 2002) + + 29 Apr 2002; Daniel Robbins ebuild.sh: added jnelson's + KV_extract.awk script which extracts the kernel version from the actual + kernel sources Makefile, making our KV setting much more robust! Thanks Jon + :) + + 29 Apr 2002; Daniel Robbins emerge: correctly fixed + emerge search examples to use single quotes (to turn off globbing.) This + closes bug #1609. + + 29 Apr 2002; Daniel Robbins portage.py: virtual entries + for no-longer-installed packages now get automatically removed on unmerge. + This closes bug #2255 and #1891 (Thilo Bangert's comment on #1891 is also + fixed.) + +*portage-1.9.4 (29 Apr 2002) + + 29 Apr 2002; Daniel Robbins portage.py: Added support + for RESTRICT="nomirror". If "mirror" is defined in FEATURES and "nomirror" + is defined in RESTRICT, then files will not be fetched. + + 29 Apr 2002; Daniel Robbins emerge: Fixed docs for + "unmerge", added docs for "--oneshot". Closes bugs #2156 and #2182. + + 29 Apr 2002; Daniel Robbins ebuild.sh: Fix for USE + troubles; confirmed by Azarah as working :) Also, we now strip the path + from "KV" as we should. + +*portage-1.9.4_pre1 (26 Apr 2002) + + 26 Apr 2002; Daniel Robbins tarball.sh: no longer + necessary for VERSION to equal "@portage_version@" to get the version + auto-set. VERSION can now be set to anything and tarball.sh will get it + right. + + 26 Apr 2002; Daniel Robbins emerge: I've started work + on revamping/improving the "blocks" system to get ready to fix bug #1891. + Already fixed a bug where "blocks" ("!" deps) print out the wrong blocking + package name. This is now fixed. Blocks need additional testing. + + 26 Apr 2002; Daniel Robbins portage.py, ebuild.sh, use: + "use" is now a bash builtin function rather than an external python-based + command. This appears to fix the USE inconstencies, as it should, thereby + closing bug #2000. + +*portage-1.9.3 (24 Apr 2002) + + 24 Apr 2002; Jon Nelson : portage.py, chkcontents: + Emulate fchksum's md5 checksum routine. Closes bug #2787. + + 23 Apr 2002; Daniel Robbins : emerge: invalid + short options result in an exit. Closes bug #2025. + + 22 Apr 2002; Daniel Robbins : emerge: rsync zlib + compression enabled by default. + +*portage-1.9.2 (21 Apr 2002) + + 21 Apr 2002; Daniel Robbins : portage.py: signal + handler now zaps /etc/ld.so.preload if it's there -- this prevents it + from hanging around and causing sandbox badness. + + 21 Apr 2002; Daniel Robbins : emerge: fixed an + error where --emptytree mode wouldn't really have a fully empty tree, + due to the emptytree.inject() coming before the emptytree.root=None; + the inject() caused a recalc of the USE vars, which caused the tree + to become partially populated and it wasn't cleared. This closes bug + #1897. + + 21 Apr 2002; Daniel Robbins : portage.py: package + building now executes the "setup" stage along with the unpack, compile, + install stages so that global variables can be shared. This fixes an issue + with woodchip's new apache ebuild and closes bug #1813. + +*portage-1.9.1 (16 Apr 2002) + + 16 Apr 2002; Daniel Robbins : tiny (and forgotten) + quick fix. + +*portage-1.9.0 (16 Apr 2002) + + 16 Apr 2002; Daniel Robbins : portage.py: fetching + should now try *all* alternate download locations, closing bug #1544. + Yay! + + 15 Apr 2002; Daniel Robbins : emerge: "emerge R" now + works correctly, closing bug #1094. + + 15 Apr 2002; Daniel Robbins : ebuild.sh: *'s and ?'s in + DEPEND and SRC_URI syntax should no longer get glob-expanded to files in + /usr/portage. This fixes some cryptic bugs. It also closes bug #1473. + + 15 Apr 2002; Daniel Robbins : portage.py: emerge --debug + now works again. Closes bug #1437. + + 15 Apr 2002; Daniel Robbins : portage.py: moved argument + check to the beginning of the doebuild() function to prevent "ebuild + foo.ebuild fart" from causing the md5sums to be checked before recognizing + that "fart" is not a valid command. Closes bug #1823. + + 15 Apr 2002; Daniel Robbins : portage.py: 'USE="-foo" + emerge bar' should now work correctly and consistently. Fixes to the config + class. Closes bug #1455. + + 15 Apr 2002; Daniel Robbins : portage.py: applied + jnelson's patch to properly kill all children when interrupted with ^C + + 15 Apr 2002; Donny Davies : make.conf: added a + RESUMECOMMAND for lukemftp. + + 15 Apr 2002; Daniel Robbins : portage.py: fixed up some + "zing" logic inside the merge code (fixing variable being used before + assignment errors) + + 15 Apr 2002; Jon Nelson : src/sandbox/Makefile, + src/sandbox/problems/Makefile, src/sandbox/problems/sandbox_dev_fd_foo.c, + src/sandbox/sandbox.c: Cleaned up Makefiles somewhat to take advantage of GNU + Make, added '/dev/zero' and /dev/fd/' (<- note trailing slash) to the list of + items accessible safely from the sandbox. Added sandbox_dev_fd_foo.c to test + for /dev/fd/. The test is almost verbatim from the autoconf test suite. + + 13 Apr 2002; Martin Schlemmer : ebuild.sh: + Export $S and $D in dyn_compile and dyn_install, as our patched + version of libtool uses these to fixup .la files. + +*portage-1.8.19 (09 Apr 2002) + + 08 Apr 2002; Geert Bevin : emerge: Removed --all switch to + emerge unmerge and clea. Added emerge prune which is the same as old emerge + unmerge. Emerge unmerge removes all instances again without any proctedtion, + as before. Added reporting of Omitted versions due to dep selectors. + Renamed Removing and Keeping to Selected and Protected + + 08 Apr 2002; Geert Bevin : emerge, portage.py: Better + unmerge and clean reporting. Added homepage output to emerge --search. + Bugfix when specifying a package without category that doesn't exist. + +*portage-1.8.18 (07 Apr 2002) + + 07 Apr 2002; Geert Bevin : make.globals, emerge: + Simplified unmerge functionality. Deprecated the CLEANMODE var, + emerge clean now removes both revisions and slots automatically, + emerge unmerge now removes all versions and revisions by default. + Both understand world and system targets, and the --all option which doesn't + check which packages are old and outdated. + Documentation fixes. + AUTOCLEAN var addition and added the autoclean functionality. + +*portage-1.8.17 (05 Apr 2002) + + 05 Apr 2002; Daniel Robbins : portage.py: no longer + print out the counter number after a merge. This information should not + need to be known by end-users. + + 05 Apr 2002; Daniel Robbins : sandbox.c: patched to + allow access to /dev/vc from sandbox, allowing vim and screen to compile + correctly from console. + + 05 Apr 2002; Daniel Robbins : portage.py: fixed a bug + that prevented md5 digests from being compared on archives. + + 04 Apr 2002; Daniel Robbins : portage.py: Parse errors + in /etc/env.d files no longer cause a traceback. + +*portage-1.8.16 (04 Apr 2002) + + 04 Apr 2002; Geert Bevin portage.py, emerge : Forgot to + commit my changes, this is an assembled version of both drobbins's and my + changes + +*portage-1.8.15 (04 Apr 2002) + + 04 Apr 2002; Daniel Robbins portage.py: Fixed a + semi-long standing bug where I was comparing atimes rather than mtimes when + seeing if dep caches were stale. This fixes a bug originally reported by Dan + Armak. + +*portage-1.8.14 (04 Apr 2002) + + 04 Apr 2002; Geert Bevin emerge: + Fixed short options for --all, --safe and clean. + +*portage-1.8.13 (04 Apr 2002) + + 04 Apr 2002; Geert Bevin portage.py, emerge: + Added emerge --all clean and emerge --safe unmerge. + Made the counter updates atomic so that multiple merges can happen without + risking counter clashes. + Updated --help. + Fixed short options bug that prevented two seperate short options to be + specified successively. + +*portage-1.8.12 (04 Apr 2002) + + 04 Apr 2002; Geert Bevin portage.py, emerge: + implemented "emerge clean" with oldrevs, oldversions and oldslots options for + the make.conf/make.globals CLEANMODE variable. + + 03 Apr 2002; Daniel Robbins portage.py: Added an + indentation fix to prevent merge from dying if a file attempts to install + itself on top of an existing directory. Closes bug #1498. + +*portage-1.8.11.1 (03 Apr 2002) + + 03 Apr 2002; Geert Bevin portage.py: important fixes + for movefile() -- changed the order of ownership / permissions settings since + suid/guid bits were overwritten, added support back for 'ebuild config' since + it was accidentally left out + +*portage-1.8.11 (02 Apr 2002) + + 02 Apr 2002; Daniel Robbins portage.py: important fixes + for movefile() -- ownership now preserved across filesystems, mv -f fallback + for special files, other optimizations and robustness improvements. Important + fixes all-round. + + 02 Apr 2002; Geert Bevin emerge: + fixed bad indentation of a part of the code that made unmerging multiple + packages behave badly + +*portage-1.8.10 (01 Apr 2002) + + 01 Apr 2002; Daniel Robbins make.globals: removed USE + settings from make.globals. + + 01 Apr 2002; Daniel Robbins portage.py: In trying to fix + the glibc merge bug, we rewrote movefile() and it now runs blazingly fast. I + also tweaked the code to remove the need for an ">>> Updating mtimes..." + stage. This is all done dynamically now. *Much* faster. And hopefully + solid for glibc upgraders. + +*portage-1.8.9.4 (01 Apr 2002) + + 31 Mar 2002; Daniel Robbins portage.py: adapted + movefile() which should preserves timestamps and ownership on files and + symlinks it moves. + +*portage-1.8.9.3 (31 Mar 2002) + + 31 Mar 2002; Daniel Robbins portage.py: promising + rewrite of movefile() not only will probably fix glibc merge bug but also + speeds up merging at least 20x! Calling "mv" for every file really make + things super-slow! + +*portage-1.8.9.2 (31 Mar 2002) + + 31 Mar 2002; Daniel Robbins portage.py: desperate attempt + to fix movefile() bug... a hack really. glibc merges still dying. + +*portage-1.8.9.1 (31 Mar 2002) + + 31 Mar 2002; Daniel Robbins portage.py: it appears that + movefile() (using "/bin/mv") can still die if moving a new symlink on top of + an existing library symlink. Upon failure, we now use a fallback mechanism + to use "/bin/sln" to create the new symlink safely. + +*portage-1.8.9 (30 Mar 2002) + + 30 Mar 2002; Daniel Robbins portage.py: tiny cosmetic + fix for digest generation. + + 30 Mar 2002; Daniel Robbins emerge: entries in the + world profile will be ignored if at least one version of the package in + question isn't already merged. Prevents "--update world" from remerging + packages that have since been unmerged. + + 30 Mar 2002; Daniel Robbins various: changing all + references from /usr/bin/python to /usr/bin/python2.2. + + 30 Mar 2002; Daniel Robbins db-update.py: moving this + script here from FILESDIR. + + 30 Mar 2002; Daniel Robbins portage.py: stuff doesn't + get added to the world profile if it is already an essential ("*") package in + the system profile. Keeps things clean and flexible. + +*portage-1.8.9_pre38 (30 Mar 2002) + + 30 Mar 2002; Daniel Robbins portage.py: resolve_key() + didn't call load() on mapped virtuals, resulting in inconsistent resolution + of virtual keys. Now fixed; thanks to woodchip for the bug report. + +*portage-1.8.9_pre37 (30 Mar 2002) + + 30 Mar 2002; Daniel Robbins portage.py: specific + provides (dev-lang/python-2.2) will be converted to their generic form + (dev-lang/python) before being recorded. + +*portage-1.8.9_pre36 (30 Mar 2002) + + 30 Mar 2002; Daniel Robbins portage.py, emerge: new + virtuals fixes and a db-upgrade.py script in the ebuild to solve another + virtuals problem. + +*portage-1.8.9_pre35 (29 Mar 2002) + + 29 Mar 2002; Daniel Robbins portage.py, emerge: digest + generation fixes; emerge --update will now update dependents even if the main + package hasn't been updated. getdict() fix, fixing a traceback. + +*portage-1.8.9_pre34 (28 Mar 2002) + + 28 Mar 2002; Daniel Robbins portage.py: Added an indent + fix for the new virtuals code, eliminating a traceback. Tweaked digest handling, + fixing a cosmetic error. + +*portage-1.8.9_pre33 (28 Mar 2002) + + 28 Mar 2002; Daniel Robbins portage.py: tweaked digest + creation in doebuild() to hopefully avoid creating digests twice. I hope I + didn't break anything in the process. + + 28 Mar 2002: Daniel Robbins portage.py, emerge: "emerge + update" is now "emerge --update"; "world" added back. New world + implementation that works like this ... if you type "emerge media-gfx/gimp", + media-gfx/gimp will be added to the "world" favorites file in + /var/cache/edb/world. This world file is added to the system profile in + order to create the set of "world" packages to merge. You can manually put + specific deps (for pinning) in /var/cache/edb/world and they won't get + overwritten. To prevent a package that you specify on the emerge + command-line from being added to the world profile, use the "--oneshot" + option, which tells emerge that it should be merged once but not updated. + + 28 Mar 2002: Daniel Robbins portage.py: New virtuals + implementation; new virtual info is recorded in /var/cache/edb/virtuals; + virtuals data is created by merging the profile virtual info with the new + edb/virtuals file. Note: We no longer add virtual package entries to + /var/db/pkg. This change solves the bug where virtual files get auto-updated + by pkg-update, and also solves the bug where doing an "emerge --update world" + will cause ssmtp to be merged in order to satisfy the virtual/mta dep (which + you already have satisfied by postfix, for example). Now, postfix will be + updated if necessary, but that's it. :) + +*portage-1.8.9_pre32 (22 Mar 2002) + + 22 Mar 2002; Daniel Robbins portage.py: fixed a bug + related to scanning for available binary packages, which would cause emerge + to die. + + 21 Mar 2002; Dan Armak portage.py: added ECLASSDIR + (=$PORTDIR/eclass) to settings exported by python side to bash side. + ebuild.sh: remove ECLASSDIR setting to use the one now provided by + portage.py. Also, clean inherit() and make it use debug-print(). + +*portage-1.8.9_pre31 (21 Mar 2002) + + 21 Mar 2002; Daniel Robbins ebuild.sh: Added Dan + Armak's patch to enable eclasses. :) + + 21 Mar 2002; Grant Goodyear portage.py: + Added a drobbins patch to at line 469. Should fix emerge rsync + problem when /etc/make.profile doesn't exist. + +*portage-1.8.9_pre30 (20 Mar 2002) + + 20 Mar 2002; Daniel Robbins portage.py, emerge: emerge + --emptytree now works again and I added a new --nodeps option to emerge as + well. + +*portage-1.8.9_pre29 (20 Mar 2002) + + 20 Mar 2002; Daniel Robbins portage.py: CONTENTS files + now record the correct path when ROOT!="/". + +*portage-1.8.9_pre28 (20 Mar 2002) + + 20 Mar 2002; Daniel Robbins portage.py, emerge: an + /etc/make.profile dir is now optional and portage will work if it's missing + or is a broken symlink. + + 20 Mar 2002; Daniel Robbins portage.py: fix load() + method in packagetree() class. + +*portage-1.8.9_pre27 (19 Mar 2002) + + 19 Mar 2002; Daniel Robbins portage.py: + /etc/make.profile/packages wasn't correctly masking core system packages; + fixed. + +*portage-1.8.9_pre26 (18 Mar 2002) + + 18 Mar 2002; Daniel Robbins portage.py: configuration + settings don't get loaded from ${ROOT}/etc anymore, just /etc. This + simplifies the creation of a new build image. + + 18 Mar 2002; Daniel Robbins portage.py: Don't expect a + digest file if SRC_URI is set to "" or undefined. + + 18 Mar 2002; Daniel Robbins : RDEPEND was getting set + to DEPEND even if there was an RDEPEND="" in the ebuild. This has now been + fixed and RDEPEND will only get to DEPEND if RDEPEND has unset (not "unset + or null", as it was before this fix.) + + 18 Mar 2002; Daniel Robbins : emerge: circular + dependencies error will result in the digraph dependencies being printed to + stdout, greatly simplifying debugging. + + 18 Mar 2002; Geert Bevin : src/sandbox/problems: Added + several sample implementations to reproduce reported bugs. + + 18 Mar 2002; Geert Bevin : libsandbox.c: All paths are now + checked for multiple successive slashes anywhere, this closes bug 827. + Performance should be slightly improved for other apps on the system for who + the sandbox is not turned on. + + 14 Mar 2002; Daniel Robbins : output.py: quick fix to + turn off white color output -- not good for terminals with white background. + This closes bug #1135. + + 11 Mar 2002; Daniel Robbins : Applied karltk's version + information patch. Portage.py now contains version information, and this + info is reported by "emerge --version". Thanks Karl! :) + +*portage-1.8.9_pre25 (11 Mar 2002) + + 10 Mar 2002; Daniel Robbins portage.py, emerge: roll + back portagetree incremental db optimizations to fix an important bug (no + package.mask calculations being done.) Emerge will now abort if a dependency + can't be satisfied rather than printing just a warning. + +*portage-1.8.9_pre24 (09 Mar 2002) + + 09 Mar 2002; Daniel Robbins emerge: fixed missing + "--clean" option so "--clean rsync" should work again. Also converted emerge + to work with our new db layout (db objects are in the portage module now). + + 09 Mar 2002; Daniel Robbins portage.py: Added USE + ordering, a concept envisioned by Vitaly Kushneriuk. The idea is to allow + customization of how Portage resolves USE variables. The default is + "env:conf:auto:defaults" (set in the USE_ORDER variable -- this default is + now in make.globals but as always you should set your custom USE_ORDER in + make.conf if desired.) So, my default, USE settings will be calculated as + follows. The USE variables will be grabbed from the + /etc/make.profile/make.defaults file (this is "defaults".) Then, the + /etc/make.profile/use.defaults file will be consulted. This file lists (one + per line) a USE variable and a corresponding dependency. If the dependency + is satisfied, the USE variable is auto-enabled and added to our working list + (this is "auto"). Then /etc/make.conf is consulted, so that the user has the + option of force-enabling (with USE="foo") or force-disabling (with + USE="-foo") any USE variables as desired (this is "conf".) Then, the + environment is consulted, allowing easy modifications from the command-line + (this is "env"). Also added is the ability for USE settings to be + dynamically regenerated in an efficient way as packages are merged. So, + right after xfree is emerged, the "X" use variable can be immediately + auto-enabled. Thanks to Vitaly for providing the vision for this. + +*portage-1.8.9_pre23 (08 Mar 2002) + + 09 Mar 2002; Daniel Robbins portage.py: our portage + tree and /var/db/pkg tree now uses incremental caching rather than doing + an exhaustive scan on startup. This should speed up this respective code + by 2-30x depending on how many packages you're emerging. This involved + quite a few changes to the code, and there could be some bugs, although I + tried to be very careful. These changes could also break code that access + internal .tree[] dictionaries directly. + + 08 Mar 2002; Daniel Robbins portage.py: SRC_URIs with + USE-enabled ( ) clauses in them weren't working because I was iterating + through multi-level lists without flatten()ing them. Now fixed. + + 07 Mar 2002; Daniel Robbins portage.py: We no longer + depend upon a file being unmerged. We try to unlink during unmerge() in a + "try" clause, with an exception for OSError. If the directory is immutable + then Portage continues gracefully. This closes a bug reported by Verwilst -- + unmerging an old baselayout would die when it tried to delete /dev/shm. + Fixed in Portage to eliminate these kinds of problems in the future. + +*portage-1.8.9_pre22 (07 Mar 2002) + + 07 Mar 2002; Daniel Robbins portage.py: I had + sys.exit() in doebuild()'s fetch section. Converted to "return 1" and + "return 0" to be emerge --fetchonly friendly. Thanks to Dan Armak for the + bug report. + +*portage-1.8.9_pre21 (07 Mar 2002) + + 07 Mar 2002; Daniel Robbins portage.py: fixed symlink + merge bug related to "safe" emerges. This should fix problems of Portage + dying when merging certain things. I'm hoping that this fix will give us a + solid merge implementation. It should. Thanks to Bart Verwilst for tracking + down a merge problem that I could reproduce. + +*portage-1.8.9_pre20 (06 Mar 2002) + + 06 Mar 2002; Daniel Robbins ebuild.sh, others: users + can now forcefully disable stripping of their ebuild binaries by adding a + RESTRICT="nostrip" to their ebuild. Additionally, the DEBUG variable has + been renamed to DEBUGBUILD to prevent namespace collisions. This closes bug + #868. + + 06 Mar 2002; Daniel Robbins portage.py : Fixed a + long-standing bug where the pkg_preinst() and pkg_postinst() functions being + called came from the existing package ebuild in /var/db/pkg rather than the + new ebuild being merged. pkg_prerm() and pkg_postrm() still use the ebuild + in /var/db/pkg, which is correct. Thanks to Dan Armak for tracking down this + bug. + +*portage-1.8.9_pre19 (05 Mar 2002) + + 05 Mar 2002; Daniel Robbins portage.py : Fixed two bugs + reported by Dan Armak relating to incomplete (not missing) message digests. + They should now get regenerated automatically is "digest" is in FEATURES and + not confuse the fetch code. + +*portage-1.8.9_pre18 (04 Mar 2002) + + 04 Mar 2002; Daniel Robbins portage.py : Bug fix in + dep_bestmatch(); rev comparison now works correctly and dep_bestmatch will + properly handle 2-digit revisions in particular. This closes bug #952. + + 04 Mar 2002; Daniel Robbins portage.py : Thanks to a + bug report by Bruce Locke, the long-standing bug where symlinks with + different mtimes would still get unmerged is now fixed. This allows glibc + (of all things) to be unmerged safely. We needed this fix. Closes bug #964. + + 03 Mar 2002; Daniel Robbins portage.py : KDEDIR -> + KDEDIRS (fixing my typo) + +*portage-1.8.9_pre17 (27 Feb 2002) + + 27 Feb 2002; Daniel Robbins emerge : --help + documentation is now up-to-date; short options tweaked. + + 26 Feb 2002; Daniel Robbins portage.py : Fixed an + unmerge error caused by digests now being recorded in lowercase. unmerge now + compensates for 100% backwards compatibility. Moved "continue" outside of + "try" block since this is disallowed in Python. This fixes a python warning + during fetch. + + 26 Feb 2002; Geert Bevin bin/dohtml : Added support for + installing .gif files too since quite some docs still ship with those instead + of .jpg or .png. + +*portage-1.8.9_pre16 (25 Feb 2002) + + 25 Feb 2002; Daniel Robbins emerge : emerge syntax + changed back to "classic" style; replaced dots with spinner, did a major code + cleanup and removed pieces that will be rewritten for 1.8.9 final. emerge + documentation isn't up-to-date at all; I'm holding off on the --help rewrite + until after 1.8.9 features have been finalized (soon!) + + 25 Feb 2002; Daniel Robbins : Added RESTRICT variable + to ebuilds. If RESTRICT="fetch" is set in the ebuild, it means that the + files listed in SRC_URI are simply filenames and that the real files must be + downloaded manually. This allows us to deal with realplayer, since + overriding dyn_fetch is no longer an option now that we have the fetch code + in python. Also added a cosmetic tweak to emerge during info file + regeneration. + + 25 Feb 2002; Daniel Robbins cnf/* : updated ${x} -> + ${URI} in $FETCHCOMMAND. + + 24 Feb 2002; Daniel Robbins Fixed another fetch bug + where the download wouldn't cycle to alternate mirrors (it'd get stuck on + the first download location) + +*portage-1.8.9_pre15 (24 Feb 2002) + + 24 Feb 2002; Daniel Robbins portage.py: some fixing of + the merge code; added automatic digest generation when "digest" is in + FEATURES; made the fetch() code not depend on a pre-existing digest. This + should fix all known digest/fetch issues. + +*portage-1.8.9_pre14 (23 Feb 2002) + + 23 Feb 2002; Daniel Robbins portage.py: If you have a + file that's hosted directly on our master ibiblio mirror, you can specify + it in SRC_URI as "http://mirror/myfile.tar.bz2". "http://mirror" will be + expanded to the first mirror defined in GENTOO_MIRRORS, or our master ibiblio + mirror if no mirrors are defined. Groovy. This closes bug #627. + + 23 Feb 2002; Daniel Robbins make.globals, emerge, + portage.py: wget is no longer hardcoded; FETCHCOMMAND is enabled again, but + uses ${FILE} and ${URI} instead of ${x} and ${y} now. Added download + resuming, which requires the definition of RESUMECOMMAND (added to + make.globals). Updated spawn() so that when it's called as spawn(foo,free=1) + as an argument, sandboxing is turned off. Replaced all calls to + os.system(foo) with spawn(foo,free=1), since os.system() messes with signal + handling. Added a default SIGINT signal handler to portage.py so that ^C + interrupts are handled correctly (portage will immediately exit with a return + code of 1). This has been tested and works for ebuild and emerge. These + additions should also close bug #407 and #760. + + 23 Feb 2002; Daniel Robbins emerge: spython -> python + fix; resolution of cvs merge conflict. Removed edepend assignment bug + reintroduced in Geert's commit; added comment explaining why the new code is + needed so it doesn't get removed again ;) + + 22 Feb 2002; Geert Bevin emerge: removed spurious cvs + conflict lines fixed bug in the cleanup code where different slots weren't + handled too well + +*portage-1.8.9_pre13 (22 Feb 2002) + + 22 Feb 2002; Daniel Robbins various: fix /bin/sh + symlink merge problems and massively simplified movefile() code. Added back + some emerge code so that "emerge --search rsync" doesn't run rsync. + +*portage 1.8.9_pre12 (22 Feb 2002) + + 22 Feb 2002; Daniel Robbins portage.py: everything + should now generate *lowercase* md5sums, fixing problems with digest + backwards compatibility. + + 22 Feb 2002; Daniel Robbins portage.py: changed + position of digest generation call so that "ebuild digest" now works if the + sources have not yet been downloaded. + +*portage 1.8.9_pre11 (22 Feb 2002) + + 22 Feb 2002; Daniel Robbins portage.py: unmerging now + works correctly. + +*portage 1.8.9_pre10 (22 Feb 2002) + + 22 Feb 2002; Daniel Robbins : "emerge" didn't like the + new portage.py (fixed); A merge database bug (fixed). Fixing the merge bug + should also result in merges happening much faster than before, maybe up to 3 + times as fast. We no longer resolve symlinks when testing protection paths. + +*portage 1.8.9_pre9 (21 Feb 2002) + + 21 Feb 2002; Daniel Robbins : moved entirety of Portage + download/digest code from ebuild.sh (bash) to portage.py (python). No + support for custom FETCHCOMMANDs yet, but that's coming soon. Good news is + that it appears to work well and allowed some cleanups and optimizations to + doebuild(). SYNC support added. See cnf/make.conf for more info -- + basically, "emerge rsync" (now callable via "emerge sync" as well) supports a + configurable "Portage server" that begins either with "rsync://" or "cvs://". + "emerge sync" is now not only a clean front-end, but a configurable front-end + to the Portage update process. I also removed dependency checking from + 'ebuild'. This allowed me to removed some redundant code from portage.py, + and seemed fine to do since 'ebuild' is more and more becoming a low-level + developer tool. + + 21 Feb 2002; Daniel Robbins : rewrite of cumulative USE + setting code so that the new FEATURES (what used to be called MAINTAINER) is + now cumulative and supports "-" and "-*" options. FEATURES is expanded using + all config files, while USE ignores make.globals but uses everything else. + Optimization of a couple parts of doebuild(). Upgraded expandpath() and used + it in one place where it was removed accidentally (in the new merge code.) + Master category list is now stored externally in + ${PORTDIR}/profiles/categories for ease of maintenance. + + 21 Feb 2002; Daniel Robbins emerge: now supports the + EMERGE_OPTS make.conf variable for enabling emerge options by default. + Closes bug #605. + + 21 Feb 2002; Daniel Robbins portage.py: dep_match() now + works with * deps (again? Looks like the code got ripped out somehow); this + closes bug #490. + + 21 Feb 2002; Daniel Robbins global change from + "spython" -> "python", now that Portage is slick enough to update shared + libraries correctly. + + 21 Feb 2002; Grant Goodyear bin/chkcontents, + man/chkcontents.1: New script to compare what's in a package's CONTENTS file + with what's actually on the filesystem. Useful for discovering that a + package "collision" has occurred. + + 21 Feb 2002; Daniel Robbins ebuild.sh, portage.py: + Dependencies should be no longer checked during the "unpack" stage. This + closes bug #231. Added the $KV kernel version variable to ebuild.sh so that + it's available for all ebuilds. This closes bug #599. + + 21 Feb 2002; Daniel Robbins ebuild.sh: S now defaults + to ${WORKDIR}/${P} if it isn't defined. That's right. Defining S is now + optional :) This should eliminate around 1000 lines from our ports tree. + + 20 Feb 2002; Daniel Robbins portage.py: Fixed some + major bugs in the new merge/config protect code. Merging and config + protection should now work. + + 18 Feb 2002; Daniel Robbins portage.py, emerge, + ebuild.sh : Rewrote merge code. Should merge symlinks only *after* the + target has been merged (needs testing). Added lots of comments. Split + dblink.merge() into 2 new functions -- .walktree() and .mergeme(). + Cleaned/optimized merging a good deal. Added special "-*" USE variable to + unset *all* USE variables defined up until that point. + + 18 Feb 2002; Daniel Robbins portage.py, emerge, + ebuild.sh : Fixed USE bug (config.reset() threw away our cumulative USE), + streamlined turbo dep calculations by moving edb cache entry creation to + ebuild.sh. Started coding new dblink.merge() method that should be much + cleaner, faster and merge symlinks safely. + + 17 Feb 2002; Daniel Robbins portage.py : Added + cumulative USE variable support. The final USE var is calculated + cumulatively starting with make.profile, then make.conf, and then the + environment. Any "-foo" option in USE will turn off a previously-defined USE + setting. So, if you want to use the profile-default USE settings except turn + "X" off, you add 'USE="-X"' to /etc/make.conf and that's it. This greatly + simplifies USE variable maintenance since developers can now easily add new + USE variables that default to 'on'. Simply add the USE variable and then add + it to make.profile. It will then be included in everyone's USE variables + automatically unless they explicitly "-newvar" in /etc/make.conf or in the + local environment. This also enables easy one-shot disabling of USE + variables. For example, to merge xchat without GNOME support (when "gnome" + is in your /etc/make.conf USE variable), simply type "USE="-gnome" emerge + net-irc/xchat". This is a lot easier than temporarily tweaking + /etc/make.conf. + + 17 Feb 2002: Daniel Robbins emerge : Added a quick hack + to cache ebuild dependency info using extended attributes on XFS filesystems. + Gives a factor of 10 speedup for dependency calculations. Will look into a + generic caching solution that should offer similar performance increases on + all filesystems. Note: the fact that this hack is on CVS means that emerge + is currently in a hyper-experimental state and shouldn't be used right now. + + 16 Feb 2002; G.Bevin emerge : added support for 'emerge + cat/pkg-version' instead of always having to require 'emerge cat/pkg' + + 15 Feb 2002; G.Bevin emerge : reimplemented the display + of cleaned packages to clearly show all versions that are about to be removed + and which versions are going to stay + + 13 Feb 2002; D.Robbins emerge : + added --emptytree option + + 13 Feb 2002; G.Bevin emerge, portage.py : + fixed little bug where emerge --clean rsync wasn't correctly handled anymore + implemented all new functionalities of emerge --clean, this adds --slots, + --versions and --all options together with world and system modes + + 12 Feb 2002; G.Bevin emerge, portage.py : + changed emerge --zap to emerge --clean + removed parts of the already implemented slots functionality to be able to + fall back to a more flexible implementation. Binary compatible slots will now + mostly influence emerge during the --clean operation + + 12 Feb 2002; G.Bevin emerge : + added fallback check in case UNMERGE_DELAY hasn't been defined in + make.globals or make.conf + +*portage 1.8.9_pre8 (18 Feb 2002) + + 12 Feb 2002; G.Bevin emerge : + changed the rebuild code to use depgraph instead, dramatically reducing code + duplication + + 11 Feb 2002; G.Bevin emerge : + changed indentation of a code part that wasn't at the right level. It got the + count of the non slot packages during --zap completely wrong + +*portage 1.8.9_pre7 (11 Feb 2002) + + 11 Feb 2002; G.Bevin portage.py : + fixed bug in packagetree.dep_match() where a ~ dependency is returned as a + string instead of as a list + + 11 Feb 2002; G.Bevin emerge : + - removed support for --all and world in 'emerge --unmerge', by default now + all matching packages are removed since with the new slots functionality + old package versions should not exists anymore + - colored package name red too when a blocking package is found during + pretend operation + - changed emerge invocation arguments to be in a new universal interface + format this has been decided to be : + 'emerge --action --option --option [packageset]' + some features however don't respect this, but that's since they are not + package installation related and are easier to use as straight commands + eg: emerge rsync + - added UNMERGE_DELAY var to make.globals and support it in emerge to obtain + the number of seconds to wait + - support for NOCOLOR="yes" as wel as NOCOLOR="true" + - major speedups for emerge -search + - added formatted package descriptions of the matches from emerge --search + that nicely wrap at 80 chars + - rewrote retrieval of package descriptions to support descriptions that are + specified on multiple lines + - added support for 'noslot' to --zap, --update and --rebuild + + 11 Feb 2002; G.Bevin sandbox.c, libsandbox.c : + added checks to see if the files where information is written to are really + regular files and not symlinks + +*portage 1.8.9_pre6 (10 Feb 2002) + + 10 Feb 2002; G.Bevin emerge : + added support for 'emerge --unmerge world' which removes all old package + versions from the system + made 'emerge --unmerge' take binary compatibility slots into account, this + prevents that packages with different versions but also different slots, are + being unmerged + added support for "--verbose" in "emerge rebuild" and "emerge world" to + provide details about packages that aren't in the local tree anymore and to + notify the user about which packages don't support slots + + 9 Feb 2002; G.Bevin emerge : + added support for the rebuild mode which rebuilds all the packages on your + system for which a corresponding package could be found in to portage tree + + 9 Feb 2002; G.Bevin portage.py : + renamed getEbuildPaths() or vartree to getebuildpaths() + fixed bug in the merging of binary packages + + 7 Feb 2002; G.Bevin xpack.py : + added additional argument to tbz2.getfile() which allows default content to + be provided when the requested file couldn't be found in the tbz2 archive + + 7 Feb 2002; G.Bevin ebuild.sh : + added SLOT information as the third entry in the temporary deps file that is + generated during ebuild depend, + + 7 Feb 2002; G.Bevin portage.py : + obtain SLOT information from the deps file instead of using the slotgrab() + function, removed slotgrab() function, updated some comments + + 7 Feb 2002; G.Bevin emerge : + added SLOT information to the generated edepend var for binary packages + +*portage 1.8.9_pre5 (6 Feb 2002) + + 6 Feb 2002; G.Bevin portage.py : + fixed bugs where the old instance wasn't unmerged correctly if slots are + identical, but ebuild version numbers not + + 6 Feb 2002; Grant Goodyear cnf/make.conf : + Copied proxy lines from make.globals (bug 431). + + 6 Feb 2002; Vitaly Kushneriuk portage.py : + added missing SLOT param to merge(...). + +*portage 1.8.9_pre4 (6 Feb 2002) + + 6 Feb 2002; G.Bevin portage.py : + fixed some bugs in the handling of PROVIDES and virtual packages together + with slots, they used code that wasn't upudated to the new dblink constructor + virtuals now use "" as slot, resulting in normally to same behaviour as what + has been done before. + + 5 Feb 2002; G.Bevin emerge : + sorted the packages to unmerge since this makes package names with revision + endings appear before plain version numbers. This makes the unmerge code + first remove the old and non slot aware packages before removing the newer + alternative which is in fact exactly the same apart from the revision + identifier. + +*portage 1.8.9_pre3 (5 Feb 2002) + + 5 Feb 2002; G.Bevin portage.py : + only let the backward compatibility algorithm kick in during unmerge since + it's impossible to correctly detect is in general. + +*portage 1.8.9_pre2 (5 Feb 2002) + + 5 Feb 2002; G.Bevin portage.py : + fixed bug in the backward compatibility algorithm + +*portage 1.8.9_pre1 (5 Feb 2002) + + 4 Feb 2002; G.Bevin ebuild.sh, emerge, portage.py : + added binary compatibility slots, this also contains additional code to keep + the unmerging of packages backwards compatible. + + 4 Feb 2002; G.Bevin portage.py : + added back support for the "ebuild help" command which seems to have + disappeared somewhere along the updates + + 4 Feb 2002; G.Bevin make.conf, make.globals : + added description and default entry for the imlib USE variable + added flag to prozilla to disable prozilla's waiting for a user's keypress + when a failure occurs + + 4 Feb 2002; G.Bevin output.py : + bugfix, write read() function instead of red(), doh ! + + 4 Feb 2002; G.Bevin emerge, portage.py : + implemented the ! dependency which prevents incompatible packages to be + installed on the same system at the same time + + 4 Feb 2002; G.Bevin emerge : + most emerge invocation options now have alternative short flags + + 4 Feb 2002; G.Bevin emerge : + emerge now doesn't unmerge the last version of an installed version by + default anymore, to really remove all instanced of packages the --all flag + has to be used, the --safe flag is deprecated + + 3 Feb 2002; G.Bevin output.py, emerge,make.globals : + all output can now be turned to black and white by using the functions in + output.py, this determines the mode by checking to NOCOLOR variable in + make.conf or make.globals + + 3 Feb 2002; G.Bevin emerge : + made it possible to run emerge --help and --search as non root + +*portage 1.8.8-r1 (1 Feb 2002) + + 1 Feb 2002; G.Bevin portage.py, ebuild.sh, ebuild.5 : + added support for a pkg_setup() function which is executed before anything + else and can be typically used for package configuration actions or required + system checks + + 1 Feb 2002; G.Bevin portage.py : + implemented the noauto MAINTAINER flags for all relevant ebuild commands + + 1 Feb 2002; G.Bevin portage.py : + make env-update disregard backup files + + 1 Feb 2002; G.Bevin emerge : + added --pretend support instead of interactively asking to proceed, + also added a delay before unmerging though to be sure + +*portage 1.8.8 (1 Feb 2002) + + 1 Feb 2002; G.Bevin emerge : + added --safe switch to complement the --unmerge option + + 1 Feb 2002; G.Bevin portage.py : + rewrote the packagename without category support to also graceously handle + deps specifiers at the beginning, this shouldn't be used in the ebuilds, but + are very handy when using emerge --unmerge + + 1 Feb 2002; G.Bevin emerge : + added emerge --unmerge support + + 1 Feb 2002; G.Bevin portage.py : + added packagename without category support in the dep_match function + +*portage 1.8.7 (30 Jan 2002) + + 30 Jan 2002; G.Bevin portage.py : + integrated and slightly adapted Brent Rahn's code to support package names + without category + + 30 Jan 2002; G.Bevin ebuild.sh : + integrated and fixed Azarah's patch to fix the wrongly generated archive size + in the digests + +*portage 1.8.6-r3 (28 Jan 2002) + + 28 Jan 2002; G.Bevin portage.py : + disabled warnings about non existant config file paths + + 28 Jan 2002; G.Bevin emerge : + added verwilst pkgsearch code, which was turned into a seperate class and + refactored for clarity and execution speed + + 28 Jan 2002; G.Bevin portage.py : + renamed _xxx vars to _prepart in Vitaly's code addition + +*portage 1.8.6-r2 (27 Jan 2002) + + 24 Jan 2002; Vitaly Kushneriuk portage.py : + Fixed version compare code Also added test script to test future versions. + +*portage 1.8.6-r1 (24 Jan 2002) + + 24 Jan 2002; Karl Trygve Kalleberg dojar: + Fixed typos. + +*portage 1.8.6 (23 Jan 2002) + + 22 Jan 2002; G.Bevin libsandbox.c : + added an additional check for SANDBOX_ON to optimize the speed in the execvp + function call. Also removed error messages being printed when the PATH var + isn't set. + + 20 Jan 2002; Karl Trygve Kalleberg dojar : + added dojar shell command as a java JAR handler + + 17 Jan 2002; Daniel Robbins : + The package chosen by "emerge sys-apps/shadow" now matches that chosen in an + emerge update or emerge system. I forgot to add some "*" dep code to the + dep_nomatch() method; this is now fixed. + +*portage 1.8.5 (13 Jan 2002) + + 13 Jan 2002; G.Bevin ebuilds.sh, portage.py: + added fine grained maintainer settings + +*portage 1.8.4 (13 Jan 2002) + + 12 Jan 2002; Daniel Robbins : + "emerge sys-apps/bash/" now works. (trailing "/" stripped to make + tab-completion users happy) This fixes bug #119 + + 12 Jan 2002; Daniel Robbins : + Portage should no longer bomb out if the current working directory doesn't + exist (has been deleted from underneath). + + 12 Jan 2002; Daniel Robbins : + added "--world" option for "emerge update". This tells Portage to update + the base system *as well as* upgrade any packages that are currently + installed but have new versions available. This is your standard full system + update command. This fixes bug #122 + + 12 Jan 2002; Daniel Robbins : + Added an expandpath() cache which speeds up merging dramatically. + +*portage 1.8.3 (11 Jan 2002) + + 11 Jan 2002; Mikael Hallendal ebuild.sh: + added functions econf and einstall. Also made src_compile having a default + implementation. + +*portage 1.8.2 (07 Jan 2002) + + 07 Jan 2002; G.Bevin : + sandbox included in portage + +*portage 1.8.1 (30 Dec 2001) + + 29 Dec 2001; Daniel Robbins : + "emerge update" is now functional! Although the algorithm really should be + sound, it is still considered in testing since we may need to tweak some + dependencies. + + 27 Dec 2001; Daniel Robbins : + Removed objprelink from the default USE variable. + +*portage 1.8.0 (22 Dec 2001) + + 22 Dec 2001; Daniel Robbins : + I messed up the "transparent .so library" update. Included is the correct + fix, which seems to allow glibc to update on my system without any tricks. + I just merged a new glibc while in X, without using any of glibc's old + pkg_postinst/pkg_preinst hacks. + + 21 Dec 2001; Daniel Robbins make.defaults.5, make.conf.5 : + Moved make.defaults.5 to make.conf.5 and updated contents. + +*portage 1.7.8 (21 Dec 2001) + + 21 Dec 2001; Daniel Robbins portage.py : + ebuild install doesn't throw away the compile directory if ebuild has been + changed and MAINTAINER is set; we now use mv -f to move files into location + on the filesystem, making our library install method even more robust. It + should now be totally safe to upgrade glibc while in X and playing music + with xmms and surfing the Web and compiling 20 applications at once :) + +* portage 1.7.7 (14 Dec 2001) + + 14 Dec 2001; Aron Griffis : portage.py : + movefile() now unlink()s the destination file first which solves shared + library install problems. + +* portage 1.7.6 (13 Dec 2001) + + 10 Dec 2001; Daniel Robbins portage.py : + env_update() now generates an /etc/csh.env file in csh shell format. + +* portage 1.7.5 (13 Dec 2001) + + 10 Dec 2001; Daniel Robbins portage.py : + added a little fix so a ~ dep isn't satisfied by a *much* later installed + version; i.e. ~media-libs/freetype-1.3.1 satisfied by + media-libs/freetype-2.0.5 being installed. + + 30 Nov 2001; Daniel Robbins ebuild : + added a KeyboardInterrupt handler so ^C'ing a running ebuild process doesn't + produce a Python traceback. + +* portage 1.7.4 (29 Nov 2001) + + 29 Nov 2001; Daniel Robbins portage.py : + removed an unnecessary quirk in the code preventing virtual packages from + being in any other category but "virtual". + + 25 Nov 2001; Daniel Robbins emerge : + info file detection code has been improved. + +* portage 1.7.3 (20 Nov 2001) + + 20 Nov 2001; Daniel Robbins pdb, pdb.cgi, xpak : + used /usr/bin/python instead of /usr/bin/spython. Fixed. + +* portage 1.7.2 (13 Nov 2001) + + 13 Nov 2001; Aron Griffis : + emake will now try to build in parallel, and if it fails, will retry in + non-parallel mode. + + 13 Nov 2001; Daniel Robbins ebuild.sh : + an ebuild that used an archive with a name that was part of another archive + would cause Portage to mess up the digest check. No longer. + + 31 Oct 2001; Donny Davies make.conf, make.globals : + comments about merging the fetch programs before trying to use them. + +* portage 1.7.1 (30 Oct 2001) + + 30 Oct 2001; Daniel Robbins portage.py : + I accidentally broke "=" deps by being sloppy when I added "*" deps. Trivial + fix applied. + +* portage 1.7 (29 Oct 2001) + + 29 Oct 2001; Daniel Robbins portage.py : + strange typo fix in the empty() digraph method. + +* portage 1.6.12 (29 Oct 2001) + + 29 Oct 2001; Daniel Robbins portage.py : + "*" deps now implemented. "=sys/foo-1*" matches the latest 1.x version/rev of + sys/foo, but will not match a 2.x version. + + 26 Oct 2001; Daniel Robbins portage.py : + various new categories added. + +Portage 1.6.11, released 18 Oct 2001 +==================================== + + *portage.py; device nodes are now not unmerged at all. + + +Portage 1.6.10, released 18 Oct 2001 +=================================== + + *ebuild.sh: A and AA fix; now any A="foo" lines in the ebuild are ignored, + allowing ebuilds with them to continue working. + + *portage.py: remove gnome-apps, gnome-office, gnome-libs, add gnome-extra + categories. + + *ebuild.sh, portage.py: You can now use USE variables in SRC_URI to + conditionally include archives. In MAINTAINER mode, all archives are + automatically included so that maintainers can check SRC_URIs and also + generate complete digests. A new file-based DEPEND and RDEPEND-passing + mechanism has been added. + + *ebuild.sh Now adds filesize to the digest files + +Portage 1.6.9, released 15 Sep 2001 +=================================== + + *portage.py + unmerge() now does not touch device nodes. Unlinking them or touching them + in any way is bad practice. + + +Portage 1.6.8, released 12 Sep 2001 +=================================== + + *portage.py + movefile() will now unlink() destfile if it is a symlink. Should fix + problems where file gets created at symlink target rather than replacing + the symlink. + + *queryhost.sh (agriffis) + Parallel pinging and other fixes. + +Portage 1.6.7, released 05 Sep 2001 +=================================== + + *portage.py + (last-minute fix) + CONFIG_PROTECT unmerge protection is now observed for symlinks, fifos and + device nodes. + + *portage.py + Fixes for unmerging CONFIG_PROTECTed files. Protected files are now *not* + unlinked from the filesystem. Messier but safer, and simplifies package + upgrades. + + *emerge + Emerge output cleanups for GNU info directory generation. New --verbose + mode; new CONFIG_PROTECT scanning feature to let people know when there are + config files to be updated. New "--help config" docs to explain how to + do it. + +Portage 1.6.6, released 01 Sep 2001 +==================================== + + *portage.py + Upgraded directory merging over existing objects. Existing symlinks that + point to existing directories will be kept and used as is; directories will + be used as-is; any other objects (broken symlinks, files) will be copied + to origfilename.backup and a ne directory will be created in its place. + +Portage 1.6.5, released 31 Aug 2001 +==================================== + + *emerge + Fixes for handling multiple ebuilds, packages and/or dependencies on + the command-line. + + *portage.py + An optimization to the digraph class so that the firstzero() method finds + matches in close to the order that keys were added to the digraph. diff --git a/TODO b/TODO new file mode 100644 index 000000000..fd8cfcc81 --- /dev/null +++ b/TODO @@ -0,0 +1,60 @@ +# TODO list for Portage; the Gentoo Linux package system +# $Id: TODO,v 1.11 2004/09/09 08:02:53 carpaski Exp $ + +# +# Add your name to the top of any item you are working actively on +# and then commit. Be sure you have a current copy of this file. +# + +Legend: + '*' Just do it. '#' Tricky + '!' Difficult '@' Restricted in some way + + File "/usr/lib/portage/pym/portage_locks.py", line 46, in lockfile + myfd = os.open(lockfilename, os.O_CREAT|os.O_RDWR,0660) + OSError: [Errno 13] Permission denied: '/var/tmp/portage/tmpfs/aux_db_key_temp' + + + + +* Clean should only produce output for 'emerge clean' + +# Stop using mtimes for packages. Have portage look up all files in the + vardb to ensure that a file isn't duplicated and unmerge it if not. + Potentially slow... Need some way to speed it up... hash of filenames? + +# Virtuals. /var/cache/edb/virtuals -- Effectively remove it. + /etc/portage/virtuals is a user-modifiable version that acts like an + incremental applied on top of an ON-DEMAND virtual calculation system. + Virtuals should be calculated from /var/db/pkg EVERY time it is requested. + +# Repoman needs to ignore all user-set info in /etc/portage + It's not relevant to deployed users and will probably be a general gotcha. + +# Multiple rsync repos. + bug 28796 -- Enable metadata caches for them. + +# STICKIES and related enhancements: + bug 9379, bug 13616, Aether's config code + +# Determine file lock status before starting downloads -- Prevent races/deletes + Patches exist for this. Integrate and find all colliding descriptors/cmds. + Create a fileIO layer? (wget and other external calls are a problem) + +* Add category support to searches... emerge -s @catgory + +@ rsync - track changes based in subtrees to reduce filetree expense. + Possible plans: + Use md5's of tree file list + md5 of subtree -- client-side burden. + Maintain hash of changes on rsync1 -- Server-side burden. ** + Implement CVSUP. ** + +# 'emerge sync' timestamp awareness -- Make sure IP is associated and not + used at random as servers may differ. bug 21794 + +! Rename all undocumented variables used in bash to prefixed values that + are not easy to accidently duplicate. BUILDDIR --> PORTAGE_BUILDDIR or + something like that. Prevent ebuilds from clobbering system variables. + + + diff --git a/bin/archive-conf b/bin/archive-conf new file mode 100755 index 000000000..6e198f49f --- /dev/null +++ b/bin/archive-conf @@ -0,0 +1,101 @@ +#!/usr/bin/python +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-src/portage/bin/archive-conf,v 1.7 2004/10/04 13:57:36 vapier Exp $ + +# +# archive-conf -- save off a config file in the dispatch-conf archive dir +# +# Written by Wayne Davison with code snagged from +# Jeremy Wohl's dispatch-conf script and the portage chkcontents script. +# + +import os, sys, string +sys.path = ["/usr/lib/portage/pym"]+sys.path + +import portage, dispatch_conf + +FIND_EXTANT_CONTENTS = "find %s -name CONTENTS" + +MANDATORY_OPTS = [ 'archive-dir' ] + +try: + import fchksum + def perform_checksum(filename): return fchksum.fmd5t(filename) +except ImportError: + import md5 + def md5_to_hex(md5sum): + hexform = "" + for ix in xrange(len(md5sum)): + hexform = hexform + "%02x" % ord(md5sum[ix]) + return string.lower(hexform) + + def perform_checksum(filename): + f = open(filename, 'rb') + blocksize=32768 + data = f.read(blocksize) + size = 0L + sum = md5.new() + while data: + sum.update(data) + size = size + len(data) + data = f.read(blocksize) + return (md5_to_hex(sum.digest()),size) + +def archive_conf(): + args = [] + content_files = [] + md5_match_hash = {} + + options = dispatch_conf.read_config(MANDATORY_OPTS) + + for conf in sys.argv[1:]: + if not os.path.isabs(conf): + conf = os.path.abspath(conf) + args += [ conf ] + 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() + + # Search for the saved md5 checksum of all the specified config files + # and see if the current file is unmodified or not. + try: + todo_cnt = len(args) + for file in content_files: + file = file.rstrip() + try: + contents = open(file, "r") + except IOError, e: + print >> sys.stderr, 'archive-conf: Unable to open %s: %s' % (file, e) + sys.exit(1) + lines = contents.readlines() + for line in lines: + items = string.split(line) + if items[0] == 'obj': + for conf in args: + if items[1] == conf: + stored = string.lower(items[2]) + real = string.lower(perform_checksum(conf)[0]) + if stored == real: + md5_match_hash[conf] = conf + todo_cnt -= 1 + if todo_cnt == 0: + raise "Break" + except "Break": + pass + + for conf in args: + archive = os.path.join(options['archive-dir'], conf.lstrip('/')) + if options['use-rcs'] == 'yes': + dispatch_conf.rcs_archive(archive, conf, md5_match_hash[conf], '') + dispatch_conf.rcs_archive_post_process(archive) + else: + dispatch_conf.file_archive(archive, conf, md5_match_hash[conf], '') + dispatch_conf.file_archive_post_process(archive) + +# run +if len(sys.argv) > 1: + archive_conf() +else: + print >> sys.stderr, 'Usage: archive-conf /CONFIG/FILE [/CONFIG/FILE...]' diff --git a/bin/chkcontents b/bin/chkcontents new file mode 100755 index 000000000..eebf868cd --- /dev/null +++ b/bin/chkcontents @@ -0,0 +1,62 @@ +#!/usr/bin/python +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-src/portage/bin/chkcontents,v 1.11 2004/10/04 13:56:50 vapier Exp $ + +# Very simple program to compare the md5sums of a package as listed +# in VDB_PATH/category/package/CONTENTS with the md5sums of the +# actual programs on the system (and makes sure that symlinks point to +# the right files). + +import string, os.path, os, sys +sys.path = ["/usr/lib/portage/pym"]+sys.path +import portage + +def CONTENTScheck(path): + try: + contents = open(path, "r") + except IOError, e: + print "Unable to open %s: %s" % (path, e) + sys.exit(1) + lines = contents.readlines() + for line in lines: + items = string.split(line) + # items is a list w/ size depending on the type of item listed in item[0] + # if items[0] = 'dir' then items[1] is the path of a directory + # if items[0] = 'obj' then items[1] is the path of a file, + # items[2] is the file's md5sum, + # items[3] is the file's size + # if items[0] = 'sym' then items[1] is the path of a symbolic link, + # items[2] is '->' + # items[3] is the file the symlink should point to + # items[4] is the symlink mtime + if (items[0] == 'obj'): + md5stored = string.lower(items[2]) + # fchksum.fmdft(file) returns the file's md5sum and the file's size + md5real = string.lower(portage.perform_checksum(items[1])[0]) + if (md5stored != md5real): + if md5real: + print "%s has md5sum of %s instead of %s" % (items[1], md5real, md5stored) + else: + print "%s is missing!" % items[1] + elif (items[0] == 'sym'): + link = items[1] + target = items[3] + if (not os.path.islink(link)): + print "%s is not a symbolic link" % link + continue + actualtarget = os.readlink(link) + if (os.path.normpath(actualtarget) != os.path.normpath(target)): + print "%s points to %s, not %s" % (link, actualtarget, target) + + +if __name__ == '__main__': + import sys + if (len(sys.argv) != 2 or sys.argv[1] == "--help"): + print "This program compares md5sums in the file VDB_PATH/category/package/CONTENTS" + print "with the md5sums of the actual files on the filesystem" + print "(and makes sure that symlinks point to the right files)." + print "\nUsage: chkcontents path/to/CONTENTS" + sys.exit(1) + CONTENTScheck(sys.argv[1]) + diff --git a/bin/clean_locks b/bin/clean_locks new file mode 100755 index 000000000..aa6669c16 --- /dev/null +++ b/bin/clean_locks @@ -0,0 +1,36 @@ +#!/usr/bin/python -O +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-src/portage/bin/clean_locks,v 1.1 2004/09/26 10:44:31 carpaski Exp $ + +import os,sys +sys.path = ["/usr/lib/portage/pym"]+sys.path + +import portage_locks + +if not sys.argv[1:] or "--help" in sys.argv or "-h" in sys.argv: + print + print "You must specify directories with hardlink-locks to clean." + print "You may optionally specify --force, which will remove all" + 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.exit(1) + +force = False +if "--force" in sys.argv[1:]: + force=True + +for x in sys.argv[1:]: + if x == "--force": + continue + for y in portage_locks.hardlock_cleanup(x, remove_all_locks=force): + print y + print + + + + \ No newline at end of file diff --git a/bin/dispatch-conf b/bin/dispatch-conf new file mode 100755 index 000000000..2db6a329a --- /dev/null +++ b/bin/dispatch-conf @@ -0,0 +1,311 @@ +#!/usr/bin/python -O +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-src/portage/bin/dispatch-conf,v 1.7.2.10 2005/05/12 15:20:22 jstubbs Exp $ + +# +# dispatch-conf -- Integrate modified configs, post-emerge +# +# Jeremy Wohl (http://igmus.org) +# +# TODO +# dialog menus +# + +from stat import * +from random import * +import os, shutil, sys, string, re, commands, atexit +sys.path = ["/usr/lib/portage/pym"]+sys.path + +import portage, dispatch_conf + +FIND_EXTANT_CONFIGS = "find %s/ -iname '._cfg????_*' | sed -e 's://:/:g'" +DIFF_CONTENTS = 'diff -Nu %s %s' +DIFF_CVS_INTERP = 'diff -Nu %s %s | grep "^[+-][^+-]" | grep -v "# .Header:.*"' +DIFF_WSCOMMENTS = 'diff -Nu %s %s | grep "^[+-][^+-]" | grep -v "^[-+]#" | grep -v "^[-+][:space:]*$"' + +# We need a secure scratch dir and python does silly verbose errors on the use of tempnam +oldmask = os.umask(0077) +SCRATCH_DIR = None +while SCRATCH_DIR is None: + try: + mydir = "/tmp/dispatch-conf." + for x in range(0,8): + if int(random() * 3) == 0: + mydir += chr(int(65+random()*26.0)) + elif int(random() * 2) == 0: + mydir += chr(int(97+random()*26.0)) + else: + mydir += chr(int(48+random()*10.0)) + if os.path.exists(mydir): + continue + os.mkdir(mydir) + SCRATCH_DIR = mydir + except OSError, e: + if e.errno != 17: + raise +os.umask(oldmask) + +# Ensure the scratch dir is deleted +def cleanup(mydir=SCRATCH_DIR): + shutil.rmtree(SCRATCH_DIR) +atexit.register(cleanup) + +MANDATORY_OPTS = [ 'archive-dir', 'diff', 'replace-cvs', 'replace-wscomments', 'merge' ] + +class dispatch: + options = {} + + def grind (self, config_paths): + confs = [] + count = 0 + + + self.options = dispatch_conf.read_config(MANDATORY_OPTS) + + if self.options.has_key("log-file"): + if os.path.exists(self.options["log-file"]): + shutil.copyfile(self.options["log-file"], self.options["log-file"] + '.old') + os.remove(self.options["log-file"]) + else: + self.options["log-file"] = "/dev/null" + + # + # Build list of extant configs + # + + for path in config_paths.split (): + if not os.path.exists (path): + continue + + confs += self.massage (os.popen (FIND_EXTANT_CONFIGS % (path,)).readlines ()) + + if self.options['use-rcs'] == 'yes' and ((os.system( "which rcs >/dev/null 2>&1" ) == 256) + or (os.system( "which ci >/dev/null 2>&1" ) == 256) + or (os.system( "which co >/dev/null 2>&1" ) == 256) + or (os.system( "which rcsmerge >/dev/null 2>&1" ) == 256)): + print >> sys.stderr, 'dispatch-conf: Error finding all RCS utils and use-rcs=yes in config; fatal' + return False + + + # + # Remove new configs identical to current + # and + # Auto-replace configs a) whose differences are simply CVS interpolations, + # or b) whose differences are simply ws or comments, + # or c) in paths now unprotected by CONFIG_PROTECT_MASK, + # + + def f (conf): + mrgconf = re.sub(r'\._cfg', '._mrg', conf['new']) + archive = os.path.join(self.options['archive-dir'], conf['current'].lstrip('/')) + if self.options['use-rcs'] == 'yes': + mrgfail = dispatch_conf.rcs_archive(archive, conf['current'], conf['new'], mrgconf) + else: + mrgfail = dispatch_conf.file_archive(archive, conf['current'], conf['new'], mrgconf) + if os.path.exists(archive + '.dist'): + unmodified = len(commands.getoutput(DIFF_CONTENTS % (conf['current'], archive + '.dist'))) == 0 + else: + unmodified = 0 + if os.path.exists(mrgconf): + if mrgfail or len(commands.getoutput(DIFF_CONTENTS % (conf['new'], mrgconf))) == 0: + os.unlink(mrgconf) + newconf = conf['new'] + else: + newconf = mrgconf + else: + newconf = conf['new'] + + same_file = len(commands.getoutput (DIFF_CONTENTS % (conf ['current'], newconf))) == 0 + same_cvs = len(commands.getoutput (DIFF_CVS_INTERP % (conf ['current'], newconf))) == 0 + same_wsc = len(commands.getoutput (DIFF_WSCOMMENTS % (conf ['current'], newconf))) == 0 + + # Do options permit? + same_cvs = same_cvs and self.options['replace-cvs'] == 'yes' + same_wsc = same_wsc and self.options['replace-wscomments'] == 'yes' + unmodified = unmodified and self.options['replace-unmodified'] == 'yes' + + if same_file: + os.unlink (conf ['new']) + self.post_process(conf['current']) + if os.path.exists(mrgconf): + os.unlink(mrgconf) + return False + elif unmodified or same_cvs or same_wsc or conf ['dir'] in portage.settings ['CONFIG_PROTECT_MASK'].split (): + self.replace(newconf, conf['current']) + self.post_process(conf['current']) + if newconf == mrgconf: + os.unlink(conf['new']) + elif os.path.exists(mrgconf): + os.unlink(mrgconf) + return False + else: + return True + + confs = filter (f, confs) + + # + # Interactively process remaining + # + + for conf in confs: + count = count + 1 + + newconf = conf['new'] + mrgconf = re.sub(r'\._cfg', '._mrg', newconf) + if os.path.exists(mrgconf): + newconf = mrgconf + show_new_diff = 0 + + while 1: + if show_new_diff: + os.system((self.options['diff']) % (conf['new'], mrgconf)) + show_new_diff = 0 + else: + os.system((self.options['diff']) % (conf['current'], newconf)) + + print + print '>> (%i of %i) -- %s' % (count, len(confs), conf ['current']) + print '>> q quit, h help, n next, e edit-new, z zap-new, u use-new\n m merge, t toggle-merge, l look-merge: ', + + c = getch () + + if c == 'q': + sys.exit (0) + if c == 'h': + self.do_help () + continue + elif c == 't': + if newconf == mrgconf: + newconf = conf['new'] + elif os.path.exists(mrgconf): + newconf = mrgconf + continue + elif c == 'n': + break + elif c == 'm': + merged = SCRATCH_DIR+"/"+os.path.basename(conf['current']) + print + os.system (self.options['merge'] % (merged, conf ['current'], newconf)) + shutil.copyfile(merged, mrgconf) + os.remove(merged) + mystat = os.lstat(conf['new']) + os.chmod(mrgconf, mystat[ST_MODE]) + os.chown(mrgconf, mystat[ST_UID], mystat[ST_GID]) + newconf = mrgconf + continue + elif c == 'l': + show_new_diff = 1 + continue + elif c == 'e': + os.system(os.environ['EDITOR'] + ' ' + newconf) + continue + elif c == 'z': + os.unlink(conf['new']) + if os.path.exists(mrgconf): + os.unlink(mrgconf) + break + elif c == 'u': + self.replace(newconf, conf ['current']) + self.post_process(conf['current']) + if newconf == mrgconf: + os.unlink(conf['new']) + elif os.path.exists(mrgconf): + os.unlink(mrgconf) + break + else: + continue + + + def replace (self, newconf, curconf): + """Replace current config with the new/merged version. Also logs + the diff of what changed into the configured log file.""" + os.system((DIFF_CONTENTS % (curconf, newconf)) + '>>' + self.options["log-file"]) + try: + shutil.copyfile(newconf, curconf) + os.remove(newconf) + except (IOError, os.error), why: + print >> sys.stderr, 'dispatch-conf: Error renaming %s to %s: %s; fatal' % \ + (newconf, curconf, str(why)) + + + def post_process(self, curconf): + archive = os.path.join(self.options['archive-dir'], curconf.lstrip('/')) + if self.options['use-rcs'] == 'yes': + dispatch_conf.rcs_archive_post_process(archive) + else: + dispatch_conf.file_archive_post_process(archive) + + + 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). + + We keep ._cfg0002_conf over ._cfg0001_conf and ._cfg0000_conf. + """ + h = {} + + newconfigs.sort () + + for nconf in newconfigs: + nconf = nconf.rstrip () + conf = re.sub (r'\._cfg\d+_', '', nconf) + dir = re.match (r'^(.+)/', nconf).group (1) + + if h.has_key (conf): + mrgconf = re.sub(r'\._cfg', '._mrg', h[conf]['new']) + if os.path.exists(mrgconf): + os.unlink(mrgconf) + os.unlink(h[conf]['new']) + + h [conf] = { 'current' : conf, 'dir' : dir, 'new' : nconf } + + configs = h.values () + configs.sort (lambda a, b: cmp(a ['current'], b ['current'])) + + return configs + + + def do_help (self): + print; print + + print ' u -- update current config with new config and continue' + print ' z -- zap (delete) new config and continue' + print ' n -- skip to next config, leave all intact' + print ' e -- edit new config' + print ' m -- interactively merge current and new configs' + print ' l -- look at diff between pre-merged and merged configs' + print ' t -- toggle new config between merged and pre-merged state' + print ' h -- this screen' + print ' q -- quit' + + print; print 'press any key to return to diff...', + + getch () + + +def getch (): + # from ASPN - Danny Yoo + # + import sys, tty, termios + + fd = sys.stdin.fileno() + old_settings = termios.tcgetattr(fd) + try: + tty.setraw(sys.stdin.fileno()) + ch = sys.stdin.read(1) + finally: + termios.tcsetattr(fd, termios.TCSADRAIN, old_settings) + return ch + + +# run +d = dispatch () + +if len(sys.argv) > 1: + # for testing + d.grind (string.join (sys.argv [1:])) +else: + d.grind (portage.settings ['CONFIG_PROTECT']) diff --git a/bin/dobin b/bin/dobin new file mode 100755 index 000000000..4c070d95b --- /dev/null +++ b/bin/dobin @@ -0,0 +1,28 @@ +#!/bin/bash +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-src/portage/bin/dobin,v 1.13 2004/10/04 13:56:50 vapier Exp $ + +if [ ${#} -lt 1 ] ; then + echo "${0}: at least one argument needed" + exit 1 +fi + +if [ ! -d "${D}${DESTTREE}/bin" ] ; then + install -d "${D}${DESTTREE}/bin" || exit 2 +fi + +for x in "$@" ; do + if [ -x "${x}" ] ; then + #if executable, use existing perms + install "${x}" "${D}${DESTTREE}/bin" || exit 3 + else + #otherwise, use reasonable defaults + echo ">>> dobin: making ${x} executable..." + if [ "$USERLAND" == "GNU" ]; then + install -m0755 -o root -g root "${x}" "${D}${DESTTREE}/bin" || exit 4 + else + install -m0755 -o root -g wheel "${x}" "${D}${DESTTREE}/bin" || exit 4 + fi + fi +done diff --git a/bin/doconfd b/bin/doconfd new file mode 100755 index 000000000..73d5cedcf --- /dev/null +++ b/bin/doconfd @@ -0,0 +1,15 @@ +#!/bin/bash +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-src/portage/bin/doconfd,v 1.2.2.1 2005/01/13 04:51:56 vapier Exp $ + +if [ ${#} -lt 1 ] ; then + echo "doconfd: at least one argument needed" + exit 1 +fi + +tmp_INSDESTTREE="${INSDESTTREE}" +INSDESTTREE=/etc/conf.d/ +doins "$@" +INSDESTTREE="${tmp_INSDESTTREE}" +unset tmp_INSDESTTREE diff --git a/bin/dodir b/bin/dodir new file mode 100755 index 000000000..6df8f4031 --- /dev/null +++ b/bin/dodir @@ -0,0 +1,8 @@ +#!/bin/bash +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-src/portage/bin/dodir,v 1.5 2004/10/04 13:56:50 vapier Exp $ + +for x in "$@" ; do + install -d ${DIROPTIONS} "${D}${x}" +done diff --git a/bin/dodoc b/bin/dodoc new file mode 100755 index 000000000..a25aeddb9 --- /dev/null +++ b/bin/dodoc @@ -0,0 +1,23 @@ +#!/bin/bash +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-src/portage/bin/dodoc,v 1.6.2.2 2005/05/15 11:04:21 jstubbs Exp $ + +if [ $# -lt 1 ] ; then + echo "$0: at least one argument needed" 1>&2 + exit 1 +fi + +dir="${D}usr/share/doc/${PF}/${DOCDESTTREE}" +if [ ! -d "${dir}" ] ; then + install -d "${dir}" +fi + +for x in "$@" ; do + if [ -s "${x}" ] ; then + install -m0644 "${x}" "${dir}" + gzip -f -9 "${dir}/${x##*/}" + elif [ ! -e "${x}" ] ; then + echo "dodoc: ${x} does not exist" 1>&2 + fi +done diff --git a/bin/doenvd b/bin/doenvd new file mode 100755 index 000000000..8a794d7f6 --- /dev/null +++ b/bin/doenvd @@ -0,0 +1,15 @@ +#!/bin/bash +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-src/portage/bin/doenvd,v 1.2.2.1 2005/01/13 04:51:56 vapier Exp $ + +if [ ${#} -lt 1 ] ; then + echo "doenvd: at least one argument needed" + exit 1 +fi + +tmp_INSDESTTREE="${INSDESTTREE}" +INSDESTTREE=/etc/env.d/ +doins "$@" +INSDESTTREE="${tmp_INSDESTTREE}" +unset tmp_INSDESTTREE diff --git a/bin/doexe b/bin/doexe new file mode 100755 index 000000000..9c2f41093 --- /dev/null +++ b/bin/doexe @@ -0,0 +1,26 @@ +#!/bin/bash +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-src/portage/bin/doexe,v 1.10.2.1 2004/12/06 03:01:43 carpaski Exp $ + +mynum=${#} +if [ ${mynum} -lt 1 ] ; then + echo "doexe: at least one argument needed" + exit 1 +fi +if [ ! -d "${D}${EXEDESTTREE}" ] ; then + install -d "${D}${EXEDESTTREE}" +fi + +for x in "$@" ; do + if [ -L "${x}" ] ; then + cp "${x}" "${T}" + mysrc="${T}"/`/usr/bin/basename "${x}"` + elif [ -d "${x}" ] ; then + echo "doexe: warning, skipping directory ${x}" + continue + else + mysrc="${x}" + fi + install ${EXEOPTIONS} "${mysrc}" "${D}${EXEDESTTREE}" +done diff --git a/bin/dohard b/bin/dohard new file mode 100755 index 000000000..7313e2f24 --- /dev/null +++ b/bin/dohard @@ -0,0 +1,13 @@ +#!/bin/bash +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-src/portage/bin/dohard,v 1.6 2004/10/04 13:56:50 vapier Exp $ + +if [ ${#} -ne 2 ] ; then + echo "${0}: two arguments needed" + exit 1 +fi + +mysrc="${1}" +mydest="${2}" +ln -f "${D}${mysrc}" "${D}${mydest}" diff --git a/bin/dohtml b/bin/dohtml new file mode 100755 index 000000000..50e13924a --- /dev/null +++ b/bin/dohtml @@ -0,0 +1,159 @@ +#!/usr/bin/python +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-src/portage/bin/dohtml,v 1.14.2.1 2004/10/27 14:39:29 jstubbs Exp $ + +# +# Typical usage: +# dohtml -r docs/* +# - put all files and directories in docs into /usr/share/doc/${PF}/html +# dohtml foo.html +# - put foo.html into /usr/share/doc/${PF}/html +# +# +# Detailed usage: +# dohtml +# - will install the files in the list of files (space-separated list) into +# /usr/share/doc/${PF}/html, provided the file ends in .html, .png, .jpg +# or .css +# dohtml -r +# - will do as 'dohtml', but recurse into all directories, as long as the +# directory name is not CVS +# dohtml -A jpe,java [-r] +# - will do as 'dohtml' but add .jpe,.java (default filter list is +# added to your list) +# dohtml -a png,gif,html,htm [-r] +# - will do as 'dohtml' but filter on .png,.gif,.html,.htm (default filter +# list is ignored) +# dohtml -x CVS,SCCS,RCS -r +# - will do as 'dohtml -r', but ignore directories named CVS, SCCS, RCS +# + +import os +import string +import sys +import types + +def dodir(path): + os.system("install -d '%s'" % path) + +def dofile(src,dst): + + os.system("install -m0644 '%s' '%s'" % (src, dst)) + +def install(basename, dirname, options, prefix=""): + + fullpath = basename + if prefix: fullpath = prefix + "/" + fullpath + if dirname: fullpath = dirname + "/" + fullpath + + if options.DOCDESTTREE: + destdir = options.D + "usr/share/doc/" + options.PF + "/" + options.DOCDESTTREE + "/" + options.doc_prefix + "/" + prefix + else: + destdir = options.D + "usr/share/doc/" + options.PF + "/html/" + options.doc_prefix + "/" + prefix + + if os.path.isfile(fullpath): + ext = os.path.splitext(basename)[1] + if (len(ext) and ext[1:] in options.allowed_exts) or basename in options.allowed_files: + dodir(destdir) + dofile(fullpath, destdir + "/" + basename) + elif options.recurse and os.path.isdir(fullpath) and \ + basename not in options.disallowed_dirs: + for i in os.listdir(fullpath): + pfx = basename + if prefix: pfx = prefix + "/" + pfx + install(i, dirname, options, pfx) + +class OptionsClass: + def __init__(self): + self.PF = "" + self.D = "" + self.DOCDESTTREE = "" + + if os.environ.has_key("PF"): + self.PF = os.environ["PF"] + if os.environ.has_key("D"): + self.D = os.environ["D"] + if os.environ.has_key("DOCDESTTREE"): + self.DOCDESTTREE = os.environ["DOCDESTTREE"] + + self.allowed_exts = [ 'png', 'gif', 'html', 'htm', 'jpg', 'css', 'js' ] + self.allowed_files = [] + self.disallowed_dirs = [ 'CVS' ] + self.recurse = False + self.verbose = False + self.doc_prefix = "" + +def print_help(): + opts = OptionsClass() + + print "dohtml [-a .foo,.bar] [-A .foo,.bar] [-f foo,bar] [-x foo,bar]" + print " [-r] [-V] [file ...]" + print + print " -a Set the list of allowed to those that are specified." + print " Default:", string.join(opts.allowed_exts, ",") + print " -A Extend the list of allowed file types." + print " -f Set list of allowed extensionless file names." + print " -x Set directories to be excluded from recursion." + print " Default:", string.join(opts.disallowed_dirs, ",") + print " -r Install files and directories recursively." + print " -V Be verbose." + print + +def parse_args(): + options = OptionsClass() + args = [] + + x = 1 + while x < len(sys.argv): + arg = sys.argv[x] + if arg in ["-h","-r","-V"]: + if arg == "-h": + print_help() + sys.exit(0) + elif arg == "-r": + options.recurse = True + elif arg == "-V": + options.verbose = True + elif sys.argv[x] in ["-A","-a","-f","-x","-p"]: + x += 1 + if x == len(sys.argv): + print_help() + sys.exit(0) + elif arg == "-p": + options.doc_prefix = sys.argv[x] + else: + values = string.split(sys.argv[x], ",") + if arg == "-A": + options.allowed_exts.extend(values) + elif arg == "-a": + options.allowed_exts = values + elif arg == "-f": + options.allowed_files = values + elif arg == "-x": + options.disallowed_dirs = values + else: + args.append(sys.argv[x]) + x += 1 + + return (options, args) + +def main(): + + (options, args) = parse_args() + + if type(options.allowed_exts) == types.StringType: + options.allowed_exts = options.allowed_exts.split(",") + + if options.verbose: + print "Allowed extensions:", options.allowed_exts + print "Document prefix : '" + options.doc_prefix + "'" + print "Allowed files :", options.allowed_files + + for x in args: + basename = os.path.basename(x) + dirname = os.path.dirname(x) + install(basename, dirname, options) + +if __name__ == "__main__": + main() diff --git a/bin/doinfo b/bin/doinfo new file mode 100755 index 000000000..a8d7f4d7e --- /dev/null +++ b/bin/doinfo @@ -0,0 +1,21 @@ +#!/bin/bash +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-src/portage/bin/doinfo,v 1.7 2004/10/04 13:56:50 vapier 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" +fi + +for x in "$@" ; do + if [ -e "${x}" ] ; then + install -m0644 "${x}" "${D}usr/share/info" + gzip -f -9 "${D}usr/share/info/${x##*/}" + else + echo "doinfo: ${x} does not exist" + fi +done diff --git a/bin/doinitd b/bin/doinitd new file mode 100755 index 000000000..d4f725ab4 --- /dev/null +++ b/bin/doinitd @@ -0,0 +1,15 @@ +#!/bin/bash +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-src/portage/bin/doinitd,v 1.2.2.1 2005/01/13 04:51:56 vapier Exp $ + +if [ ${#} -lt 1 ] ; then + echo "doinitd: at least one argument needed" + exit 1 +fi + +tmp_EXEDESTTREE="${EXEDESTTREE}" +EXEDESTTREE=/etc/init.d/ +doexe "$@" +EXEDESTTREE="${tmp_EXEDESTTREE}" +unset tmp_EXEDESTTREE diff --git a/bin/doins b/bin/doins new file mode 100755 index 000000000..551905e93 --- /dev/null +++ b/bin/doins @@ -0,0 +1,53 @@ +#!/bin/bash +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-src/portage/bin/doins,v 1.7.2.2 2004/12/17 22:25:13 carpaski Exp $ + +if [ $# -lt 1 ] ; then + echo "${0}: at least one argument needed" + exit 1 +fi + +if [ "${1}" == "-r" ] ; then + DOINSRECUR=y + shift +else + DOINSRECUR=n +fi +[ -z "${INSDEPTH}" ] && declare -i INSDEPTH=0 +if [ ${INSDEPTH} -gt 30 ] ; then + echo "${0}: sanity check ... 30 directories is too much :(" + exit 1 +fi + +if [ "${INSDESTTREE%${D}*}" == "" ]; then + echo "-------------------------------------------------------" 1>&2 + echo "You should not use \${D} with helpers." 1>&2 + echo " --> ${INSDESTTREE}" 1>&2 + echo "-------------------------------------------------------" 1>&2 + #exit 1 +fi + +[ ! -d "${D}${INSDESTTREE}" ] && dodir "${INSDESTTREE}" + +for x in "$@" ; do + if [ -L "$x" ] ; then + cp "$x" "${T}" + mysrc="${T}/$(/usr/bin/basename "${x}")" + elif [ -d "$x" ] ; then + if [ "${DOINSRECUR}" == "n" ] ; then + continue + fi + + mydir="${INSDESTTREE}/$(basename "${x}")" + find "${x}" -mindepth 1 -maxdepth 1 -exec \ + env \ + INSDESTTREE="${mydir}" \ + INSDEPTH=$((INSDEPTH+1)) \ + doins -r {} \; + continue + else + mysrc="${x}" + fi + install ${INSOPTIONS} "${mysrc}" "${D}${INSDESTTREE}" +done diff --git a/bin/dojar b/bin/dojar new file mode 100755 index 000000000..77dadfee0 --- /dev/null +++ b/bin/dojar @@ -0,0 +1,54 @@ +#!/bin/sh +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-src/portage/bin/dojar,v 1.8 2004/10/04 13:56:50 vapier Exp $ +# Author Karl Trygve Kalleberg + +# +# Typical usage: +# dojar foo.jar bar.jar +# - installs foo.jar and bar.jar into /usr/share/${PN}/lib, and adds them +# both to /usr/share/${PN}/classpath.env +# +# Detailed usage +# dojar +# - installs into /usr/share/${PN}/lib and adds each to +# /usr/share/${PN}/classpath.env. +# +# The classpath.env file is currently merely a convenience for the user as +# it allows him to: +# export CLASSPATH=${CLASSPATH}:`cat /usr/share/foo/classpath.env` +# +# For many packages that set FOO_HOME, placing the jar files into +# lib will allow the user to set FOO_HOME=/usr/share/foo and have the +# scripts work as expected. +# +# Possibly a jarinto will be needed in the future. +# + +if [ -z "$JARDESTTREE" ] ; then + JARDESTTREE="lib" +fi + +jarroot="${DESTTREE}/share/${PN}/" +jardest="${DESTTREE}/share/${PN}/${JARDESTTREE}/" +pf="${D}${jarroot}/package.env" + +dodir "${jardest}" + +for i in $* ; do + bn="$(basename $i)" + + if [ -f "$pf" ] ; then + oldcp=`grep "CLASSPATH=" "$pf" | sed "s/CLASSPATH=//"` + grep -v "CLASSPATH=" "$pf" > "${pf}.new" + echo "CLASSPATH=${oldcp}:${jardest}${bn}" >> "${pf}.new" + mv "${pf}.new" "$pf" + else + echo "DESCRIPTION=\"${DESCRIPTION}\"" > "$pf" + echo "CLASSPATH=${jardest}${bn}" >> "$pf" + fi + + cp "$i" "${D}${jardest}/" + chmod 0444 "${D}${jardest}/${bn}" +done diff --git a/bin/dolib b/bin/dolib new file mode 100755 index 000000000..51b2327d3 --- /dev/null +++ b/bin/dolib @@ -0,0 +1,41 @@ +#!/bin/bash +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-src/portage/bin/dolib,v 1.8.2.2 2005/01/12 02:07:15 carpaski Exp $ + +LIBDIR_VAR="LIBDIR_${ABI}" +if [ -n "${ABI}" -a -n "${!LIBDIR_VAR}" ]; then + CONF_LIBDIR="${!LIBDIR_VAR}" +fi +unset LIBDIR_VAR + +if [ -z "${CONF_LIBDIR}" ]; then + # we need this to default to lib so that things dont break + CONF_LIBDIR="lib" +fi +libdir="${D}${DESTTREE}/${CONF_LIBDIR}" +for X in 1 2 3; do + # The escaping is weird. It will break if you escape the last one. + libdir="${libdir//\/\///}" +done + + +if [ ${#} -lt 1 ] ; then + echo "${0}: at least one argument needed" + exit 1 +fi +if [ ! -d "${libdir}" ] ; then + install -d "${libdir}" +fi + +for x in "$@" ; do + if [ -e "${x}" ] ; then + if [ ! -L "${x}" ] ; then + install ${LIBOPTIONS} "${x}" "${libdir}" + else + ln -s "$(readlink "${x}")" "${libdir}/${x}" + fi + else + echo "${0}: ${x} does not exist" + fi +done diff --git a/bin/dolib.a b/bin/dolib.a new file mode 100755 index 000000000..f7cced1c6 --- /dev/null +++ b/bin/dolib.a @@ -0,0 +1,7 @@ +#!/bin/bash +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-src/portage/bin/dolib.a,v 1.8 2004/10/10 10:07:20 carpaski Exp $ + +exec env LIBOPTIONS="-m0644" \ + dolib "$@" diff --git a/bin/dolib.so b/bin/dolib.so new file mode 100755 index 000000000..aa6df7db8 --- /dev/null +++ b/bin/dolib.so @@ -0,0 +1,7 @@ +#!/bin/bash +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-src/portage/bin/dolib.so,v 1.12 2004/10/10 10:07:20 carpaski Exp $ + +exec env LIBOPTIONS="-m0755" \ + dolib "$@" diff --git a/bin/doman b/bin/doman new file mode 100755 index 000000000..5c23ea0d2 --- /dev/null +++ b/bin/doman @@ -0,0 +1,52 @@ +#!/bin/bash +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-src/portage/bin/doman,v 1.13.2.2 2005/07/29 05:55:34 vapier Exp $ + +if [ $# -lt 1 ] ; then + echo "$0: at least one argument needed" 1>&2 + exit 1 +fi + +BASE="/usr/share" +i18n="" + +for x in "$@" ; do + if [ "${x:0:6}" == "-i18n=" ] ; then + i18n="${x:6}/" + fi + if [ "${x}" == ".keep" ] ; then + continue + fi + + suffix=${x##*.} + + if [ "$suffix" == "gz" ] ; then + compressed="gz" + realname="${x%.*}" + suffix="${realname##*.}" + else + realname="$x" + compressed="" + fi + + mandir=${i18n}man${suffix:0:1} + + if echo ${mandir} | egrep -q 'man[0-9n](|f|p|pm)$' -; then + if [ -s "${x}" ] ; then + if [ ! -d "${D}${BASE}/man/${mandir}" ] ; then + install -d "${D}${BASE}/man/${mandir}" + fi + + install -m0644 "${x}" "${D}${BASE}/man/${mandir}" + + if [ -z "${compressed}" ] ; then + gzip -f -9 "${D}${BASE}/man/${mandir}/${x##*/}" + fi + else + echo "doman: ${x} does not exist" 1>&2 + fi + else + echo "doman: '${x}' is probably not a man page; skipping" 1>&2 + fi +done diff --git a/bin/domo b/bin/domo new file mode 100755 index 000000000..ca3cf4b4e --- /dev/null +++ b/bin/domo @@ -0,0 +1,26 @@ +#!/bin/bash +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-src/portage/bin/domo,v 1.6 2004/10/04 13:56:50 vapier Exp $ + +mynum=${#} +if [ ${mynum} -lt 1 ] ; then + echo "${0}: at least one argument needed" + exit 1 +fi +if [ ! -d "${D}${DESTTREE}/share/locale" ] ; then + install -d "${D}${DESTTREE}/share/locale/" +fi + +for x in "$@" ; do + if [ -e "${x}" ] ; then + mytiny="${x##*/}" + mydir="${D}${DESTTREE}/share/locale/${mytiny%.*}/LC_MESSAGES" + if [ ! -d "${mydir}" ] ; then + install -d "${mydir}" + fi + install -m0644 "${x}" "${mydir}/${MOPREFIX}.mo" + else + echo "${0}: ${x} does not exist" + fi +done diff --git a/bin/dopython b/bin/dopython new file mode 100755 index 000000000..a3ffab968 --- /dev/null +++ b/bin/dopython @@ -0,0 +1,23 @@ +#!/usr/bin/python +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-src/portage/bin/dopython,v 1.8 2004/10/04 13:56:50 vapier Exp $ + +import sys +sys.path = ["/usr/lib/portage/pym"]+sys.path + +from sys import * +import portage +import types +mycommand=argv[1]+"(" +x=2 +while (x>> dosbin: making ${x} executable..." + if [ "$USERLAND" == "GNU" ]; then + install -m0755 -o root -g root "${x}" "${D}${DESTTREE}/sbin" || exit 4 + else + install -m0755 -o root -g wheel "${x}" "${D}${DESTTREE}/sbin" || exit 4 + fi + fi +done diff --git a/bin/dosed b/bin/dosed new file mode 100755 index 000000000..2c53b22d3 --- /dev/null +++ b/bin/dosed @@ -0,0 +1,22 @@ +#!/bin/bash +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-src/portage/bin/dosed,v 1.7 2004/10/04 13:56:50 vapier Exp $ + +mysed="s:${D}::g" + +for x in "$@" ; do + y="${D}${x}" + if [ -a "${y}" ] ; then + if [ -f "${y}" ] ; then + mysrc="${T}/${y##*/}" + cp "${y}" "${mysrc}" + sed -e "${mysed}" "${mysrc}" > "${y}" + else + echo "${y} is not a regular file!" + exit 1 + fi + else + mysed="${x}" + fi +done diff --git a/bin/dosym b/bin/dosym new file mode 100755 index 000000000..ca8cb713f --- /dev/null +++ b/bin/dosym @@ -0,0 +1,13 @@ +#!/bin/bash +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-src/portage/bin/dosym,v 1.7 2004/10/04 13:56:50 vapier Exp $ + +if [ ${#} -ne 2 ] ; then + echo "${0}: two arguments needed" + exit 1 +fi + +target="${1}" +linkname="${2}" +ln -snf "${target}" "${D}${linkname}" diff --git a/bin/ebuild b/bin/ebuild new file mode 100755 index 000000000..2c4ed713d --- /dev/null +++ b/bin/ebuild @@ -0,0 +1,61 @@ +#!/usr/bin/python -O +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-src/portage/bin/ebuild,v 1.18.2.3 2005/05/07 04:32:59 ferringb Exp $ + +import os,sys +sys.path = ["/usr/lib/portage/pym"]+sys.path +import portage_util + +def getroot(): + try: + a=os.environ["ROOT"] + if a == '/': + return '/' + except SystemExit, e: + raise # Needed else we can't exit. + except: + return '/' + return os.path.normpath(a)+'/' + +os.environ["PORTAGE_CALLER"]="ebuild" + +if len(sys.argv)<=2: + print "expecting two arguments." + sys.exit(1) + +import getopt + +debug=0 + +opts,pargs=getopt.getopt(sys.argv[1:],'',['debug']) +for opt in opts: + if opt[0]=='--debug': + debug=1 + +if "merge" in pargs: + print "Disabling noauto in features... merge disables it. (qmerge doesn't)" + os.environ["FEATURES"] = os.environ.get("FEATURES", "") + " -noauto" + +import portage + +for x in pargs[1:]: + try: + tmpsettings = portage.config(clone=portage.settings) + + if x in ['clean','config']: + cleanup=1 + else: + cleanup=0 + a=portage.doebuild(pargs[0],x,getroot(),tmpsettings,debug=debug,cleanup=cleanup) + except KeyboardInterrupt: + print "(interrupted by user -- ctrl-C?)" + a=1 + except IOError: + a=1 + print "ebuild: this ebuild generated output during the depend phase (bad)" + if a == None: + portage_util.writemsg("Could not run the required binary?\n") + sys.exit(127) + if a: + sys.exit(a) diff --git a/bin/ebuild.sh b/bin/ebuild.sh new file mode 100755 index 000000000..3271859ea --- /dev/null +++ b/bin/ebuild.sh @@ -0,0 +1,1868 @@ +#!/bin/bash +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-src/portage/bin/ebuild.sh,v 1.201.2.42 2005/08/20 17:24:30 jstubbs Exp $ + +export SANDBOX_PREDICT="${SANDBOX_PREDICT}:/proc/self/maps:/dev/console:/usr/lib/portage/pym:/dev/random" +export SANDBOX_WRITE="${SANDBOX_WRITE}:/dev/shm:${PORTAGE_TMPDIR}" +export SANDBOX_READ="${SANDBOX_READ}:/dev/shm:${PORTAGE_TMPDIR}" + +if [ ! -z "${PORTAGE_GPG_DIR}" ]; then + SANDBOX_PREDICT="${SANDBOX_PREDICT}:${PORTAGE_GPG_DIR}" +fi + +if [ "$*" != "depend" ] && [ "$*" != "clean" ] && [ "$*" != "nofetch" ]; then + if [ -f "${T}/environment" ]; then + source "${T}/environment" &>/dev/null + fi +fi + +if [ -n "$#" ]; then + ARGS="${*}" +fi + +declare -rx EBUILD_PHASE="$*" + +# Prevent aliases from causing portage to act inappropriately. +# Make sure it's before everything so we don't mess aliases that follow. +unalias -a + +# Unset some variables that break things. +unset GZIP BZIP BZIP2 CDPATH GREP_OPTIONS GREP_COLOR GLOBIGNORE + +# We need this next line for "die" and "assert". It expands +# It _must_ preceed all the calls to die and assert. +shopt -s expand_aliases +alias die='diefunc "$FUNCNAME" "$LINENO" "$?"' +alias assert='_pipestatus="${PIPESTATUS[*]}"; [[ "${_pipestatus// /}" -eq 0 ]] || diefunc "$FUNCNAME" "$LINENO" "$_pipestatus"' +alias save_IFS='[ "${IFS:-unset}" != "unset" ] && old_IFS="${IFS}"' +alias restore_IFS='if [ "${old_IFS:-unset}" != "unset" ]; then IFS="${old_IFS}"; unset old_IFS; else unset IFS; fi' + +OCC="$CC" +OCXX="$CXX" +source /etc/profile.env &>/dev/null +if [ -f "${PORTAGE_BASHRC}" ]; then + source "${PORTAGE_BASHRC}" +fi +[ ! -z "$OCC" ] && export CC="$OCC" +[ ! -z "$OCXX" ] && export CXX="$OCXX" + +export PATH="/sbin:/usr/sbin:/usr/lib/portage/bin:/bin:/usr/bin:${ROOTPATH}" +[ ! -z "$PREROOTPATH" ] && export PATH="${PREROOTPATH%%:}:$PATH" + +if [ -e /etc/init.d/functions.sh ]; then + source /etc/init.d/functions.sh &>/dev/null +elif [ -e /etc/rc.d/config/functions ]; then + source /etc/rc.d/config/functions &>/dev/null +else + #Mac OS X + source /usr/lib/portage/bin/functions.sh &>/dev/null +fi + +# the sandbox is disabled by default except when overridden in the relevant stages +export SANDBOX_ON="0" + +# sandbox support functions; defined prior to profile.bashrc srcing, since the profile might need to add a default exception (/usr/lib64/conftest fex, bug #60147) +addread() +{ + export SANDBOX_READ="$SANDBOX_READ:$1" +} + +addwrite() +{ + export SANDBOX_WRITE="$SANDBOX_WRITE:$1" +} + +adddeny() +{ + export SANDBOX_DENY="$SANDBOX_DENY:$1" +} + +addpredict() +{ + export SANDBOX_PREDICT="$SANDBOX_PREDICT:$1" +} + + +# source the existing profile.bashrc's. +save_IFS +IFS=$'\n' +for dir in ${PROFILE_PATHS}; do + # Must unset it so that it doesn't mess up assumptions in the RCs. + unset IFS + if [ -f "${dir}/profile.bashrc" ]; then + source "${dir}/profile.bashrc" + fi +done +restore_IFS + + +esyslog() { + # Custom version of esyslog() to take care of the "Red Star" bug. + # MUST follow functions.sh to override the "" parameter problem. + return 0 +} + + +use() { + if useq ${1}; then + return 0 + fi + return 1 +} + +usev() { + if useq ${1}; then + echo "${1}" + return 0 + fi + return 1 +} + +useq() { + local u="${1}" + local neg=0 + if [ "${u:0:1}" == "!" ]; then + u="${u:1}" + neg=1 + fi + local x + + # Make sure we have this USE flag in IUSE + if ! hasq "${u}" ${IUSE} ${E_IUSE} && ! hasq "${u}" ${PORTAGE_ARCHLIST} selinux; then + echo "QA Notice: USE Flag '${u}' not in IUSE for ${CATEGORY}/${PF}" >&2 + fi + + for x in ${USE}; do + if [ "${x}" == "${u}" ]; then + if [ ${neg} -eq 1 ]; then + return 1 + else + return 0 + fi + fi + done + if [ ${neg} -eq 1 ]; then + return 0 + else + return 1 + fi +} + +has() { + if hasq "$@"; then + return 0 + fi + return 1 +} + +hasv() { + if hasq "$@"; then + echo "${1}" + return 0 + fi + return 1 +} + +hasq() { + local x + + local me=$1 + shift + + # All the TTY checks really only help out depend. Which is nice. + # Logging kills all this anyway. Everything becomes a pipe. --NJ + for x in "$@"; do + if [ "${x}" == "${me}" ]; then + return 0 + fi + done + return 1 +} + +has_version() { + if [ "${EBUILD_PHASE}" == "depend" ]; then + echo -n "QA Notice: has_version() in global scope: " >&2 + if [ ${ECLASS_DEPTH} -gt 0 ]; then + echo "eclass ${ECLASS}" >&2 + else + echo "${CATEGORY}/${PF}" >&2 + fi + fi + # return shell-true/shell-false if exists. + # Takes single depend-type atoms. + if /usr/lib/portage/bin/portageq 'has_version' "${ROOT}" "$1"; then + return 0 + else + return 1 + fi +} + +portageq() { + if [ "${EBUILD_PHASE}" == "depend" ]; then + echo -n "QA Notice: portageq in global scope: " >&2 + if [ ${ECLASS_DEPTH} -gt 0 ]; then + echo "eclass ${ECLASS}" >&2 + else + echo "${CATEGORY}/${PF}" >&2 + fi + fi + /usr/lib/portage/bin/portageq "$@" +} + + +# ---------------------------------------------------------------------------- +# ---------------------------------------------------------------------------- +# ---------------------------------------------------------------------------- + + +best_version() { + if [ "${EBUILD_PHASE}" == "depend" ]; then + echo -n "QA Notice: best_version() in global scope: " >&2 + if [ ${ECLASS_DEPTH} -gt 0 ]; then + echo "eclass ${ECLASS}" >&2 + else + echo "${CATEGORY}/${PF}" >&2 + fi + fi + # returns the best/most-current match. + # Takes single depend-type atoms. + /usr/lib/portage/bin/portageq 'best_version' "${ROOT}" "$1" +} + +use_with() { + if [ -z "$1" ]; then + echo "!!! use_with() called without a parameter." >&2 + echo "!!! use_with [ [value]]" >&2 + return 1 + fi + + local UW_SUFFIX="" + if [ ! -z "${3}" ]; then + UW_SUFFIX="=${3}" + fi + + local UWORD="$2" + if [ -z "${UWORD}" ]; then + UWORD="$1" + fi + + if useq $1; then + echo "--with-${UWORD}${UW_SUFFIX}" + else + echo "--without-${UWORD}" + fi + return 0 +} + +use_enable() { + if [ -z "$1" ]; then + echo "!!! use_enable() called without a parameter." >&2 + echo "!!! use_enable [ [value]]" >&2 + return 1 + fi + + local UE_SUFFIX="" + if [ ! -z "${3}" ]; then + UE_SUFFIX="=${3}" + fi + + local UWORD="$2" + if [ -z "${UWORD}" ]; then + UWORD="$1" + fi + + if useq $1; then + echo "--enable-${UWORD}${UE_SUFFIX}" + else + echo "--disable-${UWORD}" + fi + return 0 +} + +diefunc() { + local funcname="$1" lineno="$2" exitcode="$3" + shift 3 + echo >&2 + echo "!!! ERROR: $CATEGORY/$PF failed." >&2 + echo "!!! Function $funcname, Line $lineno, Exitcode $exitcode" >&2 + echo "!!! ${*:-(no error message)}" >&2 + echo "!!! If you need support, post the topmost build error, NOT this status message." >&2 + echo >&2 + exit 1 +} + +#if no perms are specified, dirs/files will have decent defaults +#(not secretive, but not stupid) +umask 022 +export DESTTREE=/usr +export INSDESTTREE="" +export EXEDESTTREE="" +export DOCDESTTREE="" +export INSOPTIONS="-m0644" +export EXEOPTIONS="-m0755" +export LIBOPTIONS="-m0644" +export DIROPTIONS="-m0755" +export MOPREFIX=${PN} + +check_KV() +{ + if [ -z "${KV}" ]; then + eerror "" + eerror "Could not determine your kernel version." + eerror "Make sure that you have /usr/src/linux symlink." + eerror "And that said kernel has been configured." + eerror "You can also simply run the following command" + eerror "in the kernel referenced by /usr/src/linux:" + eerror " make include/linux/version.h" + eerror "" + die + fi +} + +# adds ".keep" files so that dirs aren't auto-cleaned +keepdir() +{ + dodir "$@" + local x + if [ "$1" == "-R" ] || [ "$1" == "-r" ]; then + shift + find "$@" -type d -printf "${D}/%p/.keep\n" | tr "\n" "\0" | $XARGS -0 -n100 touch || die "Failed to recursive create .keep files" + else + for x in "$@"; do + touch "${D}/${x}/.keep" || die "Failed to create .keep in ${D}/${x}" + done + fi +} + +strip_duplicate_slashes () { + if [ -n "${1}" ]; then + local removed="${1/\/\///}" + [ "${removed}" != "${removed/\/\///}" ] && removed=$(strip_duplicate_slashes "${removed}") + echo ${removed} + fi +} + +econf() { + local LOCAL_EXTRA_ECONF="${EXTRA_ECONF}" + + if [ -z "${ECONF_SOURCE}" ]; then + ECONF_SOURCE="." + fi + if [ -x "${ECONF_SOURCE}/configure" ]; then + if [ -e /usr/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} + done + fi + + if [ ! -z "${CBUILD}" ]; then + LOCAL_EXTRA_ECONF="--build=${CBUILD} ${LOCAL_EXTRA_ECONF}" + fi + + if [ ! -z "${CTARGET}" ]; then + LOCAL_EXTRA_ECONF="--target=${CTARGET} ${LOCAL_EXTRA_ECONF}" + fi + + # if the profile defines a location to install libs to aside from default, pass it on. + # if the ebuild passes in --libdir, they're responsible for the conf_libdir fun. + LIBDIR_VAR="LIBDIR_${ABI}" + if [ -n "${ABI}" -a -n "${!LIBDIR_VAR}" ]; then + CONF_LIBDIR="${!LIBDIR_VAR}" + fi + unset LIBDIR_VAR + if [ -n "${CONF_LIBDIR}" ] && [ "${*/--libdir}" == "$*" ]; then + if [ "${*/--exec-prefix}" != "$*" ]; then + local args="$(echo $*)" + local -a pref=($(echo ${args/*--exec-prefix[= ]})) + CONF_PREFIX=${pref} + [ "${CONF_PREFIX:0:1}" != "/" ] && CONF_PREFIX="/${CONF_PREFIX}" + elif [ "${*/--prefix}" != "$*" ]; then + local args="$(echo $*)" + local -a pref=($(echo ${args/*--prefix[= ]})) + CONF_PREFIX=${pref} + [ "${CONF_PREFIX:0:1}" != "/" ] && CONF_PREFIX="/${CONF_PREFIX}" + else + CONF_PREFIX="/usr" + fi + export CONF_PREFIX + [ "${CONF_LIBDIR:0:1}" != "/" ] && CONF_LIBDIR="/${CONF_LIBDIR}" + + CONF_LIBDIR_RESULT="${CONF_PREFIX}${CONF_LIBDIR}" + for X in 1 2 3; do + # The escaping is weird. It will break if you escape the last one. + CONF_LIBDIR_RESULT="${CONF_LIBDIR_RESULT//\/\///}" + done + + LOCAL_EXTRA_ECONF="--libdir=${CONF_LIBDIR_RESULT} ${LOCAL_EXTRA_ECONF}" + fi + + echo "${ECONF_SOURCE}/configure" \ + --prefix=/usr \ + --host=${CHOST} \ + --mandir=/usr/share/man \ + --infodir=/usr/share/info \ + --datadir=/usr/share \ + --sysconfdir=/etc \ + --localstatedir=/var/lib \ + "$@" \ + ${LOCAL_EXTRA_ECONF} + + if ! "${ECONF_SOURCE}/configure" \ + --prefix=/usr \ + --host=${CHOST} \ + --mandir=/usr/share/man \ + --infodir=/usr/share/info \ + --datadir=/usr/share \ + --sysconfdir=/etc \ + --localstatedir=/var/lib \ + "$@" \ + ${LOCAL_EXTRA_ECONF}; then + + if [ -s config.log ]; then + echo + echo "!!! Please attach the config.log to your bug report:" + echo "!!! ${PWD}/config.log" + fi + die "econf failed" + fi + else + die "no configure script found" + fi +} + +einstall() { + # CONF_PREFIX is only set if they didn't pass in libdir above. + LIBDIR_VAR="LIBDIR_${ABI}" + if [ -n "${ABI}" -a -n "${!LIBDIR_VAR}" ]; then + CONF_LIBDIR="${!LIBDIR_VAR}" + fi + unset LIBDIR_VAR + if [ -n "${CONF_LIBDIR}" ] && [ "${CONF_PREFIX:-unset}" != "unset" ]; then + EI_DESTLIBDIR="${D}/${CONF_PREFIX}/${CONF_LIBDIR}" + EI_DESTLIBDIR="$(strip_duplicate_slashes ${EI_DESTLIBDIR})" + EXTRA_EINSTALL="libdir=${EI_DESTLIBDIR} ${EXTRA_EINSTALL}" + unset EI_DESTLIBDIR + fi + + 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 \ + ${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 \ + ${EXTRA_EINSTALL} \ + "$@" install || die "einstall failed" + else + die "no Makefile found" + fi +} + +pkg_setup() +{ + return +} + +pkg_nofetch() +{ + [ -z "${SRC_URI}" ] && return + + echo "!!! The following are listed in SRC_URI for ${PN}:" + for MYFILE in `echo ${SRC_URI}`; do + echo "!!! $MYFILE" + done +} + +src_unpack() { + if [ "${A}" != "" ]; then + unpack ${A} + fi +} + +src_compile() { + if [ -x ./configure ]; then + econf + fi + if [ -f Makefile ] || [ -f GNUmakefile ] || [ -f makefile ]; then + emake || die "emake failed" + fi +} + +src_test() +{ + addpredict / + if make check -n &> /dev/null; then + echo ">>> Test phase [check]: ${CATEGORY}/${PF}" + if ! make check; then + hasq test $FEATURES && die "Make check failed. See above for details." + hasq test $FEATURES || eerror "Make check failed. See above for details." + fi + elif make test -n &> /dev/null; then + echo ">>> Test phase [test]: ${CATEGORY}/${PF}" + if ! make test; then + hasq test $FEATURES && die "Make test failed. See above for details." + hasq test $FEATURES || eerror "Make test failed. See above for details." + fi + else + echo ">>> Test phase [none]: ${CATEGORY}/${PF}" + fi + SANDBOX_PREDICT="${SANDBOX_PREDICT%:/}" +} + +src_install() +{ + return +} + +pkg_preinst() +{ + return +} + +pkg_postinst() +{ + return +} + +pkg_prerm() +{ + return +} + +pkg_postrm() +{ + return +} + +pkg_config() +{ + eerror "This ebuild does not have a config function." +} + +# Used to generate the /lib/cpp and /usr/bin/cc wrappers +gen_wrapper() { + cat > $1 << END +#!/bin/sh + +$2 "\$@" +END + + chmod 0755 $1 +} + +dyn_setup() +{ + pkg_setup +} + +dyn_unpack() { + trap "abort_unpack" SIGINT SIGQUIT + local newstuff="no" + if [ -e "${WORKDIR}" ]; then + local x + local checkme + for x in ${AA}; do + echo ">>> Checking ${x}'s mtime..." + if [ "${DISTDIR}/${x}" -nt "${WORKDIR}" ]; then + echo ">>> ${x} has been updated; recreating WORKDIR..." + newstuff="yes" + rm -rf "${WORKDIR}" + break + fi + done + if [ "${EBUILD}" -nt "${WORKDIR}" ]; then + echo ">>> ${EBUILD} has been updated; recreating WORKDIR..." + newstuff="yes" + rm -rf "${WORKDIR}" + elif [ ! -f "${BUILDDIR}/.unpacked" ]; then + echo ">>> Not marked as unpacked; recreating WORKDIR..." + newstuff="yes" + rm -rf "${WORKDIR}" + fi + fi + if [ -e "${WORKDIR}" ]; then + if [ "$newstuff" == "no" ]; then + echo ">>> WORKDIR is up-to-date, keeping..." + return 0 + fi + fi + + install -m0700 -d "${WORKDIR}" || die "Failed to create dir '${WORKDIR}'" + [ -d "$WORKDIR" ] && cd "${WORKDIR}" + echo ">>> Unpacking source..." + src_unpack + touch "${BUILDDIR}/.unpacked" || die "IO Failure -- Failed 'touch .unpacked' in BUILDIR" + echo ">>> Source unpacked." + cd "$BUILDDIR" + trap SIGINT SIGQUIT +} + +dyn_clean() { + if [ "$USERLAND" == "BSD" ] && type -p chflags &>/dev/null; then + chflags -R noschg,nouchg,nosappnd,nouappnd,nosunlnk,nouunlnk \ + "${BUILDDIR}" + fi + + if [ "$USERLAND" == "Darwin" ] && type -p chflags &>/dev/null; then + chflags -R noschg,nouchg,nosappnd,nouappnd "${BUILDDIR}" + fi + + rm -rf "${BUILDDIR}/image" + + if ! hasq keeptemp $FEATURES; then + rm -rf "${T}" + else + mv "${T}/environment" "${T}/environment.keeptemp" + fi + + if ! hasq keepwork $FEATURES; then + rm -rf "${BUILDDIR}/.unpacked" + rm -rf "${BUILDDIR}/.compiled" + rm -rf "${BUILDDIR}/.tested" + rm -rf "${BUILDDIR}/.installed" + rm -rf "${BUILDDIR}/.packaged" + rm -rf "${BUILDDIR}/build-info" + rm -rf "${WORKDIR}" + fi + + if [ -f "${BUILDDIR}/.unpacked" ]; then + find "${BUILDDIR}" -type d ! -regex "^${WORKDIR}" | sort -r | tr "\n" "\0" | $XARGS -0 rmdir &>/dev/null + fi + + if [ -z "$(find "${BUILDDIR}" -mindepth 1 -maxdepth 1)" ]; then + rmdir "${BUILDDIR}" + fi + true +} + +into() { + if [ $1 == "/" ]; then + export DESTTREE="" + else + export DESTTREE=$1 + if [ ! -d "${D}${DESTTREE}" ]; then + install -d "${D}${DESTTREE}" + fi + fi +} + +insinto() { + if [ "$1" == "/" ]; then + export INSDESTTREE="" + else + export INSDESTTREE=$1 + if [ ! -d "${D}${INSDESTTREE}" ]; then + install -d "${D}${INSDESTTREE}" + fi + fi +} + +exeinto() { + if [ "$1" == "/" ]; then + export EXEDESTTREE="" + else + export EXEDESTTREE="$1" + if [ ! -d "${D}${EXEDESTTREE}" ]; then + install -d "${D}${EXEDESTTREE}" + fi + fi +} + +docinto() { + if [ "$1" == "/" ]; then + export DOCDESTTREE="" + else + export DOCDESTTREE="$1" + if [ ! -d "${D}usr/share/doc/${PF}/${DOCDESTTREE}" ]; then + install -d "${D}usr/share/doc/${PF}/${DOCDESTTREE}" + fi + fi +} + +insopts() { + INSOPTIONS="" + for x in $*; do + #if we have a debug build, let's not strip anything + if hasq nostrip $FEATURES $RESTRICT && [ "$x" == "-s" ]; then + continue + else + INSOPTIONS="$INSOPTIONS $x" + fi + done + export INSOPTIONS +} + +diropts() { + DIROPTIONS="" + for x in $*; do + DIROPTIONS="${DIROPTIONS} $x" + done + export DIROPTIONS +} + +exeopts() { + EXEOPTIONS="" + for x in $*; do + #if we have a debug build, let's not strip anything + if hasq nostrip $FEATURES $RESTRICT && [ "$x" == "-s" ]; then + continue + else + EXEOPTIONS="$EXEOPTIONS $x" + fi + done + export EXEOPTIONS +} + +libopts() { + LIBOPTIONS="" + for x in $*; do + #if we have a debug build, let's not strip anything + if hasq nostrip $FEATURES $RESTRICT && [ "$x" == "-s" ]; then + continue + else + LIBOPTIONS="$LIBOPTIONS $x" + fi + done + export LIBOPTIONS +} + +abort_handler() { + local msg + if [ "$2" != "fail" ]; then + msg="${EBUILD}: ${1} aborted; exiting." + else + msg="${EBUILD}: ${1} failed; exiting." + fi + echo + echo "$msg" + echo + eval ${3} + #unset signal handler + trap SIGINT SIGQUIT +} + +abort_compile() { + abort_handler "src_compile" $1 + rm -f "${BUILDDIR}/.compiled" + exit 1 +} + +abort_unpack() { + abort_handler "src_unpack" $1 + rm -f "${BUILDDIR}/.unpacked" + rm -rf "${BUILDDIR}/work" + exit 1 +} + +abort_package() { + abort_handler "dyn_package" $1 + rm -f "${BUILDDIR}/.packaged" + rm -f "${PKGDIR}"/All/${PF}.t* + exit 1 +} + +abort_test() { + abort_handler "dyn_test" $1 + rm -f "${BUILDDIR}/.tested" + exit 1 +} + +abort_install() { + abort_handler "src_install" $1 + rm -rf "${BUILDDIR}/image" + exit 1 +} + +dyn_compile() { + trap "abort_compile" SIGINT SIGQUIT + [ "${CFLAGS-unset}" != "unset" ] && export CFLAGS + [ "${CXXFLAGS-unset}" != "unset" ] && export CXXFLAGS + [ "${LIBCFLAGS-unset}" != "unset" ] && export LIBCFLAGS + [ "${LIBCXXFLAGS-unset}" != "unset" ] && export LIBCXXFLAGS + [ "${LDFLAGS-unset}" != "unset" ] && export LDFLAGS + [ "${ASFLAGS-unset}" != "unset" ] && export ASFLAGS + + [ "${CCACHE_DIR-unset}" != "unset" ] && export CCACHE_DIR + [ "${CCACHE_SIZE-unset}" != "unset" ] && export CCACHE_SIZE + + [ "${DISTCC_DIR-unset}" == "unset" ] && export DISTCC_DIR="${PORTAGE_TMPDIR}/.distcc" + [ ! -z "${DISTCC_DIR}" ] && addwrite "${DISTCC_DIR}" + + if hasq noauto $FEATURES &>/dev/null && [ ! -f ${BUILDDIR}/.unpacked ]; then + echo + echo "!!! We apparently haven't unpacked... This is probably not what you" + echo "!!! want to be doing... You are using FEATURES=noauto so I'll assume" + echo "!!! that you know what you are doing... You have 5 seconds to abort..." + echo + + echo -ne "\a"; sleep 0.25 &>/dev/null; echo -ne "\a"; sleep 0.25 &>/dev/null + echo -ne "\a"; sleep 0.25 &>/dev/null; echo -ne "\a"; sleep 0.25 &>/dev/null + echo -ne "\a"; sleep 0.25 &>/dev/null; echo -ne "\a"; sleep 0.25 &>/dev/null + echo -ne "\a"; sleep 0.25 &>/dev/null; echo -ne "\a"; sleep 0.25 &>/dev/null + + echo -ne "\a"; sleep 0,25 &>/dev/null; echo -ne "\a"; sleep 0,25 &>/dev/null + echo -ne "\a"; sleep 0,25 &>/dev/null; echo -ne "\a"; sleep 0,25 &>/dev/null + echo -ne "\a"; sleep 0,25 &>/dev/null; echo -ne "\a"; sleep 0,25 &>/dev/null + echo -ne "\a"; sleep 0,25 &>/dev/null; echo -ne "\a"; sleep 0,25 &>/dev/null + sleep 3 + fi + + cd "${BUILDDIR}" + if [ ! -e "build-info" ]; then + mkdir build-info + fi + cp "${EBUILD}" "build-info/${PF}.ebuild" + + if [ ${BUILDDIR}/.compiled -nt "${WORKDIR}" ]; then + echo ">>> It appears that ${PN} is already compiled; skipping." + echo ">>> (clean to force compilation)" + trap SIGINT SIGQUIT + return + fi + if [ -d "${S}" ]; then + cd "${S}" + fi + #our custom version of libtool uses $S and $D to fix + #invalid paths in .la files + export S D + #some packages use an alternative to $S to build in, cause + #our libtool to create problematic .la files + export PWORKDIR="$WORKDIR" + src_compile + #|| abort_compile "fail" + cd "${BUILDDIR}" + touch .compiled + cd build-info + + echo "$ASFLAGS" > ASFLAGS + echo "$CATEGORY" > CATEGORY + echo "$CBUILD" > CBUILD + echo "$CC" > CC + echo "$CDEPEND" > CDEPEND + echo "$CFLAGS" > CFLAGS + echo "$CHOST" > CHOST + echo "$CTARGET" > CTARGET + echo "$CXX" > CXX + echo "$CXXFLAGS" > CXXFLAGS + echo "$DEPEND" > DEPEND + echo "$EXTRA_ECONF" > EXTRA_ECONF + echo "$EXTRA_EINSTALL" > EXTRA_EINSTALL + echo "$EXTRA_EMAKE" > EXTRA_MAKE + echo "$FEATURES" > FEATURES + echo "$INHERITED" > INHERITED + echo "$IUSE" > IUSE + echo "$PKGUSE" > PKGUSE + echo "$LDFLAGS" > LDFLAGS + echo "$LIBCFLAGS" > LIBCFLAGS + echo "$LIBCXXFLAGS" > LIBCXXFLAGS + echo "$LICENSE" > LICENSE + echo "$PDEPEND" > PDEPEND + echo "$PF" > PF + echo "$PROVIDE" > PROVIDE + echo "$RDEPEND" > RDEPEND + echo "$RESTRICT" > RESTRICT + echo "$SLOT" > SLOT + echo "$USE" > USE + + set > environment + export -p | sed 's:declare -rx:declare -x:' >> environment + bzip2 -9 environment + + cp "${EBUILD}" "${PF}.ebuild" + if hasq nostrip $FEATURES $RESTRICT; then + touch DEBUGBUILD + fi + trap SIGINT SIGQUIT +} + +dyn_package() { + trap "abort_package" SIGINT SIGQUIT + cd "${BUILDDIR}/image" + tar cpvf - ./ | bzip2 -f > ../bin.tar.bz2 || die "Failed to create tarball" + cd .. + xpak build-info inf.xpak + tbz2tool join bin.tar.bz2 inf.xpak "${PF}.tbz2" + mv "${PF}.tbz2" "${PKGDIR}/All" || die "Failed to move tbz2 to ${PKGDIR}/All" + rm -f inf.xpak bin.tar.bz2 + if [ ! -d "${PKGDIR}/${CATEGORY}" ]; then + install -d "${PKGDIR}/${CATEGORY}" + fi + ln -sf "../All/${PF}.tbz2" "${PKGDIR}/${CATEGORY}/${PF}.tbz2" || die "Failed to create symlink in ${PKGDIR}/${CATEGORY}" + echo ">>> Done." + cd "${BUILDDIR}" + touch .packaged || die "Failed to 'touch .packaged' in ${BUILDDIR}" + trap SIGINT SIGQUIT +} + + +dyn_test() { + if [ ${BUILDDIR}/.tested -nt "${WORKDIR}" ]; then + echo ">>> It appears that ${PN} has already been tested; skipping." + return + fi + trap "abort_test" SIGINT SIGQUIT + if [ -d "${S}" ]; then + cd "${S}" + fi + if hasq maketest $RESTRICT || hasq test $RESTRICT; then + ewarn "Skipping make test/check due to ebuild restriction." + echo ">>> Test phase [explicitly disabled]: ${CATEGORY}/${PF}" + elif ! hasq test $FEATURES; then + echo ">>> Test phase [not enabled]: ${CATEGORY}/${PF}" + else + echo ">>> Test phase [enabled]: ${CATEGORY}/${PF}" + src_test + fi + + cd "${BUILDDIR}" + touch .tested || die "Failed to 'touch .tested' in ${BUILDDIR}" + trap SIGINT SIGQUIT +} + + + +dyn_install() { + trap "abort_install" SIGINT SIGQUIT + rm -rf "${BUILDDIR}/image" + mkdir "${BUILDDIR}/image" + if [ -d "${S}" ]; then + cd "${S}" + fi + echo + echo ">>> Install ${PF} into ${D} category ${CATEGORY}" + #our custom version of libtool uses $S and $D to fix + #invalid paths in .la files + export S D + #some packages uses an alternative to $S to build in, cause + #our libtool to create problematic .la files + export PWORKDIR="$WORKDIR" + src_install + #|| abort_install "fail" + prepall + cd "${D}" + + declare -i UNSAFE=0 + for i in $(find "${D}/" -type f -perm -2002); do + ((UNSAFE++)) + echo "UNSAFE SetGID: $i" + done + for i in $(find "${D}/" -type f -perm -4002); do + ((UNSAFE++)) + echo "UNSAFE SetUID: $i" + done + + if type -p scanelf > /dev/null ; then + # Make sure we disallow insecure RUNPATH/RPATH's + # Don't want paths that point to the tree where the package was built + # (older, broken libtools would do this). Also check for null paths + # because the loader will search $PWD when it finds null paths. + f=$(scanelf -qyRF '%r %p' "${D}" | grep -E "(${BUILDDIR}|: |::|^ )") + if [[ -n ${f} ]] ; then + echo -ne '\a\n' + echo "QA Notice: the following files contain insecure RUNPATH's" + echo " Please file a bug about this at http://bugs.gentoo.org/" + echo " For more information on this issue, kindly review:" + echo " http://bugs.gentoo.org/81745" + echo "${f}" + echo -ne '\a\n' + die "Insecure binaries detected" + fi + + # Check for setid binaries but are not built with BIND_NOW + f=$(scanelf -qyRF '%b %p' "${D}") + if [[ -n ${f} ]] ; then + echo -ne '\a\n' + echo "QA Notice: the following files are setXid, dyn linked, and using lazy bindings" + echo " This combination is generally discouraged. Try re-emerging the package:" + echo " LDFLAGS='-Wl,-z,now' emerge ${PN}" + echo "${f}" + echo -ne '\a\n' + [[ ${FEATURES/stricter} != "${FEATURES}" ]] \ + && die "Aborting due to lazy bindings" + sleep 1 + fi + + # TEXTREL's are baaaaaaaad + f=$(scanelf -qyRF '%t %p' "${D}") + if [[ -n ${f} ]] ; then + echo -ne '\a\n' + echo "QA Notice: the following files contain runtime text relocations" + echo " Text relocations require a lot of extra work to be preformed by the" + echo " dynamic linker which will cause serious performance impact on IA-32" + echo " and might not function properly on other architectures hppa for example." + echo " If you are a programmer please take a closer look at this package and" + echo " consider writing a patch which addresses this problem." + echo "${f}" + echo -ne '\a\n' + [[ ${FEATURES/stricter} != "${FEATURES}" ]] \ + && die "Aborting due to textrels" + sleep 1 + fi + + # Check for files with executable stacks + f=$(scanelf -qyRF '%e %p' "${D}") + if [[ -n ${f} ]] ; then + echo -ne '\a\n' + echo "QA Notice: the following files contain executable stacks" + echo " Files with executable stacks will not work properly (or at all!)" + echo " on some architectures/operating systems. A bug should be filed" + echo " at http://bugs.gentoo.org/ to make sure the file is fixed." + echo "${f}" + echo -ne '\a\n' + [[ ${FEATURES/stricter} != "${FEATURES}" ]] \ + && die "Aborting due to +x stack" + sleep 1 + fi + + # Save NEEDED information + scanelf -qyRF '%p %n' "${D}" | sed -e 's:^:/:' > "${BUILDDIR}"/build-info/NEEDED + fi + + if [[ ${UNSAFE} > 0 ]] ; then + die "There are ${UNSAFE} unsafe files. Portage will not install them." + fi + + # dumps perms to stdout. if error, no perms dumped. + function stat_perms() { + local f + # only define do_stat if it hasn't been already + if ! type -p do_stat &> /dev/null; then + if ! type -p stat &>/dev/null; then + do_stat() { + # Generic version -- Octal result + python -c "import os,stat; print '%o' % os.stat('$1')[stat.ST_MODE]" + } + else + if [ "${USERLAND}" == "BSD" ] || [ "${USERLAND}" == "Darwin" ]; then + do_stat() { + # BSD version -- Octal result + $(type -p stat) -f '%p' "$1" + } + else + do_stat() { + # Linux version -- Hex result converted to Octal + f=$($(type -p stat) -c '%f' "$1") || return $? + printf '%o' "0x$f" + } + fi + fi + fi + + f=$(do_stat "$@") || return + f="${f:2:4}" + echo $f + } + + local file s + local count=0 + find "${D}/" -user portage | while read file; do + count=$(( $count + 1 )) + [[ ! -L "${file}" ]] && s=$(stat_perms "$file") + if [ -z "${s}" ]; then + ewarn "failed stat_perm'ing $file. User intervention during install isn't wise..." + continue + fi + chown root "$file" + [[ ! -L "${file}" ]] && chmod "$s" "$file" + done + if (( $count > 0 )); then + ewarn "$count files were installed with user portage!" + fi + + count=0 + find "${D}/" -group portage | while read file; do + count=$(( $count + 1 )) + [[ ! -L "${file}" ]] && s=$(stat_perms "$file") + if [ -z "${s}" ]; then + echo "failed stat_perm'ing '$file' . User intervention during install isn't wise..." + continue + fi + chgrp 0 "${file}" + [[ ! -L "${file}" ]] && chmod "$s" "$file" + done + if (( $count > 0 )); then + ewarn "$count files were installed with group portage!" + fi + + unset -f stat_perms + + # Portage regenerates this on the installed system. + if [ -f "${D}/usr/share/info/dir.gz" ]; then + rm -f "${D}/usr/share/info/dir.gz" + fi + + if hasq multilib-strict ${FEATURES} && [ -x /usr/bin/file -a -x /usr/bin/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}" + done + done + fi + + touch "${BUILDDIR}/.installed" + echo ">>> Completed installing ${PF} into ${D}" + echo + cd ${BUILDDIR} + trap SIGINT SIGQUIT +} + +dyn_preinst() { + # set IMAGE depending if this is a binary or compile merge + [ "${EMERGE_FROM}" == "binary" ] && IMAGE=${PKG_TMPDIR}/${PF}/bin \ + || IMAGE=${D} + + pkg_preinst + + # hopefully this will someday allow us to get rid of the no* feature flags + # we don't want globbing for initial expansion, but afterwards, we do + local shopts=$- + set -o noglob + for no_inst in ${INSTALL_MASK}; do + set +o noglob + einfo "Removing ${no_inst}" + # normal stuff + rm -Rf ${IMAGE}/${no_inst} >&/dev/null + + # we also need to handle globs (*.a, *.h, etc) + find "${IMAGE}" -name ${no_inst} -exec rm -fR {} \; >&/dev/null + done + # set everything back the way we found it + set +o noglob + set -${shopts} + + # remove man pages + if hasq noman $FEATURES; then + rm -fR "${IMAGE}/usr/share/man" + fi + + # remove info pages + if hasq noinfo $FEATURES; then + rm -fR "${IMAGE}/usr/share/info" + fi + + # remove docs + if hasq nodoc $FEATURES; then + rm -fR "${IMAGE}/usr/share/doc" + fi + + # remove share dir if unnessesary + if hasq nodoc $FEATURES -o hasq noman $FEATURES -o hasq noinfo $FEATURES; then + rmdir "${IMAGE}/usr/share" &> /dev/null + fi + + # Smart FileSystem Permissions + if hasq sfperms $FEATURES; then + for i in $(find ${IMAGE}/ -type f -perm -4000); do + ebegin ">>> SetUID: [chmod go-r] $i " + chmod go-r "$i" + eend $? + done + for i in $(find ${IMAGE}/ -type f -perm -2000); do + ebegin ">>> SetGID: [chmod o-r] $i " + chmod o-r "$i" + eend $? + done + fi + + # total suid control. + if hasq suidctl $FEATURES > /dev/null ; then + sfconf=/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 + suid="`grep ^${i/${IMAGE}/}$ ${sfconf}`" + if [ "${suid}" = "${i/${IMAGE}/}" ]; then + echo "- ${i/${IMAGE}/} is an approved suid file" + else + echo ">>> Removing sbit on non registered ${i/${IMAGE}/}" + for x in 5 4 3 2 1 0; do echo -ne "\a"; sleep 0.25 ; done + echo -ne "\a" + chmod ugo-s "${i}" + grep ^#${i/${IMAGE}/}$ ${sfconf} > /dev/null || { + # sandbox prevents us from writing directly + # to files outside of the sandbox, but this + # can easly be bypassed using the addwrite() function + addwrite "${sfconf}" + echo ">>> Appending commented out entry to ${sfconf} for ${PF}" + ls_ret=`ls -ldh "${i}"` + echo "## ${ls_ret%${IMAGE}*}${ls_ret#*${IMAGE}}" >> ${sfconf} + echo "#${i/${IMAGE}/}" >> ${sfconf} + # no delwrite() eh? + # delwrite ${sconf} + } + fi + else + echo "suidctl feature set but you are lacking a ${sfconf}" + fi + done + fi + + # SELinux file labeling (needs to always be last in dyn_preinst) + if useq 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 + echo ">>> Setting SELinux security labels" + if [ -f ${POLICYDIR}/file_contexts/file_contexts ]; then + cp -f "${POLICYDIR}/file_contexts/file_contexts" "${T}" + else + make -C "${POLICYDIR}" FC=${T}/file_contexts "${T}/file_contexts" + fi + + addwrite /selinux/context + /usr/sbin/setfiles -r "${IMAGE}" "${T}/file_contexts" "${IMAGE}" \ + || die "Failed to set SELinux security labels." + else + # nonfatal, since merging can happen outside a SE kernel + # like during a recovery situation + echo "!!! Unable to set SELinux security labels" + fi + fi + trap SIGINT SIGQUIT +} + +dyn_spec() { + tar czf "/usr/src/redhat/SOURCES/${PF}.tar.gz" "${O}/${PF}.ebuild" "${O}/files" || die "Failed to create base rpm tarball." + + cat <<__END1__ > ${PF}.spec +Summary: ${DESCRIPTION} +Name: ${PN} +Version: ${PV} +Release: ${PR} +Copyright: GPL +Group: portage/${CATEGORY} +Source: ${PF}.tar.gz +Buildroot: ${D} +%description +${DESCRIPTION} + +${HOMEPAGE} + +%prep +%setup -c + +%build + +%install + +%clean + +%files +/ +__END1__ + +} + +dyn_rpm() { + dyn_spec + rpmbuild -bb "${PF}.spec" || die "Failed to integrate rpm spec file" + install -D "/usr/src/redhat/RPMS/i386/${PN}-${PV}-${PR}.i386.rpm" "${RPMDIR}/${CATEGORY}/${PN}-${PV}-${PR}.rpm" || die "Failed to move rpm" +} + +dyn_help() { + echo + echo "Portage" + echo "Copyright 1999-2004 Gentoo Foundation" + echo + echo "How to use the ebuild command:" + echo + echo "The first argument to ebuild should be an existing .ebuild file." + echo + echo "One or more of the following options can then be specified. If more" + echo "than one option is specified, each will be executed in order." + echo + echo " help : show this help screen" + echo " setup : execute package specific setup actions" + echo " fetch : download source archive(s) and patches" + echo " digest : creates a digest and a manifest file for the package" + echo " manifest : creates a manifest file for the package" + echo " unpack : unpack/patch sources (auto-fetch if needed)" + echo " compile : compile sources (auto-fetch/unpack if needed)" + echo " test : test package (auto-fetch/unpack/compile if needed)" + echo " preinst : execute pre-install instructions" + echo " postinst : execute post-install instructions" + echo " install : installs the package to the temporary install directory" + echo " qmerge : merge image into live filesystem, recording files in db" + echo " merge : does fetch, unpack, compile, install and qmerge" + echo " prerm : execute pre-removal instructions" + echo " postrm : execute post-removal instructions" + echo " unmerge : remove package from live filesystem" + echo " config : execute package specific configuration actions" + echo " package : create tarball package in ${PKGDIR}/All" + echo " rpm : builds a RedHat RPM package" + echo " clean : clean up all source and temporary files" + echo + echo "The following settings will be used for the ebuild process:" + echo + echo " package : ${PF}" + echo " slot : ${SLOT}" + echo " category : ${CATEGORY}" + echo " description : ${DESCRIPTION}" + echo " system : ${CHOST}" + echo " c flags : ${CFLAGS}" + echo " c++ flags : ${CXXFLAGS}" + echo " make flags : ${MAKEOPTS}" + echo -n " build mode : " + if hasq nostrip $FEATURES $RESTRICT; then + echo "debug (large)" + else + echo "production (stripped)" + fi + echo " merge to : ${ROOT}" + echo + if [ -n "$USE" ]; then + echo "Additionally, support for the following optional features will be enabled:" + echo + echo " ${USE}" + fi + echo +} + +# debug-print() gets called from many places with verbose status information useful +# for tracking down problems. The output is in $T/eclass-debug.log. +# You can set ECLASS_DEBUG_OUTPUT to redirect the output somewhere else as well. +# The special "on" setting echoes the information, mixing it with the rest of the +# emerge output. +# 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 +debug-print() { + # if $T isn't defined, we're in dep calculation mode and + # shouldn't do anything + [ -z "$T" ] && return 0 + + while [ "$1" ]; do + + # extra user-configurable targets + if [ "$ECLASS_DEBUG_OUTPUT" == "on" ]; then + echo "debug: $1" + elif [ -n "$ECLASS_DEBUG_OUTPUT" ]; then + echo "debug: $1" >> $ECLASS_DEBUG_OUTPUT + fi + + # default target + echo "$1" >> "${T}/eclass-debug.log" + # let the portage user own/write to this file + chmod g+w "${T}/eclass-debug.log" &>/dev/null + + shift + done +} + +# The following 2 functions are debug-print() wrappers + +debug-print-function() { + str="$1: entering function" + shift + debug-print "$str, parameters: $*" +} + +debug-print-section() { + debug-print "now in section $*" +} + +# Sources all eclasses in parameters +declare -ix ECLASS_DEPTH=0 +inherit() { + ECLASS_DEPTH=$(($ECLASS_DEPTH + 1)) + if [[ $ECLASS_DEPTH > 1 ]]; then + debug-print "*** Multiple Inheritence (Level: ${ECLASS_DEPTH})" + fi + + local location + local PECLASS + + local B_IUSE + local B_DEPEND + local B_RDEPEND + local B_CDEPEND + local B_PDEPEND + while [ "$1" ]; do + location="${ECLASSDIR}/${1}.eclass" + + # PECLASS is used to restore the ECLASS var after recursion. + PECLASS="$ECLASS" + export ECLASS="$1" + + if [ "$EBUILD_PHASE" != "depend" ]; then + if ! hasq $ECLASS $INHERITED; then + echo + echo "QA Notice: ECLASS '$ECLASS' inherited illegally in $CATEGORY/$PF" >&2 + echo + fi + fi + + # any future resolution code goes here + if [ -n "$PORTDIR_OVERLAY" ]; then + local overlay + for overlay in ${PORTDIR_OVERLAY}; do + olocation="${overlay}/eclass/${1}.eclass" + if [ -e "$olocation" ]; then + location="${olocation}" + debug-print " eclass exists: ${location}" + fi + done + fi + debug-print "inherit: $1 -> $location" + + #We need to back up the value of DEPEND and RDEPEND to B_DEPEND and B_RDEPEND + #(if set).. and then restore them after the inherit call. + + #turn off glob expansion + set -f + + # Retain the old data and restore it later. + unset B_IUSE B_DEPEND B_RDEPEND B_CDEPEND B_PDEPEND + [ "${IUSE-unset}" != "unset" ] && B_IUSE="${IUSE}" + [ "${DEPEND-unset}" != "unset" ] && B_DEPEND="${DEPEND}" + [ "${RDEPEND-unset}" != "unset" ] && B_RDEPEND="${RDEPEND}" + [ "${CDEPEND-unset}" != "unset" ] && B_CDEPEND="${CDEPEND}" + [ "${PDEPEND-unset}" != "unset" ] && B_PDEPEND="${PDEPEND}" + unset IUSE DEPEND RDEPEND CDEPEND PDEPEND + #turn on glob expansion + set +f + + source "$location" || export ERRORMSG="died sourcing $location in inherit()" + [ -z "${ERRORMSG}" ] || die "${ERRORMSG}" + + #turn off glob expansion + set -f + + # If each var has a value, append it to the global variable E_* to + # be applied after everything is finished. New incremental behavior. + [ "${IUSE-unset}" != "unset" ] && export E_IUSE="${E_IUSE} ${IUSE}" + [ "${DEPEND-unset}" != "unset" ] && export E_DEPEND="${E_DEPEND} ${DEPEND}" + [ "${RDEPEND-unset}" != "unset" ] && export E_RDEPEND="${E_RDEPEND} ${RDEPEND}" + [ "${CDEPEND-unset}" != "unset" ] && export E_CDEPEND="${E_CDEPEND} ${CDEPEND}" + [ "${PDEPEND-unset}" != "unset" ] && export E_PDEPEND="${E_PDEPEND} ${PDEPEND}" + + [ "${B_IUSE-unset}" != "unset" ] && IUSE="${B_IUSE}" + [ "${B_IUSE-unset}" != "unset" ] || unset IUSE + + [ "${B_DEPEND-unset}" != "unset" ] && DEPEND="${B_DEPEND}" + [ "${B_DEPEND-unset}" != "unset" ] || unset DEPEND + + [ "${B_RDEPEND-unset}" != "unset" ] && RDEPEND="${B_RDEPEND}" + [ "${B_RDEPEND-unset}" != "unset" ] || unset RDEPEND + + [ "${B_CDEPEND-unset}" != "unset" ] && CDEPEND="${B_CDEPEND}" + [ "${B_CDEPEND-unset}" != "unset" ] || unset CDEPEND + + [ "${B_PDEPEND-unset}" != "unset" ] && PDEPEND="${B_PDEPEND}" + [ "${B_PDEPEND-unset}" != "unset" ] || unset PDEPEND + + #turn on glob expansion + set +f + + hasq $1 $INHERITED || export INHERITED="$INHERITED $1" + + export ECLASS="$PECLASS" + + shift + done + ECLASS_DEPTH=$(($ECLASS_DEPTH - 1)) +} + +# Exports stub functions that call the eclass's functions, thereby making them default. +# For example, if ECLASS="base" and you call "EXPORT_FUNCTIONS src_unpack", the following +# code will be eval'd: +# src_unpack() { base_src_unpack; } +EXPORT_FUNCTIONS() { + if [ -z "$ECLASS" ]; then + echo "EXPORT_FUNCTIONS without a defined ECLASS" >&2 + exit 1 + fi + while [ "$1" ]; do + debug-print "EXPORT_FUNCTIONS: ${1} -> ${ECLASS}_${1}" + eval "$1() { ${ECLASS}_$1 "\$@" ; }" > /dev/null + shift + done +} + +# adds all parameters to E_DEPEND and E_RDEPEND, which get added to DEPEND +# and RDEPEND after the ebuild has been processed. This is important to +# allow users to use DEPEND="foo" without frying dependencies added by an +# earlier inherit. It also allows RDEPEND to work properly, since a lot +# of ebuilds assume that an unset RDEPEND gets its value from DEPEND. +# Without eclasses, this is true. But with them, the eclass may set +# RDEPEND itself (or at least used to) which would prevent RDEPEND from +# getting its value from DEPEND. This is a side-effect that made eclasses +# have unreliable dependencies. + +newdepend() { + debug-print-function newdepend $* + debug-print "newdepend: E_DEPEND=$E_DEPEND E_RDEPEND=$E_RDEPEND" + + while [ -n "$1" ]; do + case $1 in + "/autotools") + do_newdepend DEPEND sys-devel/autoconf sys-devel/automake sys-devel/make + ;; + "/c") + do_newdepend DEPEND sys-devel/gcc virtual/libc + do_newdepend RDEPEND virtual/libc + ;; + *) + do_newdepend DEPEND $1 + ;; + esac + shift + done +} + +newrdepend() { + debug-print-function newrdepend $* + do_newdepend RDEPEND $1 +} + +newcdepend() { + debug-print-function newcdepend $* + do_newdepend CDEPEND $1 +} + +newpdepend() { + debug-print-function newpdepend $* + do_newdepend PDEPEND $1 +} + +do_newdepend() { + # This function does a generic change determining whether we're in an + # eclass or not. If we are, we change the E_* variables for deps. + debug-print-function do_newdepend $* + [ -z "$1" ] && die "do_newdepend without arguments" + + # Grab what we're affecting... Figure out if we're affecting eclasses. + [[ ${ECLASS_DEPTH} > 0 ]] && TARGET="E_$1" + [[ ${ECLASS_DEPTH} > 0 ]] || TARGET="$1" + shift # $1 was a variable name. + + while [ -n "$1" ]; do + # This bit of evil takes TARGET and uses it to evaluate down to a + # variable. This is a sneaky way to make this infinately expandable. + # The normal translation of this would look something like this: + # E_DEPEND="${E_DEPEND} $1" :::::: Cool, huh? :) + eval export ${TARGET}=\"\${${TARGET}} \$1\" + shift + done +} + +# this is a function for removing any directory matching a passed in pattern from +# PATH +remove_path_entry() { + save_IFS + IFS=":" + stripped_path="${PATH}" + while [ -n "$1" ]; do + cur_path="" + for p in ${stripped_path}; do + if [ "${p/${1}}" == "${p}" ]; then + cur_path="${cur_path}:${p}" + fi + done + stripped_path="${cur_path#:*}" + shift + done + restore_IFS + PATH="${stripped_path}" +} + +# === === === === === === === === === === === === === === === === === === +# === === === === === functions end, main part begins === === === === === +# === === === === === functions end, main part begins === === === === === +# === === === === === functions end, main part begins === === === === === +# === === === === === === === === === === === === === === === === === === + +if [ "$*" != "depend" ] && [ "$*" != "clean" ]; then + cd ${PORTAGE_TMPDIR} &> /dev/null + cd ${BUILD_PREFIX} &> /dev/null + + if [ "$(id -nu)" == "portage" ] ; then + export USER=portage + fi + + if hasq distcc ${FEATURES} &>/dev/null; then + if [ -d /usr/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="/usr/lib/distcc/bin:${PATH}" + [ ! -z "${DISTCC_LOG}" ] && addwrite "$(dirname ${DISTCC_LOG})" + elif which distcc &>/dev/null; then + export CC="distcc $CC" + export CXX="distcc $CXX" + fi + fi + + if hasq ccache ${FEATURES} &>/dev/null; then + #We can enable compiler cache support + if [ -z "${PATH/*ccache*/}" ]; then + # Remove the other reference. + remove_path_entry "ccache" + fi + + if [ -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}" + fi + + [ -z "${CCACHE_DIR}" ] && export CCACHE_DIR="/root/.ccache" + + addread "${CCACHE_DIR}" + addwrite "${CCACHE_DIR}" + + [ -n "${CCACHE_SIZE}" ] && ccache -M ${CCACHE_SIZE} &> /dev/null + fi + + # XXX: Load up the helper functions. +# for X in /usr/lib/portage/bin/functions/*.sh; do +# source ${X} || die "Failed to source ${X}" +# done + +else + +killparent() { + trap INT + kill ${PORTAGE_MASTER_PID} +} +trap "killparent" INT + +fi # "$*"!="depend" && "$*"!="clean" + +export SANDBOX_ON="1" +export S=${WORKDIR}/${P} + +unset E_IUSE E_DEPEND E_RDEPEND E_CDEPEND E_PDEPEND + +declare -r T P PN PV PVR PR A D EBUILD EMERGE_FROM O PPID FILESDIR +declare -r PORTAGE_TMPDIR + +# Turn of extended glob matching so that g++ doesn't get incorrectly matched. +shopt -u extglob + +QA_INTERCEPTORS="javac java-config python python-config perl grep egrep fgrep sed gcc g++ cc bash awk nawk gawk pkg-config" +# level the QA interceptors if we're in depend +if hasq "depend" "$@"; then + for BIN in ${QA_INTERCEPTORS}; do + BIN_PATH=`type -pf ${BIN}` + if [ "$?" != "0" ]; then + BODY="echo \"*** missing command: ${BIN}\" >&2; return 127" + else + BODY="${BIN_PATH} \"\$@\"; return \$?" + fi + FUNC_SRC="${BIN}() { + echo -n \"QA Notice: ${BIN} in global scope: \" >&2 + if [ \$ECLASS_DEPTH -gt 0 ]; then + echo \"eclass \${ECLASS}\" >&2 + else + echo \"\${CATEGORY}/\${PF}\" >&2 + fi + ${BODY} + }"; + eval "$FUNC_SRC" || echo "error creating QA interceptor ${BIN}" >&2 + done + unset src bin_path body +fi +source ${EBUILD} || die "error sourcing ebuild" +if ! hasq depend $EBUILD_PHASE; then + RESTRICT="${PORTAGE_RESTRICT}" + unset PORTAGE_RESTRICT +fi +[ -z "${ERRORMSG}" ] || die "${ERRORMSG}" + +# Expand KEYWORDS +# We need to turn off pathname expansion for -* in KEYWORDS and +# we need to escape ~ to avoid tilde expansion +set -f +KEYWORDS="`eval echo ${KEYWORDS//~/\\~}`" +set +f + +hasq nostrip ${RESTRICT} && export DEBUGBUILD=1 + +#a reasonable default for $S +if [ "$S" = "" ]; then + export S=${WORKDIR}/${P} +fi + +#wipe the interceptors. we don't want saved. +if hasq "depend" "$@"; then + unset -f $QA_INTERCEPTORS + unset QA_INTERCEPTORS +fi + +#some users have $TMP/$TMPDIR to a custom dir in their home ... +#this will cause sandbox errors with some ./configure +#scripts, so set it to $T. +export TMP="${T}" +export TMPDIR="${T}" + +# Note: this next line is not the same as export RDEPEND=${RDEPEND:-${DEPEND}} +# That will test for unset *or* NULL (""). We want just to set for unset... + +#turn off glob expansion from here on in to prevent *'s and ? in the DEPEND +#syntax from getting expanded :) Fixes bug #1473 +#check eclass rdepends also. bug #58819 +set -f +if [ "${RDEPEND-unset}" == "unset" ] && [ "${E_RDEPEND-unset}" == "unset" ] ; then + export RDEPEND="${DEPEND} ${E_DEPEND}" + debug-print "RDEPEND: not set... Setting to: ${DEPEND}" +fi + +#add in dependency info from eclasses +IUSE="$IUSE $E_IUSE" +DEPEND="$DEPEND $E_DEPEND" +RDEPEND="$RDEPEND $E_RDEPEND" +CDEPEND="$CDEPEND $E_CDEPEND" +PDEPEND="$PDEPEND $E_PDEPEND" + +unset E_IUSE E_DEPEND E_RDEPEND E_CDEPEND E_PDEPEND + +if [ "${EBUILD_PHASE}" != "depend" ]; then + # Lock the dbkey variables after the global phase + declare -r DEPEND RDEPEND SLOT SRC_URI RESTRICT HOMEPAGE LICENSE DESCRIPTION + declare -r KEYWORDS INHERITED IUSE CDEPEND PDEPEND PROVIDE +fi + +set +f + +for myarg in $*; do + case $myarg in + nofetch) + pkg_nofetch + exit 1 + ;; + prerm|postrm|postinst|config) + export SANDBOX_ON="0" + if [ "$PORTAGE_DEBUG" != "1" ]; then + pkg_${myarg} + #Allow non-zero return codes since they can be caused by && + else + set -x + pkg_${myarg} + #Allow non-zero return codes since they can be caused by && + set +x + fi + ;; + unpack|compile|test|clean|install) + if [ "${SANDBOX_DISABLED="0"}" == "0" ]; then + export SANDBOX_ON="1" + else + export SANDBOX_ON="0" + fi + if [ "$PORTAGE_DEBUG" != "1" ]; then + dyn_${myarg} + #Allow non-zero return codes since they can be caused by && + else + set -x + dyn_${myarg} + #Allow non-zero return codes since they can be caused by && + set +x + fi + export SANDBOX_ON="0" + ;; + help|clean|setup|preinst) + #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. + export SANDBOX_ON="0" + if [ "$PORTAGE_DEBUG" != "1" ]; then + dyn_${myarg} + else + set -x + dyn_${myarg} + set +x + fi + ;; + package|rpm) + export SANDBOX_ON="0" + if [ "$PORTAGE_DEBUG" != "1" ]; then + dyn_${myarg} + else + set -x + dyn_${myarg} + set +x + fi + ;; + depend) + export SANDBOX_ON="0" + set -f + + # Handled in portage.py now + #dbkey=${PORTAGE_CACHEDIR}/${CATEGORY}/${PF} + + if [ ! -d "${dbkey%/*}" ]; then + install -d -g ${PORTAGE_GID} -m2775 "${dbkey%/*}" + fi + + # Make it group writable. 666&~002==664 + umask 002 + + #the extra `echo` commands remove newlines + echo `echo "$DEPEND"` > $dbkey + echo `echo "$RDEPEND"` >> $dbkey + echo `echo "$SLOT"` >> $dbkey + echo `echo "$SRC_URI"` >> $dbkey + echo `echo "$RESTRICT"` >> $dbkey + echo `echo "$HOMEPAGE"` >> $dbkey + echo `echo "$LICENSE"` >> $dbkey + echo `echo "$DESCRIPTION"` >> $dbkey + echo `echo "$KEYWORDS"` >> $dbkey + echo `echo "$INHERITED"` >> $dbkey + echo `echo "$IUSE"` >> $dbkey + echo `echo "$CDEPEND"` >> $dbkey + echo `echo "$PDEPEND"` >> $dbkey + echo `echo "$PROVIDE"` >> $dbkey + echo `echo "$UNUSED_01"` >> $dbkey + echo `echo "$UNUSED_02"` >> $dbkey + echo `echo "$UNUSED_03"` >> $dbkey + echo `echo "$UNUSED_04"` >> $dbkey + echo `echo "$UNUSED_05"` >> $dbkey + echo `echo "$UNUSED_06"` >> $dbkey + echo `echo "$UNUSED_07"` >> $dbkey + echo `echo "$UNUSED_08"` >> $dbkey + set +f + #make sure it is writable by our group: + exit 0 + ;; + *) + export SANDBOX_ON="1" + echo "Please specify a valid command." + echo + dyn_help + exit 1 + ;; + esac + + #if [ $? -ne 0 ]; then + # exit 1 + #fi +done + +if [ "$myarg" != "clean" ]; then + # Save current environment and touch a success file. (echo for success) + umask 002 + set | egrep -v "^SANDBOX_" > "${T}/environment" 2>/dev/null + chown portage:portage "${T}/environment" &>/dev/null + chmod g+w "${T}/environment" &>/dev/null +fi + +exit 0 diff --git a/bin/emake b/bin/emake new file mode 100755 index 000000000..44fe83402 --- /dev/null +++ b/bin/emake @@ -0,0 +1,14 @@ +#!/bin/bash +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-src/portage/bin/emake,v 1.9.2.1 2005/05/18 15:19:52 jstubbs Exp $ +# +# emake: Supplies some default parameters to GNU make. At the moment the +# only parameter supplied is -jN, where N is a number of +# parallel processes that should be ideal for the running host +# (e.g. on a single-CPU machine, N=2). The MAKEOPTS variable +# is set in /etc/make.globals. We don't source +# /etc/make.globals here because emake is only called from an +# ebuild. + +${MAKE:-make} ${MAKEOPTS} ${EXTRA_EMAKE} "$@" diff --git a/bin/emerge b/bin/emerge new file mode 100755 index 000000000..5ae171963 --- /dev/null +++ b/bin/emerge @@ -0,0 +1,3213 @@ +#!/usr/bin/python -O +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-src/portage/bin/emerge,v 1.345.2.38 2005/08/13 17:25:26 ferringb Exp $ + +import os,sys +os.environ["PORTAGE_CALLER"]="emerge" +sys.path = ["/usr/lib/portage/pym"]+sys.path + +import portage + +import emergehelp,xpak,string,re,commands,time,shutil,traceback,atexit,signal,socket,types +from stat import * +from output import * + +import portage_util +import portage_locks +import portage_exception + + +spinner_msgs = ["Gentoo Rocks ("+os.uname()[0]+")", + "Thank you for using Gentoo. :)", + "Are you actually trying to read this?", + "How many times have you stared at this?", + "We are generating the cache right now", + "You are paying too much attention.", + "A theory is better than its explanation.", + "Phasers locked on target, Captain.", + "Thrashing is just virtual crashing.", + "To be is to program.", + "Real Users hate Real Programmers.", + "When all else fails, read the instructions.", + "Functionality breeds Contempt.", + "The future lies ahead.", + "3.1415926535897932384626433832795028841971694", + "Sometimes insanity is the only alternative.", + "Inaccuracy saves a world of explanation.", + ] + + +def update_basic_spinner(): + global spinner, spinpos + spinpos = (spinpos+1) % 500 + if (spinpos % 100) == 0: + if spinpos == 0: + sys.stdout.write(". ") + else: + sys.stdout.write(".") + sys.stdout.flush() + +def update_scroll_spinner(): + global spinner, spinpos + if(spinpos >= len(spinner)): + sys.stdout.write(darkgreen(" \b\b\b"+spinner[len(spinner)-1-(spinpos%len(spinner))])) + else: + sys.stdout.write(green("\b "+spinner[spinpos])) + sys.stdout.flush() + spinpos = (spinpos+1) % (2*len(spinner)) + +def update_twirl_spinner(): + global spinner, spinpos + spinpos = (spinpos+1) % len(spinner) + sys.stdout.write("\b\b "+spinner[spinpos]) + sys.stdout.flush() + +spinpos = 0 +spinner = "/-\\|/-\\|/-\\|/-\\|\\-/|\\-/|\\-/|\\-/|" +update_spinner = update_twirl_spinner +if "candy" in portage.settings.features: + spinner = spinner_msgs[int(time.time()*100)%len(spinner_msgs)] + update_spinner = update_scroll_spinner +if not sys.stdout.isatty() or ("--nospinner" in sys.argv): + update_spinner = update_basic_spinner + + +if (not sys.stdout.isatty()) or (portage.settings["NOCOLOR"] in ["yes","true"]): + nocolor() + +def normpath(mystr): + if mystr and (mystr[0]=='/'): + return os.path.normpath("///"+mystr) + else: + return os.path.normpath(mystr) + +def userquery(prompt, responses=None, colours=None): + """Displays a prompt and a set of responses, then waits for a response + which is checked against the responses and the first to match is + returned. + + prompt: a String. + responses: a List of Strings. + colours: a List of Functions taking and returning a String, used to + process the responses for display. Typically these will be functions + like red() but could be e.g. lambda x: "DisplayString". + If responses is omitted, defaults to ["Yes", "No"], [green, red]. + If only colours is omitted, defaults to [bold, ...]. + + Returns a member of the List responses. (If called without optional + arguments, returns "Yes" or "No".) + KeyboardInterrupt is converted to SystemExit to avoid tracebacks being + printed.""" + if responses is None: + responses, colours = ["Yes", "No"], [green, red] + elif colours is None: + colours=[bold] + colours=(colours*len(responses))[:len(responses)] + print bold(prompt), + try: + while True: + response=raw_input("["+string.join([colours[i](responses[i]) for i in range(len(responses))],"/")+"] ") + for key in responses: + if response.upper()==key[:len(response)].upper(): + return key + print "Sorry, response '%s' not understood." % response, + except (EOFError, KeyboardInterrupt): + print "Interrupted." + sys.exit(1) + +def sorted_versions(verlist): + ret = [] + for ver in verlist: + verparts = ver.split("-") + if len(verparts) == 2: + verrev = int(verparts[1][1:]) + else: + verrev = 0 + x = 0 + while x < len(ret): + retparts = ret[x].split("-") + verdiff = portage.vercmp(retparts[0], verparts[0]) + if verdiff > 0: + break + elif verdiff == 0: + if len(retparts) == 2: + retrev = int(retparts[1][1:]) + else: + retrev = 0 + if retrev >= verrev: + break + x += 1 + ret.insert(x, ver) + return ret + +if portage.settings.has_key("PORTAGE_NICENESS"): + try: + os.nice(int(portage.settings["PORTAGE_NICENESS"])) + except SystemExit, e: + raise # Needed else can't exit + except Exception,e: + print "!!! Failed to change nice value to '"+str(portage.settings["PORTAGE_NICENESS"])+"'" + print "!!!",e + +#Freeze the portdbapi for enhanced performance: +portage.portdb.freeze() + +# Kill noauto as it will break merges otherwise. +while 'noauto' in portage.features: + del portage.features[portage.features.index('noauto')] + +#number of ebuilds merged +merged=0 +params=["selective", "deep", "self", "recurse", "empty"] +actions=[ +"clean", "config", "depclean", +"info", "inject", "metadata", +"prune", "regen", "rsync", "search", +"sync", "system", "unmerge", "world", +] +options=[ +"--ask", +"--buildpkg", "--buildpkgonly", +"--changelog", "--columns", +"--debug", "--deep", +"--digest", +"--emptytree", +"--fetchonly", "--fetch-all-uri", +"--getbinpkg", "--getbinpkgonly", +"--help", "--noconfmem", +"--newuse", "--nocolor", +"--nodeps", "--noreplace", +"--nospinner", "--oneshot", +"--onlydeps", "--pretend", +"--quiet", "--resume", +"--searchdesc", "--selective", +"--skipfirst", +"--tree", +"--update", "--upgradeonly", +"--usepkg", "--usepkgonly", +"--verbose", "--version" +] + +shortmapping={ +"1":"--oneshot", +"a":"--ask", +"b":"--buildpkg", "B":"--buildpkgonly", +"c":"--clean", "C":"--unmerge", +"d":"--debug", "D":"--deep", +"e":"--emptytree", +"f":"--fetchonly", "F":"--fetch-all-uri", +"g":"--getbinpkg", "G":"--getbinpkgonly", +"h":"--help", +"i":"--inject", +"k":"--usepkg", "K":"--usepkgonly", +"l":"--changelog", +"n":"--noreplace", "N":"--newuse", +"o":"--onlydeps", "O":"--nodeps", +"p":"--pretend", "P":"--prune", +"q":"--quiet", +"s":"--search", "S":"--searchdesc", +'t':"--tree", +"u":"--update", "U":"--upgradeonly", +"v":"--verbose", "V":"--version" +} + +myaction=None +myopts=[] +myfiles=[] +edebug=0 + +# process short actions +tmpcmdline=sys.argv[1:] +#tmpcmdline.extend(portage.settings["EMERGE_OPTS"].split()) +cmdline=[] +for x in tmpcmdline: + if x[0:1]=="-"and x[1:2]!="-": + for y in x[1:]: + if shortmapping.has_key(y): + if shortmapping[y] in cmdline: + print + print "*** Warning: Redundant use of",shortmapping[y] + else: + cmdline.append(shortmapping[y]) + else: + print "!!! Error: -"+y+" is an invalid short action or option." + sys.exit(1) + else: + cmdline.append(x) + +# process the options and command arguments +for x in cmdline: + if not x: + continue + if len(x)>=2 and x[0:2]=="--": + if x in options: + myopts.append(x) + elif x[2:] in actions: + if x[2:]=="rsync" or x=="rsync": + # "emerge --rsync" + print + print red("*** '--rsync' has been deprecated.") + print red("*** Please use '--sync' instead.") + print + x="--sync" + if myaction: + if myaction not in ["system", "world"]: + myaction="--"+myaction + print + print red("!!!")+green(" Multiple actions requested... Please choose one only.") + print red("!!!")+" '"+darkgreen(myaction)+"' "+red("or")+" '"+darkgreen(x)+"'" + print + sys.exit(1) + myaction=x[2:] + else: + print "!!! Error:",x,"is an invalid option." + sys.exit(1) + elif (not myaction) and (x in actions): + if x not in ["system", "world"]: + #print red("*** Deprecated use of action '"+x+"'") + if x=="rsync": + # "emerge rsync" + print + print red("*** 'rsync' will now install the package rsync.") + print red("*** To sync the tree, please use '--sync' instead.") + print + myfiles.append(x) + continue + if myaction: + print + print red("!!!")+green(" Multiple actions requested... Please choose one only.") + print red("!!! '")+darkgreen(myaction)+"' "+red("or")+" '"+darkgreen(x)+"'" + print + sys.exit(1) + myaction=x + elif x[-1]=="/": + # this little conditional helps tab completion + myfiles.append(x[:-1]) + else: + myfiles.append(x) + + +if "moo" in myfiles: + print """ + + Gentoo (""" + os.uname()[0] + """) + + _______________________ +< Have you mooed today? > + ----------------------- + \ ^__^ + \ (oo)\_______ + (__)\ )\/\ + ||----w | + || || + +""" + +if (myaction in ["world", "system"]) and myfiles: + print "emerge: please specify a package class (\"world\" or \"system\") or individual packages, but not both." + sys.exit(1) + +for x in myfiles: + if (x[-7:] == ".ebuild" or x[-5:] == ".tbz2") and os.path.exists(os.path.abspath(x)): + print "emerging by path implies --oneshot... adding --oneshot to options." + print red("\n*** emerging by path is broken and may not always work!!!\n") + break + +if ("--tree" in myopts) and ("--columns" in myopts): + print "emerge: can't specify both of \"--tree\" and \"--columns\"." + sys.exit(1) + +# Always create packages if FEATURES=buildpkg +# Imply --buildpkg if --buildpkgonly +if ("buildpkg" in portage.features) or ("--buildpkgonly" in myopts): + if "--buildpkg" not in myopts: + myopts.append("--buildpkg") + +# --tree only makes sense with --pretend +if "--tree" in myopts and not (("--pretend" in myopts) or ("--ask" in myopts)): + print ">>> --tree implies --pretend... adding --pretend to options." + myopts.append("--pretend") + +# Also allow -S to invoke search action (-sS) +if ("--searchdesc" in myopts): + if myaction and myaction != "search": + myfiles.append(myaction) + if "--search" not in myopts: + myopts.append("--search") + myaction = "search" + +# Always try and fetch binary packages if FEATURES=getbinpkg +if ("getbinpkg" in portage.features): + myopts.append("--getbinpkg") + +if ("--getbinpkgonly" in myopts) and not ("--usepkgonly" in myopts): + myopts.append("--usepkgonly") + +if ("--getbinpkgonly" in myopts) and not ("--getbinpkg" in myopts): + myopts.append("--getbinpkg") + +if ("--getbinpkg" in myopts) and not ("--usepkg" in myopts): + myopts.append("--usepkg") + +# Also allow -K to apply --usepkg/-k +if ("--usepkgonly" in myopts) and not ("--usepkg" in myopts): + myopts.append("--usepkg") + +# Print deprecation warning for -U +if ("--upgradeonly" in myopts): + print + print red("*** Warning: --upgradeonly is a deprecated option in portage-"+portage.VERSION) + print red("*** and will likely be removed in a future version.") + print + # Also allow -U to apply --update/-u + if not ("--update" in myopts): + print ">>> --upgradeonly implies --update... adding --update to options." + myopts.append("--update") + +# Also allow -l to apply --pretend/-p, but if already in --ask mode +if ("--changelog" in myopts) and not (("--pretend" in myopts) or ("--ask" in myopts)): + print ">>> --changelog implies --pretend... adding --pretend to options." + myopts.append("--pretend") + +# Allow -p to remove --ask +if ("--pretend" in myopts) and ("--ask" in myopts): + print ">>> --pretend disables --ask... removing --ask from options." + myopts.remove("--ask") + +# forbid --ask when not in a terminal +# note: this breaks `emerge --ask | tee logfile`, but that doesn't work anyway. +if ("--ask" in myopts) and (not sys.stdin.isatty()): + portage.writemsg("!!! \"--ask\" should only be used in a terminal. Exiting.\n") + sys.exit(1) + +# Set so that configs will be merged regardless of remembered status +if ("--noconfmem" in myopts): + portage.settings.unlock() + portage.settings["NOCONFMEM"]="1" + portage.settings.backup_changes("NOCONFMEM") + portage.settings.lock() + +# Set various debug markers... They should be merged somehow. +if ("--debug" in myopts): + portage.settings.unlock() + portage.settings["PORTAGE_DEBUG"]="1" + portage.settings.backup_changes("PORTAGE_DEBUG") + portage.debug=1 + portage.settings.lock() + +if ("--resume" in myopts): + if "--verbose" in myopts: + print "* --verbose is currently broken with --resume. Disabling..." + myopts.remove("--verbose") + if "--tree" in myopts: + print "* --tree is currently broken with --resume. Disabling..." + myopts.remove("--tree") + +# Set color output +if ("--nocolor" in myopts) and (sys.stdout.isatty()): + nocolor() + +CLEAN_DELAY = 5 +EMERGE_WARNING_DELAY = 10 +if portage.settings["CLEAN_DELAY"]: + CLEAN_DELAY = string.atoi("0"+portage.settings["CLEAN_DELAY"]) +if portage.settings["EMERGE_WARNING_DELAY"]: + EMERGE_WARNING_DELAY = string.atoi("0"+portage.settings["EMERGE_WARNING_DELAY"]) + +if "inject" == myaction: + 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("*** 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("*** For more information on fine-grained portage control, please see") + print red("*** the portage man page.") + print + +def emergelog(mystr,short_msg=None): + if "notitles" not in portage.features: + if short_msg: + xtermTitle(short_msg) + else: + 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) + else: + mylogfile=open("/var/log/emerge.log", "a") + + l=portage_locks.lockfile(mylogfile) + # seek because we may have gotten held up by the lock. + # if so, we may not be positioned at the end of the file. + mylogfile.seek(0,2) + mylogfile.write(str(time.time())[:10]+": "+mystr+"\n") + mylogfile.flush() + portage_locks.unlockfile(l) + mylogfile.close() + except SystemExit, e: + raise # Needed else can't exit + except Exception, e: + if edebug: + print "emergelog():",e + pass + +def emergeexit(): + """This gets out final log message in before we quit.""" + if "--pretend" not in myopts: + emergelog(" *** terminating.") + if "notitles" not in portage.features: + xtermTitleReset() +atexit.register(emergeexit) + +def emergeexitsig(signum, frame): + signal.signal(signal.SIGINT, signal.SIG_IGN) + portage.portageexit() + portage_util.writemsg("\n\nExiting on signal %(signal)s\n" % {"signal":signum}) + sys.exit(100+signum) +signal.signal(signal.SIGINT, emergeexitsig) + +def countdown(secs=5, doing="Starting"): + if secs: + print ">>> Waiting",secs,"seconds before starting..." + print ">>> (Control-C to abort)...\n"+doing+" in: ", + ticks=range(secs) + ticks.reverse() + for sec in ticks: + sys.stdout.write(red(str(sec+1)+" ")) + sys.stdout.flush() + time.sleep(1) + print + +# formats a size given in bytes nicely +def format_size(mysize): + if type(mysize) not in [types.IntType,types.LongType]: + return str(mysize) + mystr=str(mysize/1024) + mycount=len(mystr) + while (mycount > 3): + mycount-=3 + mystr=mystr[:mycount]+","+mystr[mycount:] + return mystr+" kB" + + +def getgccversion(): + """ + rtype: C{str} + return: the current in-use gcc version + """ + + gcc_env_dir = os.path.join('/', '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" + + "!!! to update the environment of this terminal and possibly\n" + + "!!! other terminals also." + ) + + gcc_distcc_broken_error = green( + '!!! Relying on the shell to locate gcc, this may break\n' + + '!!! DISTCC, installing gcc-config and setting your current gcc\n' + + '!!! profile will fix this' + ) + + def fallback(): + + print >>sys.stderr, gcc_distcc_broken_error + + gccout = commands.getstatusoutput(gcc_ver_command) + + if gccout[0] != 0: + print >>sys.stderr, gcc_not_found_error + gccver = "[unavailable]" + else: + gccver = gcc_ver_prefix + gccout[1] + + return gccver + + if os.path.isfile(gcc_config_config): + try: + gccver_str = open(gcc_config_config).read().strip() + gccver = gcc_ver_prefix + string.join(gccver_str.split('-')[4:], '-') + except IndexError: + gccver = fallback() + + else: + import glob + dir_l = glob.glob(os.path.join(gcc_env_dir, '*-*')) + + if len(dir_l) == 1: + try: + gccver = gcc_ver_prefix + dir_l[0].split('-')[-1] + except IndexError: + gccver = fallback() + + else: + # There was no "config" file in /etc/env.d/gcc and there was more + # than one profile in /etc/env.d/gcc so we can't actively + # determine what version of gcc we are using so we fall back on the + # old way that breaks distcc + + gccver = fallback() + + return gccver + +def getportageversion(): + try: + import re + profilever = os.path.normpath("///"+os.readlink("/etc/make.profile")) + basepath = os.path.normpath("///"+portage.settings["PORTDIR"]+"/profiles") + if re.match(basepath,profilever): + profilever = profilever[len(basepath)+1:] + else: + profilever = "!"+profilever + del basepath + except SystemExit, e: + raise # Needed else can't exit + except: + profilever="unavailable" + libcver=[] + libclist = portage.vardbapi(portage.root).match("virtual/libc") + libclist += portage.vardbapi(portage.root).match("virtual/glibc") + libclist = portage_util.unique_array(libclist) + for x in libclist: + xs=portage.catpkgsplit(x) + if libcver: + libcver+=","+string.join(xs[1:], "-") + else: + libcver=string.join(xs[1:], "-") + if libcver==[]: + libcver="unavailable" + + gccver = getgccversion() + unameout=os.uname()[2]+" "+os.uname()[4] + + return "Portage " + portage.VERSION +" ("+profilever+", "+gccver+", "+libcver+", "+unameout+")" + +def help(): + # Move all the help stuff out of this file. + emergehelp.help(myaction,myopts,havecolor) + +# check if root user is the current user for the actions where emerge needs this +if ("--pretend" in myopts) or ("--fetchonly" in myopts or "--fetch-all-uri" in myopts) or (myaction=="search"): + if not portage.secpass: + if portage.wheelgid==portage.portage_gid: + print "emerge: wheel group membership required for \"--pretend\" and search." + print "emerge: wheel group use is being deprecated. Please update group and passwd to" + print " include the portage user as noted above, and then use group portage." + else: + print "emerge: portage group membership required for \"--pretend\" and search." + sys.exit(1) +elif "--version" in myopts: + print getportageversion() + sys.exit(0) +elif "--help" in myopts: + help() + sys.exit(0) +elif portage.secpass!=2: + if myaction in ["search", "info", "regen"]: + pass + elif (not myaction) and (not myfiles): + pass + elif ("--pretend" in myopts) and (myaction in ["world","system","clean","prune","unmerge"]): + pass + else: + if "--debug" in myopts: + print "myaction",myaction + print "myopts",myopts + print "emerge: root access required." + sys.exit(1) + +if not "--pretend" in myopts: + emergelog("Started emerge on: "+time.strftime("%b %d, %Y %H:%M:%S", time.localtime())) + myelogstr="" + if myopts: + myelogstr=string.join(myopts, " ") + if myaction: + myelogstr+=" "+myaction + if myfiles: + myelogstr+=" "+string.join(myfiles, " ") + emergelog(" *** emerge "+myelogstr) + +#configure emerge engine parameters +# +# self: include _this_ package regardless of if it is merged. +# selective: exclude the package if it is merged +# recurse: go into the dependencies +# empty: pretend nothing is merged +myparams=["self","recurse"] +add=[] +sub=[] +if "--update" in myopts: + add.extend(["selective","empty"]) +if "--emptytree" in myopts: + add.extend(["empty"]) + sub.extend(["selective"]) +if "--nodeps" in myopts: + sub.extend(["recurse"]) +if "--noreplace" in myopts: + add.extend(["selective"]) +if "--deep" in myopts: + add.extend(["deep"]) +if "--selective" in myopts: + add.extend(["selective"]) +if myaction in ["world","system"]: + add.extend(["selective"]) +elif myaction in ["depclean"]: + add.extend(["empty"]) + sub.extend(["selective"]) +for x in add: + if (x not in myparams) and (x not in sub): + myparams.append(x) +for x in sub: + if x in myparams: + myparams.remove(x) + +# search functionality +class search: + + # + # class constants + # + VERSION_SHORT=1 + VERSION_RELEASE=2 + + # + # public interface + # + def __init__(self): + """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"] + + def execute(self,searchkey): + """Performs the search for the supplied search key""" + global myopts + match_category = 0 + self.searchkey=searchkey + self.packagematches = [] + if "--searchdesc" in myopts: + self.searchdesc=1 + self.matches = {"pkg":[], "desc":[]} + else: + self.searchdesc=0 + self.matches = {"pkg":[]} + print "Searching... ", + + if self.searchkey[0] == '@': + match_category = 1 + self.searchkey = self.searchkey[1:] + if self.searchkey=="*": + #hack for people who aren't regular expression gurus + self.searchkey==".*" + if re.search("\+\+", self.searchkey): + #hack for people who aren't regular expression gurus + self.searchkey=re.sub("\+\+","\+\+",self.searchkey) + self.searchre=re.compile(self.searchkey.lower(),re.I) + for package in portage.portdb.cp_all(): + update_spinner() + + if match_category: + match_string = package[:] + else: + match_string = package.split("/")[-1] + + masked=0 + if self.searchre.search(match_string): + if not portage.portdb.xmatch("match-visible",package): + masked=1 + self.matches["pkg"].append([package,masked]) + elif self.searchdesc: # DESCRIPTION searching + full_package = portage.portdb.xmatch("bestmatch-visible",package) + if not full_package: + #no match found; we don't want to query description + full_package=portage.best(portage.portdb.xmatch("match-all",package)) + if not full_package: + continue + else: + masked=1 + try: + full_desc = portage.portdb.aux_get(full_package,["DESCRIPTION"])[0] + except KeyError: + print "emerge: search: aux_get() failed, skipping" + continue + if self.searchre.search(full_desc): + self.matches["desc"].append([full_package,masked]) + self.mlen=0 + for mtype in self.matches.keys(): + self.matches[mtype].sort() + self.mlen += len(self.matches[mtype]) + + def output(self): + """Outputs the results of the search.""" + print "\b\b \n[ Results for search key : "+white(self.searchkey)+" ]" + print "[ Applications found : "+white(str(self.mlen))+" ]" + print " " + for mtype in self.matches.keys(): + for match,masked in self.matches[mtype]: + if mtype=="pkg": + catpack=match + full_package = portage.portdb.xmatch("bestmatch-visible",match) + if not full_package: + #no match found; we don't want to query description + masked=1 + full_package=portage.best(portage.portdb.xmatch("match-all",match)) + else: + full_package = match + match = portage.pkgsplit(match)[0] + + if full_package: + try: + desc, homepage, license = portage.portdb.aux_get(full_package,["DESCRIPTION","HOMEPAGE","LICENSE"]) + except KeyError: + print "emerge: search: aux_get() failed, skipping" + continue + if masked: + print green("*")+" "+white(match)+" "+red("[ Masked ]") + else: + print green("*")+" "+white(match) + myversion = self.getVersion(full_package, search.VERSION_RELEASE) + + mysum = [0,0] + mycat = match.split("/")[0] + mypkg = match.split("/")[1] + + mydigest = portage.db["/"]["porttree"].dbapi.finddigest(mycat+"/"+mypkg + "-" + myversion) + + try: + myfile = open(mydigest,"r") + for line in myfile.readlines(): + mysum[0] += int(line.split(" ")[3]) + myfile.close() + mystr = str(mysum[0]/1024) + mycount=len(mystr) + while (mycount > 3): + mycount-=3 + mystr=mystr[:mycount]+","+mystr[mycount:] + mysum[0]=mystr+" kB" + except SystemExit, e: + raise # Needed else can't exit + except Exception, e: + if edebug: + print "!!! Exception:",e + mysum[0]=" [no/bad digest]" + + if "--quiet" not in myopts: + print " ", darkgreen("Latest version available:"),myversion + print " ", self.getInstallationStatus(mycat+'/'+mypkg) + print " ", darkgreen("Size of downloaded files:"),mysum[0] + print " ", darkgreen("Homepage:")+" ",homepage + print " ", darkgreen("Description:"),desc + print " ", darkgreen("License:")+" ",license + print + print + # + # private interface + # + def getInstallationStatus(self,package): + installed_package = self.installcache.dep_bestmatch(package) + result = "" + version = self.getVersion(installed_package,search.VERSION_RELEASE) + if len(version) > 0: + result = darkgreen("Latest version installed:")+" "+version + else: + result = darkgreen("Latest version installed:")+" [ Not Installed ]" + return result + + def getVersion(self,full_package,detail): + if len(full_package) > 1: + package_parts = portage.catpkgsplit(full_package) + if detail == search.VERSION_RELEASE and package_parts[3] != 'r0': + result = package_parts[2]+ "-" + package_parts[3] + else: + result = package_parts[2] + else: + result = "" + return result + + +#build our package digraph +def getlist(mode): + if mode=="system": + mylines=portage.settings.packages + elif mode=="world": + try: + myfile=open(portage.root+portage.WORLD_FILE,"r") + mylines=myfile.readlines() + myfile.close() + except OSError: + print "!!! Couldn't open "+pfile+"; exiting." + sys.exit(1) + except IOError: + #world file doesn't exist + mylines=[] + mynewlines=[] + for x in mylines: + myline=string.join(string.split(x)) + if not len(myline): + continue + elif myline[0]=="#": + continue + elif mode=="system": + if myline[0]!="*": + continue + myline=myline[1:] + mynewlines.append(myline.strip()) + return mynewlines + +def genericdict(mylist): + mynewdict={} + for x in mylist: + mynewdict[portage.dep_getkey(x)]=x + return mynewdict + +olddbapi=None +class depgraph: + + def __init__(self,myaction,myopts): + 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!!! Is the symlink correct? Is your portage tree complete?\n\n")) + sys.exit(9) + self.applied_useflags = {} + + self.missingbins=[] + self.myaction=myaction + self.digraph=portage.digraph() + self.orderedkeys=[] + self.outdatedpackages=[] + self.mydbapi={} + self.mydbapi["/"] = 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() + if "empty" not in myparams: + for pkg in portage.db[portage.root]["vartree"].getallcpv(): + self.mydbapi[portage.root].cpv_inject(pkg) + + if "--usepkg" in myopts: + portage.db["/"]["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 + mybigkey = specification of package to merge; myparent = parent package (one depending on me); + addme = should I be added to the tree? (for the --onlydeps mode)""" + #stuff to add: + #SLOT-aware emerge + #IUSE-aware emerge + #"no downgrade" emerge + #print "mybigkey:",mybigkey + + jbigkey=string.join(mybigkey) + if self.digraph.hasnode(jbigkey+" merge") or self.digraph.hasnode(jbigkey+" nomerge"): + #this conditional is needed to prevent infinite recursion on already-processed deps + return 1 + + update_spinner() + + mytype,myroot,mykey=mybigkey + # select the correct /var database that we'll be checking against + vardbapi=portage.db[myroot]["vartree"].dbapi + + if addme: + # if the package is already on the system, we add a "nomerge" + # directive, otherwise we add a "merge" directive. + 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 "--buildpkgonly" not in myopts and myparent and (self.mydbapi[myroot].match(mykey) or vardbapi.match(mykey)): + mybigkey.append(myparent.split()[2]) + self.digraph.addnode(string.join(mybigkey),myparent) + return 1 + + if myuse == None: + self.pkgsettings.setcpv(mykey) + myuse=string.split(self.pkgsettings["USE"], " ") + + self.applied_useflags[mykey] = myuse + + merging=1 + if addme: + # this is where we add the node to the list of packages to merge + if not myparent: + # command-line specified or part of a world list... + if ("self" not in myparams) or (("selective" in myparams) and vardbapi.cpv_exists(mykey)): + # the package is on the system, so don't merge it. + merging=0 + elif ("selective" in myparams) and vardbapi.cpv_exists(mykey): + merging=0 + + if (merging==0 and mytype=="ebuild" and "--newuse" in myopts and vardbapi.cpv_exists(mykey)): + iuses=string.split(portage.portdb.aux_get(mykey, ["IUSE"])[0]) + old_use=string.split(vardbapi.aux_get(mykey, ["USE"])[0]) + now_use=string.split(self.pkgsettings["USE"]) + for x in iuses: + if (old_use.count(x) and not now_use.count(x)) or (not old_use.count(x) and now_use.count(x)): + merging=1 + break + else: + #onlydeps mode; don't merge + merging=2 + if merging==1: + mybigkey.append("merge") + else: + mybigkey.append("nomerge") + + # whatever the case, we need to add the node to our digraph so + # that children can depend upon it. + self.digraph.addnode(string.join(mybigkey),myparent) + if ("deep" not in myparams) and (not merging): + return 1 + elif "recurse" not in myparams: + return 1 + + edepend={} + if mytype=="binary": + mypkgparts=portage.catpkgsplit(mykey) + tbz2name = string.split(mykey, "/")[1]+".tbz2" + if tbz2name in portage.db[portage.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] + edepend["DEPEND"] ="" + edepend["RDEPEND"]=string.join(string.split(edepend["RDEPEND"])," ") + edepend["PDEPEND"]=string.join(string.split(edepend["PDEPEND"])," ") + edepend["CDEPEND"]=string.join(string.split(edepend["CDEPEND"])," ") + edepend["SLOT"] =string.strip(edepend["SLOT"]) + #portage.db[portage.root]["bintree"].gettbz2(mykey) + else: # It's local. + mytbz2=xpak.tbz2(portage.db[portage.root]["bintree"].getname(mykey)) + edepend["DEPEND"] ="" + edepend["RDEPEND"]=string.join(mytbz2.getelements("RDEPEND")," ") + edepend["PDEPEND"]=string.join(mytbz2.getelements("PDEPEND")," ") + edepend["CDEPEND"]=string.join(mytbz2.getelements("CDEPEND")," ") + edepend["SLOT"] =mytbz2.getfile("SLOT",mypkgparts[2]) + elif mytype=="ebuild": + try: + mymeta = ["DEPEND","RDEPEND","PDEPEND","CDEPEND"] + myfoo = portage.portdb.aux_get(mykey, mymeta) + for index in range(0,len(mymeta)): + edepend[mymeta[index]] = myfoo[index] + except (KeyError,IOError): + print "emerge: create(): aux_get() error on",mykey+"; aborting..." + sys.exit(1) + mydep={} + mp=string.join(mybigkey) + + if myroot=="/": + mydep["/"]=edepend["DEPEND"]+" "+edepend["RDEPEND"] + if not self.select_dep("/",mydep["/"],myparent=mp,myuse=myuse): + return 0 + else: + mydep["/"]=edepend["DEPEND"] + mydep[myroot]=edepend["RDEPEND"] + if not self.select_dep("/",mydep["/"],myparent=mp,myuse=myuse): + return 0 + if not self.select_dep(myroot,mydep[myroot],myparent=mp,myuse=myuse): + return 0 + + if edepend.has_key("PDEPEND") and edepend["PDEPEND"]: + # Post Depend -- Add to the list without a parent, as it depends + # on a package being present AND must be built after that package. + if not self.select_dep(myroot,edepend["PDEPEND"],myuse=myuse): + return 0 + + return 1 + + def select_files(self,myfiles): + "given a list of .tbz2s, .ebuilds and deps, create the appropriate depgraph and return a favorite list" + myfavorites=[] + for x in myfiles: + if x[-5:]==".tbz2": + if not os.path.exists(x): + if os.path.exists(self.pkgsettings["PKGDIR"]+"/All/"+x): + x=self.pkgsettings["PKGDIR"]+"/All/"+x + elif os.path.exists(self.pkgsettings["PKGDIR"]+"/"+x): + x=self.pkgsettings["PKGDIR"]+"/"+x + else: + print "\n\n!!! Binary package '"+str(x)+"' does not exist." + print "!!! Please ensure the tbz2 exists as specified.\n" + 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): + 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): + 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) + 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.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("*** 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): + return (0,myfavorites) + elif not "--oneshot" in myopts: + myfavorites.append(mykey) + else: + try: + mykey=portage.dep_expand(x,mydb=portage.portdb) + except ValueError, errpkgs: + print "\n\n!!! The short ebuild name \"" + x + "\" is ambiguous. Please specify" + print "!!! one of the following fully-qualified ebuild names instead:\n" + for i in errpkgs[0]: + print " " + green(i) + print + sys.exit(1) + + # select needs to return 0 on dep_check failure + + sys.stdout.flush() + sys.stderr.flush() + + try: + self.mysd = self.select_dep(portage.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") + portage.writemsg("!!! to aid in the detection of malicious intent.\n\n") + portage.writemsg("!!! THIS IS A POSSIBLE INDICATION OF A TAMPERED FILES -- CHECK CAREFULLY.\n") + portage.writemsg("!!! Affected file: %s\n" % (e)) + sys.exit(1) + except portage_exception.InvalidSignature, e: + portage.writemsg("\n\n!!! An invalid gpg signature is preventing portage from calculating the\n") + portage.writemsg("!!! required dependencies. This is a security feature enabled by the admin\n") + portage.writemsg("!!! to aid in the detection of malicious intent.\n\n") + portage.writemsg("!!! THIS IS A POSSIBLE INDICATION OF A TAMPERED FILES -- CHECK CAREFULLY.\n") + portage.writemsg("!!! Affected file: %s\n" % (e)) + sys.exit(1) + except SystemExit, e: + raise # Needed else can't exit + except Exception, e: + if "--debug" in myopts: + raise + print "\n\n!!! Problem in",mykey,"dependencies." + print "!!!",str(e),e.__module__ + sys.exit(1) + + if not self.mysd: + return (0,myfavorites) + elif not "--oneshot" in myopts: + myfavorites.append(mykey) + + missing=0 + if "--usepkgonly" in myopts: + for x in self.digraph.dict.keys(): + xs=string.split(x," ") + if (xs[0] != "binary") and (xs[3]=="merge"): + if missing == 0: + print + missing += 1 + print "Missing binary for:",xs[2] + + # We're true here unless we are missing binaries. + return (not missing,myfavorites) + + 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 + + matches=portage.db[myroot]["vartree"].dbapi.match(pkg) + if matches: + myslot=portage.db["/"]["porttree"].getslot(pkgver) + for match in matches: + if portage.pkgcmp(portage.catpkgsplit(pkgver)[1:], portage.catpkgsplit(match)[1:]) < 0: + curslot=portage.db[myroot]["vartree"].getslot(match) + if curslot == myslot: + return match + + def select_dep(self,myroot,depstring,myparent=None,arg=None,myuse=None): + "given a dependency string, create the appropriate depgraph and return 1 on success and 0 on failure" + if "--debug" in myopts: + print + print "Parent: ",myparent + 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) + + if not mycheck[0]: + mymerge=[] + else: + mymerge=mycheck[1] + + else: + #we're processing a command-line argument; unconditionally merge it even if it's already merged + mymerge=[depstring] + + # dep_check has been run so we can now add our parent to our + # build state to update virtuals and other settings. This + # happens after the package is added to the tree so that a + # package can depend on a virtual which it satisfies. + if myparent: + myp = myparent.split() + if myp[3]=="merge": + self.mydbapi[myroot].cpv_inject(myp[2]) + if myp[0]=="binary": + self.pkgsettings.setinst(myp[2],portage.db["/"]["bintree"].dbapi) + else: + self.pkgsettings.setinst(myp[2],portage.db[myroot]["porttree"].dbapi) + + if not mymerge: + return 1 + + if "--debug" in myopts: + print "Candidates:",mymerge + for x in mymerge: + myk=None + binpkguseflags=None + if x[0]=="!": + # if this package is myself, don't append it to block list. + if "--debug" in myopts: + print "Myparent",myparent + if (myparent): + if myparent.split()[2] in portage.portdb.xmatch("match-all", x[1:]): + # myself, so exit. + continue + # adding block + myk=["blocks",myroot,x[1:]] + else: + #We are not processing a blocker but a normal dependency + myeb=None + myeb_matches = portage.portdb.xmatch("match-visible",x) + if ("--usepkgonly" not in myopts): + myeb=portage.best(myeb_matches) + + myeb_pkg=None + 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) + 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): + if myeb_pkg_matches[idx] not in myeb_matches: + del myeb_pkg_matches[idx] + myeb_pkg = portage.best(myeb_pkg_matches) + + if not myeb_pkg: + myeb_pkg = None + elif ("--newuse" in myopts): + iuses=string.split(portage.db["/"]["bintree"].dbapi.aux_get(myeb_pkg, ["IUSE"])[0]) + old_use=string.split(portage.db["/"]["bintree"].dbapi.aux_get(myeb_pkg, ["USE"])[0]) + self.pkgsettings.setcpv(myeb_pkg) + now_use=string.split(self.pkgsettings["USE"]) + self.pkgsettings.reset() + for x in iuses: + if (old_use.count(x) and not now_use.count(x)) or (not old_use.count(x) and now_use.count(x)): + myeb_pkg = None + break + + if (not myeb) and (not myeb_pkg): + if not arg: + xinfo='"'+x+'"' + else: + xinfo='"'+arg+'"' + if myparent: + xfrom = '(dependency required by '+green('"'+myparent.split()[2]+'"')+red(' ['+myparent.split()[0]+"])") + alleb=portage.portdb.xmatch("match-all",x) + if alleb: + if "--usepkgonly" not in myopts: + print "\n!!! "+red("All ebuilds that could satisfy ")+green(xinfo)+red(" have been masked.") + print "!!! One of the following masked packages is required to complete your request:" + oldcomment = "" + for p in alleb: + mreasons = portage.getmaskingstatus(p) + print "- "+p+" (masked by: "+string.join(mreasons, ", ")+")" + comment = portage.getmaskingreason(p) + if comment and comment != oldcomment: + print comment + oldcomment = comment + print + print "For more information, see MASKED PACKAGES section in the emerge man page or " + print "section 2.2 \"Software Availability\" in the Gentoo Handbook." + if myparent: + print "!!! "+red(xfrom) + print + else: + print "\n!!! "+red("There are no packages available to satisfy: ")+green(xinfo) + print "!!! Either add a suitable binary package or compile from an ebuild." + else: + print "\nemerge: there are no ebuilds to satisfy "+xinfo+"." + print + return 0 + + if "--debug" in myopts: + print "ebuild:",myeb + print "binpkg:",myeb_pkg + + if myeb and myeb_pkg: + myeb_s = portage.catpkgsplit(myeb) + myeb_s = [myeb_s[0]+"/"+myeb_s[1], myeb_s[2], myeb_s[3]] + myeb_pkg_s = portage.catpkgsplit(myeb_pkg) + myeb_pkg_s = [myeb_pkg_s[0]+"/"+myeb_pkg_s[1], myeb_pkg_s[2], myeb_pkg_s[3]] + + if portage.pkgcmp(myeb_s, myeb_pkg_s) == 0: # pkg is same version as ebuild + myeb = None + else: + myeb_pkg = None + + if "--upgradeonly" in myopts: + # Check that there isn't a newer version of this package already installed + cand = None + try: + # XXX: This can throw an exception if the ebuild doesn't exist + if myeb: + cand=self.is_newer_ver_installed(myroot,x,myeb) + elif myeb_pkg: + cand=self.is_newer_ver_installed(myroot,x,myeb_pkg) + except SystemExit, e: + raise # Needed else can't exit + except Exception, e: + print "Warning: "+str(e) + if cand: + myeb=cand + + if myeb: + myk=["ebuild",myroot,myeb] + elif myeb_pkg: + binpkguseflags=portage.db[portage.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") + sys.exit(1) + + #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) + # if myeb in mypk: + # #Use it only if it's exactly the version we want. + # myk=["binary",myroot,myeb] + # else: + # myk=["ebuild",myroot,myeb] + #else: + # myk=["ebuild",myroot,myeb] + if myparent: + #we are a dependency, so we want to be unconditionally added + if not self.create(myk,myparent,myuse=binpkguseflags): + return 0 + else: + #if mysource is not set, then we are a command-line dependency and should not be added + #if --onlydeps is specified. + if not self.create(myk,myparent,"--onlydeps" not in myopts,myuse=binpkguseflags): + return 0 + + if "--debug" in myopts: + print "Exiting...",myparent + return 1 + + + def altlist(self): + mygraph=self.digraph.copy() + dolist=["/"] + retlist=[] + for x in portage.db.keys(): + portage.db[x]["merge"]=[] + if x not in dolist: + dolist.append(x) + while (not mygraph.empty()): + mycurkey=mygraph.firstzero() + if not mycurkey: + print "!!! Error: circular dependencies:" + print + for x in mygraph.dict.keys(): + for y in mygraph.dict[x][1]: + print y,"depends on",x + print + sys.exit(1) + splitski=string.split(mycurkey) + #I'm not sure of the significance of the following lines (vestigal?) so I'm commenting 'em out. + #These lines remove already-merged things from our alt-list + #if "--update" in myopts: + # if not portage.db["/"]["vartree"].exists_specific(splitski[2]): + # portage.db["/"]["merge"].append(splitski) + #else: + portage.db[splitski[1]]["merge"].append(splitski) + mygraph.delnode(mycurkey) + for x in dolist: + for y in portage.db[x]["merge"]: + retlist.append(y) + return retlist + + def xcreate(self,mode="system"): + global syslist + if mode=="system": + mylist=syslist + else: + #world mode + worldlist=getlist("world") + sysdict=genericdict(syslist) + worlddict=genericdict(worldlist) + #we're effectively upgrading sysdict to contain all new deps from worlddict + for x in worlddict.keys(): + #only add the world node if the package is: + #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): + sysdict[x]=worlddict[x] + elif portage.db[portage.root]["vartree"].dbapi.match(x): + #package is installed + sysdict[x]=worlddict[x] + else: + print "\n*** Package in world file is not installed: "+x + mylist = sysdict.keys() + + for mydep in mylist: + myeb=portage.portdb.xmatch("bestmatch-visible",mydep) + if not myeb: + #this is an unavailable world entry; just continue + continue + + if "--upgradeonly" in myopts: + cand=self.is_newer_ver_installed(portage.root,mydep,myeb) + if cand: + myeb=cand + + #THIS NEXT BUNCH OF CODE NEEDS TO BE REPLACED TO SUPPORT WORLD ANTI-DEPS + #if mydep2[0]=="!":, etc. + binpkguseflags = None + if "--usepkg" in myopts: + mypk=portage.db[portage.root]["bintree"].dep_bestmatch(mydep) + if myeb==mypk: + myk=["binary",portage.root,mypk] + binpkguseflags=portage.db[portage.root]["bintree"].get_use(mypk) + if ("--newuse" in myopts): + iuses=string.split(portage.db["/"]["bintree"].dbapi.aux_get(mypk, ["IUSE"])[0]) + old_use=string.split(portage.db["/"]["bintree"].dbapi.aux_get(mypk, ["USE"])[0]) + self.pkgsettings.setcpv(mypk) + now_use=string.split(self.pkgsettings["USE"]) + self.pkgsettings.reset() + for x in iuses: + if (old_use.count(x) and not now_use.count(x)) or (not old_use.count(x) and now_use.count(x)): + myk=["ebuild",portage.root,myeb] + binpkguseflags=None + break + elif "--usepkgonly" in myopts: + if not mypk: + self.missingbins += [myeb] + myk=["binary",portage.root,myeb] + else: + myk=["binary",portage.root,mypk] + else: + myk=["ebuild",portage.root,myeb] + else: + myk=["ebuild",portage.root,myeb] + + if not self.create(myk,myuse=binpkguseflags): + print + print "!!! Problem with",myk[0],myk[2] + print "!!! Possibly a DEPEND/*DEPEND problem." + print + return 0 + return 1 + + def match(self,mydep,myroot=portage.root,mykey=None): + # support mutual exclusive deps + mydep2=mydep + if mydep2[0]=="!": + mydep2=mydep[1:] + + 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+" "+mydep2 + else: + myeb=portage.db[portage.root]["porttree"].dep_bestmatch(mydep2) + if not myeb: + if not mykey: + print "\n!!! Error: couldn't find match for",mydep + else: + print "\n!!! Error: couldn't find match for",mydep,"in",mykey + print + sys.exit(1) + + if "--usepkg" in myopts: + mypk=portage.db[portage.root]["bintree"].dep_bestmatch(mydep) + if myeb==mypk: + myk="binary "+portage.root+" "+mypk + else: + myk="ebuild "+myroot+" "+myeb + else: + myk="ebuild "+myroot+" "+myeb + + return myk + + def display(self,mylist): + changelogs=[] + p=[] + totalsize=0 + + if "--verbose" in myopts: + overlays = string.split(portage.settings['PORTDIR_OVERLAY']) + + if "--tree" in myopts: + mylist.reverse() + mygraph=self.digraph.copy() + + i = 0 + while i < len(mylist): + if mylist[i][-1]=="nomerge": + if not ("--tree" in myopts): + # we don't care about this elements + mylist.pop(i) + continue + if (i == (len(mylist) - 1)) \ + or (mygraph.depth(string.join(mylist[i])) \ + >= mygraph.depth(string.join(mylist[i+1]))): + # end of a useless branch (may be the last one) + # -> delete the element and test the previous one + mylist.pop(i) + if i > 0: + i -= 1 + continue + # the branch continues, or we've found a good element. + # -> let's see what's next, if anything + i += 1 + + display_overlays=False + # files to fetch list - avoids counting a same file twice + # in size display (verbose mode) + myfetchlist=[] + for x in mylist: + fetch=" " + + if x[0]=="blocks": + addl=""+red("B")+" "+fetch+" " + resolved=portage.db[x[1]]["vartree"].resolve_key(x[2]) + print "["+x[0]+" "+addl+"]",red(resolved), + if resolved!=x[2]: + if x[3]: + print red("(\""+x[2]+"\" is blocking "+x[3]+")") + else: + print red("(\""+x[2]+"\")") + else: + if x[3]: + print red("(is blocking "+x[3]+")") + else: + print + else: + if (x[0]!="binary") and ("fetch" in string.split(portage.portdb.aux_get(x[2],["RESTRICT"])[0])): + fetch = red("F") + if portage.portdb.fetch_check(x[2], portage.settings): + fetch = green("f") + + #we need to use "--emptrytree" testing here rather than "empty" param testing because "empty" + #param is used for -u, where you still *do* want to see when something is being upgraded. + myoldbest="" + if (not "--emptytree" in myopts) and portage.db[x[1]]["vartree"].exists_specific(x[2]): + 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]) + elif x[0] == "ebuild": + mynewslot=portage.db["/"]["porttree"].getslot(x[2]) + myoldlist=portage.db[x[1]]["vartree"].dbapi.match(portage.pkgsplit(x[2])[0]) + myinslotlist=filter((lambda p: portage.db[portage.root]["vartree"].getslot(p)==mynewslot),myoldlist) + if myinslotlist: + myoldbest=portage.best(myinslotlist) + addl=" "+fetch + if portage.pkgcmp(portage.pkgsplit(x[2]), portage.pkgsplit(myoldbest)) < 0: + # Downgrade in slot + addl+=turquoise("U")+blue("D") + else: + # Update in slot + addl+=turquoise("U")+" " + else: + # New slot, mark it new. + addl=" "+green("NS")+fetch+" " + + if "--changelog" in myopts: + changelogs.extend(self.calc_changelog( + portage.portdb.findname(x[2]), + portage.db["/"]["vartree"].dep_bestmatch('/'.join(portage.catpkgsplit(x[2])[:2])), + x[2] + )) + else: + addl=" "+green("N")+" "+fetch+" " + + verboseadd="" + if "--verbose" in myopts: + # iuse verbose + try: + if x[0] == "binary": + iuse_split = string.split(portage.db["/"]["bintree"].dbapi.aux_get(x[2],["IUSE"])[0]) + elif x[0] == "ebuild": + iuse_split = string.split(portage.portdb.aux_get(x[2],["IUSE"])[0]) + else: + iuse_split = [] + except SystemExit, e: + raise # Needed else can't exit + except: + portage.writemsg("!!! Error getting IUSE (report this to bugs.gentoo.org)\n") + portage.writemsg("!!! %s\n" % x) + iuse_split = [] + iuse_split.sort() + old_use=None + if myoldbest: + pkg=myoldbest + else: + pkg=x[2] + if portage.db["/"]["vartree"].dbapi.cpv_exists(pkg): + try: + old_use=string.split(portage.db["/"]["vartree"].dbapi.aux_get(pkg, ["USE"])[0]) + except SystemExit, e: + raise # Needed else can't exit + except: + pass + iuse="" + now_use=self.applied_useflags[x[2]] + for ebuild_iuse in portage_util.unique_array(iuse_split): + usechange="" + if old_use: + if (old_use.count(ebuild_iuse) and not now_use.count(ebuild_iuse)) or (not old_use.count(ebuild_iuse) and now_use.count(ebuild_iuse)): + usechange="*" + + if ebuild_iuse in self.applied_useflags[x[2]]: + if usechange == "*": + iuse=green("+"+ebuild_iuse) + else: + iuse=red("+"+ebuild_iuse) + elif ebuild_iuse in portage.settings.usemask: + iuse=blue("(-"+ebuild_iuse+")") + else: + iuse=blue("-"+ebuild_iuse) + verboseadd+=iuse+usechange+" " + + # size verbose + mysize=0 + if x[0] == "ebuild" and x[-1]!="nomerge": + myfilesdict=portage.portdb.getfetchsizes(x[2], useflags=self.applied_useflags[x[2]], debug=edebug) + if myfilesdict==None: + myfilesdict="[empty/missing/bad digest]" + else: + for myfetchfile in myfilesdict.keys(): + if myfetchfile not in myfetchlist: + mysize+=myfilesdict[myfetchfile] + myfetchlist.append(myfetchfile) + totalsize+=mysize + verboseadd+=format_size(mysize)+" " + + # overlay verbose + # XXX: Invalid binaries have caused tracebacks here. 'if file_name' + # x = ['binary', '/', 'sys-apps/pcmcia-cs-3.2.7.2.6', 'merge'] + file_name=portage.portdb.findname(x[2]) + if file_name: # It might not exist in the tree + dir_name=os.path.abspath(os.path.dirname(file_name)+"/../..") + if (overlays.count(dir_name)>0): + verboseadd+=teal("["+str(overlays.index(os.path.normpath(dir_name))+1)+"]")+" " + display_overlays=True + else: + verboseadd += "[No ebuild?]" + + xs=portage.pkgsplit(x[2]) + if xs[2]=="r0": + xs[2]="" + else: + xs[2]="-"+xs[2] + + if self.pkgsettings.has_key("COLUMNWIDTH"): + mywidth=int(self.pkgsettings.settings["COLUMNWIDTH"]) + else: + mywidth=130 + oldlp=mywidth-30 + newlp=oldlp-30 + + indent="" + if ("--tree" in myopts): + indent=" "*mygraph.depth(string.join(x)) + + if myoldbest: + myoldbest=portage.pkgsplit(myoldbest)[1]+"-"+portage.pkgsplit(myoldbest)[2] + if myoldbest[-3:]=="-r0": + myoldbest=myoldbest[:-3] + myoldbest=blue("["+myoldbest+"]") + + if x[1]!="/": + if "--columns" in myopts: + myprint="["+x[0]+" "+addl+"] "+indent+darkgreen(xs[0]) + if (newlp-nc_len(myprint)) > 0: + myprint=myprint+(" "*(newlp-nc_len(myprint))) + myprint=myprint+"["+darkblue(xs[1]+xs[2])+"] " + if (oldlp-nc_len(myprint)) > 0: + myprint=myprint+" "*(oldlp-nc_len(myprint)) + myprint=myprint+myoldbest + myprint=myprint+darkgreen(" to "+x[1])+" "+verboseadd + else: + myprint="["+x[0]+" "+addl+"] "+darkgreen(x[2])+" "+myoldbest+" "+darkgreen("to "+x[1])+" "+verboseadd + else: + if "--columns" in myopts: + myprint="["+x[0]+" "+addl+"] "+indent+darkgreen(xs[0]) + if (newlp-nc_len(myprint)) > 0: + myprint=myprint+(" "*(newlp-nc_len(myprint))) + myprint=myprint+green(" ["+xs[1]+xs[2]+"] ") + if (oldlp-nc_len(myprint)) > 0: + myprint=myprint+(" "*(oldlp-nc_len(myprint))) + myprint=myprint+myoldbest+" "+verboseadd + else: + if x[3]=="nomerge": + myprint=darkblue("[nomerge ] "+indent+x[2]+" "+myoldbest+" ")+verboseadd + else: + myprint="["+x[0]+" "+addl+"] "+indent+darkgreen(x[2])+" "+myoldbest+" "+verboseadd + p.append(myprint) + + if ("--tree" not in myopts): + mysplit=portage.pkgsplit(x[2]) + + # XXX mysplit _can_ be None.... Why? + if mysplit and (len(mysplit)==3): + if "--emptytree" not in myopts: + if mysplit[0]=="sys-apps/portage": + if ((mysplit[1]+mysplit[2]) != portage.VERSION) and \ + ("livecvsportage" not in portage.settings.features): + if mylist.index(x)>> Recording",myfavkey,"in \"world\" favorites file..." + if not "--fetchonly" in myopts: + portage.writedict(myfavdict,portage.root+portage.WORLD_FILE,writekey=0) + + portage.mtimedb["resume"]["mergelist"]=mymergelist[:] + + # We need to yank the harmful-to-new-builds settings from features. + myorigfeat=self.pkgsettings["FEATURES"] + myfeat=myorigfeat.split() + while ("keeptemp" in myfeat): + del myfeat[myfeat.index("keeptemp")] + while ("keepwork" in myfeat): + del myfeat[myfeat.index("keepwork")] + + self.pkgsettings["FEATURES"]=string.join(myfeat) + + mergecount=0 + for x in mymergelist: + mergecount+=1 + myroot=x[1] + pkgindex=2 + if x[0]=="blocks": + pkgindex=3 + 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]) + + self.pkgsettings["EMERGE_FROM"] = x[0][:] + self.pkgsettings.backup_changes("EMERGE_FROM") + + #buildsyspkg: Check if we need to _force_ binary package creation + issyspkg = ("buildsyspkg" in myfeat) \ + and x[0] != "blocks" \ + and mysysdict.has_key(portage.cpv_getkey(x[2])) \ + and not ("--buildpkg" in myopts) + if x[0] in ["ebuild","blocks"]: + if (x[0]=="blocks") and ("--fetchonly" not in myopts): + raise Exception, "Merging a blocker" + elif ("--fetchonly" in myopts) or ("--fetch-all-uri" in myopts): + if ("--fetch-all-uri" in myopts): + retval=portage.doebuild(y,"fetch",myroot,self.pkgsettings,edebug,("--pretend" in myopts),fetchonly=1,fetchall=1) + else: + retval=portage.doebuild(y,"fetch",myroot,self.pkgsettings,edebug,("--pretend" in myopts),fetchonly=1) + if (retval == None) or retval: + print + print "!!! Fetch for",y,"failed, continuing..." + print + returnme=1 + continue + elif "--buildpkg" in myopts or issyspkg: + #buildsyspkg: Sounds useful to display something, but I don't know if we should also log it + if issyspkg: + print ">>> This is a system package, let's pack a rescue tarball." + #emergelog(">>> This is a system package, let's pack a rescue tarball.") + #create pkg, then merge pkg + short_msg = "emerge: ("+str(mergecount)+" of "+str(len(mymergelist))+") "+x[pkgindex]+" Clean" + emergelog(" === ("+str(mergecount)+" of "+str(len(mymergelist))+") Cleaning ("+x[pkgindex]+"::"+y+")", short_msg=short_msg) + retval=portage.doebuild(y,"clean",myroot,self.pkgsettings,edebug,cleanup=1) + if (retval == None): + portage_util.writemsg("Unable to run required binary.\n") + sys.exit(127) + if retval: + sys.exit(retval) + short_msg = "emerge: ("+str(mergecount)+" of "+str(len(mymergelist))+") "+x[pkgindex]+" Compile" + emergelog(" === ("+str(mergecount)+" of "+str(len(mymergelist))+") Compiling/Packaging ("+x[pkgindex]+"::"+y+")", short_msg=short_msg) + retval=portage.doebuild(y,"package",myroot,self.pkgsettings,edebug) + if (retval == None): + portage_util.writemsg("Unable to run required binary.\n") + sys.exit(127) + if retval: + sys.exit(retval) + #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]) + 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) + + self.pkgsettings["EMERGE_FROM"] = "binary" + self.pkgsettings.backup_changes("EMERGE_FROM") + + retval=portage.pkgmerge(mytbz2,myroot,self.pkgsettings) + if retval==None: + sys.exit(1) + else: + short_msg = "emerge: ("+str(mergecount)+" of "+str(len(mymergelist))+") "+x[pkgindex]+" Clean" + emergelog(" === ("+str(mergecount)+" of "+str(len(mymergelist))+") Cleaning ("+x[pkgindex]+"::"+y+")", short_msg=short_msg) + retval=portage.doebuild(y,"clean",myroot,self.pkgsettings,edebug,cleanup=1) + if (retval == None): + portage_util.writemsg("Unable to run required binary.\n") + sys.exit(127) + if retval: + sys.exit(retval) + short_msg = "emerge: ("+str(mergecount)+" of "+str(len(mymergelist))+") "+x[pkgindex]+" Compile" + emergelog(" === ("+str(mergecount)+" of "+str(len(mymergelist))+") Compiling/Merging ("+x[pkgindex]+"::"+y+")", short_msg=short_msg) + retval=portage.doebuild(y,"merge",myroot,self.pkgsettings,edebug) + if (retval == None): + portage_util.writemsg("Unable to run required binary.\n") + sys.exit(127) + if retval: + sys.exit(retval) + #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]): + 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]) + + if ("--fetchonly" in myopts) or ("--fetch-all-uri" in myopts): + continue + + short_msg = "emerge: ("+str(mergecount)+" of "+str(len(mymergelist))+") "+x[pkgindex]+" Merge Binary" + emergelog(" === ("+str(mergecount)+" of "+str(len(mymergelist))+") Merging Binary ("+x[pkgindex]+"::"+mytbz2+")", short_msg=short_msg) + retval=portage.pkgmerge(mytbz2,x[1],self.pkgsettings) + if retval==None: + sys.exit(1) + #need to check for errors + if "--buildpkgonly" not in myopts: + portage.db[x[1]]["vartree"].inject(x[2]) + myfavkey=portage.cpv_getkey(x[2]) + if "--fetchonly" not in myopts and "--fetch-all-uri" not in myopts and myfavkey in favorites: + myfavs=portage.grabfile(myroot+portage.WORLD_FILE) + myfavdict=genericdict(myfavs) + mysysdict=genericdict(syslist) + #don't record if already in system profile or already recorded + if (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) + + if ("noclean" not in portage.features) and (x[0] != "binary"): + short_msg = "emerge: ("+str(mergecount)+" of "+str(len(mymergelist))+") "+x[pkgindex]+" Clean Post" + emergelog(" === ("+str(mergecount)+" of "+str(len(mymergelist))+") Post-Build Cleaning ("+x[pkgindex]+"::"+y+")", short_msg=short_msg) + retval=portage.doebuild(y,"clean",myroot,self.pkgsettings,edebug,cleanup=1) + if (retval == None): + portage_util.writemsg("Unable to run required binary.\n") + sys.exit(127) + if retval: + sys.exit(retval) + + if ("--pretend" not in myopts) and ("--fetchonly" not in myopts) and ("--fetch-all-uri" not in myopts): + # Clean the old package that we have merged over top of it. + if self.pkgsettings["AUTOCLEAN"]=="yes": + xsplit=portage.pkgsplit(x[2]) + emergelog(" >>> AUTOCLEAN: "+xsplit[0]) + retval=unmerge("clean", [xsplit[0]]) + if not retval: + emergelog(" --- AUTOCLEAN: Nothing unmerged.") + + # Figure out if we need a restart. + mysplit=portage.pkgsplit(x[2]) + if mysplit[0]=="sys-apps/portage": + myver=mysplit[1]+"-"+mysplit[2] + if myver[-3:]=='-r0': + myver=myver[:-3] + if (myver != portage.VERSION) and \ + ("livecvsportage" not in portage.settings.features): + if len(mymergelist) > mergecount: + myargv=sys.argv + myr=0 + for myra in range(len(myargv)): + if myargv[myr][0:len("portage")]=="portage": + del myargv[myr] + myr-=1 + if myargv[myr][0:len("sys-apps/portage")]=="sys-apps/portage": + del myargv[myr] + myr-=1 + myr+=1 + emergelog(" *** RESTARTING emerge via exec() after change of portage version.") + portage.portageexit() + # Remove --ask from options before restarting + mynewargv=[] + badlongopts = ["--ask","--tree","--changelog"] + badshortopts = ["a","t","l"] + for arg in myargv: + if arg[0:2] == "--": + if arg in badlongopts: + continue + mynewargv += [arg] + elif arg[0] == "-": + myarg = "-" + for ch in arg[1:]: + if ch in badshortopts: + continue + myarg += ch + mynewargv += [myarg] + else: + mynewargv += [arg] + os.execv("/usr/lib/portage/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]) + + # Unsafe for parallel merges + del portage.mtimedb["resume"]["mergelist"][0] + + emergelog(" *** Finished. Cleaning up...") + + # We're out of the loop... We're done. Delete the resume data. + if portage.mtimedb.has_key("resume"): + del portage.mtimedb["resume"] + + if ("--pretend" not in myopts): + if ("--fetchonly" not in myopts) and ("--fetch-all-uri" not in myopts): + if (mergecount>0): + if retval: + portage.env_update() + + #by doing an exit this way, --fetchonly can continue to try to + #fetch everything even if a particular download fails. + if "--fetchonly" in myopts or "--fetch-all-uri" in myopts: + if returnme: + print "\n\n!!! Some fetch errors were encountered. Please see above for details.\n\n" + sys.exit(returnme) + else: + sys.exit(0) + +def unmerge(unmerge_action, unmerge_files): + candidate_catpkgs=[] + global_unmerge=0 + + realsyslist = getlist("system") + syslist = [] + for x in realsyslist: + mycp = portage.dep_getkey(x) + if mycp in portage.settings.virtuals: + syslist.extend(portage.settings.virtuals[mycp]) + syslist.append(mycp) + + global myopts + mysettings = portage.config(clone=portage.settings) + + if not unmerge_files or "world" in unmerge_files or "system" in unmerge_files: + if "unmerge"==unmerge_action: + print + print bold("emerge unmerge")+" can only be used with specific package names, not with "+bold("world")+" or" + print bold("system")+" targets." + print + return 0 + else: + global_unmerge=1 + + localtree=portage.db[portage.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: + candidate_catpkgs.extend(localtree.getallnodes()) + elif "system" in unmerge_files: + candidate_catpkgs.extend(getlist("system")) + else: + #we've got command-line arguments + if not unmerge_files: + print "\nNo packages to unmerge have been provided.\n" + return 0 + for x in unmerge_files: + arg_parts=x.split('/') + if (x[0] not in [".","/"]) and (arg_parts[-1][-7:] != ".ebuild"): + #possible cat/pkg or dep; treat as such + candidate_catpkgs.append(x) + elif unmerge_action in ["prune","clean"]: + print "\n!!! Prune and clean do not accept individual ebuilds as arguments;\n skipping.\n" + continue + else: + # it appears that the user is specifying an installed ebuild and we're in "unmerge" mode, so it's + # ok. + if not os.path.exists(x): + print "\n!!! The path '"+x+"' doesn't exist.\n" + return 0 + + absx = os.path.abspath(x) + sp_absx = absx.split("/") + if sp_absx[-1][-7:] == ".ebuild": + del sp_absx[-1] + absx = string.join(sp_absx,"/") + + sp_absx_len = len(sp_absx) + + vdb_path = portage.root+portage.VDB_PATH + vdb_len = len(vdb_path) + + sp_vdb = vdb_path.split("/") + sp_vdb_len = len(sp_vdb) + + if not os.path.exists(absx+"/CONTENTS"): + print "!!! Not a valid db dir: "+str(absx) + return 0 + + if sp_absx_len <= sp_vdb_len: + # 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" + 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" + return 0 + + print "="+string.join(sp_absx[sp_vdb_len:],"/") + candidate_catpkgs.append("="+string.join(sp_absx[sp_vdb_len:],"/")) + + if ("--pretend" in myopts) or ("--ask" in myopts): + print darkgreen("\n>>> These are the packages that I would unmerge:") + + pkgmap={} + numselected=0 + for x in candidate_catpkgs: + #cycle through all our candidate deps and determine what will and will not get unmerged + try: + mymatch=localtree.dep_match(x) + except KeyError: + mymatch=None + except ValueError, errpkgs: + print "\n\n!!! The short ebuild name \"" + x + "\" is ambiguous. Please specify" + print "!!! one of the following fully-qualified ebuild names instead:\n" + for i in errpkgs[0]: + print " " + green(i) + print + sys.exit(1) + + if not mymatch and x[0] not in "<>=~": + #add a "=" if missing + mymatch=localtree.dep_match("="+x) + if not mymatch: + print "\n--- Couldn't find " + white(x) + " to "+unmerge_action+"." + continue + mykey=portage.key_expand(portage.dep_getkey(mymatch[0]),portage.db["/"]["vartree"].dbapi) + if not pkgmap.has_key(mykey): + pkgmap[mykey]={"protected":[], "selected":[], "omitted":[] } + if unmerge_action=="unmerge": + for y in mymatch: + if y not in pkgmap[mykey]["selected"]: + pkgmap[mykey]["selected"].append(y) + numselected=numselected+len(mymatch) + + else: + #unmerge_action in ["prune", clean"] + slotmap={} + for mypkg in mymatch: + if unmerge_action=="clean": + myslot=localtree.getslot(mypkg) + else: + #since we're pruning, we don't care about slots and put all the pkgs in together + myslot=0 + if not slotmap.has_key(myslot): + slotmap[myslot]={} + slotmap[myslot][localtree.dbapi.cpv_counter(mypkg)]=mypkg + for myslot in slotmap.keys(): + counterkeys=slotmap[myslot].keys() + counterkeys.sort() + if not counterkeys: + continue + counterkeys.sort() + pkgmap[mykey]["protected"].append(slotmap[myslot][counterkeys[-1]]) + del counterkeys[-1] + #be pretty and get them in order of merge: + for ckey in counterkeys: + pkgmap[mykey]["selected"].append(slotmap[myslot][ckey]) + numselected=numselected+1 + #ok, now the last-merged package is protected, and the rest are selected + if global_unmerge and not numselected: + print "\n>>> No outdated packages were found on your system.\n" + return 0 + + if not numselected: + print "\n>>>",unmerge_action+": No packages selected for removal.\n" + return 0 + + for x in pkgmap.keys(): + for y in localtree.dep_match(x): + if y not in pkgmap[x]["omitted"] and \ + y not in pkgmap[x]["selected"] and \ + y not in pkgmap[x]["protected"]: + pkgmap[x]["omitted"].append(y) + if global_unmerge and not pkgmap[x]["selected"]: + #avoid cluttering the preview printout with stuff that isn't getting unmerged + continue + if not (pkgmap[x]["protected"] or pkgmap[x]["omitted"]) and (x in syslist): + print red("\a\n\n!!! '%s' is part of your system profile. '%s'" % (mykey)) + print yellow("\a!!! Unmerging it may be damaging to your system.\n") + if "--pretend" not in myopts and "--ask" not in myopts: + global EMERGE_WARNING_DELAY + countdown(EMERGE_WARNING_DELAY,red("Press Ctrl-C to Stop")) + print "\n "+white(x) + for mytype in ["selected","protected","omitted"]: + print string.rjust(mytype,12)+":", + if pkgmap[x][mytype]: + for mypkg in pkgmap[x][mytype]: + mysplit=portage.catpkgsplit(mypkg) + if mysplit[3]=="r0": + myversion=mysplit[2] + else: + myversion=mysplit[2]+"-"+mysplit[3] + if mytype=="selected": + print red(myversion), + else: + print green(myversion), + else: + print "none", + print + + print "\n>>>",red("'Selected'"),"packages are slated for removal." + print ">>>",green("'Protected'"),"and",green("'omitted'"),"packages will not be removed.\n" + + if "--pretend" in myopts: + #we're done... return + return 0 + if "--ask" in myopts: + if userquery("Do you want me to unmerge these packages?")=="No": + # enter pretend mode for correct formatting of results + myopts+=["--pretend"] + print + print "Quitting." + print + return 0 + #the real unmerging begins, after a short delay.... + + global CLEAN_DELAY + countdown(CLEAN_DELAY, ">>> Unmerging") + + for x in pkgmap.keys(): + for y in pkgmap[x]["selected"]: + print ">>> Unmerging "+y+"..." + emergelog("=== Unmerging... ("+y+")") + mysplit=string.split(y,"/") + #unmerge... + retval=portage.unmerge(mysplit[0],mysplit[1],portage.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() + if not numselected: + return 0 + else: + return 1 + + +def chk_updated_info_files(retval): + root=portage.root + + infodirs=[] + infodirs.extend(string.split(portage.settings["INFOPATH"], ":")) + infodirs.extend(string.split(portage.settings["INFODIR"], ":")) + + print + if os.path.exists("/usr/bin/install-info"): + regen_infodirs=[] + for z in infodirs: + if z=='': + continue + inforoot=normpath(root+z) + if os.path.isdir(inforoot): + try: + infomtime=os.stat(inforoot)[ST_MTIME] + except SystemExit, e: + raise # Needed else can't exit + except: + infomtime=0 + + if not portage.mtimedb.has_key("info"): + portage.mtimedb["info"]={} + if portage.mtimedb["info"].has_key(inforoot): + if portage.mtimedb["info"][inforoot]==infomtime: + pass + else: + portage.mtimedb["info"][inforoot]=infomtime + regen_infodirs.append(inforoot) + else: + regen_infodirs.append(inforoot) + + if not regen_infodirs: + print " "+green("*")+" GNU info directory index is up-to-date." + else: + print " "+green("*")+" Regenerating GNU info directory index..." + + icount=0 + badcount=0 + for inforoot in regen_infodirs: + if inforoot=='': + continue + try: + os.rename(inforoot+"/dir",inforoot+"/dir.old") + except SystemExit, e: + raise # Needed else can't exit + except: + pass + + if not os.path.isdir(inforoot): + continue + errmsg = "" + 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] + existsstr="already exists, for file `" + if myso!="": + if re.search(existsstr,myso): + # Already exists... Don't increment the count for this. + pass + elif myso[:44]=="install-info: warning: no info dir entry in ": + # This info file doesn't contain a DIR-header: install-info produces this + # (harmless) warning (the --quiet switch doesn't seem to work). + # Don't increment the count for this. + pass + else: + badcount=badcount+1 + errmsg += myso + "\n" + icount=icount+1 + + #update mtime so we can potentially avoid regenerating. + portage.mtimedb["info"][inforoot]=os.stat(inforoot)[ST_MTIME] + + if badcount: + print " "+yellow("*")+" Processed",icount,"info files;",badcount,"errors." + print errmsg + else: + print " "+green("*")+" Processed",icount,"info files." + + +def post_emerge(retval=0): + global myopts + os.chdir("/") + if "--pretend" in myopts: + sys.exit(retval) + + emergelog(" *** exiting successfully.") + + if "noinfo" not in portage.settings.features: + chk_updated_info_files(retval) + + chk_updated_cfg_files() + sys.exit(retval) + + +def chk_updated_cfg_files(): + if portage.settings["CONFIG_PROTECT"]: + #number of directories with some protect files in them + procount=0 + for x in string.split(portage.settings["CONFIG_PROTECT"]): + if os.path.isdir(x): + a=commands.getstatusoutput("cd "+x+"; find . -iname '._cfg????_*'") + if a[0]!=0: + print " "+red("*")+" error scanning",x + else: + files=string.split(a[1]) + if files: + procount=procount+1 + print " "+yellow("* IMPORTANT:")+"",len(files),"config files in",x,"need updating." + if procount: + #print " "+yellow("*")+" Type "+green("emerge --help config")+" to learn how to update config files." + print " "+yellow("*")+" Type "+green("emerge --help config")+" to learn how to update config files." + print + +# general options that should be taken into account before any action +if "--debug" in myopts: + edebug=1 + +if myaction in ["sync","rsync","metadata"] and (not "--help" in myopts): + if "--pretend" in myopts: + print "emerge: \"sync\" actions do not support \"--pretend.\"" + sys.exit(1) + + emergelog(" === "+str(myaction)) + myportdir=portage.settings["PORTDIR"] + if myportdir[-1]=="/": + myportdir=myportdir[:-1] + if not os.path.exists(myportdir): + print ">>>",myportdir,"not found, creating it." + os.makedirs(myportdir,0755) + syncuri=string.rstrip(portage.settings["SYNC"]) + os.umask(0022) + if myaction == "metadata": + if "--ask" in myopts: + if userquery("Are you sure?") == "No": + sys.exit(1) + print "skipping sync" + updatecache_flg = True + tmpservertimestampfile = None + elif syncuri[:8]=="rsync://": + if not os.path.exists("/usr/bin/rsync"): + print "!!! /usr/bin/rsync does not exist, so rsync support is disabled." + print "!!! Type \"emerge net-misc/rsync\" to enable rsync support." + sys.exit(1) + mytimeout=180 + if portage.settings.has_key("RSYNC_TIMEOUT"): + try: + mytimeout=int(portage.settings["RSYNC_TIMEOUT"]) + except SystemExit, e: + raise # Needed else can't exit + except: + pass + + rsync_flags = [ + "--recursive", # Recurse directories + "--links", # Consider symlinks + "--safe-links", # Ignore links outside of tree + "--perms", # Preserve permissions + "--times", # Preserive mod times + "--compress", # Compress the data transmitted + "--force", # Force deletion on non-empty dirs + "--whole-file", # Don't do block transfers, only entire files + "--delete", # Delete files that aren't in the master tree + "--delete-after", # Delete only after everything else is done + "--stats", # Show final statistics about what was transfered + "--timeout="+str(mytimeout), # IO timeout if not done in X seconds + "--exclude='/distfiles'", # Exclude distfiles from consideration + "--exclude='/local'", # Exclude local from consideration + "--exclude='/packages'", # Exclude packages from consideration + ] + + if "--quiet" in myopts: + rsync_flags.append("--quiet") # Shut up a lot + else: + rsync_flags.append("--progress") # Progress meter for each file + + if "--verbose" in myopts: + rsync_flags.append("--verbose") # More noise? Not really sure what + + if "--debug" in myopts: + rsync_flags.append("--checksum") # Force checksum on all files + + if portage.settings.has_key("RSYNC_EXCLUDEFROM"): + if os.path.exists(portage.settings["RSYNC_EXCLUDEFROM"]): + rsync_flags.append("--exclude-from="+portage.settings["RSYNC_EXCLUDEFROM"]) + else: + print "!!! RSYNC_EXCLUDEFROM specified, but file does not exist." + + if portage.settings.has_key("RSYNC_RATELIMIT"): + rsync_flags.append("--bwlimit="+portage.settings["RSYNC_RATELIMIT"]) + + rsynccommand = "/usr/bin/rsync " + string.join(rsync_flags, " ") + + servertimestampdir = portage.settings.depcachedir+"/" + servertimestampfile = portage.settings.depcachedir+"/timestamp.chk" + tmpservertimestampdir = portage.settings["PORTAGE_TMPDIR"]+"/" + tmpservertimestampfile = portage.settings["PORTAGE_TMPDIR"]+"/timestamp.chk" + + # We only use the backup if a timestamp exists in the portdir. + content=None + if os.path.exists(myportdir+"/metadata/timestamp.chk"): + content=portage.grabfile(servertimestampfile) + if (not content): + content=portage.grabfile(myportdir+"/metadata/timestamp.chk") + + if (content): + try: + mytimestamp=time.mktime(time.strptime(content[0], "%a, %d %b %Y %H:%M:%S +0000")) + except ValueError: + mytimestamp=0 + else: + mytimestamp=0 + + if not os.path.exists(servertimestampdir): + os.mkdir(servertimestampdir) + os.chown(servertimestampdir, os.getuid(), portage.portage_gid) + os.chmod(servertimestampdir, 02775) + + #exitcode=0 + try: + maxretries=int(portage.settings["RSYNC_RETRIES"]) + except SystemExit, e: + raise # Needed else can't exit + except: + maxretries=3 #default number of retries + + retries=0 + hostname, port=re.split("rsync://([^:/]*)(:[0-9]+)?", syncuri)[1:3]; + if port==None: + port="" + updatecache_flg=True + + ips=[] + while (1): + if ips: + del ips[0] + if ips==[]: + try: + ips=socket.gethostbyname_ex(hostname)[2] + except SystemExit, e: + raise # Needed else can't exit + except Exception, e: + print "Notice:",str(e) + dosyncuri=syncuri + + if ips: + try: + dosyncuri=string.replace(syncuri, "//"+hostname+port+"/", "//"+ips[0]+port+"/", 1) + except SystemExit, e: + raise # Needed else can't exit + except Exception, e: + print "Notice:",str(e) + dosyncuri=syncuri + + if (retries==0): + if "--ask" in myopts: + if userquery("Do you want to sync your Portage tree with the mirror at\n" + blue(dosyncuri) + bold("?"))=="No": + print + print "Quitting." + print + sys.exit(0) + emergelog(">>> starting rsync with "+dosyncuri) + if "--quiet" not in myopts: + print ">>> starting rsync with "+dosyncuri+"..." + else: + emergelog(">>> Starting retry %d of %d with %s" % (retries,maxretries,dosyncuri)) + print "\n\n>>> Starting retry %d of %d with %s" % (retries,maxretries,dosyncuri) + + if "--quiet" not in myopts: + print ">>> checking server timestamp ..." + mycommand=rsynccommand+" "+dosyncuri+"/metadata/timestamp.chk "+tmpservertimestampdir + exitcode=portage.spawn(mycommand,portage.settings,free=1) + if (exitcode==0): + try: + servertimestamp = time.mktime(time.strptime(portage.grabfile(tmpservertimestampfile)[0], "%a, %d %b %Y %H:%M:%S +0000")) + except SystemExit, e: + raise # Needed else can't exit + except: + servertimestamp = 0 + + if (servertimestamp != 0) and (servertimestamp == mytimestamp): + emergelog(">>> Cancelling sync -- Already current.") + print + print ">>>" + print ">>> Timestamps on the server and in the local repository are the same." + print ">>> Cancelling all further sync action. You are already up to date." + print ">>>" + print + sys.exit(0) + elif (servertimestamp != 0) and (servertimestamp < mytimestamp): + emergelog(">>> Server out of date: %s" % dosyncuri) + print + print ">>>" + print ">>> SERVER OUT OF DATE: %s" % dosyncuri + print ">>>" + print + elif (servertimestamp == 0) or (servertimestamp > mytimestamp): + # actual sync + mycommand=rsynccommand+" "+dosyncuri+"/ "+myportdir + exitcode=portage.spawn(mycommand,portage.settings,free=1) + if exitcode in [0,1,2,3,4,11,14,20,21]: + break + elif exitcode in [0,1,2,3,4,11,14,20,21]: + break + + retries=retries+1 + + if retries<=maxretries: + print ">>> retry ..." + time.sleep(11) + else: + # over retries + # exit loop + updatecache_flg=False + break + + if (exitcode==0): + emergelog("=== Sync completed with %s" % dosyncuri) + elif (exitcode>0): + print + if exitcode==1: + print darkred("!!!")+green(" Rsync has reported that there is a syntax error. Please ensure") + print darkred("!!!")+green(" that your SYNC statement is proper.") + print darkred("!!!")+green(" SYNC="+portage.settings["SYNC"]) + elif exitcode==11: + print darkred("!!!")+green(" Rsync has reported that there is a File IO error. Normally") + print darkred("!!!")+green(" this means your disk is full, but can be caused by corruption") + print darkred("!!!")+green(" on the filesystem that contains PORTDIR. Please investigate") + print darkred("!!!")+green(" and try again after the problem has been fixed.") + print darkred("!!!")+green(" PORTDIR="+portage.settings["PORTDIR"]) + elif exitcode==20: + print darkred("!!!")+green(" Rsync was killed before it finished.") + else: + print darkred("!!!")+green(" Rsync has not successfully finished. It is recommended that you keep") + print darkred("!!!")+green(" trying or that you use the 'emerge-webrsync' option if you are unable") + print darkred("!!!")+green(" to use rsync due to firewall or other restrictions. This should be a") + print darkred("!!!")+green(" temporary problem unless complications exist with your network") + print darkred("!!!")+green(" (and possibly your system's filesystem) configuration.") + print + sys.exit(exitcode) + elif syncuri[:6]=="cvs://": + if not os.path.exists("/usr/bin/cvs"): + print "!!! /usr/bin/cvs does not exist, so rsync support is disabled." + print "!!! Type \"emerge dev-util/cvs\" to enable CVS support." + sys.exit(1) + cvsroot=syncuri[6:] + cvsdir=os.path.dirname(myportdir) + if not os.path.exists(myportdir+"/CVS"): + #initial checkout + print ">>> starting initial cvs checkout with "+syncuri+"..." + if not portage.spawn("cd "+cvsdir+"; cvs -d "+cvsroot+" login",portage.settings,free=1): + print "!!! cvs login error; exiting." + sys.exit(1) + if os.path.exists(cvsdir+"/gentoo-x86"): + print "!!! existing",cvsdir+"/gentoo-x86 directory; exiting." + sys.exit(1) + if not portage.spawn("cd "+cvsdir+"; cvs -z0 -d "+cvsroot+" co -P gentoo-x86",portage.settings,free=1): + print "!!! cvs checkout error; exiting." + sys.exit(1) + if cvsdir!=myportdir: + portage.movefile(cvsdir,portage.settings["PORTDIR"]) + sys.exit(0) + else: + #cvs update + print ">>> starting cvs update with "+syncuri+"..." + sys.exit(portage.spawn("cd "+myportdir+"; cvs -z0 -q update -dP",portage.settings,free=1)) + else: + print "!!! rsync setting: ",syncuri,"not recognized; exiting." + sys.exit(1) + + try: # Prevent users from affecting ebuild.sh. + os.close(sys.stdin.fileno()) + except SystemExit, e: + raise # Needed else can't exit + except: + pass + + if os.path.exists(myportdir+"/metadata/cache") and updatecache_flg: + if "--quiet" not in myopts: + print "\n>>> Updating Portage cache: ", + os.umask(0002) + cachedir = os.path.normpath(portage.settings.depcachedir) + if cachedir in ["/", "/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." + print "!!! This is ALMOST CERTAINLY NOT what you want: "+str(cachedir) + sys.exit(73) + if not os.path.exists(cachedir): + os.mkdir(cachedir) + + # Potentially bad + #if os.path.exists(cachedir+"/"+myportdir): + # portage.spawn("rm -Rf "+cachedir+"/"+myportdir+"/*",portage.settings,free=1) + + # save timestamp.chk for next timestamp check. + try: + if tmpservertimestampfile != None: + portage.movefile(tmpservertimestampfile, servertimestampfile) + except SystemExit, e: + raise # Needed else can't exit + except Exception, e: + print "!!! Failed to save current timestamp." + print "!!!",e + + portage.portdb.flush_cache() + + try: + os.umask(002) + os.chown(cachedir, os.getuid(), portage.portage_gid) + os.chmod(cachedir, 02775) + except SystemExit, e: + raise # Needed else can't exit + except: + pass + # we don't make overlay trees cache here, plus we don't trust portage.settings.categories + porttree_root = portage.portdb.porttree_root + pdb = portage.portdbapi(porttree_root, portage.config(config_profile_path=portage.settings.profile_path[:], \ + config_incrementals=portage.settings.incrementals[:])) + cp_list = pdb.cp_all() + if len(cp_list) == 0: + print "no metadata to transfer, exiting" + sys.exit(0) + cp_list.sort() + pcnt=0 + pcntstr="" + pcntcount=len(cp_list)/100.0 + nextupdate=pcntcount + current=1 + + def cleanse_cache(pdb, cat, saves, porttree_root=porttree_root): + if len(saves): + d={} + for v in saves: + d[portage.catsplit(v)[1]] = True + for pv in pdb.auxdb[porttree_root][cat].keys(): + if pv not in d: + pdb.auxdb[porttree_root][cat].del_key(pv) + else: + try: + pdb.auxdb[porttree_root][cat].clear() + del pdb.auxdb[porttree_root][cat] + except KeyError: + pass + + savelist = [] + catlist = [] + oldcat = portage.catsplit(cp_list[0])[0] + for cp in cp_list: + current += 1 + if current >= nextupdate: + pcnt += 1 + nextupdate += pcntcount + if "--quiet" not in myopts: + pcntstr = str(pcnt) + sys.stdout.write("\b"*(len(pcntstr)+1)+pcntstr+"%") + sys.stdout.flush() + cat = portage.catsplit(cp)[0] + if cat != oldcat: + catlist.append(oldcat) + cleanse_cache(pdb, oldcat, savelist) + savelist = [] + oldcat = cat + mymatches = pdb.xmatch("match-all", cp) + savelist.extend(mymatches) + for cpv in mymatches: + try: pdb.aux_get(cpv, ["IUSE"],metacachedir=myportdir+"/metadata/cache",debug=("cachedebug" in portage.features)) + except SystemExit: raise + except Exception, e: print "\nFailed cache update:",cpv,e + catlist.append(oldcat) + catlist.append("local") + cleanse_cache(pdb, oldcat, savelist) + filelist = portage.listdir(cachedir+"/"+myportdir) + for x in filelist: + found = False + for y in catlist: + if x.startswith(y): + found = True + break + if not found: + portage.spawn("cd /; rm -Rf "+cachedir+"/"+myportdir+"/"+x,portage.settings,free=1,droppriv=1) + + + sys.stdout.write("\n\n") + sys.stdout.flush() + + 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")) + + chk_updated_cfg_files() + + if(mybestpv != mypvs): + print + print red(" * ")+bold("An update to portage is available.")+" It is _highly_ recommended" + print red(" * ")+"that you update portage now, before any other packages are updated." + print red(" * ")+"Please do so and then update "+bold("ALL")+" of your configuration files." + print +elif myaction=="regen": + emergelog(" === regen") + #regenerate cache entries + print "Regenerating cache entries... " + try: + os.close(sys.stdin.fileno()) + except SystemExit, e: + raise # Needed else can't exit + except: + pass + sys.stdout.flush() + mynodes=portage.portdb.cp_all() + for x in mynodes: + mymatches=portage.portdb.xmatch("match-all",x) + if not "--quiet" in myopts: + print "processing",x + for y in mymatches: + try: + foo=portage.portdb.aux_get(y,["DEPEND"],debug=1) + except SystemExit, e: + # sys.exit is an exception... And consequently, we can't catch it. + raise + except Exception, e: + print "\n error processing %(cpv)s, continuing... (%(e)s)" % {"cpv":y,"e":str(e)} + print "done!" +# HELP action +elif "config"==myaction: + if len(myfiles) != 1 or "system" in myfiles or "world" in myfiles: + print red("!!! config can only take a single package atom at this time\n") + sys.exit(1) + + print + pkgs = portage.db[portage.root]["vartree"].dbapi.match(myfiles[0]) + if len(pkgs) == 0: + print "No packages found.\n" + sys.exit(0) + elif len(pkgs) > 1: + if "--ask" in myopts: + options = [] + print "Please select a package to configure:" + idx = 0 + for pkg in pkgs: + idx += 1 + options.append(str(idx)) + print options[-1]+") "+pkg + print "X) Cancel" + options.append("X") + idx = userquery("Selection?", options) + if idx == "X": + sys.exit(0) + pkg = pkgs[int(idx)-1] + else: + print "The following packages available:" + for pkg in pkgs: + print "* "+pkg + print "\nPlease use a specific atom or the --ask option." + sys.exit(1) + else: + pkg = pkgs[0] + + print + if "--ask" in myopts: + if userquery("Ready to configure "+pkg+"?") == "No": + sys.exit(0) + else: + print "Configuring pkg..." + print + ebuildpath = portage.db[portage.root]["vartree"].dbapi.findname(pkg) + mysettings = portage.config(clone=portage.settings) + portage.doebuild(ebuildpath,"config",portage.root,mysettings,debug=("--debug" in myopts),cleanup=True) + print + +# INFO action +elif "info"==myaction: + unameout=commands.getstatusoutput("uname -mrp")[1] + print getportageversion() + print "=================================================================" + print "System uname: "+unameout + if os.path.exists("/etc/gentoo-release"): + os.system("cat /etc/gentoo-release") + else: + print "Unknown Host Operating System" + + output=commands.getstatusoutput("distcc --version") + if not output[0]: + print str(string.split(output[1],"\n",1)[0]), + if "distcc" in portage.features: + print "[enabled]" + else: + print "[disabled]" + + output=commands.getstatusoutput("ccache -V") + if not output[0]: + print str(string.split(output[1],"\n",1)[0]), + if "ccache" in portage.features: + print "[enabled]" + else: + print "[disabled]" + + myvars = ["sys-devel/autoconf", "sys-devel/automake", "virtual/os-headers", + "sys-devel/binutils", "sys-devel/libtool", "dev-lang/python"] + myvars += portage_util.grabfile(portage.settings["PORTDIR"]+"/profiles/info_pkgs") + myvars = portage_util.unique_array(myvars) + myvars.sort() + + for x in myvars: + if portage.isvalidatom(x): + pkg_matches = portage.db["/"]["vartree"].dbapi.match(x) + pkgs = [] + for y in pkg_matches: + mycpv = portage.catpkgsplit(y) + if(mycpv[3] != "r0"): + pkgs += [mycpv[2] + "-" + mycpv[3]] + else: + pkgs += [mycpv[2]] + if not pkgs: + pkgs = "[Not Present]" + else: + pkgs = ", ".join(sorted_versions(pkgs)) + print "%-20s %s" % (x+":", pkgs) + else: + print "%-20s %s" % (x+":", "[NOT VALID]") + + libtool_vers = string.join(portage.db["/"]["vartree"].dbapi.match("sys-devel/libtool"), ",") + + if "--verbose" in myopts: + myvars=portage.settings.keys() + else: + myvars = ['GENTOO_MIRRORS', 'CONFIG_PROTECT', 'CONFIG_PROTECT_MASK', + 'PORTDIR', 'DISTDIR', 'PKGDIR', 'PORTAGE_TMPDIR', + 'PORTDIR_OVERLAY', 'USE', 'CHOST', 'CFLAGS', 'CXXFLAGS', + 'ACCEPT_KEYWORDS', 'SYNC', 'FEATURES'] + + myvars.extend(portage_util.grabfile(portage.settings["PORTDIR"]+"/profiles/info_vars")) + + myvars = portage_util.unique_array(myvars) + unset_vars = [] + myvars.sort() + for x in myvars: + if portage.settings.has_key(x): + print x+'="'+portage.settings[x]+'"' + else: + unset_vars.append(x) + if unset_vars: + print "Unset: "+", ".join(unset_vars) + print + + if "--debug" in myopts: + for x in dir(portage): + module = getattr(portage, x) + if "cvs_id_string" in dir(module): + print "%s: %s" % (str(x), str(module.cvs_id_string)) + +# SEARCH action +elif "search"==myaction: + if not myfiles: + print "emerge: no search terms provided." + else: + searchinstance = search() + for mysearch in myfiles: + try: + searchinstance.execute(mysearch) + except re.error, comment: + print "\n!!! Regular expression error in \"%s\": %s" % ( mysearch, comment ) + sys.exit(1) + searchinstance.output() +elif "inject"==myaction: + if not myfiles: + print "emerge: please specify at least one cat/pkg-ver to inject." + sys.exit(1) + if "--pretend" in myopts: + print "emerge: the \"inject\" action does not support \"--pretend.\"" + sys.exit(1) + for x in myfiles: + if x[0] in [">","<","=","!"]: + print "!!! '"+x+"' is an invalid specification." + print "!!! Must be 'category/package-version' with no other symbols." + print + continue + mycps=portage.catpkgsplit(x) + 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): + print "!!! Not injecting",x+"; Package already exists." + else: + if "--ask" in myopts: + if userquery("Do you want to inject the package %s?" % x)=="No": + print + print "Quitting." + print + sys.exit(0) + portage.db["/"]["vartree"].dbapi.cpv_inject(x) + print ">>> Injected",x+"." + emergelog(" === inject: "+x) +elif "unmerge"==myaction or "prune"==myaction or "clean"==myaction: + if 1==unmerge(myaction, myfiles): + post_emerge() + +elif "depclean"==myaction: + # Kill packages that aren't explicitly merged or are required as a + # dependency of another package. World file is explicit. + + print + print red("*** WARNING ***")+" : DEPCLEAN CAN SERIOUSLY IMPAIR YOUR SYSTEM. USE CAUTION." + print red("*** WARNING ***")+" : (Cancel: CONTROL-C) -- ALWAYS VERIFY ALL PACKAGES IN THE" + print red("*** WARNING ***")+" : CANDIDATE LIST FOR SANITY BEFORE ALLOWING DEPCLEAN TO" + print red("*** WARNING ***")+" : UNMERGE ANY PACKAGES." + print red("*** WARNING ***")+" :" + print red("*** WARNING ***")+" : USE FLAGS MAY HAVE AN EXTREME EFFECT ON THE OUTPUT." + print red("*** WARNING ***")+" : SOME LIBRARIES MAY BE USED BY PACKAGES BUT ARE NOT" + print red("*** WARNING ***")+" : CONSIDERED TO BE A DEPEND DUE TO USE FLAG SETTINGS." + print red("*** WARNING ***")+" : emerge --update --deep --newuse world TO VERIFY" + print red("*** WARNING ***")+" : SANITY IN THIS REGARD." + print red("*** WARNING ***")+" :" + print red("*** WARNING ***")+" : Packages in the list that are desired may be added" + print red("*** WARNING ***")+" : directly to the world file to cause them to be ignored" + print red("*** WARNING ***")+" : by depclean and maintained in the future. BREAKAGES DUE" + print red("*** WARNING ***")+" : TO UNMERGING AN ==IN-USE LIBRARY== MAY BE REPAIRED BY" + print red("*** WARNING ***")+" : MERGING *** THE PACKAGE THAT COMPLAINS *** ABOUT THE" + print red("*** WARNING ***")+" : MISSING LIBRARY." + print + if ("--pretend" not in myopts) and ("--ask" not in myopts): + countdown(EMERGE_WARNING_DELAY, ">>> Depclean") + emergelog(" >>> depclean") + + mydepgraph=depgraph(myaction,myopts) + syslist=getlist("system") + worldlist=getlist("world") + + print "Calculating",myaction,"dependencies ", + if not mydepgraph.xcreate("world"): + print "\n!!! Failed to create deptree." + sys.exit(1) + print "\b\b ... done!" + + if ("--usepkgonly" in myopts) and mydepgraph.missingbins: + sys.stderr.write(red("The following binaries are not available for merging...\n")) + for x in mydepgraph.missingbins: + sys.stderr.write(" "+str(x)+"\n") + sys.stderr.write("\nThese are required by '--usepkgonly' -- Terminating.\n\n") + sys.exit(1) + + alldeps=mydepgraph.digraph.allnodes() + myvarlist=portage.vardbapi(portage.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 + if not alldeps: + print "!!! You have no dependencies. Impossible. Bug." + + if not (syslist and worldlist and myvarlist and alldeps): + print + sys.exit(1) + + reallist=[] + for x in alldeps: + myparts=portage.catpkgsplit(string.split(x)[2]) + if not myparts: + sys.stderr.write( + red("!!! There appears to be a problem with the following package:\n")+ + red("!!! "+str(string.split(x)[2])+"\n\n")+ + "!!! Please ensure that blocking/conflicting packages are not merged."+ + "!!! 'emerge -p "+str(string.split(x)[2])+"\n\n") + if ("--pretend" not in myopts) and ("--ask" not in myopts): + countdown(EMERGE_WARNING_DELAY, "*** Continuing") + continue + + catpack=myparts[0]+"/"+myparts[1] + if catpack not in reallist: + reallist.append(catpack) + + cleanlist=[] + for x in myvarlist: + if x not in reallist: + if x not in cleanlist: + cleanlist.append(x) + + for x in syslist+worldlist: + myparts = portage.catpkgsplit(x) + if myparts: + if myparts[0][0] in ('<','>','='): + myparts[0] = myparts[0][1:] + if myparts[0][0] in ('<','>','='): + myparts[0] = myparts[0][1:] + catpack=myparts[0]+"/"+myparts[1] + else: + catpack=x + if catpack in cleanlist: + cleanlist.remove(catpack) + + #print "\n\n\nCleaning: " + #for x in cleanlist: + # print x + #print + + if len(cleanlist): + unmerge("unmerge", cleanlist) + + print + print "Packages installed: "+str(len(myvarlist)) + print "Packages in world: "+str(len(worldlist)) + print "Packages in system: "+str(len(syslist)) + print "Unique package names: "+str(len(reallist)) + print "Required packages: "+str(len(alldeps)) + if "--pretend" in myopts: + print "Number to remove: "+str(len(cleanlist)) + else: + print "Number removed: "+str(len(cleanlist)) + post_emerge() + +# "update", "system", or just process files: +else: + favorites=[] + syslist=getlist("system") + if (("--pretend" in myopts) and not ("--fetchonly" in myopts or "--fetch-all-uri" in myopts)) or ("--ask" in myopts): + if "--tree" in myopts: + print + print darkgreen("These are the packages that I would merge, in reverse order:") + print + else: + print + print darkgreen("These are the packages that I would merge, in order:") + print + + if ("--resume" in myopts) and portage.mtimedb.has_key("resume"): + myresumeopts=portage.mtimedb["resume"]["myopts"][:] + + while "--skipfirst" in myresumeopts: + myresumeopts.remove("--skipfirst") + while "--ask" in myresumeopts: + myresumeopts.remove("--ask") + + for myopt in myopts: + if myopt not in myresumeopts: + myresumeopts.append(myopt) + myopts=myresumeopts + mydepgraph=depgraph("resume",myopts) + if "--resume" not in myopts: + myopts+=["--resume"] + else: + if ("--resume" in myopts): + del myopts[myopts.index("--resume")] + print darkgreen("emerge: It seems we have nothing to resume...") + sys.exit(0) + + mydepgraph=depgraph(myaction,myopts) + if myaction in ["system","world"]: + print "Calculating",myaction,"dependencies ", + sys.stdout.flush() + if not mydepgraph.xcreate(myaction): + print "!!! Depgraph creation failed." + sys.exit(1) + print "\b\b ...done!" + else: + if not myfiles: + print "emerge: please tell me what to do." + help() + sys.exit(1) + #we don't have any files to process; skip this step and exit + print "Calculating dependencies ", + sys.stdout.flush() + retval,favorites=mydepgraph.select_files(myfiles) + if not retval: + sys.exit(1) + print "\b\b ...done!" + + if ("--usepkgonly" in myopts) and mydepgraph.missingbins: + sys.stderr.write(red("The following binaries are not available for merging...\n")) + + if mydepgraph.missingbins: + for x in mydepgraph.missingbins: + sys.stderr.write(" "+str(x)+"\n") + sys.stderr.write("\nThese are required by '--usepkgonly' -- Terminating.\n\n") + sys.exit(1) + + if "--ask" in myopts: + if "--resume" in myopts: + mydepgraph.display(portage.mtimedb["resume"]["mergelist"]) + prompt="Do you want me to resume merging these packages?" + else: + mydepgraph.display(mydepgraph.altlist()) + mergecount=0 + for x in mydepgraph.altlist(): + if x[3]!="nomerge": + mergecount+=1 + #check for blocking dependencies + if x[0]=="blocks": + print "\n!!! Error: The above package list contains packages which cannot be installed" + print "!!! on the same system." + print + sys.exit(1) + if mergecount==0: + if portage.settings["AUTOCLEAN"] and "yes"==portage.settings["AUTOCLEAN"]: + prompt="Nothing to merge; do you want me to auto-clean packages?" + else: + print + print "Nothing to merge; quitting." + print + sys.exit(0) + elif "--fetchonly" in myopts or "--fetch-all-uri" in myopts: + prompt="Do you want me to fetch the source files for these packages?" + else: + prompt="Do you want me to merge these packages?" + print + if userquery(prompt)=="No": + print + print "Quitting." + print + sys.exit(0) + # Don't ask again (e.g. when auto-cleaning packages after merge) + myopts.remove("--ask") + + if ("--pretend" in myopts) and not ("--fetchonly" in myopts or "--fetch-all-uri" in myopts): + if ("--resume" in myopts): + mydepgraph.display(portage.mtimedb["resume"]["mergelist"]) + else: + mydepgraph.display(mydepgraph.altlist()) + else: + if ("--buildpkgonly" in myopts): + if not mydepgraph.digraph.hasallzeros(): + print "\n!!! --buildpkgonly requires all dependencies to be merged." + print "!!! Cannot merge requested packages. Merge deps and try again.\n" + sys.exit(1) + + if ("--resume" in myopts): + favorites=portage.mtimedb["resume"]["favorites"] + mydepgraph.merge(portage.mtimedb["resume"]["mergelist"]) + else: + portage.mtimedb["resume"]={} + portage.mtimedb["resume"]["myopts"]=myopts + portage.mtimedb["resume"]["favorites"]=favorites + if ("--digest" in myopts) and not ("--fetchonly" in myopts or "--fetch-all-uri" in myopts): + for pkgline in mydepgraph.altlist(): + 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)) + mydepgraph.merge(mydepgraph.altlist()) + + if portage.mtimedb.has_key("resume"): + del portage.mtimedb["resume"] + if portage.settings["AUTOCLEAN"] and "yes"==portage.settings["AUTOCLEAN"]: + print ">>> Auto-cleaning packages ..." + unmerge("clean", ["world"]) + post_emerge() diff --git a/bin/emerge-webrsync b/bin/emerge-webrsync new file mode 100755 index 000000000..024af23e8 --- /dev/null +++ b/bin/emerge-webrsync @@ -0,0 +1,141 @@ +#!/bin/bash +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-src/portage/bin/Attic/emerge-webrsync,v 1.8.2.4 2005/02/26 11:22:38 carpaski Exp $ +# Author: Karl Trygve Kalleberg +# Rewritten from the old, Perl-based emerge-webrsync script + +GENTOO_MIRRORS="${GENTOO_MIRRORS} $(/usr/lib/portage/bin/portageq gentoo_mirrors)" +PORTDIR="$(/usr/lib/portage/bin/portageq portdir)" +FETCHCOMMAND="$(/usr/lib/portage/bin/portageq envvar FETCHCOMMAND)" +USERLAND="$(/usr/lib/portage/bin/portageq envvar USERLAND)" +DISTDIR="$(/usr/lib/portage/bin/portageq envvar PORTAGE_TMPDIR)/emerge-webrsync" + +if [ ! -d $DISTDIR ] ; then + mkdir -p $DISTDIR +fi + +cd "$DISTDIR" + +found=0 +if [ "$1" == "-v" ] ; then + wgetops= +else + #this sucks. probably better to do 1> /dev/null + #that said, waiting on the refactoring. + if [ "${FETCHCOMMAND/wget}" != "${FETCHCOMMAND}" ]; then + wgetops="-q" + elif [ "${FETCHCOMMAND/curl}" != "${FETCHCOMMAND}" ]; then + wgetops="-s -f" + fi +fi + +if type -p md5sum > /dev/null; then + md5_com='md5sum -c "${FILE}.md5sum"' +elif type -p md5 > /dev/null; then + md5_com='[ "$(md5 -q ${FILE})" == "$(cut -d \ -f 1 ${FILE}.md5sum)" ]' +else + echo "warning, unable to do md5 verification of the snapshot!" + echo "no suitable md5/md5sum binary was found!" + md5_com='true' +fi + +sync_local() { + echo Syncing local tree... + if ! tar jxf $FILE; then + echo "Tar failed to extract the image. Please review the output." + echo "Executed command: tar jxf $FILE" + exit 1 + fi + rm -f $FILE + # Make sure user and group file ownership is root + chown -R 0:0 portage + cd portage + rsync -av --progress --stats --delete --delete-after \ + --exclude='/distfiles' --exclude='/packages' \ + --exclude='/local' . ${PORTDIR%%/} + cd .. + echo "cleaning up" + rm -rf portage + echo "transferring metadata/cache" + emerge metadata +} + +echo "Fetching most recent snapshot" + +declare -i attempts=-1 +while (( $attempts < 40 )) ; do + attempts=$(( attempts + 1 )) + + #this too, sucks. it works in the interim though. + if [ "$USERLAND" == "BSD" ] || [ "$USERLAND" == "Darwin" ] ; then + daysbefore=$(expr $(date +"%s") - 86400 \* $attempts) + day=$(date -r $daysbefore +"%d") + month=$(date -r $daysbefore +"%m") + year=$(date -r $daysbefore +"%Y") + else + day=$(date -d "-$attempts day" +"%d") + month=$(date -d "-$attempts day" +"%m") + year=$(date -d "-$attempts day" +"%Y") + fi + + FILE_ORIG="portage-${year}${month}${day}.tar.bz2" + + echo "Attempting to fetch file dated: ${year}${month}${day}" + + got_md5=0 + + if [ ! -e "${FILE_ORIG}.md5sum" ]; then + FILE="${FILE_ORIG}.md5sum" + for i in $GENTOO_MIRRORS ; do + URI="${i}/snapshots/${FILE}" + if (eval "$FETCHCOMMAND $wgetops") && [ -s "${FILE}" ]; then + got_md5=1 + break + fi + done + else + got_md5=1 + fi + FILE="${FILE_ORIG}" + + if (($got_md5 == 0 )); then + echo " --- No md5sum present on the mirror. (Not yet available.)" + continue + elif [ -s "${FILE}" ]; then + if eval "$md5_com"; then + echo " === snapshot $FILE is correct, using it" + sync_local + echo + echo " === Snapshot has beed sync'd" + echo + exit 0 + else + rm $FILE + fi + fi + + for i in $GENTOO_MIRRORS ; do + URI="${i}/snapshots/$FILE" + rm -f "$FILE" + if (eval "$FETCHCOMMAND $wgetops") && [ -s "$FILE" ]; then + if ! eval "$md5_com"; then + echo "md5 failed on $FILE" + rm ${FILE} + continue + else + sync_local + echo + echo " *** Completed websync, please now perform a normal rsync if possible." + echo " Update is current as of the of YYYYMMDD: ${year}${month}${day}" + echo + exit 0 + fi + fi + + done +done + +rm -rf portage + +exit 1 diff --git a/bin/emerge.orig b/bin/emerge.orig new file mode 100755 index 000000000..c66f32eae --- /dev/null +++ b/bin/emerge.orig @@ -0,0 +1,3227 @@ +#!/usr/bin/python -O +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-src/portage/bin/emerge,v 1.345.2.33 2005/06/02 00:57:52 vapier Exp $ + +import os,sys +os.environ["PORTAGE_CALLER"]="emerge" +sys.path = ["/usr/lib/portage/pym"]+sys.path + +import portage + +import emergehelp,xpak,string,re,commands,time,shutil,traceback,atexit,signal,socket,types +from stat import * +from output import * + +import portage_util +import portage_locks +import portage_exception + + +spinner_msgs = ["Gentoo Rocks ("+os.uname()[0]+")", + "Thank you for using Gentoo. :)", + "Are you actually trying to read this?", + "How many times have you stared at this?", + "We are generating the cache right now", + "You are paying too much attention.", + "A theory is better than its explanation.", + "Phasers locked on target, Captain.", + "Thrashing is just virtual crashing.", + "To be is to program.", + "Real Users hate Real Programmers.", + "When all else fails, read the instructions.", + "Functionality breeds Contempt.", + "The future lies ahead.", + "3.1415926535897932384626433832795028841971694", + "Sometimes insanity is the only alternative.", + "Inaccuracy saves a world of explanation.", + ] + + +def update_basic_spinner(): + global spinner, spinpos + spinpos = (spinpos+1) % 500 + if (spinpos % 100) == 0: + if spinpos == 0: + sys.stdout.write(". ") + else: + sys.stdout.write(".") + sys.stdout.flush() + +def update_scroll_spinner(): + global spinner, spinpos + if(spinpos >= len(spinner)): + sys.stdout.write(darkgreen(" \b\b\b"+spinner[len(spinner)-1-(spinpos%len(spinner))])) + else: + sys.stdout.write(green("\b "+spinner[spinpos])) + sys.stdout.flush() + spinpos = (spinpos+1) % (2*len(spinner)) + +def update_twirl_spinner(): + global spinner, spinpos + spinpos = (spinpos+1) % len(spinner) + sys.stdout.write("\b\b "+spinner[spinpos]) + sys.stdout.flush() + +spinpos = 0 +spinner = "/-\\|/-\\|/-\\|/-\\|\\-/|\\-/|\\-/|\\-/|" +update_spinner = update_twirl_spinner +if "candy" in portage.settings.features: + spinner = spinner_msgs[int(time.time()*100)%len(spinner_msgs)] + update_spinner = update_scroll_spinner +if not sys.stdout.isatty() or ("--nospinner" in sys.argv): + update_spinner = update_basic_spinner + + +if (not sys.stdout.isatty()) or (portage.settings["NOCOLOR"] in ["yes","true"]): + nocolor() + +def normpath(mystr): + if mystr and (mystr[0]=='/'): + return os.path.normpath("///"+mystr) + else: + return os.path.normpath(mystr) + +def userquery(prompt, responses=None, colours=None): + """Displays a prompt and a set of responses, then waits for a response + which is checked against the responses and the first to match is + returned. + + prompt: a String. + responses: a List of Strings. + colours: a List of Functions taking and returning a String, used to + process the responses for display. Typically these will be functions + like red() but could be e.g. lambda x: "DisplayString". + If responses is omitted, defaults to ["Yes, "No"], [green, red]. + If only colours is omitted, defaults to [bold, ...]. + + Returns a member of the List responses. (If called without optional + arguments, returns "Yes" or "No".) + KeyboardInterrupt is converted to SystemExit to avoid tracebacks being + printed.""" + if responses is None: + responses, colours = ["Yes", "No"], [green, red] + elif colours is None: + colours=[bold] + colours=(colours*len(responses))[:len(responses)] + print bold(prompt), + try: + while True: + response=raw_input("["+string.join([colours[i](responses[i]) for i in range(len(responses))],"/")+"] ") + for key in responses: + if response.upper()==key[:len(response)].upper(): + return key + print "Sorry, response '%s' not understood." % response, + except (EOFError, KeyboardInterrupt): + print "Interrupted." + sys.exit(1) + +def sorted_versions(verlist): + ret = [] + for ver in verlist: + verparts = ver.split("-") + if len(verparts) == 2: + verrev = int(verparts[1][1:]) + else: + verrev = 0 + x = 0 + while x < len(ret): + retparts = ret[x].split("-") + verdiff = portage.vercmp(retparts[0], verparts[0]) + if verdiff > 0: + break + elif verdiff == 0: + if len(retparts) == 2: + retrev = int(retparts[1][1:]) + else: + retrev = 0 + if retrev >= verrev: + break + x += 1 + ret.insert(x, ver) + return ret + +if portage.settings.has_key("PORTAGE_NICENESS"): + try: + os.nice(int(portage.settings["PORTAGE_NICENESS"])) + except SystemExit, e: + raise # Needed else can't exit + except Exception,e: + print "!!! Failed to change nice value to '"+str(portage.settings["PORTAGE_NICENESS"])+"'" + print "!!!",e + +#Freeze the portdbapi for enhanced performance: +portage.portdb.freeze() + +# Kill noauto as it will break merges otherwise. +while 'noauto' in portage.features: + del portage.features[portage.features.index('noauto')] + +#number of ebuilds merged +merged=0 +params=["selective", "deep", "self", "recurse", "empty"] +actions=[ +"clean", "config", "depclean", +"info", "inject", "metadata", +"prune", "regen", "rsync", "search", +"sync", "system", "unmerge", "world", +] +options=[ +"--ask", +"--buildpkg", "--buildpkgonly", +"--changelog", "--columns", +"--debug", "--deep", +"--digest", +"--emptytree", +"--fetchonly", "--fetch-all-uri", +"--getbinpkg", "--getbinpkgonly", +"--help", "--noconfmem", +"--newuse", "--nocolor", +"--nodeps", "--noreplace", +"--nospinner", "--oneshot", +"--onlydeps", "--pretend", +"--quiet", "--resume", +"--searchdesc", "--selective", +"--skipfirst", +"--tree", +"--update", "--upgradeonly", +"--usepkg", "--usepkgonly", +"--verbose", "--version" +] + +shortmapping={ +"1":"--oneshot", +"a":"--ask", +"b":"--buildpkg", "B":"--buildpkgonly", +"c":"--clean", "C":"--unmerge", +"d":"--debug", "D":"--deep", +"e":"--emptytree", +"f":"--fetchonly", "F":"--fetch-all-uri", +"g":"--getbinpkg", "G":"--getbinpkgonly", +"h":"--help", +"i":"--inject", +"k":"--usepkg", "K":"--usepkgonly", +"l":"--changelog", +"n":"--noreplace", "N":"--newuse", +"o":"--onlydeps", "O":"--nodeps", +"p":"--pretend", "P":"--prune", +"q":"--quiet", +"s":"--search", "S":"--searchdesc", +'t':"--tree", +"u":"--update", "U":"--upgradeonly", +"v":"--verbose", "V":"--version" +} + +myaction=None +myopts=[] +myfiles=[] +edebug=0 + +# process short actions +tmpcmdline=sys.argv[1:] +#tmpcmdline.extend(portage.settings["EMERGE_OPTS"].split()) +cmdline=[] +for x in tmpcmdline: + if x[0:1]=="-"and x[1:2]!="-": + for y in x[1:]: + if shortmapping.has_key(y): + if shortmapping[y] in cmdline: + print + print "*** Warning: Redundant use of",shortmapping[y] + else: + cmdline.append(shortmapping[y]) + else: + print "!!! Error: -"+y+" is an invalid short action or option." + sys.exit(1) + else: + cmdline.append(x) + +# process the options and command arguments +for x in cmdline: + if not x: + continue + if len(x)>=2 and x[0:2]=="--": + if x in options: + myopts.append(x) + elif x[2:] in actions: + if x[2:]=="rsync" or x=="rsync": + # "emerge --rsync" + print + print red("*** '--rsync' has been deprecated.") + print red("*** Please use '--sync' instead.") + print + x="--sync" + if myaction: + if myaction not in ["system", "world"]: + myaction="--"+myaction + print + print red("!!!")+green(" Multiple actions requested... Please choose one only.") + print red("!!!")+" '"+darkgreen(myaction)+"' "+red("or")+" '"+darkgreen(x)+"'" + print + sys.exit(1) + myaction=x[2:] + else: + print "!!! Error:",x,"is an invalid option." + sys.exit(1) + elif (not myaction) and (x in actions): + if x not in ["system", "world"]: + #print red("*** Deprecated use of action '"+x+"'") + if x=="rsync": + # "emerge rsync" + print + print red("*** 'rsync' will now install the package rsync.") + print red("*** To sync the tree, please use '--sync' instead.") + print + myfiles.append(x) + continue + if myaction: + print + print red("!!!")+green(" Multiple actions requested... Please choose one only.") + print red("!!! '")+darkgreen(myaction)+"' "+red("or")+" '"+darkgreen(x)+"'" + print + sys.exit(1) + myaction=x + elif x[-1]=="/": + # this little conditional helps tab completion + myfiles.append(x[:-1]) + else: + myfiles.append(x) + + +if "moo" in myfiles: + print """ + + Gentoo (""" + os.uname()[0] + """) + + _______________________ +< Have you mooed today? > + ----------------------- + \ ^__^ + \ (oo)\_______ + (__)\ )\/\ + ||----w | + || || + +""" + +if (myaction in ["world", "system"]) and myfiles: + print "emerge: please specify a package class (\"world\" or \"system\") or individual packages, but not both." + sys.exit(1) + +for x in myfiles: + if (x[-7:] == ".ebuild" or x[-5:] == ".tbz2") and os.path.exists(os.path.abspath(x)): + print "emerging by path implies --oneshot... adding --oneshot to options." + print red("\n*** emerging by path is broken and may not always work!!!\n") + break + +if ("--tree" in myopts) and ("--columns" in myopts): + print "emerge: can't specify both of \"--tree\" and \"--columns\"." + sys.exit(1) + +# Always create packages if FEATURES=buildpkg +# Imply --buildpkg if --buildpkgonly +if ("buildpkg" in portage.features) or ("--buildpkgonly" in myopts): + if "--buildpkg" not in myopts: + myopts.append("--buildpkg") + +# --tree only makes sense with --pretend +if "--tree" in myopts and not (("--pretend" in myopts) or ("--ask" in myopts)): + print ">>> --tree implies --pretend... adding --pretend to options." + myopts.append("--pretend") + +# Also allow -S to invoke search action (-sS) +if ("--searchdesc" in myopts): + if myaction and myaction != "search": + myfiles.append(myaction) + if "--search" not in myopts: + myopts.append("--search") + myaction = "search" + +# Always try and fetch binary packages if FEATURES=getbinpkg +if ("getbinpkg" in portage.features): + myopts.append("--getbinpkg") + +if ("--getbinpkgonly" in myopts) and not ("--usepkgonly" in myopts): + myopts.append("--usepkgonly") + +if ("--getbinpkgonly" in myopts) and not ("--getbinpkg" in myopts): + myopts.append("--getbinpkg") + +if ("--getbinpkg" in myopts) and not ("--usepkg" in myopts): + myopts.append("--usepkg") + +# Also allow -K to apply --usepkg/-k +if ("--usepkgonly" in myopts) and not ("--usepkg" in myopts): + myopts.append("--usepkg") + +# Print deprecation warning for -U +if ("--upgradeonly" in myopts): + print + print red("*** Warning: --upgradeonly is a deprecated option in portage-"+portage.VERSION) + print red("*** and will likely be removed in a future version.") + print + # Also allow -U to apply --update/-u + if not ("--update" in myopts): + print ">>> --upgradeonly implies --update... adding --update to options." + myopts.append("--update") + +# Also allow -l to apply --pretend/-p, but if already in --ask mode +if ("--changelog" in myopts) and not (("--pretend" in myopts) or ("--ask" in myopts)): + print ">>> --changelog implies --pretend... adding --pretend to options." + myopts.append("--pretend") + +# Allow -p to remove --ask +if ("--pretend" in myopts) and ("--ask" in myopts): + print ">>> --pretend disables --ask... removing --ask from options." + myopts.remove("--ask") + +# forbid --ask when not in a terminal +# note: this breaks `emerge --ask | tee logfile`, but that doesn't work anyway. +if ("--ask" in myopts) and (not sys.stdin.isatty()): + portage.writemsg("!!! \"--ask\" should only be used in a terminal. Exiting.\n") + sys.exit(1) + +# Set so that configs will be merged regardless of remembered status +if ("--noconfmem" in myopts): + portage.settings.unlock() + portage.settings["NOCONFMEM"]="1" + portage.settings.backup_changes("NOCONFMEM") + portage.settings.lock() + +# Set various debug markers... They should be merged somehow. +if ("--debug" in myopts): + portage.settings.unlock() + portage.settings["PORTAGE_DEBUG"]="1" + portage.settings.backup_changes("PORTAGE_DEBUG") + portage.debug=1 + portage.settings.lock() + +if ("--resume" in myopts): + if "--verbose" in myopts: + print "* --verbose is currently broken with --resume. Disabling..." + myopts.remove("--verbose") + if "--tree" in myopts: + print "* --tree is currently broken with --resume. Disabling..." + myopts.remove("--tree") + +# Set color output +if ("--nocolor" in myopts) and (sys.stdout.isatty()): + nocolor() + +CLEAN_DELAY = 5 +EMERGE_WARNING_DELAY = 10 +if portage.settings["CLEAN_DELAY"]: + CLEAN_DELAY = string.atoi("0"+portage.settings["CLEAN_DELAY"]) +if portage.settings["EMERGE_WARNING_DELAY"]: + EMERGE_WARNING_DELAY = string.atoi("0"+portage.settings["EMERGE_WARNING_DELAY"]) + +if "inject" == myaction: + 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("*** 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("*** For more information on fine-grained portage control, please see") + print red("*** the portage man page.") + print + +def emergelog(mystr,short_msg=None): + if "notitles" not in portage.features: + if short_msg: + xtermTitle(short_msg) + else: + 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) + else: + mylogfile=open("/var/log/emerge.log", "a") + + l=portage_locks.lockfile(mylogfile) + # seek because we may have gotten held up by the lock. + # if so, we may not be positioned at the end of the file. + mylogfile.seek(0,2) + mylogfile.write(str(time.time())[:10]+": "+mystr+"\n") + mylogfile.flush() + portage_locks.unlockfile(l) + mylogfile.close() + except SystemExit, e: + raise # Needed else can't exit + except Exception, e: + if edebug: + print "emergelog():",e + pass + +def emergeexit(): + """This gets out final log message in before we quit.""" + if "--pretend" not in myopts: + emergelog(" *** terminating.") + if "notitles" not in portage.features: + xtermTitleReset() +atexit.register(emergeexit) + +def emergeexitsig(signum, frame): + signal.signal(signal.SIGINT, signal.SIG_IGN) + portage.portageexit() + portage_util.writemsg("\n\nExiting on signal %(signal)s\n" % {"signal":signum}) + sys.exit(100+signum) +signal.signal(signal.SIGINT, emergeexitsig) + +def countdown(secs=5, doing="Starting"): + if secs: + print ">>> Waiting",secs,"seconds before starting..." + print ">>> (Control-C to abort)...\n"+doing+" in: ", + ticks=range(secs) + ticks.reverse() + for sec in ticks: + sys.stdout.write(red(str(sec+1)+" ")) + sys.stdout.flush() + time.sleep(1) + print + +# formats a size given in bytes nicely +def format_size(mysize): + if type(mysize) not in [types.IntType,types.LongType]: + return str(mysize) + mystr=str(mysize/1024) + mycount=len(mystr) + while (mycount > 3): + mycount-=3 + mystr=mystr[:mycount]+","+mystr[mycount:] + return mystr+" kB" + + +def getgccversion(): + """ + rtype: C{str} + return: the current in-use gcc version + """ + + gcc_env_dir = os.path.join('/', '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" + + "!!! to update the environment of this terminal and possibly\n" + + "!!! other terminals also." + ) + + gcc_distcc_broken_error = green( + '!!! Relying on the shell to locate gcc, this may break\n' + + '!!! DISTCC, installing gcc-config and setting your current gcc\n' + + '!!! profile will fix this' + ) + + def fallback(): + + print >>sys.stderr, gcc_distcc_broken_error + + gccout = commands.getstatusoutput(gcc_ver_command) + + if gccout[0] != 0: + print >>sys.stderr, gcc_not_found_error + gccver = "[unavailable]" + else: + gccver = gcc_ver_prefix + gccout[1] + + return gccver + + if os.path.isfile(gcc_config_config): + try: + gccver_str = open(gcc_config_config).read().strip() + gccver = gcc_ver_prefix + string.join(gccver_str.split('-')[4:], '-') + except IndexError: + gccver = fallback() + + else: + import glob + dir_l = glob.glob(os.path.join(gcc_env_dir, '*-*')) + + if len(dir_l) == 1: + try: + gccver = gcc_ver_prefix + dir_l[0].split('-')[-1] + except IndexError: + gccver = fallback() + + else: + # There was no "config" file in /etc/env.d/gcc and there was more + # than one profile in /etc/env.d/gcc so we can't actively + # determine what version of gcc we are using so we fall back on the + # old way that breaks distcc + + gccver = fallback() + + return gccver + +def getportageversion(): + try: + import re + profilever = os.path.normpath("///"+os.readlink("/etc/make.profile")) + basepath = os.path.normpath("///"+portage.settings["PORTDIR"]+"/profiles") + if re.match(basepath,profilever): + profilever = profilever[len(basepath)+1:] + else: + profilever = "!"+profilever + del basepath + except SystemExit, e: + raise # Needed else can't exit + except: + profilever="unavailable" + libcver=[] + libclist = portage.vardbapi(portage.root).match("virtual/libc") + libclist += portage.vardbapi(portage.root).match("virtual/glibc") + libclist = portage_util.unique_array(libclist) + for x in libclist: + xs=portage.catpkgsplit(x) + if libcver: + libcver+=","+string.join(xs[1:], "-") + else: + libcver=string.join(xs[1:], "-") + if libcver==[]: + libcver="unavailable" + + gccver = getgccversion() + unameout=os.uname()[2]+" "+os.uname()[4] + + return "Portage " + portage.VERSION +" ("+profilever+", "+gccver+", "+libcver+", "+unameout+")" + +def help(): + # Move all the help stuff out of this file. + emergehelp.help(myaction,myopts,havecolor) + +# check if root user is the current user for the actions where emerge needs this +if ("--pretend" in myopts) or ("--fetchonly" in myopts or "--fetch-all-uri" in myopts) or (myaction=="search"): + if not portage.secpass: + if portage.wheelgid==portage.portage_gid: + print "emerge: wheel group membership required for \"--pretend\" and search." + print "emerge: wheel group use is being deprecated. Please update group and passwd to" + print " include the portage user as noted above, and then use group portage." + else: + print "emerge: portage group membership required for \"--pretend\" and search." + sys.exit(1) +elif "--version" in myopts: + print getportageversion() + sys.exit(0) +elif "--help" in myopts: + help() + sys.exit(0) +elif portage.secpass!=2: + if myaction in ["search", "info", "regen"]: + pass + elif (not myaction) and (not myfiles): + pass + elif ("--pretend" in myopts) and (myaction in ["world","system","clean","prune","unmerge"]): + pass + else: + if "--debug" in myopts: + print "myaction",myaction + print "myopts",myopts + print "emerge: root access required." + sys.exit(1) + +if not "--pretend" in myopts: + emergelog("Started emerge on: "+time.strftime("%b %d, %Y %H:%M:%S", time.localtime())) + myelogstr="" + if myopts: + myelogstr=string.join(myopts, " ") + if myaction: + myelogstr+=" "+myaction + if myfiles: + myelogstr+=" "+string.join(myfiles, " ") + emergelog(" *** emerge "+myelogstr) + +#configure emerge engine parameters +# +# self: include _this_ package regardless of if it is merged. +# selective: exclude the package if it is merged +# recurse: go into the dependencies +# empty: pretend nothing is merged +myparams=["self","recurse"] +add=[] +sub=[] +if "--update" in myopts: + add.extend(["selective","empty"]) +if "--emptytree" in myopts: + add.extend(["empty"]) + sub.extend(["selective"]) +if "--nodeps" in myopts: + sub.extend(["recurse"]) +if "--noreplace" in myopts: + add.extend(["selective"]) +if "--deep" in myopts: + add.extend(["deep"]) +if "--selective" in myopts: + add.extend(["selective"]) +if myaction in ["world","system"]: + add.extend(["selective"]) +elif myaction in ["depclean"]: + add.extend(["empty"]) + sub.extend(["selective"]) +for x in add: + if (x not in myparams) and (x not in sub): + myparams.append(x) +for x in sub: + if x in myparams: + myparams.remove(x) + +# search functionality +class search: + + # + # class constants + # + VERSION_SHORT=1 + VERSION_RELEASE=2 + + # + # public interface + # + def __init__(self): + """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"] + + def execute(self,searchkey): + """Performs the search for the supplied search key""" + global myopts + match_category = 0 + self.searchkey=searchkey + self.packagematches = [] + if "--searchdesc" in myopts: + self.searchdesc=1 + self.matches = {"pkg":[], "desc":[]} + else: + self.searchdesc=0 + self.matches = {"pkg":[]} + print "Searching... ", + + if self.searchkey[0] == '@': + match_category = 1 + self.searchkey = self.searchkey[1:] + if self.searchkey=="*": + #hack for people who aren't regular expression gurus + self.searchkey==".*" + if re.search("\+\+", self.searchkey): + #hack for people who aren't regular expression gurus + self.searchkey=re.sub("\+\+","\+\+",self.searchkey) + self.searchre=re.compile(self.searchkey.lower(),re.I) + for package in portage.portdb.cp_all(): + update_spinner() + + if match_category: + match_string = package[:] + else: + match_string = package.split("/")[-1] + + masked=0 + if self.searchre.search(match_string): + if not portage.portdb.xmatch("match-visible",package): + masked=1 + self.matches["pkg"].append([package,masked]) + elif self.searchdesc: # DESCRIPTION searching + full_package = portage.portdb.xmatch("bestmatch-visible",package) + if not full_package: + #no match found; we don't want to query description + full_package=portage.best(portage.portdb.xmatch("match-all",package)) + if not full_package: + continue + else: + masked=1 + try: + full_desc = portage.portdb.aux_get(full_package,["DESCRIPTION"])[0] + except KeyError: + print "emerge: search: aux_get() failed, skipping" + continue + if self.searchre.search(full_desc): + self.matches["desc"].append([full_package,masked]) + self.mlen=0 + for mtype in self.matches.keys(): + self.matches[mtype].sort() + self.mlen += len(self.matches[mtype]) + + def output(self): + """Outputs the results of the search.""" + print "\b\b \n[ Results for search key : "+white(self.searchkey)+" ]" + print "[ Applications found : "+white(str(self.mlen))+" ]" + print " " + for mtype in self.matches.keys(): + for match,masked in self.matches[mtype]: + if mtype=="pkg": + catpack=match + full_package = portage.portdb.xmatch("bestmatch-visible",match) + if not full_package: + #no match found; we don't want to query description + masked=1 + full_package=portage.best(portage.portdb.xmatch("match-all",match)) + else: + full_package = match + match = portage.pkgsplit(match)[0] + + if full_package: + try: + desc, homepage, license = portage.portdb.aux_get(full_package,["DESCRIPTION","HOMEPAGE","LICENSE"]) + except KeyError: + print "emerge: search: aux_get() failed, skipping" + continue + if masked: + print green("*")+" "+white(match)+" "+red("[ Masked ]") + else: + print green("*")+" "+white(match) + myversion = self.getVersion(full_package, search.VERSION_RELEASE) + + mysum = [0,0] + mycat = match.split("/")[0] + mypkg = match.split("/")[1] + + mydigest = portage.db["/"]["porttree"].dbapi.finddigest(mycat+"/"+mypkg + "-" + myversion) + + try: + myfile = open(mydigest,"r") + for line in myfile.readlines(): + mysum[0] += int(line.split(" ")[3]) + myfile.close() + mystr = str(mysum[0]/1024) + mycount=len(mystr) + while (mycount > 3): + mycount-=3 + mystr=mystr[:mycount]+","+mystr[mycount:] + mysum[0]=mystr+" kB" + except SystemExit, e: + raise # Needed else can't exit + except Exception, e: + if edebug: + print "!!! Exception:",e + mysum[0]=" [no/bad digest]" + + if "--quiet" not in myopts: + print " ", darkgreen("Latest version available:"),myversion + print " ", self.getInstallationStatus(mycat+'/'+mypkg) + print " ", darkgreen("Size of downloaded files:"),mysum[0] + print " ", darkgreen("Homepage:")+" ",homepage + print " ", darkgreen("Description:"),desc + print " ", darkgreen("License:")+" ",license + print + print + # + # private interface + # + def getInstallationStatus(self,package): + installed_package = self.installcache.dep_bestmatch(package) + result = "" + version = self.getVersion(installed_package,search.VERSION_RELEASE) + if len(version) > 0: + result = darkgreen("Latest version installed:")+" "+version + else: + result = darkgreen("Latest version installed:")+" [ Not Installed ]" + return result + + def getVersion(self,full_package,detail): + if len(full_package) > 1: + package_parts = portage.catpkgsplit(full_package) + if detail == search.VERSION_RELEASE and package_parts[3] != 'r0': + result = package_parts[2]+ "-" + package_parts[3] + else: + result = package_parts[2] + else: + result = "" + return result + + +#build our package digraph +def getlist(mode): + if mode=="system": + mylines=portage.settings.packages + elif mode=="world": + try: + myfile=open(portage.root+portage.WORLD_FILE,"r") + mylines=myfile.readlines() + myfile.close() + except OSError: + print "!!! Couldn't open "+pfile+"; exiting." + sys.exit(1) + except IOError: + #world file doesn't exist + mylines=[] + mynewlines=[] + for x in mylines: + myline=string.join(string.split(x)) + if not len(myline): + continue + elif myline[0]=="#": + continue + elif mode=="system": + if myline[0]!="*": + continue + myline=myline[1:] + mynewlines.append(myline.strip()) + + # Remove everything that is package.provided from our list + for myatom in mynewlines[:]: + mykey = portage.dep_getkey(myatom) + if portage.settings.pprovideddict.has_key(mykey) and \ + portage.match_from_list(myatom, portage.settings.pprovideddict[mykey]): + mynewlines.remove(myatom) + + return mynewlines + +def genericdict(mylist): + mynewdict={} + for x in mylist: + mynewdict[portage.dep_getkey(x)]=x + return mynewdict + +olddbapi=None +class depgraph: + + def __init__(self,myaction,myopts): + 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!!! Is the symlink correct? Is your portage tree complete?\n\n")) + sys.exit(9) + self.applied_useflags = {} + + self.missingbins=[] + self.myaction=myaction + self.digraph=portage.digraph() + self.orderedkeys=[] + self.outdatedpackages=[] + self.mydbapi={} + self.mydbapi["/"] = 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() + if "empty" not in myparams: + for pkg in portage.db[portage.root]["vartree"].getallcpv(): + self.mydbapi[portage.root].cpv_inject(pkg) + + if "--usepkg" in myopts: + portage.db["/"]["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 + mybigkey = specification of package to merge; myparent = parent package (one depending on me); + addme = should I be added to the tree? (for the --onlydeps mode)""" + #stuff to add: + #SLOT-aware emerge + #IUSE-aware emerge + #"no downgrade" emerge + #print "mybigkey:",mybigkey + + jbigkey=string.join(mybigkey) + if self.digraph.hasnode(jbigkey+" merge") or self.digraph.hasnode(jbigkey+" nomerge"): + #this conditional is needed to prevent infinite recursion on already-processed deps + return 1 + + update_spinner() + + mytype,myroot,mykey=mybigkey + # select the correct /var database that we'll be checking against + vardbapi=portage.db[myroot]["vartree"].dbapi + + if addme: + # if the package is already on the system, we add a "nomerge" + # directive, otherwise we add a "merge" directive. + 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 "--buildpkgonly" not in myopts and myparent and (self.mydbapi[myroot].match(mykey) or vardbapi.match(mykey)): + mybigkey.append(myparent.split()[2]) + self.digraph.addnode(string.join(mybigkey),myparent) + return 1 + + if myuse == None: + self.pkgsettings.setcpv(mykey) + myuse=string.split(self.pkgsettings["USE"], " ") + + self.applied_useflags[mykey] = myuse + + merging=1 + if addme: + # this is where we add the node to the list of packages to merge + if not myparent: + # command-line specified or part of a world list... + if ("self" not in myparams) or (("selective" in myparams) and vardbapi.cpv_exists(mykey)): + # the package is on the system, so don't merge it. + merging=0 + elif ("selective" in myparams) and vardbapi.cpv_exists(mykey): + merging=0 + + if (merging==0 and mytype=="ebuild" and "--newuse" in myopts and vardbapi.cpv_exists(mykey)): + iuses=string.split(portage.portdb.aux_get(mykey, ["IUSE"])[0]) + old_use=string.split(vardbapi.aux_get(mykey, ["USE"])[0]) + now_use=string.split(self.pkgsettings["USE"]) + for x in iuses: + if (old_use.count(x) and not now_use.count(x)) or (not old_use.count(x) and now_use.count(x)): + merging=1 + break + else: + #onlydeps mode; don't merge + merging=2 + if merging==1: + mybigkey.append("merge") + else: + mybigkey.append("nomerge") + + # whatever the case, we need to add the node to our digraph so + # that children can depend upon it. + self.digraph.addnode(string.join(mybigkey),myparent) + if ("deep" not in myparams) and (not merging): + return 1 + elif "recurse" not in myparams: + return 1 + + edepend={} + if mytype=="binary": + mypkgparts=portage.catpkgsplit(mykey) + tbz2name = string.split(mykey, "/")[1]+".tbz2" + if tbz2name in portage.db[portage.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] + edepend["DEPEND"] ="" + edepend["RDEPEND"]=string.join(string.split(edepend["RDEPEND"])," ") + edepend["PDEPEND"]=string.join(string.split(edepend["PDEPEND"])," ") + edepend["SLOT"] =string.strip(edepend["SLOT"]) + #portage.db[portage.root]["bintree"].gettbz2(mykey) + else: # It's local. + mytbz2=xpak.tbz2(portage.db[portage.root]["bintree"].getname(mykey)) + edepend["DEPEND"] ="" + edepend["RDEPEND"]=string.join(mytbz2.getelements("RDEPEND")," ") + edepend["PDEPEND"]=string.join(mytbz2.getelements("PDEPEND")," ") + edepend["SLOT"] =mytbz2.getfile("SLOT",mypkgparts[2]) + elif mytype=="ebuild": + try: + mymeta = ["DEPEND","RDEPEND","PDEPEND"] + myfoo = portage.portdb.aux_get(mykey, mymeta) + for index in range(0,len(mymeta)): + edepend[mymeta[index]] = myfoo[index] + if "--buildpkgonly" in myopts: + edepend["RDEPEND"] = "" + except (KeyError,IOError): + print "emerge: create(): aux_get() error on",mykey+"; aborting..." + sys.exit(1) + mydep={} + mp=string.join(mybigkey) + + if myroot=="/": + mydep["/"]=edepend["DEPEND"]+" "+edepend["RDEPEND"] + if not self.select_dep("/",mydep["/"],myparent=mp,myuse=myuse): + return 0 + else: + mydep["/"]=edepend["DEPEND"] + mydep[myroot]=edepend["RDEPEND"] + if not self.select_dep("/",mydep["/"],myparent=mp,myuse=myuse): + return 0 + if not self.select_dep(myroot,mydep[myroot],myparent=mp,myuse=myuse): + return 0 + + if edepend.has_key("PDEPEND") and edepend["PDEPEND"]: + # Post Depend -- Add to the list without a parent, as it depends + # on a package being present AND must be built after that package. + if not self.select_dep(myroot,edepend["PDEPEND"],myuse=myuse): + return 0 + + return 1 + + def select_files(self,myfiles): + "given a list of .tbz2s, .ebuilds and deps, create the appropriate depgraph and return a favorite list" + myfavorites=[] + for x in myfiles: + if x[-5:]==".tbz2": + if not os.path.exists(x): + if os.path.exists(self.pkgsettings["PKGDIR"]+"/All/"+x): + x=self.pkgsettings["PKGDIR"]+"/All/"+x + elif os.path.exists(self.pkgsettings["PKGDIR"]+"/"+x): + x=self.pkgsettings["PKGDIR"]+"/"+x + else: + print "\n\n!!! Binary package '"+str(x)+"' does not exist." + print "!!! Please ensure the tbz2 exists as specified.\n" + 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): + 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): + 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) + 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.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("*** 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): + return (0,myfavorites) + elif not "--oneshot" in myopts: + myfavorites.append(mykey) + else: + try: + mykey=portage.dep_expand(x,mydb=portage.portdb) + except ValueError, errpkgs: + print "\n\n!!! The short ebuild name \"" + x + "\" is ambiguous. Please specify" + print "!!! one of the following fully-qualified ebuild names instead:\n" + for i in errpkgs[0]: + print " " + green(i) + print + sys.exit(1) + + # select needs to return 0 on dep_check failure + + sys.stdout.flush() + sys.stderr.flush() + + try: + self.mysd = self.select_dep(portage.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") + portage.writemsg("!!! to aid in the detection of malicious intent.\n\n") + portage.writemsg("!!! THIS IS A POSSIBLE INDICATION OF A TAMPERED FILES -- CHECK CAREFULLY.\n") + portage.writemsg("!!! Affected file: %s\n" % (e)) + sys.exit(1) + except portage_exception.InvalidSignature, e: + portage.writemsg("\n\n!!! An invalid gpg signature is preventing portage from calculating the\n") + portage.writemsg("!!! required dependencies. This is a security feature enabled by the admin\n") + portage.writemsg("!!! to aid in the detection of malicious intent.\n\n") + portage.writemsg("!!! THIS IS A POSSIBLE INDICATION OF A TAMPERED FILES -- CHECK CAREFULLY.\n") + portage.writemsg("!!! Affected file: %s\n" % (e)) + sys.exit(1) + except SystemExit, e: + raise # Needed else can't exit + except Exception, e: + if "--debug" in myopts: + raise + print "\n\n!!! Problem in",mykey,"dependencies." + print "!!!",str(e),e.__module__ + sys.exit(1) + + if not self.mysd: + return (0,myfavorites) + elif not "--oneshot" in myopts: + myfavorites.append(mykey) + + missing=0 + if "--usepkgonly" in myopts: + for x in self.digraph.dict.keys(): + xs=string.split(x," ") + if (xs[0] != "binary") and (xs[3]=="merge"): + if missing == 0: + print + missing += 1 + print "Missing binary for:",xs[2] + + # We're true here unless we are missing binaries. + return (not missing,myfavorites) + + 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 + + matches=portage.db[myroot]["vartree"].dbapi.match(pkg) + if matches: + myslot=portage.db["/"]["porttree"].getslot(pkgver) + for match in matches: + if portage.pkgcmp(portage.catpkgsplit(pkgver)[1:], portage.catpkgsplit(match)[1:]) < 0: + curslot=portage.db[myroot]["vartree"].getslot(match) + if curslot == myslot: + return match + + def select_dep(self,myroot,depstring,myparent=None,arg=None,myuse=None): + "given a dependency string, create the appropriate depgraph and return 1 on success and 0 on failure" + if "--debug" in myopts: + print + print "Parent: ",myparent + 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) + + if not mycheck[0]: + mymerge=[] + else: + mymerge=mycheck[1] + + else: + #we're processing a command-line argument; unconditionally merge it even if it's already merged + mymerge=[depstring] + + # dep_check has been run so we can now add our parent to our + # build state to update virtuals and other settings. This + # happens after the package is added to the tree so that a + # package can depend on a virtual which it satisfies. + if myparent: + myp = myparent.split() + if myp[3]=="merge": + self.mydbapi[myroot].cpv_inject(myp[2]) + if myp[0]=="binary": + self.pkgsettings.setinst(myp[2],portage.db["/"]["bintree"].dbapi) + else: + self.pkgsettings.setinst(myp[2],portage.db[myroot]["porttree"].dbapi) + + if not mymerge: + return 1 + + if "--debug" in myopts: + print "Candidates:",mymerge + for x in mymerge: + myk=None + binpkguseflags=None + if x[0]=="!": + # if this package is myself, don't append it to block list. + if "--debug" in myopts: + print "Myparent",myparent + if (myparent): + if myparent.split()[2] in portage.portdb.xmatch("match-all", x[1:]): + # myself, so exit. + continue + # adding block + myk=["blocks",myroot,x[1:]] + else: + #We are not processing a blocker but a normal dependency + myeb=None + myeb_matches = portage.portdb.xmatch("match-visible",x) + if ("--usepkgonly" not in myopts): + myeb=portage.best(myeb_matches) + + myeb_pkg=None + 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) + 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): + if myeb_pkg_matches[idx] not in myeb_matches: + del myeb_pkg_matches[idx] + myeb_pkg = portage.best(myeb_pkg_matches) + + if not myeb_pkg: + myeb_pkg = None + elif ("--newuse" in myopts): + iuses=string.split(portage.db["/"]["bintree"].dbapi.aux_get(myeb_pkg, ["IUSE"])[0]) + old_use=string.split(portage.db["/"]["bintree"].dbapi.aux_get(myeb_pkg, ["USE"])[0]) + self.pkgsettings.setcpv(myeb_pkg) + now_use=string.split(self.pkgsettings["USE"]) + self.pkgsettings.reset() + for x in iuses: + if (old_use.count(x) and not now_use.count(x)) or (not old_use.count(x) and now_use.count(x)): + myeb_pkg = None + break + + if (not myeb) and (not myeb_pkg): + if not arg: + xinfo='"'+x+'"' + else: + xinfo='"'+arg+'"' + if myparent: + xfrom = '(dependency required by '+green('"'+myparent.split()[2]+'"')+red(' ['+myparent.split()[0]+"])") + alleb=portage.portdb.xmatch("match-all",x) + if alleb: + if "--usepkgonly" not in myopts: + print "\n!!! "+red("All ebuilds that could satisfy ")+green(xinfo)+red(" have been masked.") + print "!!! One of the following masked packages is required to complete your request:" + oldcomment = "" + for p in alleb: + mreasons = portage.getmaskingstatus(p) + print "- "+p+" (masked by: "+string.join(mreasons, ", ")+")" + comment = portage.getmaskingreason(p) + if comment and comment != oldcomment: + print comment + oldcomment = comment + print + print "For more information, see MASKED PACKAGES section in the emerge man page or " + print "section 2.2 \"Software Availability\" in the Gentoo Handbook." + if myparent: + print "!!! "+red(xfrom) + print + else: + print "\n!!! "+red("There are no packages available to satisfy: ")+green(xinfo) + print "!!! Either add a suitable binary package or compile from an ebuild." + else: + print "\nemerge: there are no ebuilds to satisfy "+xinfo+"." + if myparent: + print xfrom + print + return 0 + + if "--debug" in myopts: + print "ebuild:",myeb + print "binpkg:",myeb_pkg + + if myeb and myeb_pkg: + myeb_s = portage.catpkgsplit(myeb) + myeb_s = [myeb_s[0]+"/"+myeb_s[1], myeb_s[2], myeb_s[3]] + myeb_pkg_s = portage.catpkgsplit(myeb_pkg) + myeb_pkg_s = [myeb_pkg_s[0]+"/"+myeb_pkg_s[1], myeb_pkg_s[2], myeb_pkg_s[3]] + + if portage.pkgcmp(myeb_s, myeb_pkg_s) == 0: # pkg is same version as ebuild + myeb = None + else: + myeb_pkg = None + + if "--upgradeonly" in myopts: + # Check that there isn't a newer version of this package already installed + cand = None + try: + # XXX: This can throw an exception if the ebuild doesn't exist + if myeb: + cand=self.is_newer_ver_installed(myroot,x,myeb) + elif myeb_pkg: + cand=self.is_newer_ver_installed(myroot,x,myeb_pkg) + except SystemExit, e: + raise # Needed else can't exit + except Exception, e: + print "Warning: "+str(e) + if cand: + myeb=cand + + if myeb: + myk=["ebuild",myroot,myeb] + elif myeb_pkg: + binpkguseflags=portage.db[portage.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") + sys.exit(1) + + #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) + # if myeb in mypk: + # #Use it only if it's exactly the version we want. + # myk=["binary",myroot,myeb] + # else: + # myk=["ebuild",myroot,myeb] + #else: + # myk=["ebuild",myroot,myeb] + if myparent: + #we are a dependency, so we want to be unconditionally added + if not self.create(myk,myparent,myuse=binpkguseflags): + return 0 + else: + #if mysource is not set, then we are a command-line dependency and should not be added + #if --onlydeps is specified. + if not self.create(myk,myparent,"--onlydeps" not in myopts,myuse=binpkguseflags): + return 0 + + if "--debug" in myopts: + print "Exiting...",myparent + return 1 + + + def altlist(self): + mygraph=self.digraph.copy() + dolist=["/"] + retlist=[] + for x in portage.db.keys(): + portage.db[x]["merge"]=[] + if x not in dolist: + dolist.append(x) + while (not mygraph.empty()): + mycurkey=mygraph.firstzero() + if not mycurkey: + print "!!! Error: circular dependencies:" + print + for x in mygraph.dict.keys(): + for y in mygraph.dict[x][1]: + print y,"depends on",x + print + sys.exit(1) + splitski=string.split(mycurkey) + #I'm not sure of the significance of the following lines (vestigal?) so I'm commenting 'em out. + #These lines remove already-merged things from our alt-list + #if "--update" in myopts: + # if not portage.db["/"]["vartree"].exists_specific(splitski[2]): + # portage.db["/"]["merge"].append(splitski) + #else: + portage.db[splitski[1]]["merge"].append(splitski) + mygraph.delnode(mycurkey) + for x in dolist: + for y in portage.db[x]["merge"]: + retlist.append(y) + return retlist + + def xcreate(self,mode="system"): + global syslist + if mode=="system": + mylist=syslist + else: + #world mode + worldlist=getlist("world") + sysdict=genericdict(syslist) + worlddict=genericdict(worldlist) + #we're effectively upgrading sysdict to contain all new deps from worlddict + for x in worlddict.keys(): + #only add the world node if the package is: + #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): + sysdict[x]=worlddict[x] + elif portage.db[portage.root]["vartree"].dbapi.match(x): + #package is installed + sysdict[x]=worlddict[x] + else: + print "\n*** Package in world file is not installed: "+x + mylist = sysdict.keys() + + for mydep in mylist: + myeb=portage.portdb.xmatch("bestmatch-visible",mydep) + if not myeb: + #this is an unavailable world entry; just continue + continue + + if "--upgradeonly" in myopts: + cand=self.is_newer_ver_installed(portage.root,mydep,myeb) + if cand: + myeb=cand + + #THIS NEXT BUNCH OF CODE NEEDS TO BE REPLACED TO SUPPORT WORLD ANTI-DEPS + #if mydep2[0]=="!":, etc. + binpkguseflags = None + if "--usepkg" in myopts: + mypk=portage.db[portage.root]["bintree"].dep_bestmatch(mydep) + if myeb==mypk: + myk=["binary",portage.root,mypk] + binpkguseflags=portage.db[portage.root]["bintree"].get_use(mypk) + if ("--newuse" in myopts): + iuses=string.split(portage.db["/"]["bintree"].dbapi.aux_get(mypk, ["IUSE"])[0]) + old_use=string.split(portage.db["/"]["bintree"].dbapi.aux_get(mypk, ["USE"])[0]) + self.pkgsettings.setcpv(mypk) + now_use=string.split(self.pkgsettings["USE"]) + self.pkgsettings.reset() + for x in iuses: + if (old_use.count(x) and not now_use.count(x)) or (not old_use.count(x) and now_use.count(x)): + myk=["ebuild",portage.root,myeb] + binpkguseflags=None + break + elif "--usepkgonly" in myopts: + if not mypk: + self.missingbins += [myeb] + myk=["binary",portage.root,myeb] + else: + myk=["binary",portage.root,mypk] + else: + myk=["ebuild",portage.root,myeb] + else: + myk=["ebuild",portage.root,myeb] + + if not self.create(myk,myuse=binpkguseflags): + print + print "!!! Problem with dependencies under ",myk[0],myk[2] + print "!!! Possibly a DEPEND/*DEPEND problem." + print + return 0 + return 1 + + def match(self,mydep,myroot=portage.root,mykey=None): + # support mutual exclusive deps + mydep2=mydep + if mydep2[0]=="!": + mydep2=mydep[1:] + + 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+" "+mydep2 + else: + myeb=portage.db[portage.root]["porttree"].dep_bestmatch(mydep2) + if not myeb: + if not mykey: + print "\n!!! Error: couldn't find match for",mydep + else: + print "\n!!! Error: couldn't find match for",mydep,"in",mykey + print + sys.exit(1) + + if "--usepkg" in myopts: + mypk=portage.db[portage.root]["bintree"].dep_bestmatch(mydep) + if myeb==mypk: + myk="binary "+portage.root+" "+mypk + else: + myk="ebuild "+myroot+" "+myeb + else: + myk="ebuild "+myroot+" "+myeb + + return myk + + def display(self,mylist): + changelogs=[] + p=[] + totalsize=0 + + if "--verbose" in myopts: + overlays = string.split(portage.settings['PORTDIR_OVERLAY']) + + if "--tree" in myopts: + mylist.reverse() + mygraph=self.digraph.copy() + + i = 0 + while i < len(mylist): + if mylist[i][-1]=="nomerge": + if not ("--tree" in myopts): + # we don't care about this elements + mylist.pop(i) + continue + if (i == (len(mylist) - 1)) \ + or (mygraph.depth(string.join(mylist[i])) \ + >= mygraph.depth(string.join(mylist[i+1]))): + # end of a useless branch (may be the last one) + # -> delete the element and test the previous one + mylist.pop(i) + if i > 0: + i -= 1 + continue + # the branch continues, or we've found a good element. + # -> let's see what's next, if anything + i += 1 + + display_overlays=False + # files to fetch list - avoids counting a same file twice + # in size display (verbose mode) + myfetchlist=[] + for x in mylist: + fetch=" " + + if x[0]=="blocks": + addl=""+red("B")+" "+fetch+" " + resolved=portage.db[x[1]]["vartree"].resolve_key(x[2]) + print "["+x[0]+" "+addl+"]",red(resolved), + if resolved!=x[2]: + if x[3]: + print red("(\""+x[2]+"\" is blocking "+x[3]+")") + else: + print red("(\""+x[2]+"\")") + else: + if x[3]: + print red("(is blocking "+x[3]+")") + else: + print + else: + if (x[0]!="binary") and ("fetch" in string.split(portage.portdb.aux_get(x[2],["RESTRICT"])[0])): + fetch = red("F") + if portage.portdb.fetch_check(x[2], portage.settings): + fetch = green("f") + + #we need to use "--emptrytree" testing here rather than "empty" param testing because "empty" + #param is used for -u, where you still *do* want to see when something is being upgraded. + myoldbest="" + if (not "--emptytree" in myopts) and portage.db[x[1]]["vartree"].exists_specific(x[2]): + 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]) + elif x[0] == "ebuild": + mynewslot=portage.db["/"]["porttree"].getslot(x[2]) + myoldlist=portage.db[x[1]]["vartree"].dbapi.match(portage.pkgsplit(x[2])[0]) + myinslotlist=filter((lambda p: portage.db[portage.root]["vartree"].getslot(p)==mynewslot),myoldlist) + if myinslotlist: + myoldbest=portage.best(myinslotlist) + addl=" "+fetch + if portage.pkgcmp(portage.pkgsplit(x[2]), portage.pkgsplit(myoldbest)) < 0: + # Downgrade in slot + addl+=turquoise("U")+blue("D") + else: + # Update in slot + addl+=turquoise("U")+" " + else: + # New slot, mark it new. + addl=" "+green("NS")+fetch+" " + + if "--changelog" in myopts: + changelogs.extend(self.calc_changelog( + portage.portdb.findname(x[2]), + portage.db["/"]["vartree"].dep_bestmatch('/'.join(portage.catpkgsplit(x[2])[:2])), + x[2] + )) + else: + addl=" "+green("N")+" "+fetch+" " + + verboseadd="" + if "--verbose" in myopts: + # iuse verbose + try: + if x[0] == "binary": + iuse_split = string.split(portage.db["/"]["bintree"].dbapi.aux_get(x[2],["IUSE"])[0]) + elif x[0] == "ebuild": + iuse_split = string.split(portage.portdb.aux_get(x[2],["IUSE"])[0]) + else: + iuse_split = [] + except SystemExit, e: + raise # Needed else can't exit + except: + portage.writemsg("!!! Error getting IUSE (report this to bugs.gentoo.org)\n") + portage.writemsg("!!! %s\n" % x) + iuse_split = [] + iuse_split.sort() + old_use=None + if myoldbest: + pkg=myoldbest + else: + pkg=x[2] + if portage.db["/"]["vartree"].dbapi.cpv_exists(pkg): + try: + old_use=string.split(portage.db["/"]["vartree"].dbapi.aux_get(pkg, ["USE"])[0]) + except SystemExit, e: + raise # Needed else can't exit + except: + pass + iuse="" + now_use=self.applied_useflags[x[2]] + for ebuild_iuse in portage_util.unique_array(iuse_split): + usechange="" + if old_use: + if (old_use.count(ebuild_iuse) and not now_use.count(ebuild_iuse)) or (not old_use.count(ebuild_iuse) and now_use.count(ebuild_iuse)): + usechange="*" + + if ebuild_iuse in self.applied_useflags[x[2]]: + if usechange == "*": + iuse=green("+"+ebuild_iuse) + else: + iuse=red("+"+ebuild_iuse) + elif ebuild_iuse in portage.settings.usemask: + iuse=blue("(-"+ebuild_iuse+")") + else: + iuse=blue("-"+ebuild_iuse) + verboseadd+=iuse+usechange+" " + + # size verbose + mysize=0 + if x[0] == "ebuild" and x[-1]!="nomerge": + myfilesdict=portage.portdb.getfetchsizes(x[2], useflags=self.applied_useflags[x[2]], debug=edebug) + if myfilesdict==None: + myfilesdict="[empty/missing/bad digest]" + else: + for myfetchfile in myfilesdict.keys(): + if myfetchfile not in myfetchlist: + mysize+=myfilesdict[myfetchfile] + myfetchlist.append(myfetchfile) + totalsize+=mysize + verboseadd+=format_size(mysize)+" " + + # overlay verbose + # XXX: Invalid binaries have caused tracebacks here. 'if file_name' + # x = ['binary', '/', 'sys-apps/pcmcia-cs-3.2.7.2.6', 'merge'] + file_name=portage.portdb.findname(x[2]) + if file_name: # It might not exist in the tree + dir_name=os.path.abspath(os.path.dirname(file_name)+"/../..") + if (overlays.count(dir_name)>0): + verboseadd+=teal("["+str(overlays.index(os.path.normpath(dir_name))+1)+"]")+" " + display_overlays=True + else: + verboseadd += "[No ebuild?]" + + xs=portage.pkgsplit(x[2]) + if xs[2]=="r0": + xs[2]="" + else: + xs[2]="-"+xs[2] + + if self.pkgsettings.has_key("COLUMNWIDTH"): + mywidth=int(self.pkgsettings.settings["COLUMNWIDTH"]) + else: + mywidth=130 + oldlp=mywidth-30 + newlp=oldlp-30 + + indent="" + if ("--tree" in myopts): + indent=" "*mygraph.depth(string.join(x)) + + if myoldbest: + myoldbest=portage.pkgsplit(myoldbest)[1]+"-"+portage.pkgsplit(myoldbest)[2] + if myoldbest[-3:]=="-r0": + myoldbest=myoldbest[:-3] + myoldbest=blue("["+myoldbest+"]") + + if x[1]!="/": + if "--columns" in myopts: + myprint="["+x[0]+" "+addl+"] "+indent+darkgreen(xs[0]) + if (newlp-nc_len(myprint)) > 0: + myprint=myprint+(" "*(newlp-nc_len(myprint))) + myprint=myprint+"["+darkblue(xs[1]+xs[2])+"] " + if (oldlp-nc_len(myprint)) > 0: + myprint=myprint+" "*(oldlp-nc_len(myprint)) + myprint=myprint+myoldbest + myprint=myprint+darkgreen(" to "+x[1])+" "+verboseadd + else: + myprint="["+x[0]+" "+addl+"] "+darkgreen(x[2])+" "+myoldbest+" "+darkgreen("to "+x[1])+" "+verboseadd + else: + if "--columns" in myopts: + myprint="["+x[0]+" "+addl+"] "+indent+darkgreen(xs[0]) + if (newlp-nc_len(myprint)) > 0: + myprint=myprint+(" "*(newlp-nc_len(myprint))) + myprint=myprint+green(" ["+xs[1]+xs[2]+"] ") + if (oldlp-nc_len(myprint)) > 0: + myprint=myprint+(" "*(oldlp-nc_len(myprint))) + myprint=myprint+myoldbest+" "+verboseadd + else: + if x[3]=="nomerge": + myprint=darkblue("[nomerge ] "+indent+x[2]+" "+myoldbest+" ")+verboseadd + else: + myprint="["+x[0]+" "+addl+"] "+indent+darkgreen(x[2])+" "+myoldbest+" "+verboseadd + p.append(myprint) + + if ("--tree" not in myopts): + mysplit=portage.pkgsplit(x[2]) + + # XXX mysplit _can_ be None.... Why? + if mysplit and (len(mysplit)==3): + if "--emptytree" not in myopts: + if mysplit[0]=="sys-apps/portage": + if ((mysplit[1]+mysplit[2]) != portage.VERSION) and \ + ("livecvsportage" not in portage.settings.features): + if mylist.index(x)>> Recording",myfavkey,"in \"world\" favorites file..." + if not "--fetchonly" in myopts: + portage.writedict(myfavdict,portage.root+portage.WORLD_FILE,writekey=0) + + portage.mtimedb["resume"]["mergelist"]=mymergelist[:] + + # We need to yank the harmful-to-new-builds settings from features. + myorigfeat=self.pkgsettings["FEATURES"] + myfeat=myorigfeat.split() + while ("keeptemp" in myfeat): + del myfeat[myfeat.index("keeptemp")] + while ("keepwork" in myfeat): + del myfeat[myfeat.index("keepwork")] + + self.pkgsettings["FEATURES"]=string.join(myfeat) + + mergecount=0 + if "--fetchonly" in myopts: + mynewmergelist = [] + for x in mymergelist: + if x[0] != "blocks": + mynewmergelist.append(x) + mymergelist = mynewmergelist + for x in mymergelist: + mergecount+=1 + myroot=x[1] + pkgindex=2 + if x[0]=="blocks": + pkgindex=3 + 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]) + + self.pkgsettings["EMERGE_FROM"] = x[0][:] + self.pkgsettings.backup_changes("EMERGE_FROM") + + #buildsyspkg: Check if we need to _force_ binary package creation + issyspkg = ("buildsyspkg" in myfeat) \ + and x[0] != "blocks" \ + and mysysdict.has_key(portage.cpv_getkey(x[2])) \ + and not ("--buildpkg" in myopts) + if x[0] in ["ebuild","blocks"]: + if (x[0]=="blocks") and ("--fetchonly" not in myopts): + raise Exception, "Merging a blocker" + elif ("--fetchonly" in myopts) or ("--fetch-all-uri" in myopts): + if x[0] == "blocks": + continue + if ("--fetch-all-uri" in myopts): + retval=portage.doebuild(y,"fetch",myroot,self.pkgsettings,edebug,("--pretend" in myopts),fetchonly=1,fetchall=1) + else: + retval=portage.doebuild(y,"fetch",myroot,self.pkgsettings,edebug,("--pretend" in myopts),fetchonly=1) + if (retval == None) or retval: + print + print "!!! Fetch for",y,"failed, continuing..." + print + returnme=1 + continue + elif "--buildpkg" in myopts or issyspkg: + #buildsyspkg: Sounds useful to display something, but I don't know if we should also log it + if issyspkg: + print ">>> This is a system package, let's pack a rescue tarball." + #emergelog(">>> This is a system package, let's pack a rescue tarball.") + #create pkg, then merge pkg + short_msg = "emerge: ("+str(mergecount)+" of "+str(len(mymergelist))+") "+x[pkgindex]+" Clean" + emergelog(" === ("+str(mergecount)+" of "+str(len(mymergelist))+") Cleaning ("+x[pkgindex]+"::"+y+")", short_msg=short_msg) + retval=portage.doebuild(y,"clean",myroot,self.pkgsettings,edebug,cleanup=1) + if (retval == None): + portage_util.writemsg("Unable to run required binary.\n") + sys.exit(127) + if retval: + sys.exit(retval) + short_msg = "emerge: ("+str(mergecount)+" of "+str(len(mymergelist))+") "+x[pkgindex]+" Compile" + emergelog(" === ("+str(mergecount)+" of "+str(len(mymergelist))+") Compiling/Packaging ("+x[pkgindex]+"::"+y+")", short_msg=short_msg) + retval=portage.doebuild(y,"package",myroot,self.pkgsettings,edebug) + if (retval == None): + portage_util.writemsg("Unable to run required binary.\n") + sys.exit(127) + if retval: + sys.exit(retval) + #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]) + 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) + + self.pkgsettings["EMERGE_FROM"] = "binary" + self.pkgsettings.backup_changes("EMERGE_FROM") + + retval=portage.pkgmerge(mytbz2,myroot,self.pkgsettings) + if retval==None: + sys.exit(1) + else: + short_msg = "emerge: ("+str(mergecount)+" of "+str(len(mymergelist))+") "+x[pkgindex]+" Clean" + emergelog(" === ("+str(mergecount)+" of "+str(len(mymergelist))+") Cleaning ("+x[pkgindex]+"::"+y+")", short_msg=short_msg) + retval=portage.doebuild(y,"clean",myroot,self.pkgsettings,edebug,cleanup=1) + if (retval == None): + portage_util.writemsg("Unable to run required binary.\n") + sys.exit(127) + if retval: + sys.exit(retval) + short_msg = "emerge: ("+str(mergecount)+" of "+str(len(mymergelist))+") "+x[pkgindex]+" Compile" + emergelog(" === ("+str(mergecount)+" of "+str(len(mymergelist))+") Compiling/Merging ("+x[pkgindex]+"::"+y+")", short_msg=short_msg) + retval=portage.doebuild(y,"merge",myroot,self.pkgsettings,edebug) + if (retval == None): + portage_util.writemsg("Unable to run required binary.\n") + sys.exit(127) + if retval: + sys.exit(retval) + #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]): + 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]) + + if ("--fetchonly" in myopts) or ("--fetch-all-uri" in myopts): + continue + + short_msg = "emerge: ("+str(mergecount)+" of "+str(len(mymergelist))+") "+x[pkgindex]+" Merge Binary" + emergelog(" === ("+str(mergecount)+" of "+str(len(mymergelist))+") Merging Binary ("+x[pkgindex]+"::"+mytbz2+")", short_msg=short_msg) + retval=portage.pkgmerge(mytbz2,x[1],self.pkgsettings) + if retval==None: + sys.exit(1) + #need to check for errors + if "--buildpkgonly" not in myopts: + portage.db[x[1]]["vartree"].inject(x[2]) + myfavkey=portage.cpv_getkey(x[2]) + if "--fetchonly" not in myopts and "--fetch-all-uri" not in myopts and myfavkey in favorites: + myfavs=portage.grabfile(myroot+portage.WORLD_FILE) + myfavdict=genericdict(myfavs) + mysysdict=genericdict(syslist) + #don't record if already in system profile or already recorded + if (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) + + if ("noclean" not in portage.features) and (x[0] != "binary"): + short_msg = "emerge: ("+str(mergecount)+" of "+str(len(mymergelist))+") "+x[pkgindex]+" Clean Post" + emergelog(" === ("+str(mergecount)+" of "+str(len(mymergelist))+") Post-Build Cleaning ("+x[pkgindex]+"::"+y+")", short_msg=short_msg) + retval=portage.doebuild(y,"clean",myroot,self.pkgsettings,edebug,cleanup=1) + if (retval == None): + portage_util.writemsg("Unable to run required binary.\n") + sys.exit(127) + if retval: + sys.exit(retval) + + if ("--pretend" not in myopts) and ("--fetchonly" not in myopts) and ("--fetch-all-uri" not in myopts): + # Clean the old package that we have merged over top of it. + if self.pkgsettings["AUTOCLEAN"]=="yes": + xsplit=portage.pkgsplit(x[2]) + emergelog(" >>> AUTOCLEAN: "+xsplit[0]) + retval=unmerge("clean", [xsplit[0]]) + if not retval: + emergelog(" --- AUTOCLEAN: Nothing unmerged.") + + # Figure out if we need a restart. + mysplit=portage.pkgsplit(x[2]) + if mysplit[0]=="sys-apps/portage": + myver=mysplit[1]+"-"+mysplit[2] + if myver[-3:]=='-r0': + myver=myver[:-3] + if (myver != portage.VERSION) and \ + ("livecvsportage" not in portage.settings.features): + if len(mymergelist) > mergecount: + myargv=sys.argv + myr=0 + for myra in range(len(myargv)): + if myargv[myr][0:len("portage")]=="portage": + del myargv[myr] + myr-=1 + if myargv[myr][0:len("sys-apps/portage")]=="sys-apps/portage": + del myargv[myr] + myr-=1 + myr+=1 + emergelog(" *** RESTARTING emerge via exec() after change of portage version.") + portage.portageexit() + # Remove --ask from options before restarting + mynewargv=[] + badlongopts = ["--ask","--tree","--changelog"] + badshortopts = ["a","t","l"] + for arg in myargv: + if arg[0:2] == "--": + if arg in badlongopts: + continue + mynewargv += [arg] + elif arg[0] == "-": + myarg = "-" + for ch in arg[1:]: + if ch in badshortopts: + continue + myarg += ch + mynewargv += [myarg] + else: + mynewargv += [arg] + os.execv("/usr/lib/portage/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]) + + # Unsafe for parallel merges + del portage.mtimedb["resume"]["mergelist"][0] + + emergelog(" *** Finished. Cleaning up...") + + # We're out of the loop... We're done. Delete the resume data. + if portage.mtimedb.has_key("resume"): + del portage.mtimedb["resume"] + + if ("--pretend" not in myopts): + if ("--fetchonly" not in myopts) and ("--fetch-all-uri" not in myopts): + if (mergecount>0): + if retval: + portage.env_update() + + #by doing an exit this way, --fetchonly can continue to try to + #fetch everything even if a particular download fails. + if "--fetchonly" in myopts or "--fetch-all-uri" in myopts: + if returnme: + print "\n\n!!! Some fetch errors were encountered. Please see above for details.\n\n" + sys.exit(returnme) + else: + sys.exit(0) + +def unmerge(unmerge_action, unmerge_files): + candidate_catpkgs=[] + global_unmerge=0 + + realsyslist = getlist("system") + syslist = [] + for x in realsyslist: + mycp = portage.dep_getkey(x) + if mycp in portage.settings.virtuals: + syslist.extend(portage.settings.virtuals[mycp]) + syslist.append(mycp) + + global myopts + mysettings = portage.config(clone=portage.settings) + + if not unmerge_files or "world" in unmerge_files or "system" in unmerge_files: + if "unmerge"==unmerge_action: + print + print bold("emerge unmerge")+" can only be used with specific package names, not with "+bold("world")+" or" + print bold("system")+" targets." + print + return 0 + else: + global_unmerge=1 + + localtree=portage.db[portage.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: + candidate_catpkgs.extend(localtree.getallnodes()) + elif "system" in unmerge_files: + candidate_catpkgs.extend(getlist("system")) + else: + #we've got command-line arguments + if not unmerge_files: + print "\nNo packages to unmerge have been provided.\n" + return 0 + for x in unmerge_files: + arg_parts=x.split('/') + if (x[0] not in [".","/"]) and (arg_parts[-1][-7:] != ".ebuild"): + #possible cat/pkg or dep; treat as such + candidate_catpkgs.append(x) + elif unmerge_action in ["prune","clean"]: + print "\n!!! Prune and clean do not accept individual ebuilds as arguments;\n skipping.\n" + continue + else: + # it appears that the user is specifying an installed ebuild and we're in "unmerge" mode, so it's + # ok. + if not os.path.exists(x): + print "\n!!! The path '"+x+"' doesn't exist.\n" + return 0 + + absx = os.path.abspath(x) + sp_absx = absx.split("/") + if sp_absx[-1][-7:] == ".ebuild": + del sp_absx[-1] + absx = string.join(sp_absx,"/") + + sp_absx_len = len(sp_absx) + + vdb_path = portage.root+portage.VDB_PATH + vdb_len = len(vdb_path) + + sp_vdb = vdb_path.split("/") + sp_vdb_len = len(sp_vdb) + + if not os.path.exists(absx+"/CONTENTS"): + print "!!! Not a valid db dir: "+str(absx) + return 0 + + if sp_absx_len <= sp_vdb_len: + # 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" + 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" + return 0 + + print "="+string.join(sp_absx[sp_vdb_len:],"/") + candidate_catpkgs.append("="+string.join(sp_absx[sp_vdb_len:],"/")) + + if ("--pretend" in myopts) or ("--ask" in myopts): + print darkgreen("\n>>> These are the packages that I would unmerge:") + + pkgmap={} + numselected=0 + for x in candidate_catpkgs: + #cycle through all our candidate deps and determine what will and will not get unmerged + try: + mymatch=localtree.dep_match(x) + except KeyError: + mymatch=None + except ValueError, errpkgs: + print "\n\n!!! The short ebuild name \"" + x + "\" is ambiguous. Please specify" + print "!!! one of the following fully-qualified ebuild names instead:\n" + for i in errpkgs[0]: + print " " + green(i) + print + sys.exit(1) + + if not mymatch and x[0] not in "<>=~": + #add a "=" if missing + mymatch=localtree.dep_match("="+x) + if not mymatch: + print "\n--- Couldn't find " + white(x) + " to "+unmerge_action+"." + continue + mykey=portage.key_expand(portage.dep_getkey(mymatch[0]),portage.db["/"]["vartree"].dbapi) + if not pkgmap.has_key(mykey): + pkgmap[mykey]={"protected":[], "selected":[], "omitted":[] } + if unmerge_action=="unmerge": + for y in mymatch: + if y not in pkgmap[mykey]["selected"]: + pkgmap[mykey]["selected"].append(y) + numselected=numselected+len(mymatch) + + else: + #unmerge_action in ["prune", clean"] + slotmap={} + for mypkg in mymatch: + if unmerge_action=="clean": + myslot=localtree.getslot(mypkg) + else: + #since we're pruning, we don't care about slots and put all the pkgs in together + myslot=0 + if not slotmap.has_key(myslot): + slotmap[myslot]={} + slotmap[myslot][localtree.dbapi.cpv_counter(mypkg)]=mypkg + for myslot in slotmap.keys(): + counterkeys=slotmap[myslot].keys() + counterkeys.sort() + if not counterkeys: + continue + counterkeys.sort() + pkgmap[mykey]["protected"].append(slotmap[myslot][counterkeys[-1]]) + del counterkeys[-1] + #be pretty and get them in order of merge: + for ckey in counterkeys: + pkgmap[mykey]["selected"].append(slotmap[myslot][ckey]) + numselected=numselected+1 + #ok, now the last-merged package is protected, and the rest are selected + if global_unmerge and not numselected: + print "\n>>> No outdated packages were found on your system.\n" + return 0 + + if not numselected: + print "\n>>>",unmerge_action+": No packages selected for removal.\n" + return 0 + + for x in pkgmap.keys(): + for y in localtree.dep_match(x): + if y not in pkgmap[x]["omitted"] and \ + y not in pkgmap[x]["selected"] and \ + y not in pkgmap[x]["protected"]: + pkgmap[x]["omitted"].append(y) + if global_unmerge and not pkgmap[x]["selected"]: + #avoid cluttering the preview printout with stuff that isn't getting unmerged + continue + if not (pkgmap[x]["protected"] or pkgmap[x]["omitted"]) and (x in syslist): + print red("\a\n\n!!! '%s' is part of your system profile. '%s'" % (mykey)) + print yellow("\a!!! Unmerging it may be damaging to your system.\n") + if "--pretend" not in myopts and "--ask" not in myopts: + global EMERGE_WARNING_DELAY + countdown(EMERGE_WARNING_DELAY,red("Press Ctrl-C to Stop")) + print "\n "+white(x) + for mytype in ["selected","protected","omitted"]: + print string.rjust(mytype,12)+":", + if pkgmap[x][mytype]: + for mypkg in pkgmap[x][mytype]: + mysplit=portage.catpkgsplit(mypkg) + if mysplit[3]=="r0": + myversion=mysplit[2] + else: + myversion=mysplit[2]+"-"+mysplit[3] + if mytype=="selected": + print red(myversion), + else: + print green(myversion), + else: + print "none", + print + + print "\n>>>",red("'Selected'"),"packages are slated for removal." + print ">>>",green("'Protected'"),"and",green("'omitted'"),"packages will not be removed.\n" + + if "--pretend" in myopts: + #we're done... return + return 0 + if "--ask" in myopts: + if userquery("Do you want me to unmerge these packages?")=="No": + # enter pretend mode for correct formatting of results + myopts+=["--pretend"] + print + print "Quitting." + print + return 0 + #the real unmerging begins, after a short delay.... + + global CLEAN_DELAY + countdown(CLEAN_DELAY, ">>> Unmerging") + + for x in pkgmap.keys(): + for y in pkgmap[x]["selected"]: + print ">>> Unmerging "+y+"..." + emergelog("=== Unmerging... ("+y+")") + mysplit=string.split(y,"/") + #unmerge... + retval=portage.unmerge(mysplit[0],mysplit[1],portage.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() + if not numselected: + return 0 + else: + return 1 + + +def chk_updated_info_files(retval): + root=portage.root + + infodirs=[] + infodirs.extend(string.split(portage.settings["INFOPATH"], ":")) + infodirs.extend(string.split(portage.settings["INFODIR"], ":")) + + print + if os.path.exists("/usr/bin/install-info"): + regen_infodirs=[] + for z in infodirs: + if z=='': + continue + inforoot=normpath(root+z) + if os.path.isdir(inforoot): + try: + infomtime=os.stat(inforoot)[ST_MTIME] + except SystemExit, e: + raise # Needed else can't exit + except: + infomtime=0 + + if not portage.mtimedb.has_key("info"): + portage.mtimedb["info"]={} + if portage.mtimedb["info"].has_key(inforoot): + if portage.mtimedb["info"][inforoot]==infomtime: + pass + else: + portage.mtimedb["info"][inforoot]=infomtime + regen_infodirs.append(inforoot) + else: + regen_infodirs.append(inforoot) + + if not regen_infodirs: + print " "+green("*")+" GNU info directory index is up-to-date." + else: + print " "+green("*")+" Regenerating GNU info directory index..." + + icount=0 + badcount=0 + for inforoot in regen_infodirs: + if inforoot=='': + continue + try: + os.rename(inforoot+"/dir",inforoot+"/dir.old") + except SystemExit, e: + raise # Needed else can't exit + except: + pass + + if not os.path.isdir(inforoot): + continue + errmsg = "" + 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] + existsstr="already exists, for file `" + if myso!="": + if re.search(existsstr,myso): + # Already exists... Don't increment the count for this. + pass + elif myso[:44]=="install-info: warning: no info dir entry in ": + # This info file doesn't contain a DIR-header: install-info produces this + # (harmless) warning (the --quiet switch doesn't seem to work). + # Don't increment the count for this. + pass + else: + badcount=badcount+1 + errmsg += myso + "\n" + icount=icount+1 + + #update mtime so we can potentially avoid regenerating. + portage.mtimedb["info"][inforoot]=os.stat(inforoot)[ST_MTIME] + + if badcount: + print " "+yellow("*")+" Processed",icount,"info files;",badcount,"errors." + print errmsg + else: + print " "+green("*")+" Processed",icount,"info files." + + +def post_emerge(retval=0): + global myopts + os.chdir("/") + if "--pretend" in myopts: + sys.exit(retval) + + emergelog(" *** exiting successfully.") + + if "noinfo" not in portage.settings.features: + chk_updated_info_files(retval) + + chk_updated_cfg_files() + sys.exit(retval) + + +def chk_updated_cfg_files(): + if portage.settings["CONFIG_PROTECT"]: + #number of directories with some protect files in them + procount=0 + for x in string.split(portage.settings["CONFIG_PROTECT"]): + if os.path.isdir(x): + a=commands.getstatusoutput("cd "+x+"; find . -iname '._cfg????_*'") + if a[0]!=0: + print " "+red("*")+" error scanning",x + else: + files=string.split(a[1]) + if files: + procount=procount+1 + print " "+yellow("* IMPORTANT:")+"",len(files),"config files in",x,"need updating." + if procount: + #print " "+yellow("*")+" Type "+green("emerge --help config")+" to learn how to update config files." + print " "+yellow("*")+" Type "+green("emerge --help config")+" to learn how to update config files." + print + +# general options that should be taken into account before any action +if "--debug" in myopts: + edebug=1 + +if myaction in ["sync","rsync","metadata"] and (not "--help" in myopts): + if "--pretend" in myopts: + print "emerge: \"sync\" actions do not support \"--pretend.\"" + sys.exit(1) + + emergelog(" === "+str(myaction)) + myportdir=portage.settings["PORTDIR"] + if myportdir[-1]=="/": + myportdir=myportdir[:-1] + if not os.path.exists(myportdir): + print ">>>",myportdir,"not found, creating it." + os.makedirs(myportdir,0755) + syncuri=string.rstrip(portage.settings["SYNC"]) + os.umask(0022) + if myaction == "metadata": + if "--ask" in myopts: + if userquery("Are you sure?") == "No": + sys.exit(1) + print "skipping sync" + updatecache_flg = True + tmpservertimestampfile = None + elif syncuri[:8]=="rsync://": + if not os.path.exists("/usr/bin/rsync"): + print "!!! /usr/bin/rsync does not exist, so rsync support is disabled." + print "!!! Type \"emerge net-misc/rsync\" to enable rsync support." + sys.exit(1) + mytimeout=180 + if portage.settings.has_key("RSYNC_TIMEOUT"): + try: + mytimeout=int(portage.settings["RSYNC_TIMEOUT"]) + except SystemExit, e: + raise # Needed else can't exit + except: + pass + + rsync_flags = [ + "--recursive", # Recurse directories + "--links", # Consider symlinks + "--safe-links", # Ignore links outside of tree + "--perms", # Preserve permissions + "--times", # Preserive mod times + "--compress", # Compress the data transmitted + "--force", # Force deletion on non-empty dirs + "--whole-file", # Don't do block transfers, only entire files + "--delete", # Delete files that aren't in the master tree + "--delete-after", # Delete only after everything else is done + "--stats", # Show final statistics about what was transfered + "--timeout="+str(mytimeout), # IO timeout if not done in X seconds + "--exclude='/distfiles'", # Exclude distfiles from consideration + "--exclude='/local'", # Exclude local from consideration + "--exclude='/packages'", # Exclude packages from consideration + ] + + if "--quiet" in myopts: + rsync_flags.append("--quiet") # Shut up a lot + else: + rsync_flags.append("--progress") # Progress meter for each file + + if "--verbose" in myopts: + rsync_flags.append("--verbose") # More noise? Not really sure what + + if "--debug" in myopts: + rsync_flags.append("--checksum") # Force checksum on all files + + if portage.settings.has_key("RSYNC_EXCLUDEFROM"): + if os.path.exists(portage.settings["RSYNC_EXCLUDEFROM"]): + rsync_flags.append("--exclude-from="+portage.settings["RSYNC_EXCLUDEFROM"]) + else: + print "!!! RSYNC_EXCLUDEFROM specified, but file does not exist." + + if portage.settings.has_key("RSYNC_RATELIMIT"): + rsync_flags.append("--bwlimit="+portage.settings["RSYNC_RATELIMIT"]) + + rsynccommand = "/usr/bin/rsync " + string.join(rsync_flags, " ") + + servertimestampdir = portage.settings.depcachedir+"/" + servertimestampfile = portage.settings.depcachedir+"/timestamp.chk" + tmpservertimestampdir = portage.settings["PORTAGE_TMPDIR"]+"/" + tmpservertimestampfile = portage.settings["PORTAGE_TMPDIR"]+"/timestamp.chk" + + # We only use the backup if a timestamp exists in the portdir. + content=None + if os.path.exists(myportdir+"/metadata/timestamp.chk"): + content=portage.grabfile(servertimestampfile) + if (not content): + content=portage.grabfile(myportdir+"/metadata/timestamp.chk") + + if (content): + try: + mytimestamp=time.mktime(time.strptime(content[0], "%a, %d %b %Y %H:%M:%S +0000")) + except ValueError: + mytimestamp=0 + else: + mytimestamp=0 + + if not os.path.exists(servertimestampdir): + os.mkdir(servertimestampdir) + os.chown(servertimestampdir, os.getuid(), portage.portage_gid) + os.chmod(servertimestampdir, 02775) + + #exitcode=0 + try: + maxretries=int(portage.settings["RSYNC_RETRIES"]) + except SystemExit, e: + raise # Needed else can't exit + except: + maxretries=3 #default number of retries + + retries=0 + hostname, port=re.split("rsync://([^:/]*)(:[0-9]+)?", syncuri)[1:3]; + if port==None: + port="" + updatecache_flg=True + + ips=[] + while (1): + if ips: + del ips[0] + if ips==[]: + try: + ips=socket.gethostbyname_ex(hostname)[2] + except SystemExit, e: + raise # Needed else can't exit + except Exception, e: + print "Notice:",str(e) + dosyncuri=syncuri + + if ips: + try: + dosyncuri=string.replace(syncuri, "//"+hostname+port+"/", "//"+ips[0]+port+"/", 1) + except SystemExit, e: + raise # Needed else can't exit + except Exception, e: + print "Notice:",str(e) + dosyncuri=syncuri + + if (retries==0): + if "--ask" in myopts: + if userquery("Do you want to sync your Portage tree with the mirror at\n" + blue(dosyncuri) + bold("?"))=="No": + print + print "Quitting." + print + sys.exit(0) + emergelog(">>> starting rsync with "+dosyncuri) + if "--quiet" not in myopts: + print ">>> starting rsync with "+dosyncuri+"..." + else: + emergelog(">>> Starting retry %d of %d with %s" % (retries,maxretries,dosyncuri)) + print "\n\n>>> Starting retry %d of %d with %s" % (retries,maxretries,dosyncuri) + + if "--quiet" not in myopts: + print ">>> checking server timestamp ..." + mycommand=rsynccommand+" "+dosyncuri+"/metadata/timestamp.chk "+tmpservertimestampdir + exitcode=portage.spawn(mycommand,portage.settings,free=1) + if (exitcode==0): + try: + servertimestamp = time.mktime(time.strptime(portage.grabfile(tmpservertimestampfile)[0], "%a, %d %b %Y %H:%M:%S +0000")) + except SystemExit, e: + raise # Needed else can't exit + except: + servertimestamp = 0 + + if (servertimestamp != 0) and (servertimestamp == mytimestamp): + emergelog(">>> Cancelling sync -- Already current.") + print + print ">>>" + print ">>> Timestamps on the server and in the local repository are the same." + print ">>> Cancelling all further sync action. You are already up to date." + print ">>>" + print + sys.exit(0) + elif (servertimestamp != 0) and (servertimestamp < mytimestamp): + emergelog(">>> Server out of date: %s" % dosyncuri) + print + print ">>>" + print ">>> SERVER OUT OF DATE: %s" % dosyncuri + print ">>>" + print + elif (servertimestamp == 0) or (servertimestamp > mytimestamp): + # actual sync + mycommand=rsynccommand+" "+dosyncuri+"/ "+myportdir + exitcode=portage.spawn(mycommand,portage.settings,free=1) + if exitcode in [0,1,2,3,4,11,14,20,21]: + break + elif exitcode in [0,1,2,3,4,11,14,20,21]: + break + + retries=retries+1 + + if retries<=maxretries: + print ">>> retry ..." + time.sleep(11) + else: + # over retries + # exit loop + updatecache_flg=False + break + + if (exitcode==0): + emergelog("=== Sync completed with %s" % dosyncuri) + elif (exitcode>0): + print + if exitcode==1: + print darkred("!!!")+green(" Rsync has reported that there is a syntax error. Please ensure") + print darkred("!!!")+green(" that your SYNC statement is proper.") + print darkred("!!!")+green(" SYNC="+portage.settings["SYNC"]) + elif exitcode==11: + print darkred("!!!")+green(" Rsync has reported that there is a File IO error. Normally") + print darkred("!!!")+green(" this means your disk is full, but can be caused by corruption") + print darkred("!!!")+green(" on the filesystem that contains PORTDIR. Please investigate") + print darkred("!!!")+green(" and try again after the problem has been fixed.") + print darkred("!!!")+green(" PORTDIR="+portage.settings["PORTDIR"]) + elif exitcode==20: + print darkred("!!!")+green(" Rsync was killed before it finished.") + else: + print darkred("!!!")+green(" Rsync has not successfully finished. It is recommended that you keep") + print darkred("!!!")+green(" trying or that you use the 'emerge-webrsync' option if you are unable") + print darkred("!!!")+green(" to use rsync due to firewall or other restrictions. This should be a") + print darkred("!!!")+green(" temporary problem unless complications exist with your network") + print darkred("!!!")+green(" (and possibly your system's filesystem) configuration.") + print + sys.exit(exitcode) + elif syncuri[:6]=="cvs://": + if not os.path.exists("/usr/bin/cvs"): + print "!!! /usr/bin/cvs does not exist, so rsync support is disabled." + print "!!! Type \"emerge dev-util/cvs\" to enable CVS support." + sys.exit(1) + cvsroot=syncuri[6:] + cvsdir=os.path.dirname(myportdir) + if not os.path.exists(myportdir+"/CVS"): + #initial checkout + print ">>> starting initial cvs checkout with "+syncuri+"..." + if not portage.spawn("cd "+cvsdir+"; cvs -d "+cvsroot+" login",portage.settings,free=1): + print "!!! cvs login error; exiting." + sys.exit(1) + if os.path.exists(cvsdir+"/gentoo-x86"): + print "!!! existing",cvsdir+"/gentoo-x86 directory; exiting." + sys.exit(1) + if not portage.spawn("cd "+cvsdir+"; cvs -z0 -d "+cvsroot+" co -P gentoo-x86",portage.settings,free=1): + print "!!! cvs checkout error; exiting." + sys.exit(1) + if cvsdir!=myportdir: + portage.movefile(cvsdir,portage.settings["PORTDIR"]) + sys.exit(0) + else: + #cvs update + print ">>> starting cvs update with "+syncuri+"..." + sys.exit(portage.spawn("cd "+myportdir+"; cvs -z0 -q update -dP",portage.settings,free=1)) + else: + print "!!! rsync setting: ",syncuri,"not recognized; exiting." + sys.exit(1) + + try: # Prevent users from affecting ebuild.sh. + os.close(sys.stdin.fileno()) + except SystemExit, e: + raise # Needed else can't exit + except: + pass + + if os.path.exists(myportdir+"/metadata/cache") and updatecache_flg: + if "--quiet" not in myopts: + print "\n>>> Updating Portage cache: ", + os.umask(0002) + cachedir = os.path.normpath(portage.settings.depcachedir) + if cachedir in ["/", "/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." + print "!!! This is ALMOST CERTAINLY NOT what you want: "+str(cachedir) + sys.exit(73) + if not os.path.exists(cachedir): + os.mkdir(cachedir) + + # Potentially bad + #if os.path.exists(cachedir+"/"+myportdir): + # portage.spawn("rm -Rf "+cachedir+"/"+myportdir+"/*",portage.settings,free=1) + + # save timestamp.chk for next timestamp check. + try: + if tmpservertimestampfile != None: + portage.movefile(tmpservertimestampfile, servertimestampfile) + except SystemExit, e: + raise # Needed else can't exit + except Exception, e: + print "!!! Failed to save current timestamp." + print "!!!",e + + portage.portdb.flush_cache() + + try: + os.umask(002) + os.chown(cachedir, os.getuid(), portage.portage_gid) + os.chmod(cachedir, 02775) + except SystemExit, e: + raise # Needed else can't exit + except: + pass + # we don't make overlay trees cache here. + backup_porttrees=portage.portdb.porttrees + porttree_root = portage.portdb.porttree_root + portage.portdb.porttrees=[porttree_root] + cp_list=portage.portdb.cp_all() + cp_list.sort() + pcnt=0 + pcntstr="" + pcntcount=len(cp_list)/100.0 + nextupdate=pcntcount + current=1 + def cleanse_cache(cat, saves, porttree_root=porttree_root): + if len(saves): + d={} + for v in saves: + d[portage.catsplit(v)[1]] = True + for pv in portage.db["/"]["porttree"].dbapi.auxdb[porttree_root][cat].keys(): + if pv not in d: + portage.db["/"]["porttree"].dbapi.auxdb[porttree_root][cat].del_key(pv) + else: + portage.db["/"]["porttree"].dbapi.auxdb[porttree_root][cat].clear() + del portage.db["/"]["porttree"].dbapi.auxdb[porttree_root][cat] + savelist = [] + catlist = [] + oldcat = portage.catsplit(cp_list[0])[0] + for cp in cp_list: + current += 1 + if current >= nextupdate: + pcnt += 1 + nextupdate += pcntcount + if "--quiet" not in myopts: + pcntstr = str(pcnt) + sys.stdout.write("\b"*(len(pcntstr)+1)+pcntstr+"%") + sys.stdout.flush() + cat = portage.catsplit(cp)[0] + if cat != oldcat: + catlist.append(oldcat) + cleanse_cache(oldcat, savelist) + savelist = [] + oldcat = cat + mymatches = portage.db["/"]["porttree"].dbapi.xmatch("match-all", cp) + savelist.extend(mymatches) + for cpv in mymatches: + try: portage.db["/"]["porttree"].dbapi.aux_get(cpv, ["IUSE"],metacachedir=myportdir+"/metadata/cache",debug=("cachedebug" in portage.features)) + except SystemExit: raise + except Exception, e: print "\nFailed cache update:",cpv,e + catlist.append(oldcat) + catlist.append("local") + cleanse_cache(oldcat, savelist) + filelist = portage.listdir(cachedir+"/"+myportdir) + for x in filelist: + found = False + for y in catlist: + if x.startswith(y): + found = True + break + if not found: + portage.spawn("cd /; rm -Rf "+cachedir+"/"+myportdir+"/"+x,portage.settings,free=1,droppriv=1) + + + portage.portdb.porttrees=backup_porttrees + sys.stdout.write("\n\n") + sys.stdout.flush() + + 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")) + + chk_updated_cfg_files() + + if(mybestpv != mypvs): + print + print red(" * ")+bold("An update to portage is available.")+" It is _highly_ recommended" + print red(" * ")+"that you update portage now, before any other packages are updated." + print red(" * ")+"Please do so and then update "+bold("ALL")+" of your configuration files." + print +elif myaction=="regen": + emergelog(" === regen") + #regenerate cache entries + print "Regenerating cache entries... " + try: + os.close(sys.stdin.fileno()) + except SystemExit, e: + raise # Needed else can't exit + except: + pass + sys.stdout.flush() + mynodes=portage.portdb.cp_all() + for x in mynodes: + mymatches=portage.portdb.xmatch("match-all",x) + if not "--quiet" in myopts: + print "processing",x + for y in mymatches: + try: + foo=portage.portdb.aux_get(y,["DEPEND"],debug=1) + except SystemExit, e: + # sys.exit is an exception... And consequently, we can't catch it. + raise + except Exception, e: + print "\n error processing %(cpv)s, continuing... (%(e)s)" % {"cpv":y,"e":str(e)} + print "done!" +# HELP action +elif "config"==myaction: + if len(myfiles) != 1 or "system" in myfiles or "world" in myfiles: + print red("!!! config can only take a single package atom at this time\n") + sys.exit(1) + + print + pkgs = portage.db[portage.root]["vartree"].dbapi.match(myfiles[0]) + if len(pkgs) == 0: + print "No packages found.\n" + sys.exit(0) + elif len(pkgs) > 1: + if "--ask" in myopts: + options = [] + print "Please select a package to configure:" + idx = 0 + for pkg in pkgs: + idx += 1 + options.append(str(idx)) + print options[-1]+") "+pkg + print "X) Cancel" + options.append("X") + idx = userquery("Selection?", options) + if idx == "X": + sys.exit(0) + pkg = pkgs[int(idx)-1] + else: + print "The following packages available:" + for pkg in pkgs: + print "* "+pkg + print "\nPlease use a specific atom or the --ask option." + sys.exit(1) + else: + pkg = pkgs[0] + + print + if "--ask" in myopts: + if userquery("Ready to configure "+pkg+"?") == "No": + sys.exit(0) + else: + print "Configuring pkg..." + print + ebuildpath = portage.db[portage.root]["vartree"].dbapi.findname(pkg) + mysettings = portage.config(clone=portage.settings) + portage.doebuild(ebuildpath,"config",portage.root,mysettings,debug=("--debug" in myopts),cleanup=True) + print + +# INFO action +elif "info"==myaction: + unameout=commands.getstatusoutput("uname -mrp")[1] + print getportageversion() + print "=================================================================" + print "System uname: "+unameout + if os.path.exists("/etc/gentoo-release"): + os.system("cat /etc/gentoo-release") + else: + print "Unknown Host Operating System" + + output=commands.getstatusoutput("distcc --version") + if not output[0]: + print str(string.split(output[1],"\n",1)[0]), + if "distcc" in portage.features: + print "[enabled]" + else: + print "[disabled]" + + output=commands.getstatusoutput("ccache -V") + if not output[0]: + print str(string.split(output[1],"\n",1)[0]), + if "ccache" in portage.features: + print "[enabled]" + else: + print "[disabled]" + + myvars = ["sys-devel/autoconf", "sys-devel/automake", "virtual/os-headers", + "sys-devel/binutils", "sys-devel/libtool", "dev-lang/python"] + myvars += portage_util.grabfile(portage.settings["PORTDIR"]+"/profiles/info_pkgs") + myvars = portage_util.unique_array(myvars) + myvars.sort() + + for x in myvars: + if portage.isvalidatom(x): + pkg_matches = portage.db["/"]["vartree"].dbapi.match(x) + pkgs = [] + for y in pkg_matches: + mycpv = portage.catpkgsplit(y) + if(mycpv[3] != "r0"): + pkgs += [mycpv[2] + "-" + mycpv[3]] + else: + pkgs += [mycpv[2]] + if not pkgs: + pkgs = "[Not Present]" + else: + pkgs = ", ".join(sorted_versions(pkgs)) + print "%-20s %s" % (x+":", pkgs) + else: + print "%-20s %s" % (x+":", "[NOT VALID]") + + libtool_vers = string.join(portage.db["/"]["vartree"].dbapi.match("sys-devel/libtool"), ",") + + if "--verbose" in myopts: + myvars=portage.settings.keys() + else: + myvars = ['GENTOO_MIRRORS', 'CONFIG_PROTECT', 'CONFIG_PROTECT_MASK', + 'PORTDIR', 'DISTDIR', 'PKGDIR', 'PORTAGE_TMPDIR', + 'PORTDIR_OVERLAY', 'USE', 'CHOST', 'CFLAGS', 'CXXFLAGS', + 'ACCEPT_KEYWORDS', 'SYNC', 'FEATURES'] + + myvars.extend(portage_util.grabfile(portage.settings["PORTDIR"]+"/profiles/info_vars")) + + myvars = portage_util.unique_array(myvars) + unset_vars = [] + myvars.sort() + for x in myvars: + if portage.settings.has_key(x): + print x+'="'+portage.settings[x]+'"' + else: + unset_vars.append(x) + if unset_vars: + print "Unset: "+", ".join(unset_vars) + print + + if "--debug" in myopts: + for x in dir(portage): + module = getattr(portage, x) + if "cvs_id_string" in dir(module): + print "%s: %s" % (str(x), str(module.cvs_id_string)) + +# SEARCH action +elif "search"==myaction: + if not myfiles: + print "emerge: no search terms provided." + else: + searchinstance = search() + for mysearch in myfiles: + try: + searchinstance.execute(mysearch) + except re.error, comment: + print "\n!!! Regular expression error in \"%s\": %s" % ( mysearch, comment ) + sys.exit(1) + searchinstance.output() +elif "inject"==myaction: + if not myfiles: + print "emerge: please specify at least one cat/pkg-ver to inject." + sys.exit(1) + if "--pretend" in myopts: + print "emerge: the \"inject\" action does not support \"--pretend.\"" + sys.exit(1) + for x in myfiles: + if x[0] in [">","<","=","!"]: + print "!!! '"+x+"' is an invalid specification." + print "!!! Must be 'category/package-version' with no other symbols." + print + continue + mycps=portage.catpkgsplit(x) + 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): + print "!!! Not injecting",x+"; Package already exists." + else: + if "--ask" in myopts: + if userquery("Do you want to inject the package %s?" % x)=="No": + print + print "Quitting." + print + sys.exit(0) + portage.db["/"]["vartree"].dbapi.cpv_inject(x) + print ">>> Injected",x+"." + emergelog(" === inject: "+x) +elif "unmerge"==myaction or "prune"==myaction or "clean"==myaction: + if 1==unmerge(myaction, myfiles): + post_emerge() + +elif "depclean"==myaction: + # Kill packages that aren't explicitly merged or are required as a + # dependency of another package. World file is explicit. + + print + print red("*** WARNING ***")+" : DEPCLEAN CAN SERIOUSLY IMPAIR YOUR SYSTEM. USE CAUTION." + print red("*** WARNING ***")+" : (Cancel: CONTROL-C) -- ALWAYS VERIFY ALL PACKAGES IN THE" + print red("*** WARNING ***")+" : CANDIDATE LIST FOR SANITY BEFORE ALLOWING DEPCLEAN TO" + print red("*** WARNING ***")+" : UNMERGE ANY PACKAGES." + print red("*** WARNING ***")+" :" + print red("*** WARNING ***")+" : USE FLAGS MAY HAVE AN EXTREME EFFECT ON THE OUTPUT." + print red("*** WARNING ***")+" : SOME LIBRARIES MAY BE USED BY PACKAGES BUT ARE NOT" + print red("*** WARNING ***")+" : CONSIDERED TO BE A DEPEND DUE TO USE FLAG SETTINGS." + print red("*** WARNING ***")+" : emerge --update --deep --newuse world TO VERIFY" + print red("*** WARNING ***")+" : SANITY IN THIS REGARD." + print red("*** WARNING ***")+" :" + print red("*** WARNING ***")+" : Packages in the list that are desired may be added" + print red("*** WARNING ***")+" : directly to the world file to cause them to be ignored" + print red("*** WARNING ***")+" : by depclean and maintained in the future. BREAKAGES DUE" + print red("*** WARNING ***")+" : TO UNMERGING AN ==IN-USE LIBRARY== MAY BE REPAIRED BY" + print red("*** WARNING ***")+" : MERGING *** THE PACKAGE THAT COMPLAINS *** ABOUT THE" + print red("*** WARNING ***")+" : MISSING LIBRARY." + print + if ("--pretend" not in myopts) and ("--ask" not in myopts): + countdown(EMERGE_WARNING_DELAY, ">>> Depclean") + emergelog(" >>> depclean") + + mydepgraph=depgraph(myaction,myopts) + syslist=getlist("system") + worldlist=getlist("world") + + print "Calculating",myaction,"dependencies ", + if not mydepgraph.xcreate("world"): + print "\n!!! Failed to create deptree." + sys.exit(1) + print "\b\b ... done!" + + if ("--usepkgonly" in myopts) and mydepgraph.missingbins: + sys.stderr.write(red("The following binaries are not available for merging...\n")) + for x in mydepgraph.missingbins: + sys.stderr.write(" "+str(x)+"\n") + sys.stderr.write("\nThese are required by '--usepkgonly' -- Terminating.\n\n") + sys.exit(1) + + alldeps=mydepgraph.digraph.allnodes() + myvarlist=portage.vardbapi(portage.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 + if not alldeps: + print "!!! You have no dependencies. Impossible. Bug." + + if not (syslist and worldlist and myvarlist and alldeps): + print + sys.exit(1) + + reallist=[] + for x in alldeps: + myparts=portage.catpkgsplit(string.split(x)[2]) + if not myparts: + sys.stderr.write( + red("!!! There appears to be a problem with the following package:\n")+ + red("!!! "+str(string.split(x)[2])+"\n\n")+ + "!!! Please ensure that blocking/conflicting packages are not merged."+ + "!!! 'emerge -p "+str(string.split(x)[2])+"\n\n") + if ("--pretend" not in myopts) and ("--ask" not in myopts): + countdown(EMERGE_WARNING_DELAY, "*** Continuing") + continue + + catpack=myparts[0]+"/"+myparts[1] + if catpack not in reallist: + reallist.append(catpack) + + cleanlist=[] + for x in myvarlist: + if x not in reallist: + if x not in cleanlist: + cleanlist.append(x) + + for x in syslist+worldlist: + myparts = portage.catpkgsplit(x) + if myparts: + if myparts[0][0] in ('<','>','='): + myparts[0] = myparts[0][1:] + if myparts[0][0] in ('<','>','='): + myparts[0] = myparts[0][1:] + catpack=myparts[0]+"/"+myparts[1] + else: + catpack=x + if catpack in cleanlist: + cleanlist.remove(catpack) + + #print "\n\n\nCleaning: " + #for x in cleanlist: + # print x + #print + + if len(cleanlist): + unmerge("unmerge", cleanlist) + + print + print "Packages installed: "+str(len(myvarlist)) + print "Packages in world: "+str(len(worldlist)) + print "Packages in system: "+str(len(syslist)) + print "Unique package names: "+str(len(reallist)) + print "Required packages: "+str(len(alldeps)) + if "--pretend" in myopts: + print "Number to remove: "+str(len(cleanlist)) + else: + print "Number removed: "+str(len(cleanlist)) + post_emerge() + +# "update", "system", or just process files: +else: + favorites=[] + syslist=getlist("system") + if (("--pretend" in myopts) and not ("--fetchonly" in myopts or "--fetch-all-uri" in myopts)) or ("--ask" in myopts): + if "--tree" in myopts: + print + print darkgreen("These are the packages that I would merge, in reverse order:") + print + else: + print + print darkgreen("These are the packages that I would merge, in order:") + print + + if ("--resume" in myopts) and portage.mtimedb.has_key("resume"): + myresumeopts=portage.mtimedb["resume"]["myopts"][:] + + while "--skipfirst" in myresumeopts: + myresumeopts.remove("--skipfirst") + while "--ask" in myresumeopts: + myresumeopts.remove("--ask") + + for myopt in myopts: + if myopt not in myresumeopts: + myresumeopts.append(myopt) + myopts=myresumeopts + mydepgraph=depgraph("resume",myopts) + if "--resume" not in myopts: + myopts+=["--resume"] + else: + if ("--resume" in myopts): + del myopts[myopts.index("--resume")] + print darkgreen("emerge: It seems we have nothing to resume...") + sys.exit(0) + + mydepgraph=depgraph(myaction,myopts) + if myaction in ["system","world"]: + print "Calculating",myaction,"dependencies ", + sys.stdout.flush() + if not mydepgraph.xcreate(myaction): + print "!!! Depgraph creation failed." + sys.exit(1) + print "\b\b ...done!" + else: + if not myfiles: + print "emerge: please tell me what to do." + help() + sys.exit(1) + #we don't have any files to process; skip this step and exit + print "Calculating dependencies ", + sys.stdout.flush() + retval,favorites=mydepgraph.select_files(myfiles) + if not retval: + sys.exit(1) + print "\b\b ...done!" + + if ("--usepkgonly" in myopts) and mydepgraph.missingbins: + sys.stderr.write(red("The following binaries are not available for merging...\n")) + + if mydepgraph.missingbins: + for x in mydepgraph.missingbins: + sys.stderr.write(" "+str(x)+"\n") + sys.stderr.write("\nThese are required by '--usepkgonly' -- Terminating.\n\n") + sys.exit(1) + + if "--ask" in myopts: + if "--resume" in myopts: + mydepgraph.display(portage.mtimedb["resume"]["mergelist"]) + prompt="Do you want me to resume merging these packages?" + else: + mydepgraph.display(mydepgraph.altlist()) + mergecount=0 + hasblocks = False + for x in mydepgraph.altlist(): + if x[3]!="nomerge": + mergecount+=1 + #check for blocking dependencies + if x[0]=="blocks": + hasblocks = True + if mergecount==0: + if portage.settings["AUTOCLEAN"] and "yes"==portage.settings["AUTOCLEAN"]: + prompt="Nothing to merge; do you want me to auto-clean packages?" + else: + print + print "Nothing to merge; quitting." + print + sys.exit(0) + elif "--fetchonly" in myopts or "--fetch-all-uri" in myopts: + prompt="Do you want me to fetch the source files for these packages?" + elif hasblocks: + print "\n!!! Error: The above package list contains packages which cannot be installed" + print "!!! on the same system." + print + sys.exit(1) + else: + prompt="Do you want me to merge these packages?" + print + if userquery(prompt)=="No": + print + print "Quitting." + print + sys.exit(0) + # Don't ask again (e.g. when auto-cleaning packages after merge) + myopts.remove("--ask") + + if ("--pretend" in myopts) and not ("--fetchonly" in myopts or "--fetch-all-uri" in myopts): + if ("--resume" in myopts): + mydepgraph.display(portage.mtimedb["resume"]["mergelist"]) + else: + mydepgraph.display(mydepgraph.altlist()) + else: + if ("--buildpkgonly" in myopts): + if not mydepgraph.digraph.hasallzeros(): + print "\n!!! --buildpkgonly requires all dependencies to be merged." + print "!!! Cannot merge requested packages. Merge deps and try again.\n" + sys.exit(1) + + if ("--resume" in myopts): + favorites=portage.mtimedb["resume"]["favorites"] + mydepgraph.merge(portage.mtimedb["resume"]["mergelist"]) + else: + portage.mtimedb["resume"]={} + portage.mtimedb["resume"]["myopts"]=myopts + portage.mtimedb["resume"]["favorites"]=favorites + if ("--digest" in myopts) and not ("--fetchonly" in myopts or "--fetch-all-uri" in myopts): + for pkgline in mydepgraph.altlist(): + 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)) + mydepgraph.merge(mydepgraph.altlist()) + + if portage.mtimedb.has_key("resume"): + del portage.mtimedb["resume"] + if portage.settings["AUTOCLEAN"] and "yes"==portage.settings["AUTOCLEAN"]: + print ">>> Auto-cleaning packages ..." + unmerge("clean", ["world"]) + post_emerge() diff --git a/bin/env-update b/bin/env-update new file mode 100755 index 000000000..a60428767 --- /dev/null +++ b/bin/env-update @@ -0,0 +1,11 @@ +#!/usr/bin/python -O +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-src/portage/bin/env-update,v 1.9 2004/10/04 13:56:50 vapier Exp $ + +import os,sys +os.environ["PORTAGE_CALLER"] = "env-update" +sys.path = ["/usr/lib/portage/pym"]+sys.path + +import portage +portage.env_update() diff --git a/bin/env-update.sh b/bin/env-update.sh new file mode 100755 index 000000000..5edc2da6b --- /dev/null +++ b/bin/env-update.sh @@ -0,0 +1,221 @@ +#!/bin/bash +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-src/portage/bin/env-update.sh,v 1.2 2004/10/04 13:56:50 vapier Exp $ + +############################################ +############################################ +# ENVIRONMENT SETUP +############################################ + +if [[ ${EUID} -ne 0 ]] ; then + echo "$0: must be root." + exit 1 +fi + +# Make sure our environment is sane +if [[ ! -z "${MAKELINKS}" ]] ; then + export MAKELINKS=0 +else + export MAKELINKS=1 +fi +export ROOT="${ROOT:=/}" +[[ ${ROOT} == */ ]] || export ROOT="${ROOT}/" + +export ENVDIR="${ROOT}etc/env.d" +mkdir -p ${ENVDIR} +chmod 755 ${ENVDIR} +specials=" + KDEDIRS PATH CLASSPATH LDPATH MANPATH INFODIR INFOPATH ROOTPATH + CONFIG_PROTECT CONFIG_PROTECT_MASK PRELINK_PATH PYTHONPATH + PRELINK_PATH_MASK ADA_INCLUDE_PATH ADA_OBJECTS_PATH" +colon_separated=" + 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 PRELINKCONF="${ROOT}etc/prelink.conf" +defaultprelinkpaths=":/bin:/sbin:/usr/bin:/usr/sbin:/lib:/usr/lib" + +export PROFILEENV="${ROOT}etc/profile.env" +export CSHENV="${ROOT}etc/csh.env" + +# make sure we aren't tricked with previous 'my_envd_' variables +unset $(set | grep '^my_envd_' | cut -d= -f1) + +############################################ +############################################ +# ENV.D PARSING +############################################ + +do_has() { + local x + local me="$1" + shift + + for x in "$@" ; do + [[ ${x} == ${me} ]] && return 0 + done + return 1 +} +has() { + local ret + local ifs="${IFS}" + unset IFS + do_has $1 ${!2} + ret=$? + export IFS="${ifs}" + return ${ret} +} +is_special() { + has $1 specials +} +is_colon_separated() { + has $1 colon_separated +} + +for envd in $(ls ${ENVDIR} | sort) ; do + # make sure file is a vaild env'd entry and not a backup file + num="${envd:0:2}" + if [[ ! -z ${num//[0-9]} ]] ; then + continue + elif [[ ${envd} == *~ || ${envd} == *.bak ]] ; then + continue + fi + + # use bash to make sure the file is valid + envd="${ENVDIR}/${envd}" + if ! (source "${envd}") ; then + echo "!!! Error parsing ${envd}!" + exit 1 + fi + + # parse env.d entries + cnfvars="$(grep '^[[:alpha:]_][[:alnum:]_]*=' "${envd}")" + export IFS=$'\n' + for cnfv in ${cnfvars} ; do + var="${cnfv/=*}" + val="${cnfv:${#var}+1}" + if [ "${val:0:1}" == "\"" ] ; then + val="${val:1:${#val}-2}" + fi + myvar="my_envd_${var}" + if is_special ${var} ; then + if [[ ! -z "${!myvar}" ]] ; then + if is_colon_separated ${var} ; then + sep=":" + else + sep=" " + fi + else + sep="" + fi + export ${myvar}="${!myvar}${sep}${val}" + else + export ${myvar}="${val}" + fi + done + unset IFS +done + +############################################ +############################################ +# LD.SO.CONF HANDLING +############################################ + +# create a : sep list from ld.so.conf +export OLD_LDPATH="" +if [ -s "${LDSOCONF}" ] ; then + while read line ; do + if [[ "${line:0:1}" == "#" ]] ; then + continue + fi + export OLD_LDPATH="${OLD_LDPATH}:${line}" + done < ${LDSOCONF} + export OLD_LDPATH="${OLD_LDPATH:1}" +fi + +# has the ldpath changed ? if so, recreate +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 +${my_envd_LDPATH//:/ +} +EOF +fi + +############################################ +############################################ +# HANDLE PRELINK PATHS +############################################ + +if prelink --version >& /dev/null ; then + # we assume LDPATH and PATH aren't empty ... if they were, we got other problems + envdprelinkcheckpaths="${my_envd_LDPATH}:${my_envd_PATH}" + if [[ ! -z "${my_envd_PRELINK_PATH}" ]] ; then + envdprelinkcheckpaths="${envdprelinkcheckpaths}:${my_envd_PRELINK_PATH}" + fi + + if [[ ! -z "${my_envd_PRELINK_PATH_MASK}" ]] ; then + export prelink_mask=":${PRELINK_PATH_MASK}:" + envdprelinkpaths="" + export IFS=":" + for dir in ${envdprelinkcheckpaths} ; do + if [[ ${dir:0-1} == / ]] ; then + noslashdir="${dir:0:${#dir}-1}" + else + dir="${dir}/" + noslashdir="${dir}" + fi + if [[ ${prelink_mask/:${dir}:/} == ${prelink_mask} \ + && ${prelink_mask/:${noslashdir}:/} == ${prelink_mask} ]] ; then + envdprelinkpaths="${envdprelinkpaths}:${dir}" + fi + done + unset IFS + else + envdprelinkpaths=":${envdprelinkcheckpaths}" + fi + + cat << EOF > ${PRELINKCONF} +# prelink.conf autogenerated by env-update; make all changes to +# contents of /etc/env.d directory +${defaultprelinkpaths//:/ +-l } +${envdprelinkpaths//:/ +-h } +EOF +fi +unset my_envd_LDPATH + +############################################ +############################################ +# RUN EXTERNAL PROGRAMS NOW +############################################ + +echo ">>> Regenerating ${ROOT}etc/ld.so.cache..." +if [[ ${MAKELINKS} -eq 0 ]] ; then + (cd / ; /sbin/ldconfig -X -r ${ROOT} >& /dev/null) +else + (cd / ; /sbin/ldconfig -r ${ROOT} >& /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 + +$(set | grep '^my_envd_' | sed -e 's:^my_envd_:export :') +EOF + +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 + +$(set | grep '^my_envd_' | sed -e 's:^my_envd_\([[:alpha:]_][[:alnum:]_]*\)=:setenv \1 :') +EOF + +[[ ${ROOT} == / ]] && /sbin/depscan.sh diff --git a/bin/etc-update b/bin/etc-update new file mode 100755 index 000000000..e8ea9376b --- /dev/null +++ b/bin/etc-update @@ -0,0 +1,407 @@ +#!/bin/bash +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-src/portage/bin/etc-update,v 1.23.2.5 2005/05/29 12:40:08 jstubbs Exp $ + +# Author Brandon Low +# +# Previous version (from which I've borrowed a few bits) by: +# Jochem Kossen +# Leo Lipelis +# Karl Trygve Kalleberg + +export PORTAGE_CALLER="etc-update" + +eval $(python -c 'import portage; print "export PORTAGE_TMPDIR="+portage.settings["PORTAGE_TMPDIR"]; print "export USERLAND="+portage.settings["USERLAND"]') + +if [ "$USERLAND" == "BSD" ] ; then + function sed() { gsed "$@"; } +elif [ "$USERLAND" == "Darwin" ] && [ -x /bin/gsed ]; then + function sed() { gsed "$@"; } +fi + +function get_config() { + item=$1 + + # 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 | \ + sed -ne "s/^ *$item *= *\([\"']\{0,1\}\)\(.*\)\1/\2/p" |sed -e '$p;d' +} + +function scan() { + + echo "Scanning Configuration files..." + rm -rf ${TMP}/files > /dev/null 2>&1 + mkdir ${TMP}/files || die "Failed mkdir command!" 1 + count=0 + input=0 + + for path in ${CONFIG_PROTECT}; do if [ -d ${path} ]; then + ofile="" + for file in `find ${path}/ -iname "._cfg????_*" | + sed -e "s:\(^.*/\)\(\._cfg[0-9]*_\)\(.*$\):\1\2\3\%\2\%\3:" | + sort -t'%' -k3 -k2 | LANG=POSIX LC_ALL=POSIX cut -f1 -d'%'`; do + rpath=`echo "${file/\/\///}" | sed -e "s:/[^/]*$::"` + rfile=`echo "${file/\/\///}" | sed -e "s:^.*/::"` + for mpath in ${CONFIG_PROTECT_MASK}; do + if [[ "${rpath}" == "${mpath}"* ]]; then + mv ${rpath}/${rfile} ${rpath}/${rfile:10} + break + fi + done + [ ! -f ${file} ] && continue + + + if [[ "${ofile:10}" != "${rfile:10}" ]] || + [[ ${opath} != ${rpath} ]]; then + MATCHES=0 + if [[ "${EU_AUTOMERGE}" == "yes" ]]; then + 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 ]*$' + MATCHES=$? + fi + elif [[ -z `diff -Nua ${rpath}/${rfile} ${rpath}/${rfile:10}| + grep "^[+-][^+-]"|grep -v '# .Header:.*'` ]]; then + MATCHES=1 + fi + if [[ "${MATCHES}" == "1" ]]; then + echo "Automerging trivial changes in: ${rfile:10}" + mv ${rpath}/${rfile} ${rpath}/${rfile:10} + continue + else + count=${count}+1 + echo "${rpath}/${rfile:10}" > ${TMP}/files/${count} + echo "${rpath}/${rfile}" >> ${TMP}/files/${count} + ofile="${rfile}" + opath="${rpath}" + continue + fi + fi + + if [[ -z `diff -Nua ${rpath}/${rfile} ${rpath}/${ofile}| + grep "^[+-][^+-]"|grep -v '# .Header:.*'` ]]; then + mv ${rpath}/${rfile} ${rpath}/${ofile} + continue + else + echo "${rpath}/${rfile}" >> ${TMP}/files/${count} + ofile="${rfile}" + opath="${rpath}" + fi + done + fi; done + +} + +function sel_file() { + local -i isfirst=0 + until [ -f ${TMP}/files/${input} ] || [ ${input} == -1 ] || [ ${input} == -3 ]; do + for file in `ls ${TMP}/files|sort -n`; do + if (( ${isfirst} == 0 )); then + isfirst=${file} + fi + echo -n "${file}${PAR} " + if (( ${mode} == 0 )); then + for word in `cat ${TMP}/files/${file}`; do + echo ${word} + done + else + head -n1 ${TMP}/files/${file} + fi + done > ${TMP}/menuitems + + if [ "${OVERWRITE_ALL}" == "yes" ]; then + input=0 + else + if (( ${mode} == 0 )); then + echo "The following is the list of files which need updating, each +configuration file is followed by a list of possible replacement files." + else + local my_title="Please select a file to update" + fi + + if (( ${mode} == 0 )); then + cat ${TMP}/menuitems + echo "Please select a file to edit by entering the corresponding number." + echo " (don't use -3 or -5 if you're unsure what to do)" + echo " (-1 to exit) (-3 to auto merge all remaining files)" + echo -n " (-5 to auto-merge AND not use 'mv -i'): " + read input + else + dialog --title "${title}" --menu "${my_title}" \ + 0 0 0 `echo "-1 Exit";cat ${TMP}/menuitems` \ + 2> ${TMP}/input + input=`cat ${TMP}/input` + fi + if (( ${input} == -5 )); then + input=-3 + export mv_opts="" + fi + if (( ${input} == -3 )); then + input=0 + export OVERWRITE_ALL="yes" + fi + fi # -3 automerge + if (( ${input} == 0 )); then + input=${isfirst} + fi + done +} + +function do_file() { + echo + local -i my_input + local -i fcount=0 + until (( `cat ${TMP}/files/${input}|wc -l` < 2 )); do + my_input=0 + if (( `cat ${TMP}/files/${input}|wc -l` == 2 )); then + my_input=1 + fi + until (( ${my_input} > 0 )) && (( ${my_input} < `cat ${TMP}/files/${input}|wc -l` )); do + fcount=0 + + if [ "${OVERWRITE_ALL}" == "yes" ]; then + my_input=0 + else + for line in `cat ${TMP}/files/${input}`; do + if (( ${fcount} > 0 )); then + echo -n "${fcount}${PAR} " + echo "${line}" + else + if (( ${mode} == 0 )); then + echo "Below are the new config files for ${line}:" + else + local my_title="Please select a file to process for ${line}" + fi + fi + fcount=${fcount}+1 + done > ${TMP}/menuitems + + if (( ${mode} == 0 )); then + cat ${TMP}/menuitems + echo -n "Please select a file to process (-1 to exit this file): " + read my_input + else + dialog --title "${title}" --menu "${my_title}" \ + 0 0 0 `cat ${TMP}/menuitems;echo "${fcount} Exit"` \ + 2> ${TMP}/input + my_input=`cat ${TMP}/input` + fi + fi # OVERWRITE_ALL + + if (( ${my_input} == 0 )); then + my_input=1 + elif (( ${my_input} == -1 )); then + input=0 + return + elif (( ${my_input} == ${fcount} )); then + break + fi + done + if (( ${my_input} == ${fcount} )); then + break + fi + + fcount=${my_input}+1 + + file=`cat ${TMP}/files/${input} | sed -e "${fcount}p;d"` + ofile=`head -n1 ${TMP}/files/${input}` + + do_cfg "${file}" "${ofile}" + + cat ${TMP}/files/${input}|sed -e "${fcount}!p;d" > ${TMP}/files/sed + mv ${TMP}/files/sed ${TMP}/files/${input} + + if (( ${my_input} == -1 )); then + break + fi + done + echo + rm ${TMP}/files/${input} + count=${count}-1 +} + +function do_cfg() { + + local file="${1}" + local ofile="${2}" + local -i my_input=0 + + until (( ${my_input} == -1 )) || [ ! -f ${file} ]; do + if [ "${OVERWRITE_ALL}" == "yes" ]; then + my_input=1 + else + showdiffcmd=$(echo "${diff_command}" | + sed -e "s:%file1:${ofile}:" -e "s:%file2:${file}:") + + if [ "${using_editor}" == 0 ]; then + ( + echo "Showing differences between ${ofile} and ${file}" + ${showdiffcmd} + ) | ${pager} + else + echo "Beginning of differences between ${ofile} and ${file}" + ${showdiffcmd} + echo "End of differences between ${ofile} and ${file}" + fi + if [ -L "${file}" ]; then + echo + echo "-------------------------------------------------------------" + echo "NOTE: File is a symlink to another file. REPLACE recommended." + echo " The original file may simply have moved. Please review." + echo "-------------------------------------------------------------" + echo + fi + echo -n "1) Replace original with update +2) Delete update, keeping original as is +3) Interactively merge original with update +4) Show differences again +Please select from the menu above (-1 to ignore this update): " + read my_input + fi + + case ${my_input} in + 1) echo "Replacing ${ofile} with ${file}" + mv ${mv_opts} ${file} ${ofile} + my_input=-1 + continue + ;; + 2) echo "Deleting ${file}" + rm ${rm_opts} ${file} + continue + ;; + 3) do_merge "${file}" "${ofile}" + my_input=${?} +# [ ${my_input} == 255 ] && my_input=-1 + continue + ;; + 4) continue + ;; + *) continue + ;; + esac + done +} + +function do_merge() { + + local file="${1}" + local ofile="${2}" + local mfile="${2}.merged" + local -i my_input=0 + echo "${file} ${ofile} ${mfile}" + + if [ -e ${mfile} ] ; then + echo "A previous version of the merged file exists, cleaning..." + rm ${rm_opts} ${mfile} + fi + + until (( ${my_input} == -1 )); do + echo "Merging ${file} and ${ofile}" + `echo "${merge_command}" | + sed -e "s:%merged:${mfile}:g" \ + -e "s:%orig:${ofile}:g" \ + -e "s:%new:${file}:g"` + until (( ${my_input} == -1 )); do + echo -n "1) Replace ${ofile} with merged file +2) Show differences between merged file and original +3) Remerge original with update +4) Edit merged file +5) Return to the previous menu +Please select from the menu above (-1 to exit, losing this merge): " + read my_input + case ${my_input} in + 1) echo "Replacing ${ofile} with ${mfile}" + chmod --reference=${ofile} ${mfile} + mv ${mv_opts} ${mfile} ${ofile} + rm ${rm_opts} ${file} + return 255 + ;; + 2) ( echo "Showing differences between ${ofile} and ${mfile}" + `echo "${diff_command}" | \ + sed -e "s:%file1:${ofile}:" \ + -e "s:%file2:${mfile}:"` ) | ${pager} + continue + ;; + 3) break + ;; + 4) ${EDITOR:-nano -w} "${mfile}" + continue + ;; + 5) rm ${rm_opts} ${mfile} + return 0 + ;; + *) continue + ;; + esac + done + done + rm ${rm_opts} ${mfile} + return 255 +} + +function die() { + trap "" term + trap "" kill + echo "Exiting: ${1}" + rm -rf ${TMP} + exit ${2} +} + +# +# Run the script +# +scriptname=`basename $0` + +trap die term + +TMP="${PORTAGE_TMPDIR}/$$" +rm -rf ${TMP} 2> /dev/null +mkdir ${TMP} || die "failed mkdir command!" 1 + +# I need the CONFIG_PROTECT value +CONFIG_PROTECT=$(/usr/lib/portage/bin/portageq config_protect) +CONFIG_PROTECT_MASK=$(/usr/lib/portage/bin/portageq config_protect_mask) + +# load etc-config's configuration +EU_AUTOMERGE=`get_config eu_automerge` +rm_opts=`get_config rm_opts` +mv_opts=`get_config mv_opts` +cp_opts=`get_config cp_opts` +pager=`get_config pager` +diff_command=`get_config diff_command` +using_editor=`get_config using_editor` +merge_command=`get_config merge_command` +declare -i mode=`get_config mode` +[ -z ${mode} ] && mode=0 +[ -z "${pager}" ] && pager="cat" + +#echo "rm_opts: $rm_opts, mv_opts: $mv_opts, cp_opts: $cp_opts" +#echo "pager: $pager, diff_command: $diff_command, merge_command: $merge_command" + +if (( ${mode} == 0 )); then + PAR=")" +else + PAR="" +fi + +declare -i count=0 +declare -i input=0 +declare title="Gentoolkit's etc-update tool!" + +scan + +until (( ${input} == -1 )); do + if (( ${count} == 0 )); then + die "Nothing left to do; exiting. :)" 0 + fi + sel_file + if (( ${input} != -1 )); then + do_file + fi +done + +die "User termination!" 0 diff --git a/bin/find-requires b/bin/find-requires new file mode 100755 index 000000000..44bc51dae --- /dev/null +++ b/bin/find-requires @@ -0,0 +1,44 @@ +#!/bin/sh +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-src/portage/bin/find-requires,v 1.5 2004/10/04 13:56:50 vapier Exp $ + +# note this works for both a.out and ELF executables +# it also auto-generates requirment lines for shell scripts + +ulimit -c 0 + +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 ` +liblist=`echo $filelist | $XARGS file | grep ":.*shared object" | cut -d : -f1 ` + +for f in $exelist; do + if [ -x $f ]; then + ldd $f | awk '/=>/ { print $1 }' + fi +done | sort -u | sed "s/['\"]/\\\&/g" | $XARGS -n 1 basename | grep -v 'libNoVersion.so' | sort -u + +for f in $liblist; do + ldd $f | awk '/=>/ { print $1 }' +done | sort -u | sed "s/['\"]/\\\&/g" | $XARGS -n 1 basename | grep -v 'libNoVersion.so' | sort -u + +for f in $scriptlist; do + if [ -x $f ]; then + head -1 $f | sed -e 's/^\#\![ ]*//' | cut -d" " -f1 + fi +done | sort -u + +#for f in $liblist $exelist ; do +# objdump -p $f | awk ' +# BEGIN { START=0; LIBNAME=""; } +# /Version References:/ { START=1; } +# /required from/ && (START==1) { +# sub(/:/, "", $3); +# LIBNAME=$3; +# } +# (START==1) && (LIBNAME!="") && ($4~/^GLIBC_*/) { print LIBNAME "(" $4 ")"; } +# /^$/ { START=0; } +# ' +#done | sort -u + diff --git a/bin/fix-db.py b/bin/fix-db.py new file mode 100755 index 000000000..d185580fa --- /dev/null +++ b/bin/fix-db.py @@ -0,0 +1,175 @@ +#!/usr/bin/python +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-src/portage/bin/fix-db.py,v 1.8 2004/10/11 04:01:00 jstubbs Exp $ + +import os,sys,re +sys.path = ["/usr/lib/portage/pym"]+sys.path + +from stat import * +from output import * +from portage import lockfile,unlockfile,VDB_PATH,root + + +mylog = open("/var/log/emerge_fix-db.log", "a") +def writemsg(msg): + if msg[-1] != '\n': + msg += "\n" + sys.stderr.write(msg) + sys.stderr.flush() + mylog.write(msg) + mylog.flush() + +def fix_global_counter(value): + myf = open("/var/cache/edb/counter") + newvalue = value+1000 + myf.write(str(newvalue)) + myf.flush() + myf.close() + return newvalue + +bad = {} +counters = {} +times = {} + +try: + real_counter = long(open("/var/cache/edb/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+"/" +for cat in os.listdir(vardbdir): + catdir = vardbdir+cat+"/" + if not os.path.isdir(catdir): + writemsg("Invalid file: '%s'\n" % catdir[:-1]) + continue + for pkg in os.listdir(catdir): + pkgdir = catdir+pkg+"/" + catpkg = cat+"/"+pkg + + if not os.path.isdir(catdir): + writemsg("Invalid file: '%s'\n" % pkgdir) + continue + + bad[catpkg] = [] + + pkgdirlist = os.listdir(pkgdir) + if not pkgdirlist: + writemsg("ERROR: Package directory is empty for '%s'\n" % catpkg) + writemsg(" Deleting this directory. Remerge if you want it back.\n") + os.rmdir(pkgdir) + del bad[catpkg] + continue + + if "CONTENTS" not in pkgdirlist: + bad[catpkg] += ["CONTENTS is missing"] + times[catpkg] = -1 + writemsg("ERROR: Contents file is missing from the package directory.\n") + writemsg(" '%s' is corrupt and should be deleted.\n" % catpkg) + else: + times[catpkg] = None + for line in open(pkgdir+"CONTENTS").readlines(): + mysplit = line.split() + if mysplit[0] == "obj": + try: + times[catpkg] = long(mysplit[-1]) + except SystemExit, e: + raise # This needs to be propogated + except: + times[catpkg] = -1 + bad[catpkg] += ["CONTENTS is corrupt"] + writemsg("ERROR: Corrupt CONTENTS file in '%s'\n" % catpkg) + writemsg(" This package should be deleted.\n") + break + if times[catpkg] == None: + times[catpkg] = os.stat(pkgdir+"CONTENTS")[ST_MTIME] + + if "COUNTER" not in pkgdirlist: + bad[catpkg] += ["COUNTER is missing"] + writemsg("ERROR: COUNTER file missing from '%s'.\n" % catpkg) + counters[catpkg] = -1 + else: + try: + counters[catpkg] = long(open(pkgdir+"COUNTER").read().strip()) + if counters[catpkg] > real_counter: + writemsg("ERROR: Global counter is lower than the '%s' COUNTER." % catpkg) + real_counter = fix_global_counter(counters[catpkg]) + except SystemExit, e: + raise # This needs to be propogated + except: + bad[catpkg] += ["COUNTER is corrupt"] + counters[catpkg] = -1 + + if "SLOT" not in pkgdirlist: + writemsg("ERROR: SLOT file missing from '%s'.\n" % catpkg) + writemsg(" RE-MERGE this exact package version or unmerge and remerge.\n") + bad[catpkg] += ["SLOT is missing"] + else: + myslot = open(pkgdir+"SLOT").read() + if myslot and myslot[-1]=="\n": + #writemsg("WARN: SLOT file has a newline. '%s'\n" % catpkg) + myslot = myslot[:-1] + if not myslot: + bad[catpkg] += ["SLOT is empty"] + writemsg("ERROR: SLOT file is empty for '%s'.\n" % catpkg) + writemsg(" RE-MERGE this exact package version or unmerge and remerge it.\n") + elif re.search("[^-a-zA-Z0-9\._]", myslot): + bad[catpkg] += ["SLOT is corrupt"] + writemsg("ERROR: SLOT file is corrupt for '%s'.\n" % catpkg) + writemsg(" RE-MERGE this exact package version or unmerge and remerge it.\n") + elif myslot.strip() != myslot: + writemsg("WARN: SLOT file has invalid characters. '%s'\n" % catpkg) + bad[catpkg] += ["SLOT is invalid"] + + if not bad[catpkg]: + del bad[catpkg] + + +actions = {} +writemsg("\n\n") +for catpkg in bad.keys(): + bad[catpkg].sort() + + mystr = "" + for x in bad[catpkg]: + mystr += " "+str(x)+"\n" + + if bad[catpkg] == ["CONTENTS is missing", "SLOT is missing"]: + writemsg("%s: (possibly injected)\n%s\n" % (green(catpkg), mystr)) + actions[catpkg] = ["ignore"] + elif bad[catpkg] == ["SLOT is empty"]: + writemsg("%s: (old package) []\n%s\n" % (yellow(catpkg), mystr)) + actions[catpkg] = ["remerge"] + else: + writemsg("%s: (damaged/invalid) []\n%s\n" % (red(catpkg), mystr)) + actions[catpkg] = ["merge exact"] + +if (len(sys.argv) > 1) and (sys.argv[1] == "--fix"): + writemsg("These are only directions, at the moment.") + for catpkg in actions.keys(): + action = actions[catpkg] + writemsg("We will now '%s' '%s'..." % (action, catpkg)) + #if action == +else: + #writemsg("Run with '--fix' to attempt automatic correction.") + pass + + + + + + + + + + + + + + + + + diff --git a/bin/fixdbentries b/bin/fixdbentries new file mode 100755 index 000000000..a9c3e1844 --- /dev/null +++ b/bin/fixdbentries @@ -0,0 +1,20 @@ +#!/bin/bash +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-src/portage/bin/fixdbentries,v 1.3 2004/10/04 13:56:50 vapier Exp $ + +# Script to adjust the contents of the DB entries after a package move. +# Fairly straight forward... ./movedbentry 'from/here' 'to/here' /over/here + +VAR=$1 +NEW=$2 +SPATH=$3 + +grep -FrZl "${VAR}" "${SPATH}" | +sed "s#${SPATH}[^\d000]\+/CONTENTS\d000##g" | +$XARGS -0 sed -i -e " +s#${VAR}\$#${NEW}#g; +s#${VAR}\([[:space:]]\)#${NEW}\1#g; +s#${VAR}\(-[^a-zA-Z]\)#${NEW}\1#g; +s#${VAR}\([^a-zA-Z0-9-]\)#${NEW}\1#g +" diff --git a/bin/fixpackages b/bin/fixpackages new file mode 100755 index 000000000..f8d1948ac --- /dev/null +++ b/bin/fixpackages @@ -0,0 +1,14 @@ +#!/usr/bin/python +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-src/portage/bin/fixpackages,v 1.6 2004/10/04 13:56:50 vapier Exp $ + +import os,sys +os.environ["PORTAGE_CALLER"]="fixpackages" +sys.path = ["/usr/lib/portage/pym"]+sys.path + +import portage + +print +print "Done." +print diff --git a/bin/fowners b/bin/fowners new file mode 100755 index 000000000..cc13372a7 --- /dev/null +++ b/bin/fowners @@ -0,0 +1,15 @@ +#!/bin/bash +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-src/portage/bin/fowners,v 1.6 2004/10/04 13:56:50 vapier Exp $ + +if [ ${#} -lt 2 ] ; then + echo "${0}: at least two arguments needed" + exit 1 +fi + +OWNER="${1}" +shift +for FILE in $*; do + chown "${OWNER}" "${D}${FILE}" +done diff --git a/bin/fperms b/bin/fperms new file mode 100755 index 000000000..ce72126e2 --- /dev/null +++ b/bin/fperms @@ -0,0 +1,15 @@ +#!/bin/bash +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-src/portage/bin/fperms,v 1.6 2004/10/04 13:56:50 vapier Exp $ + +if [ ${#} -lt 2 ] ; then + echo "${0}: at least two arguments needed" + exit 1 +fi + +PERM="${1}" +shift +for FILE in $*; do + chmod "${PERM}" "${D}${FILE}" +done diff --git a/bin/md5check.py b/bin/md5check.py new file mode 100755 index 000000000..e64d54a96 --- /dev/null +++ b/bin/md5check.py @@ -0,0 +1,102 @@ +#!/usr/bin/python -O +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-src/portage/bin/md5check.py,v 1.4 2004/10/10 10:07:20 carpaski Exp $ + +import os,sys,string +os.environ["PORTAGE_CALLER"]="mirror" +os.environ["FEATURES"]="mirror cvs" +sys.path = ["/usr/lib/portage/pym"]+sys.path + +import portage +from threading import * +from output import red,green,blue,bold +from random import shuffle +from time import sleep + + +def cstrip(mystr,mychars): + newstr = "" + for x in mystr: + if x not in mychars: + newstr += x + return newstr + +md5_list = {} +bn_list = [] +col_list = [] + +hugelist = [] +for mycp in portage.db["/"]["porttree"].dbapi.cp_all(): + hugelist += portage.db["/"]["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 = string.split(newuri) + + digestpath = portage.db["/"]["porttree"].dbapi.findname(mycpv) + digestpath = os.path.dirname(digestpath)+"/files/digest-"+pv + md5sums = portage.digestParseFile(digestpath) + + if md5sums == None: + portage.writemsg("Missing digest: %s\n" % mycpv) + md5sums = {} + + for x in md5sums.keys(): + if x[0] == '/': + del md5sums[x] + + #portage.writemsg("\n\ndigestpath: %s\n" % digestpath) + #portage.writemsg("md5sums: %s\n" % md5sums) + #portage.writemsg("newuri: %s\n" % newuri) + + bn_list = [] + for x in newuri: + if not x: + continue + if (x in [")","(",":","||"]) or (x[-1] == "?"): + # ignore it. :) + continue + x = cstrip(x,"()|?") + if not x: + continue + + mybn = os.path.basename(x) + if mybn not in bn_list: + bn_list += [mybn] + else: + continue + + if mybn not in md5sums.keys(): + portage_util.writemsg("Missing md5sum: %s in %s\n" % (mybn, mycpv)) + else: + if mybn in md5_list.keys(): + if (md5_list[mybn]["MD5"] != md5sums[mybn]["MD5"]) or \ + (md5_list[mybn]["size"] != md5sums[mybn]["size"]): + + # This associates teh md5 with each file. [md5/size] + md5joins = string.split(md5_list[mybn][2],",") + md5joins = string.join(md5joins," ["+md5_list[mybn][0]+"/"+md5_list[mybn][1]+"],") + md5joins += " ["+md5_list[mybn][0]+"/"+md5_list[mybn][1]+"]" + + portage.writemsg("Colliding md5: %s of %s [%s/%s] and %s\n" % (mybn,mycpv,md5sums[mybn][0],md5sums[mybn][1],md5joins)) + col_list += [mybn] + else: + md5_list[mybn][2] += ","+mycpv + else: + md5_list[mybn] = md5sums[mybn]+[mycpv] + del md5sums[mybn] + + #portage.writemsg(str(bn_list)+"\n") + for x in md5sums.keys(): + if x not in bn_list: + portage.writemsg("Extra md5sum: %s in %s\n" % (x, mycpv)) + + +print col_list +print +print str(len(md5_list.keys()))+" unique distfile md5s." +print str(len(bn_list))+" unique distfile names." diff --git a/bin/md5check.sh b/bin/md5check.sh new file mode 100755 index 000000000..a4f9f3fda --- /dev/null +++ b/bin/md5check.sh @@ -0,0 +1,31 @@ +#!/bin/bash +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-src/portage/bin/md5check.sh,v 1.2 2004/10/04 13:56:50 vapier Exp $ + +# pipe in the data. + +sort -u - > md5check.tmp +grep '^Extra' md5check.tmp > md5check.tmp.extra +grep '^Missing' md5check.tmp > md5check.tmp.missing +grep '^Coll' md5check.tmp > md5check.tmp.colliding + +sed -i " +s:^Col:\nCol: +s:,:\n :g +s: of :\n :g +s: and :\n :g" md5check.tmp.colliding +sed -i "s/^[^ ]\+ md5sum: \(.*\) in \(.*\)$/ \2: \1/g" md5check.tmp.missing +sed -i "s/^[^ ]\+ md5sum: \(.*\) in \(.*\)$/ \2: \1/g" md5check.tmp.extra + +#echo "Colliding files:" > md5check.colliding +#sort -u md5check.tmp.colliding >> md5check.colliding +cp md5check.tmp.colliding md5check.colliding + +echo "Missing from digest:" > md5check.missing +sort -u md5check.tmp.missing >> md5check.missing + +echo "Extra files in digest:" > md5check.extra +sort -u md5check.tmp.extra >> md5check.extra + +rm md5check.tmp* diff --git a/bin/mirror.py b/bin/mirror.py new file mode 100755 index 000000000..1e08574a4 --- /dev/null +++ b/bin/mirror.py @@ -0,0 +1,167 @@ +#!/usr/bin/python -O +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-src/portage/bin/mirror.py,v 1.3 2004/10/10 10:07:20 carpaski Exp $ + +# Defines the number of threads carrying out the downloading. +maxsems=5 + +import os,sys,string +os.environ["PORTAGE_CALLER"]="mirror" +os.environ["FEATURES"]="mirror cvs" +sys.path = ["/usr/lib/portage/pym"]+sys.path + +import portage +from threading import * +from output import red,green,blue,bold +from random import shuffle +from time import sleep + + +def cstrip(mystr,mychars): + newstr = "" + for x in mystr: + if x not in mychars: + newstr += x + return newstr + +class fetcher(Thread): + def __init__(self, filename, urilist, dest, md5sum): + self.filename = filename + self.myurilist = urilist + self.myuri = None + self.mydest = dest + self.destpath = self.mydest+"/"+self.filename + self.md5sum = md5sum + self.result = None + Thread.__init__(self) + + def fetch(self): + #print "Started",self.filename + sys.stderr.write(".") + sys.stderr.flush() + portage.spawn("wget -q -P "+str(self.mydest)+" "+self.myuri, free=1) + + def finished(self): + if os.path.exists(self.destpath) and self.md5sum: + ok,reason = portage_checksum.verify_all(self.destpath, md5sum) + if not ok: + portage_util.writemsg("Failed verification:" + reason + "\n") + return 1 + return 0 + + def delete(self): + if os.path.exists(self.destpath): + #print "Unlink:",self.destpath + os.unlink(self.destpath) + + def run(self): + if not self.finished(): + self.delete() + + while not self.finished(): + if self.myurilist: + self.myuri = self.myurilist.pop(0)+"/"+self.filename + self.fetch() + else: + self.delete() + self.result = 0 + #print "Failed:",self.filename + return 1 + + #print "Finished:",self.filename + self.result = 1 + return 0 + + +uri_list = {} +fetchers = [] +fetcher_sem = BoundedSemaphore(value=maxsems) +failures = 0 +successes = 0 + +def clean_fetchers(): + global fetcher_sem,fetchers,uri_list,failures,successes,maxsems + while len(fetchers) == maxsems: + for x in fetchers: + if not x.isAlive(): + failures += (x.result == 0) + successes += (x.result == 1) + if x.filename in uri_list.keys(): + del uri_list[x.filename] + del fetchers[fetchers.index(x)] + fetcher_sem.release() + if len(fetchers) == maxsems: + sleep(1) + + +def start_fetcher(fname, urilist, dest, md5sum): + global fetcher_sem,fetchers,uri_list,failures,successes + fetcher_sem.acquire() + fetchers.append(fetcher(fname, urilist, dest, md5sum)) + fetchers[-1].start() + + +tpm = portage.thirdpartymirrors +destdir = portage.settings["DISTDIR"][:] + +hugelist = [] +for mycp in portage.db["/"]["porttree"].dbapi.cp_all(): + hugelist += portage.db["/"]["porttree"].dbapi.cp_list(mycp) +shuffle(hugelist) + +mycount = -1 +for mycpv in hugelist: + pv = string.split(mycpv, "/")[-1] + + clean_fetchers() + + mycount += 1 + 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 = string.split(newuri) + + digestpath = portage.db["/"]["porttree"].dbapi.findname(mycpv) + digestpath = os.path.dirname(digestpath)+"/files/digest-"+pv + md5sums = portage.digestParseFile(digestpath) + + for x in newuri: + clean_fetchers() + if not x: + continue + if (x in [")","(",":","||"]) or (x[-1] == "?"): + # ignore it. :) + continue + x = cstrip(x,"()|?") + if not x: + continue + mybn = os.path.basename(x) + mydn = os.path.dirname(x) + if mybn not in uri_list.keys(): + if (len(mybn) > len("mirror://")) and (mybn[:len("mirror://")] == "mirror://"): + mysite = string.split(x[len("mirror://"):], "/")[0] + shuffle(tpm[mysite]) + uri_list[mybn] = tpm[mysite][:] + else: + uri_list[mybn] = [os.path.dirname(x)] + clean_fetchers() + if (not md5sums) or (mybn not in md5sums.keys()): + start_fetcher(mybn, uri_list[mybn], destdir, None) + else: + start_fetcher(mybn, uri_list[mybn], destdir, md5sums[mybn]) + else: + break + +sys.stderr.write("\n\nWaiting last set\n") +sys.stderr.flush() +while fetchers: + if fetchers[0].isAlive(): + fetchers[0].join() + clean_fetchers() + +print +print +print "Successes:",successes +print "Failures: ",failures diff --git a/bin/newbin b/bin/newbin new file mode 100755 index 000000000..6c7904cd8 --- /dev/null +++ b/bin/newbin @@ -0,0 +1,13 @@ +#!/bin/bash +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-src/portage/bin/newbin,v 1.7 2004/10/04 13:56:50 vapier Exp $ + +if [ -z "${T}" ] || [ -z "${2}" ] ; then + echo "Nothing defined to do." + exit 1 +fi + +rm -rf "${T}/${2}" +cp "${1}" "${T}/${2}" +dobin "${T}/${2}" diff --git a/bin/newconfd b/bin/newconfd new file mode 100755 index 000000000..662b40ede --- /dev/null +++ b/bin/newconfd @@ -0,0 +1,13 @@ +#!/bin/bash +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-src/portage/bin/newconfd,v 1.2 2004/10/04 13:56:50 vapier Exp $ + +if [ -z "${T}" ] || [ -z "${2}" ] ; then + echo "Nothing defined to do." + exit 1 +fi + +rm -rf "${T}/${2}" +cp "${1}" "${T}/${2}" +doconfd "${T}/${2}" diff --git a/bin/newdoc b/bin/newdoc new file mode 100755 index 000000000..a3c43a2ff --- /dev/null +++ b/bin/newdoc @@ -0,0 +1,13 @@ +#!/bin/bash +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-src/portage/bin/newdoc,v 1.7 2004/10/04 13:56:50 vapier Exp $ + +if [ -z "${T}" ] || [ -z "${2}" ] ; then + echo "Nothing defined to do." + exit 1 +fi + +rm -rf "${T}/${2}" +cp "${1}" "${T}/${2}" +dodoc "${T}/${2}" diff --git a/bin/newenvd b/bin/newenvd new file mode 100755 index 000000000..0ceec650f --- /dev/null +++ b/bin/newenvd @@ -0,0 +1,13 @@ +#!/bin/bash +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-src/portage/bin/newenvd,v 1.2 2004/10/04 13:56:50 vapier Exp $ + +if [ -z "${T}" ] || [ -z "${2}" ] ; then + echo "Nothing defined to do." + exit 1 +fi + +rm -rf "${T}/${2}" +cp "${1}" "${T}/${2}" +doenvd "${T}/${2}" diff --git a/bin/newexe b/bin/newexe new file mode 100755 index 000000000..a2585b3f5 --- /dev/null +++ b/bin/newexe @@ -0,0 +1,13 @@ +#!/bin/bash +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-src/portage/bin/newexe,v 1.7 2004/10/04 13:56:50 vapier Exp $ + +if [ -z "${T}" ] || [ -z "${2}" ] ; then + echo "Nothing defined to do." + exit 1 +fi + +rm -rf "${T}/${2}" +cp "${1}" "${T}/${2}" +doexe "${T}/${2}" diff --git a/bin/newinitd b/bin/newinitd new file mode 100755 index 000000000..cb23dd798 --- /dev/null +++ b/bin/newinitd @@ -0,0 +1,13 @@ +#!/bin/bash +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-src/portage/bin/newinitd,v 1.2 2004/10/04 13:56:50 vapier Exp $ + +if [ -z "${T}" ] || [ -z "${2}" ] ; then + echo "Nothing defined to do." + exit 1 +fi + +rm -rf "${T}/${2}" +cp "${1}" "${T}/${2}" +doinitd "${T}/${2}" diff --git a/bin/newins b/bin/newins new file mode 100755 index 000000000..965ff94b3 --- /dev/null +++ b/bin/newins @@ -0,0 +1,13 @@ +#!/bin/bash +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-src/portage/bin/newins,v 1.7 2004/10/04 13:56:50 vapier Exp $ + +if [ -z "${T}" ] || [ -z "${2}" ] ; then + echo "Error: Nothing defined to do." + exit 1 +fi + +rm -rf "${T}/${2}" +cp "${1}" "${T}/${2}" +doins "${T}/${2}" diff --git a/bin/newlib.a b/bin/newlib.a new file mode 100755 index 000000000..3ec62a3e9 --- /dev/null +++ b/bin/newlib.a @@ -0,0 +1,13 @@ +#!/bin/bash +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-src/portage/bin/newlib.a,v 1.7 2004/10/04 13:56:50 vapier Exp $ + +if [ -z "${T}" ] || [ -z "${2}" ] ; then + echo "Error: Nothing defined to do." + exit 1 +fi + +rm -rf "${T}/${2}" +cp "${1}" "${T}/${2}" +dolib.a "${T}/${2}" diff --git a/bin/newlib.so b/bin/newlib.so new file mode 100755 index 000000000..aa9f9a174 --- /dev/null +++ b/bin/newlib.so @@ -0,0 +1,13 @@ +#!/bin/bash +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-src/portage/bin/newlib.so,v 1.7 2004/10/04 13:56:50 vapier Exp $ + +if [ -z "${T}" ] || [ -z "${2}" ] ; then + echo "Error: Nothing defined to do." + exit 1 +fi + +rm -rf "${T}/${2}" +cp "${1}" "${T}/${2}" +dolib.so "${T}/${2}" diff --git a/bin/newman b/bin/newman new file mode 100755 index 000000000..227411a56 --- /dev/null +++ b/bin/newman @@ -0,0 +1,13 @@ +#!/bin/bash +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-src/portage/bin/newman,v 1.7 2004/10/04 13:56:50 vapier Exp $ + +if [ -z "${T}" ] || [ -z "${2}" ] ; then + echo "Nothing defined to do." + exit 1 +fi + +rm -rf "${T}/${2}" +cp "${1}" "${T}/${2}" +doman "${T}/${2}" diff --git a/bin/newsbin b/bin/newsbin new file mode 100755 index 000000000..eadfba220 --- /dev/null +++ b/bin/newsbin @@ -0,0 +1,13 @@ +#!/bin/bash +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-src/portage/bin/newsbin,v 1.7 2004/10/04 13:56:50 vapier Exp $ + +if [ -z "${T}" ] || [ -z "${2}" ] ; then + echo "Nothing defined to do." + exit 1 +fi + +rm -rf "${T}/${2}" +cp "${1}" "${T}/${2}" +dosbin "${T}/${2}" diff --git a/bin/pemerge.py b/bin/pemerge.py new file mode 100755 index 000000000..08de6eda3 --- /dev/null +++ b/bin/pemerge.py @@ -0,0 +1,44 @@ +#!/usr/bin/python -O + +import profile,time,sys,os +sys.path = ["/usr/lib/portage/bin","/usr/lib/portage/pym"]+sys.path + +def clock(): + return time.time() +profile.time.clock = clock + +profile.run("import emerge", os.getcwd()+"/prof") + +class StatsProcesser: + def __init__(self, stats): + self.output = [] + self.last = "" + import sys + sys.stdout = self + stats.print_stats() + sys.stdout = sys.__stdout__ + funcs = ["?"] + for line in self.output: + spline = line.split() + if len(spline) == 6 and spline[0][0].isdigit(): + func = spline[5][spline[5].index("(")+1:-1] + print line + if func not in funcs: + funcs.append(func) + func = "\\(" + func + "\\)" + stats.print_callers(func) + + def write(self, text): + new = self.last + text + new = new.split("\n") + if len(new) > 1: + self.output += new[:-1] + self.last = new[-1] + +import pstats +p = pstats.Stats("prof") +dir(p) +p.sort_stats("time") +p.print_stats() + +sp = StatsProcesser(p) diff --git a/bin/pkgmerge b/bin/pkgmerge new file mode 100755 index 000000000..2bbb5f680 --- /dev/null +++ b/bin/pkgmerge @@ -0,0 +1,59 @@ +#!/usr/bin/python +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-src/portage/bin/pkgmerge,v 1.8 2004/10/04 13:56:50 vapier Exp $ + +import sys,os,string +sys.path = ["/usr/lib/portage/pym"]+sys.path + +import portage,xpak + +#build our package digraph + +def digraph_create(digraph,mykey,myprovides=None): + mytbz2=xpak.tbz2(bintree.getname(mykey)) + mydep=mytbz2.getelements("RDEPEND") + digraph.addnode(mykey,myprovides) + mycheck=roottree.depcheck(string.join(mydep," ")) + if mycheck[0]==0: + print "!!! Error: RDEPEND string formatted incorrectly:",mydep + return None + for x in mycheck[1]: + mymatch=bintree.dep_bestmatch(x) + if mymatch=="": + print "!!! Error: can't resolve dependency --",x + return None + if not digraph_create(digraph,mymatch,mykey): + return None + return 1 + +#main program loop +myvirtuals=portage.getvirtuals(portage.root) +roottree=portage.vartree(portage.root,myvirtuals) +bintree=portage.binarytree("/",myvirtuals) +pretend=0 +if len(sys.argv)>=2: + if sys.argv[1]=="--pretend": + print "These are the packages that I would merge, in order:" + pretend=1 + del sys.argv[1] + elif sys.argv[1]=="--help": + print "Usage: pkgmerge [--pretend] pkg1.tbz2 [pkg2.tbz2]..." + sys.exit(1) +for mypkg in sys.argv[1:]: + digraph=portage.digraph() + mytbz2=xpak.tbz2(mypkg) + mykey=mytbz2.getelements("CATEGORY")[0]+"/"+os.path.basename(mypkg)[:-5] + digraph_create(digraph,mykey) + while not digraph.empty(): + mykey=digraph.firstzero() + if not mykey: + print "!!! Error: circular dependencies" + sys.exit(1) + mytbz2=bintree.getname(mykey) + if pretend: + print mytbz2 + else: + portage.pkgmerge(mytbz2,portage.settings["ROOT"]) + digraph.delnode(mykey) + diff --git a/bin/pkgmerge.new b/bin/pkgmerge.new new file mode 100755 index 000000000..66dbe1676 --- /dev/null +++ b/bin/pkgmerge.new @@ -0,0 +1,84 @@ +#!/usr/bin/python +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-src/portage/bin/pkgmerge.new,v 1.7 2004/10/04 13:56:50 vapier Exp $ + +import os,string,sys +sys.path = ["/usr/lib/portage/pym"]+sys.path + +import portage,xpak + +#beautiful directed graph functions + +def dig_addnode(digraph,mykey,myprovides): + if not digraph.has_key(mykey): + if myprovides==None: + digraph[mykey]=[0,[]] + else: + digraph[mykey]=[0,[myprovides]] + digraph[myprovides][0]=digraph[myprovides][0]+1 + return + digraph[mykey]=[digraph[mykey][0],digraph[mykey][1].append(myprovides)] + +def dig_delnode(digraph,mykey): + if not digraph.has_key(mykey): + return + for x in digraph[mykey][1]: + digraph[x][0]=digraph[x][0]-1 + del digraph[mykey] + +def dig_firstzero(digraph): + for x in digraph.keys(): + if digraph[x][0]==0: + return x + return None + +#build our package digraph + +def digraph_create(digraph,mykey,myprovides=None): + mytbz2=xpak.tbz2(bintree.getname(mykey)) + mydep=mytbz2.getelements("RDEPEND") + dig_addnode(digraph,mykey,myprovides) + mycheck=roottree.depcheck(string.join(mydep," ")) + if mycheck[0]==0: + print "!!! Error: RDEPEND string formatted incorrectly:",mydep + return None + for x in mycheck[1]: + mymatch=bintree.dep_bestmatch(x) + if mymatch=="": + print "!!! Error: can't resolve dependency --",x + return None + if not digraph_create(digraph,mymatch,mykey): + return None + return 1 + +#main program loop +myvirtuals=portage.getvirtual(portage.root) +roottree=portage.vartree(portage.root,myvirtuals) +bintree=portage.binarytree("/",myvirtuals) +pretend=0 +if len(sys.argv)>=2: + if sys.argv[1]=="--pretend": + print "These are the packages that I would merge, in order:" + pretend=1 + del sys.argv[1] + elif sys.argv[1]=="--help": + print "Usage: pkgmerge [--pretend] pkg1.tbz2 [pkg2.tbz2]..." + sys.exit(1) +for mypkg in sys.argv[1:]: + digraph={} + mytbz2=xpak.tbz2(mypkg) + mykey=mytbz2.getelements("CATEGORY")[0]+"/"+mypkg[:-5] + digraph_create(digraph,mykey) + while (len(digraph)): + mykey=dig_firstzero(digraph) + if not mykey: + print "!!! Error: circular dependencies" + sys.exit(1) + mytbz2=bintree.getname(mykey) + if pretend: + print mytbz2 + else: + portage.pkgmerge(mytbz2) + dig_delnode(digraph,mykey) + diff --git a/bin/pkgname b/bin/pkgname new file mode 100755 index 000000000..22be6f1da --- /dev/null +++ b/bin/pkgname @@ -0,0 +1,17 @@ +#!/usr/bin/python +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-src/portage/bin/pkgname,v 1.8 2004/10/04 13:56:50 vapier Exp $ + +import sys +sys.path = ["/usr/lib/portage/pym"]+sys.path + +import portage + +a=portage.pkgsplit(sys.argv[1]) +if a: + print a[0],a[1],a[2][1:] + sys.exit(0) +else: + print '!!! Error: package name is invalid.' + sys.exit(1) diff --git a/bin/portage_gpg_update.sh b/bin/portage_gpg_update.sh new file mode 100755 index 000000000..a20d9bc1b --- /dev/null +++ b/bin/portage_gpg_update.sh @@ -0,0 +1,6 @@ +#!/bin/bash +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-src/portage/bin/portage_gpg_update.sh,v 1.2 2004/10/04 13:56:50 vapier 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 diff --git a/bin/portageq b/bin/portageq new file mode 100755 index 000000000..6bd6c402e --- /dev/null +++ b/bin/portageq @@ -0,0 +1,256 @@ +#!/usr/bin/python -O +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-src/portage/bin/portageq,v 1.13.2.1 2005/04/12 12:23:41 jstubbs Exp $ + +import sys, os +os.environ["PORTAGE_CALLER"] = "portageq" +sys.path = ["/usr/lib/portage/pym"]+sys.path + +import portage,types,string + + +#----------------------------------------------------------------------------- +# +# To add functionality to this tool, add a function below. +# +# The format for functions is: +# +# def function(argv): +# """ +# +# """ +# +# +# "argv" is an array of the command line parameters provided after the command. +# +# Make sure you document the function in the right format. The documentation +# is used to display help on the function. +# +# You do not need to add the function to any lists, this tool is introspective, +# and will automaticly add a command by the same name as the function! +# + + +def has_version(argv): + """ + Return code 0 if it's available, 1 otherwise. + """ + if (len(argv) < 2): + print "ERROR: insufficient parameters!" + sys.exit(2) + try: + mylist=portage.db[argv[0]]["vartree"].dbapi.match(argv[1]) + if mylist: + sys.exit(0) + else: + sys.exit(1) + except KeyError: + sys.exit(1) + + +def best_version(argv): + """ + Returns category/package-version (without .ebuild). + """ + if (len(argv) < 2): + print "ERROR: insufficient parameters!" + sys.exit(2) + try: + mylist=portage.db[argv[0]]["vartree"].dbapi.match(argv[1]) + print portage.best(mylist) + except KeyError: + sys.exit(1) + + +def mass_best_version(argv): + """ []+ + Returns category/package-version (without .ebuild). + """ + if (len(argv) < 2): + print "ERROR: insufficient parameters!" + sys.exit(2) + try: + for pack in argv[1:]: + mylist=portage.db[argv[0]]["vartree"].dbapi.match(pack) + print pack+":"+portage.best(mylist) + except KeyError: + sys.exit(1) + + +def best_visible(argv): + """ []+ + Returns category/package-version (without .ebuild). + """ + if (len(argv) < 2): + print "ERROR: insufficient parameters!" + sys.exit(2) + try: + mylist=portage.db[argv[0]]["porttree"].dbapi.match(argv[1]) + print portage.best(mylist) + except KeyError: + sys.exit(1) + + +def mass_best_visible(argv): + """ []+ + Returns category/package-version (without .ebuild). + """ + if (len(argv) < 2): + print "ERROR: insufficient parameters!" + sys.exit(2) + try: + for pack in argv[1:]: + mylist=portage.db[argv[0]]["porttree"].dbapi.match(pack) + print pack+":"+portage.best(mylist) + except KeyError: + sys.exit(1) + + +def all_best_visible(argv): + """ + Returns all best_visible packages (without .ebuild). + """ + if (len(argv) < 1): + print "ERROR: insufficient parameters!" + + #print portage.db[argv[0]]["porttree"].dbapi.cp_all() + for pkg in portage.db[argv[0]]["porttree"].dbapi.cp_all(): + mybest=portage.best(portage.db[argv[0]]["porttree"].dbapi.match(pkg)) + if mybest: + print mybest + +def match(argv): + """ + Returns \n seperated list of category/package-version + """ + if (len(argv) < 2): + print "ERROR: insufficient parameters!" + sys.exit(2) + try: + print string.join(portage.db[argv[0]]["vartree"].dbapi.match(argv[1]),"\n") + except KeyError: + sys.exit(1) + + +def vdb_path(argv): + """ + Returns the path used for the var(installed) package database for the + set environment/configuration options. + """ + print portage.root+portage.VDB_PATH + +def gentoo_mirrors(argv): + """ + Returns the mirrors set to use in the portage configuration. + """ + print portage.settings["GENTOO_MIRRORS"] + + +def portdir(argv): + """ + Returns the PORTDIR path as defined in the portage configuration. + """ + print portage.settings["PORTDIR"] + + +def config_protect(argv): + """ + Returns the CONFIG_PROTECT paths as defined in the portage configuration. + """ + print portage.settings["CONFIG_PROTECT"] + + +def config_protect_mask(argv): + """ + Returns the CONFIG_PROTECT_MASK paths as defined in the portage configuration. + """ + print portage.settings["CONFIG_PROTECT_MASK"] + + +def portdir_overlay(argv): + """ + Returns the PORTDIR_OVERLAY path as defined in the portage configuration. + """ + print portage.settings["PORTDIR_OVERLAY"] + + +def pkgdir(argv): + """ + Returns the PKGDIR path as defined in the portage configuration. + """ + print portage.settings["PKGDIR"] + + +def distdir(argv): + """ + Returns the DISTDIR path as defined in the portage configuration. + """ + print portage.settings["DISTDIR"] + + +def envvar(argv): + """ + Returns a specific environment variable as exists prior to ebuild.sh. + Similar to: emerge --verbose --info | egrep '^=' + """ + print portage.settings[argv[0]] + + +#----------------------------------------------------------------------------- +# +# DO NOT CHANGE CODE BEYOND THIS POINT - IT'S NOT NEEDED! +# + +def usage(): + rev="$Revision: 1.13.2.1 $" + ver=string.split(rev, ' ')[1] + print ">>> Portage information query tool -- version "+ver + print ">>> Usage: portageq [