darwinfiles-cvs Mailing List for The Darwin Files (Page 3)
Status: Alpha
Brought to you by:
jimmacr
You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(94) |
Sep
(115) |
Oct
|
Nov
|
Dec
|
---|
From: <ji...@us...> - 2002-09-16 13:02:32
|
Update of /cvsroot/darwinfiles/packagetree/sys-apps/groff In directory usw-pr-cvs1:/tmp/cvs-serv25569 Modified Files: groff-1.17.2-r1.ebuild Log Message: Patching For Darwin Index: groff-1.17.2-r1.ebuild =================================================================== RCS file: /cvsroot/darwinfiles/packagetree/sys-apps/groff/groff-1.17.2-r1.ebuild,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** groff-1.17.2-r1.ebuild 16 Sep 2002 13:02:09 -0000 1.2 --- groff-1.17.2-r1.ebuild 16 Sep 2002 13:02:29 -0000 1.3 *************** *** 11,15 **** LICENSE="GPL-2" ! DEPEND="virtual/glibc" src_compile() { --- 11,15 ---- LICENSE="GPL-2" ! DEPEND="" src_compile() { |
From: <ji...@us...> - 2002-09-16 13:02:12
|
Update of /cvsroot/darwinfiles/packagetree/sys-apps/groff In directory usw-pr-cvs1:/tmp/cvs-serv25462 Modified Files: groff-1.17.2-r1.ebuild Log Message: Patching For Darwin Index: groff-1.17.2-r1.ebuild =================================================================== RCS file: /cvsroot/darwinfiles/packagetree/sys-apps/groff/groff-1.17.2-r1.ebuild,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** groff-1.17.2-r1.ebuild 16 Sep 2002 13:00:09 -0000 1.1 --- groff-1.17.2-r1.ebuild 16 Sep 2002 13:02:09 -0000 1.2 *************** *** 7,11 **** SRC_URI="ftp://gatekeeper.dec.com/pub/GNU/groff/${P}.tar.gz" HOMEPAGE="http://www.gnu.org/software/groff/groff.html" ! KEYWORDS="x86 ppc sparc sparc64" SLOT="0" LICENSE="GPL-2" --- 7,11 ---- SRC_URI="ftp://gatekeeper.dec.com/pub/GNU/groff/${P}.tar.gz" HOMEPAGE="http://www.gnu.org/software/groff/groff.html" ! KEYWORDS="ppc" SLOT="0" LICENSE="GPL-2" |
From: <ji...@us...> - 2002-09-16 13:01:38
|
Update of /cvsroot/darwinfiles/packagetree/sys-apps/groff In directory usw-pr-cvs1:/tmp/cvs-serv25256 Modified Files: groff-1.16.1-r1.ebuild Log Message: Patching For Darwin Index: groff-1.16.1-r1.ebuild =================================================================== RCS file: /cvsroot/darwinfiles/packagetree/sys-apps/groff/groff-1.16.1-r1.ebuild,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** groff-1.16.1-r1.ebuild 16 Sep 2002 13:00:09 -0000 1.1 --- groff-1.16.1-r1.ebuild 16 Sep 2002 13:01:34 -0000 1.2 *************** *** 7,13 **** SRC_URI="ftp://prep.ai.mit.edu/gnu/groff/${P}.tar.gz" HOMEPAGE="http://www.gnu.org/software/groff/groff.html" ! KEYWORDS="x86 ppc sparc sparc64" SLOT="0" ! DEPEND="virtual/glibc" LICENSE="GPL-2" --- 7,13 ---- SRC_URI="ftp://prep.ai.mit.edu/gnu/groff/${P}.tar.gz" HOMEPAGE="http://www.gnu.org/software/groff/groff.html" ! KEYWORDS="ppc" SLOT="0" ! DEPEND="" LICENSE="GPL-2" |
From: <ji...@us...> - 2002-09-16 13:00:37
|
Update of /cvsroot/darwinfiles/packagetree/sys-apps/groff/files In directory usw-pr-cvs1:/tmp/cvs-serv24960 Added Files: digest-groff-1.16.1-r1 digest-groff-1.17.2-r1 digest-groff-1.17.2-r2 digest-groff-1.18 digest-groff-1.18-r1 groff-1.17.2-infoext.patch groff-1.18-infoext.patch Log Message: Importing Groff --- NEW FILE: digest-groff-1.16.1-r1 --- MD5 f5dfb985bd890fd6dcd95b138935a9ad groff-1.16.1.tar.gz 1447807 --- NEW FILE: digest-groff-1.17.2-r1 --- MD5 9564e58e553e7a8d4c6e73a782f296ce groff-1.17.2.tar.gz 1503169 --- NEW FILE: digest-groff-1.17.2-r2 --- MD5 9564e58e553e7a8d4c6e73a782f296ce groff-1.17.2.tar.gz 1503169 --- NEW FILE: digest-groff-1.18 --- MD5 31474119d1ef2ded0bd0692132d50d05 groff-1.18.tar.gz 2199488 --- NEW FILE: digest-groff-1.18-r1 --- MD5 31474119d1ef2ded0bd0692132d50d05 groff-1.18.tar.gz 2199488 --- NEW FILE: groff-1.17.2-infoext.patch --- --- groff-1.17.2/doc/Makefile.orig Mon Jul 29 17:41:44 2002 +++ groff-1.17.2/doc/Makefile Mon Jul 29 17:42:06 2002 @@ -65,7 +65,7 @@ .texinfo.dvi: texi2dvi -e $< -groff: groff.texinfo +groff.info: groff.texinfo makeinfo groff.texinfo install: --- groff-1.17.2/doc/groff.texinfo.orig Mon Jul 29 17:41:24 2002 +++ groff-1.17.2/doc/groff.texinfo Mon Jul 29 17:41:37 2002 @@ -6,7 +6,7 @@ @c @c %**start of header (This is for running Texinfo on a region.) -@setfilename groff +@setfilename groff.info @settitle The GNU Troff Manual @setchapternewpage odd @footnotestyle separate --- NEW FILE: groff-1.18-infoext.patch --- --- groff-1.18/doc/Makefile.in.orig Mon Jul 29 12:50:04 2002 +++ groff-1.18/doc/Makefile.in Mon Jul 29 12:54:49 2002 @@ -104,7 +104,7 @@ prepare_examples: grnexmpl.g test -f grnexmpl.g || cp $(srcdir)/grnexmpl.g . -groff: groff.texinfo +groff.info: groff.texinfo $(MAKEINFO) -I$(srcdir) $(srcdir)/groff.texinfo gnu.eps: gnu.xpm --- groff-1.18/doc/groff.texinfo.orig Mon Jul 29 12:48:56 2002 +++ groff-1.18/doc/groff.texinfo Mon Jul 29 12:49:07 2002 @@ -8,7 +8,7 @@ @c @c %**start of header (This is for running Texinfo on a region.) -@setfilename groff +@setfilename groff.info @settitle The GNU Troff Manual @setchapternewpage odd @footnotestyle separate |
Update of /cvsroot/darwinfiles/packagetree/sys-apps/groff In directory usw-pr-cvs1:/tmp/cvs-serv24769 Added Files: ChangeLog groff-1.16.1-r1.ebuild groff-1.17.2-r1.ebuild groff-1.17.2-r2.ebuild groff-1.18-r1.ebuild groff-1.18.ebuild Log Message: Importing Groff --- NEW FILE: ChangeLog --- # ChangeLog for sys-apps/groff # Copyright 2002 Gentoo Technologies, Inc.; Distributed under the GPL # $Header: /cvsroot/darwinfiles/packagetree/sys-apps/groff/ChangeLog,v 1.1 2002/09/16 13:00:09 jimmacr Exp $ *groff-1.18-r1 (29 Jul 2002) *groff-1.17.2-r2 (29 Jul 2002) 29 Jul 2002; Martin Schlemmer <az...@ge...> groff-1.18-r1, groff-1.17.2-r2 : Some build Cleanups. Enable build of xditview if "X" in USE, and X is actually installed. We cannot make it depend on X, as X depends on perl, which in turn depend on groff and will cause circular depends. Enable the install of info pages, and also fix thier extension to .info, else they do not get gzipped. Also fixed 0.18 to install its docs/examples in the right place. *groff-1.18 (24 Jul 2002) 24 Jul 2002; Daniel Ahlberg <al...@ge...> groff-1.18.ebuild : New version. *groff-1.16.1-r1.ebuild (14 July 2002) 14 Jul 2002; phoen][x <ph...@ge...> groff-1.16.1-r1.ebuild : Added KEYWORDS, SLOT. *groff-1.17.2-r1 (1 Feb 2002) 14 Jul 2002; phoen][x <ph...@ge...> groff-1.17.2-r1.ebuild : Added KEYWORDS, SLOT. 1 Feb 2002; G.Bevin <gb...@ge...> ChangeLog : Added initial ChangeLog which should be updated whenever the package is updated in any way. This changelog is targetted to users. This means that the comments should well explained and written in clean English. The details about writing correct changelogs are explained in the skel.ChangeLog file which you can find in the root directory of the portage repository. --- NEW FILE: groff-1.16.1-r1.ebuild --- # Copyright 1999-2002 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License, v2 or later # $Header: /cvsroot/darwinfiles/packagetree/sys-apps/groff/groff-1.16.1-r1.ebuild,v 1.1 2002/09/16 13:00:09 jimmacr Exp $ S=${WORKDIR}/${P} DESCRIPTION="Text formatter used for man pages" SRC_URI="ftp://prep.ai.mit.edu/gnu/groff/${P}.tar.gz" HOMEPAGE="http://www.gnu.org/software/groff/groff.html" KEYWORDS="x86 ppc sparc sparc64" SLOT="0" DEPEND="virtual/glibc" LICENSE="GPL-2" src_compile() { ./configure --host=${CHOST} --prefix=/usr --mandir=/usr/share/man || die # emake doesn't work make || die } src_install() { dodir /usr make prefix=${D}/usr manroot=${D}/usr/share/man install || die dodoc NEWS PROBLEMS PROJECTS README TODO VERSION BUG-REPORT COPYING ChangeLog FDL MORE.STUFF REVISION } --- NEW FILE: groff-1.17.2-r1.ebuild --- # Copyright 1999-2002 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License, v2 or later # $Header: /cvsroot/darwinfiles/packagetree/sys-apps/groff/groff-1.17.2-r1.ebuild,v 1.1 2002/09/16 13:00:09 jimmacr Exp $ S=${WORKDIR}/${P} DESCRIPTION="Text formatter used for man pages" SRC_URI="ftp://gatekeeper.dec.com/pub/GNU/groff/${P}.tar.gz" HOMEPAGE="http://www.gnu.org/software/groff/groff.html" KEYWORDS="x86 ppc sparc sparc64" SLOT="0" LICENSE="GPL-2" DEPEND="virtual/glibc" src_compile() { ./configure --host=${CHOST} --prefix=/usr --mandir=/usr/share/man || die # emake doesn't work make || die } src_install() { dodir /usr make prefix=${D}/usr manroot=${D}/usr/share/man install || die cd ${D}/usr/bin #the following links are required for xman ln -s eqn geqn ln -s tbl gtbl ln -s soelim zsoelim dodoc NEWS PROBLEMS PROJECTS README TODO VERSION BUG-REPORT \ COPYING ChangeLog FDL MORE.STUFF REVISION } --- NEW FILE: groff-1.17.2-r2.ebuild --- # Copyright 1999-2002 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 # $Header: /cvsroot/darwinfiles/packagetree/sys-apps/groff/groff-1.17.2-r2.ebuild,v 1.1 2002/09/16 13:00:11 jimmacr Exp $ S=${WORKDIR}/${P} DESCRIPTION="Text formatter used for man pages" SRC_URI="ftp://gatekeeper.dec.com/pub/GNU/groff/${P}.tar.gz" HOMEPAGE="http://www.gnu.org/software/groff/groff.html" KEYWORDS="x86 sparc sparc64" SLOT="0" LICENSE="GPL-2" DEPEND="virtual/glibc" src_unpack() { unpack ${A} # Fix the info pages to have .info extensions, # else they do not get gzipped. cd ${S} patch -p1 < ${FILESDIR}/${P}-infoext.patch || die } src_compile() { # Fix problems with not finding g++ [ -z "${CC}" ] && export CC="gcc" [ -z "${CXX}" ] && export CXX="g++" ./configure --host=${CHOST} \ --prefix=/usr \ --mandir=/usr/share/man || die # emake doesn't work make || die # do the info pages. this is only needed for 1.17*, # as 1.18 do install its info pages cd ${S}/doc make groff.info || die # Only build X stuff if we have X installed, but do # not depend on it, else we get circular deps. if [ -n "`use X`" ] && [ -x /usr/X11R6/bin/xmkmf ] then cd ${S}/src/xditview xmkmf || die make depend all || die fi } src_install() { dodir /usr /usr/share/doc/${PF}/{examples,html} make prefix=${D}/usr \ manroot=${D}/usr/share/man \ docdir=${D}/usr/share/doc/${PF} \ install || die if [ -n "`use X`" ] && [ -x /usr/X11R6/bin/xmkmf ] then cd ${S}/src/xditview make DESTDIR=${D} \ BINDIR=/usr/bin \ MANPATH=/usr/share/man \ install \ install.man || die fi # the following links are required for xman dosym eqn /usr/bin/geqn dosym tbl /usr/bin/gtbl dosym soelim /usr/bin/zsoelim # this is only needed for 1.17*, as 1.18 # do install its info pages cd ${S}/doc doinfo groff.info* cd ${S} dodoc BUG-REPORT COPYING ChangeLog FDL MORE.STUFF NEWS \ PROBLEMS PROJECTS README REVISION TODO VERSION } --- NEW FILE: groff-1.18-r1.ebuild --- # Copyright 1999-2002 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 # $Header: /cvsroot/darwinfiles/packagetree/sys-apps/groff/groff-1.18-r1.ebuild,v 1.1 2002/09/16 13:00:11 jimmacr Exp $ S=${WORKDIR}/${P} DESCRIPTION="Text formatter used for man pages" SRC_URI="ftp://gatekeeper.dec.com/pub/GNU/groff/${P}.tar.gz" HOMEPAGE="http://www.gnu.org/software/groff/groff.html" KEYWORDS="x86 sparc sparc64" SLOT="0" LICENSE="GPL-2" DEPEND="virtual/glibc media-libs/netpbm" src_unpack() { unpack ${A} # Fix the info pages to have .info extensions, # else they do not get gzipped. cd ${S} patch -p1 < ${FILESDIR}/${P}-infoext.patch || die } src_compile() { # Fix problems with not finding g++ [ -z "${CC}" ] && export CC="gcc" [ -z "${CXX}" ] && export CXX="g++" ./configure --host=${CHOST} \ --prefix=/usr \ --mandir=/usr/share/man || die # emake doesn't work make || die # Only build X stuff if we have X installed, but do # not depend on it, else we get circular deps. if [ -n "`use X`" ] && [ -x /usr/X11R6/bin/xmkmf ] then cd ${S}/src/xditview xmkmf || die make depend all || die fi } src_install() { dodir /usr /usr/share/doc/${PF}/{examples,html} make prefix=${D}/usr \ manroot=${D}/usr/share/man \ docdir=${D}/usr/share/doc/${PF} \ install || die if [ -n "`use X`" ] && [ -x /usr/X11R6/bin/xmkmf ] then cd ${S}/src/xditview make DESTDIR=${D} \ BINDIR=/usr/bin \ MANPATH=/usr/share/man \ install \ install.man || die fi #the following links are required for xman dosym eqn /usr/bin/geqn dosym tbl /usr/bin/gtbl dosym soelim /usr/bin/zsoelim cd ${S} dodoc BUG-REPORT COPYING ChangeLog FDL MORE.STUFF NEWS \ PROBLEMS PROJECTS README REVISION TODO VERSION } --- NEW FILE: groff-1.18.ebuild --- # Copyright 1999-2002 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 # $Header: /cvsroot/darwinfiles/packagetree/sys-apps/groff/groff-1.18.ebuild,v 1.1 2002/09/16 13:00:11 jimmacr Exp $ S=${WORKDIR}/${P} DESCRIPTION="Text formatter used for man pages" SRC_URI="ftp://gatekeeper.dec.com/pub/GNU/groff/${P}.tar.gz" HOMEPAGE="http://www.gnu.org/software/groff/groff.html" KEYWORDS="x86 ppc sparc sparc64" SLOT="0" LICENSE="GPL-2" DEPEND="virtual/glibc media-libs/netpbm" src_compile() { ./configure --host=${CHOST} --prefix=/usr --mandir=/usr/share/man || die # emake doesn't work make || die } src_install() { dodir /usr make prefix=${D}/usr manroot=${D}/usr/share/man install || die cd ${D}/usr/bin #the following links are required for xman ln -s eqn geqn ln -s tbl gtbl ln -s soelim zsoelim dodoc NEWS PROBLEMS PROJECTS README TODO VERSION BUG-REPORT \ COPYING ChangeLog FDL MORE.STUFF REVISION } |
From: <ji...@us...> - 2002-09-16 12:59:53
|
Update of /cvsroot/darwinfiles/packagetree/sys-apps/groff/files In directory usw-pr-cvs1:/tmp/cvs-serv24619/files Log Message: Directory /cvsroot/darwinfiles/packagetree/sys-apps/groff/files added to the repository |
From: <ji...@us...> - 2002-09-16 12:35:57
|
Update of /cvsroot/darwinfiles/packagetree/sys-apps/groff In directory usw-pr-cvs1:/tmp/cvs-serv16383/groff Log Message: Directory /cvsroot/darwinfiles/packagetree/sys-apps/groff added to the repository |
From: <ji...@us...> - 2002-09-08 16:37:56
|
Update of /cvsroot/darwinfiles/portage/pym In directory usw-pr-cvs1:/tmp/cvs-serv4545 Removed Files: portage.py.new Log Message: A wandering file --- portage.py.new DELETED --- |
From: <ji...@us...> - 2002-09-08 16:37:00
|
Update of /cvsroot/darwinfiles/portage In directory usw-pr-cvs1:/tmp/cvs-serv3956 Modified Files: ChangeLog Log Message: Merged with portage-2.0.36 Index: ChangeLog =================================================================== RCS file: /cvsroot/darwinfiles/portage/ChangeLog,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** ChangeLog 11 Aug 2002 02:09:32 -0000 1.1.1.1 --- ChangeLog 8 Sep 2002 16:36:56 -0000 1.2 *************** *** 2,5 **** --- 2,215 ---- # Copyright 2002 Gentoo Technologies, Inc.; Distributed under the GPL v2 + *portage-2.0.36 (04 Sep 2002): Gentoo Linux 1.4_rc1 version + + 04 Sep 2002; Daniel Robbins <dro...@ge...> emerge: "--onlydeps" was + mostly broken since the most recent emerge code restructure. Now fixed, + closing bug #7442. + + 04 Sep 2002: Daniel Robbins <dro...@ge...> etc-update.conf: added + missing etc-update config file. + + 04 Sep 2002: Daniel Robbins <dro...@ge...> 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 <dro...@ge...> etc-update, + man/etc-update.1: new program for updating config files. + + 03 Sep 2002; Daniel Robbins <dro...@ge...> ebuild.sh: upgraded + inherit() to support $PORTDIR_OVERLAY, closing bug #6033. + + 03 Sep 2002; Daniel Robbins <dro...@ge...> emerge: calls to "cvs" now + use "-z3" compression option, closing bug #5982. + + 03 Sep 2002; Daniel Robbins <dro...@ge...> 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 <dro...@ge...> ebuild.sh: einstall now + sees "GNUmakefile", closing bug #4895. + + 03 Sep 2002; Daniel Robbins <dro...@ge...> ebuild.sh: typo fixes, + closing bug #7263. + + 03 Sep 2002; Daniel Robbins <dro...@ge...> portage.py: /var/tmp + creation now works even if /tmp already exists, closing bug #7376. + + 02 Sep 2002; Daniel Robbins <dro...@ge...> 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 <dro...@ge...>: 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 <az...@ge...> 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 <dan...@ge...> 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 <dro...@ge...> : some additional clean-ups + for the make.conf(.ppc) files. + + 30 Aug 2002; Daniel Robbins <dro...@ge...> 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 <dro...@ge...> 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 <ge...@ge...> 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 <dro...@ge...> emerge: favorites weren't + working since 2.0.30; they're working again now. This closes bug #7225. + + 29 Aug 2002; Phil Bordelon <sun...@ge...> 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 <dro...@ge...> 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 <dro...@ge...> 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 <dro...@ge...> 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 <dro...@ge...> portage.py, emerge: rewrote + gettimeval() as cpv_counter() and updated it to handle corrupt COUNTER files, + closing bug #6763. + + 28 Aug 2002; Daniel Robbins <dro...@ge...> emerge: "emerge search" now + displays information for masked packages if possible, closing bug #6823. + + 28 Aug 2002; Daniel Robbins <dro...@ge...> 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 <dro...@ge...> 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 <dro...@ge...> doman: fixed some typos, + closing bug #7152. + + 28 Aug 2002; Daniel Robbins <dro...@ge...> 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 <az...@ge...> 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 <dro...@ge...> portage.py: improved error + handling/detection of bad pkgsplit() and catpkgsplit() calls; should close + bug #6803, #6853. + + 26 Aug 2002; Daniel Robbins <dro...@ge...> 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 <dro...@ge...> 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 <az...@ge...> emerge: fixed an + indentation problem of the 'else:' at line 1304. + + 20 Aug 2002; Daniel Robbins <dro...@ge...> emerge: removed stray + "DEBUG:" output, closing bug #6732. + + *portage-2.0.29 (18 Aug 2002) + + 18 Aug 2002; Daniel Robbins <dro...@ge...> emerge, portage.py, + ebuild.sh: making some effort to make output cleaner and less cluttered, + particularly with error handling. + + 18 Aug 2002; Daniel Robbins <dro...@ge...> 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 <dro...@ge...> 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 <dro...@ge...> 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 <dro...@ge...> portage.py: portdb's + cp_all() now skips "CVS" directories, closing bug #6662. + + 18 Aug 2002; Daniel Robbins <dro...@ge...> 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 <dro...@ge...> ebuild.sh: removed + deprecated "ld.so" dependency from Dan Armak's newdepend() function. + + 17 Aug 2002; Daniel Robbins <dro...@ge...> 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 <dro...@ge...> 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 <dro...@ge...> 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 <dro...@ge...> emerge: now calls + env-update() after an unmerge() run (to fix library paths, links, etc.) + Closes bug #6511. + + 16 Aug 2002; Daniel Robbins <dro...@ge...> doman: now handles already- + gzipped man pages correctly, closing bug #6544. + + 16 Aug 2002; Daniel Robbins <dro...@ge...> 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) |
From: <ji...@us...> - 2002-09-08 16:24:02
|
Update of /cvsroot/darwinfiles/portage/src/sandbox In directory usw-pr-cvs1:/tmp/cvs-serv370 Removed Files: Makefile libsandbox.c sandbox.bashrc sandbox.c Log Message: Removing old version --- Makefile DELETED --- --- libsandbox.c DELETED --- --- sandbox.bashrc DELETED --- --- sandbox.c DELETED --- |
From: <ji...@us...> - 2002-09-08 16:23:41
|
Update of /cvsroot/darwinfiles/portage/src/sandbox/problems In directory usw-pr-cvs1:/tmp/cvs-serv308 Removed Files: Makefile libsandbox_emacsbug.c libsandbox_muttbug.c sandbox_dev_fd_foo sandbox_dev_fd_foo.c sandbox_muttbug sandbox_muttbug.c Log Message: Removing old version --- Makefile DELETED --- --- libsandbox_emacsbug.c DELETED --- --- libsandbox_muttbug.c DELETED --- --- sandbox_dev_fd_foo DELETED --- --- sandbox_dev_fd_foo.c DELETED --- --- sandbox_muttbug DELETED --- --- sandbox_muttbug.c DELETED --- |
From: <ji...@us...> - 2002-09-08 16:21:15
|
Update of /cvsroot/darwinfiles/portage/src/sandbox-1.1 In directory usw-pr-cvs1:/tmp/cvs-serv32248 Added Files: ChangeLog Makefile canonicalize.c create-localdecls libctest.c libsandbox.c sandbox.bashrc sandbox.c sandbox.h sandbox_futils.c Log Message: Merged with portage-2.0.36 --- NEW FILE: ChangeLog --- # ChangeLog for Path Sandbox # Copyright 2002 Gentoo Technologies, Inc.; Distributed under the GPL v2 # $Header: /cvsroot/darwinfiles/portage/src/sandbox-1.1/ChangeLog,v 1.1 2002/09/08 16:21:12 jimmacr Exp $ 1 Sep 2002; Martin Schlemmer <az...@ge...> : Fix my braindead 'return 1;' in a void function. Updated sandbox.c, cleanup() for this. Change cleanup() in sandbox.c not to exit with fail status if the pidsfile is missing. We really should still display sandbox violations if they occured. 31 Aug 2002; Martin Schlemmer <az...@ge...> : Update cleanup() in sandbox.c to remove the PIDSFILE if this is the last sandbox running. 25 Aug 2002; Martin Schlemmer <az...@ge...> : Major cleanups to mainly libsandbox.c again. 22 Aug 2002; Martin Schlemmer <az...@ge...> : Add copyrights to sandbox.h and sandbox_futils.h. If wrong, the parties involved should please contact me so that we can fix it. Add opendir wrapper to libsandbox.c. 21 Aug 2002; Martin Schlemmer <az...@ge...> : Do some more cleanups to ecanonicalize(), as it dropped filenames in rare cases (after my symlink cleanups), and caused glibc to bork. These fixes went into canonicalize.c. 20 Aug 2002; Martin Schlemmer <az...@ge...> : Fix spawn_shell() and main() in sandbox.c to properly return fail status. 19 Aug 2002; Martin Schlemmer <az...@ge...> : The new canonicalize() function in libsandbox.c also resolved symlinks, which caused on cleaning sandbox errors if the symlink pointed to a file in the live root. Ripped out canonicalize() and realpath() from glibc; removed the symlink stuff, and changed them to ecanonicalize() and erealpath(). 18 Aug 2002; Martin Schlemmer <az...@ge...> : Ripped out all the wrappers, and implemented those of InstallWatch. Losts of cleanups and bugfixes. Implement a execve that forces $LIBSANDBOX in $LD_PRELOAD. We can now thus do away with the feared /etc/ld.so.preload (*g*) ... Made the needed changes to sandbox.c, sandbox.h and sandbox_futils.c. Rewrote the Makefile for most parts; it now have an install target. Reformat the whole thing to look somewhat like the reworked sandbox.c and new sandbox.h and sandbox_futils.c from: Brad House <br...@ma...>. Additional Copyrights now due to the InstallWatch code: Copyright (C) 1998-9 Pancrazio `Ezio' de Mauro <p...@de...> --- NEW FILE: Makefile --- # Copyright (C) 2001 Geert Bevin, Uwyn, http://www.uwyn.com # Distributed under the terms of the GNU General Public License, v2 or later # Author : Geert Bevin <gb...@uw...> # # Modified 15 Apr 2002 Jon Nelson <jn...@ge...> # Clean up Makefile somewhat, and use make's implicit rules # # Modified 19 Aug 2002; Martin Schlemmer <az...@ge...> # Major rewrite to support new stuff # # $Header: /cvsroot/darwinfiles/portage/src/sandbox-1.1/Makefile,v 1.1 2002/09/08 16:21:12 jimmacr Exp $ CC = gcc LD = ld CFLAGS = OBJ_DEFINES = -D_GNU_SOURCE -DPIC -fPIC -D_REENTRANT LIBS = LDFLAGS = DESTDIR = TARGETS = libsandbox.so sandbox all: $(TARGETS) sandbox: sandbox.o sandbox_futils.o $(CC) $^ -ldl -lc -o $@ sandbox.o: sandbox.c sandbox.h $(CC) $(CFLAGS) -Wall -c sandbox.c sandbox_futils.o: sandbox_futils.c sandbox.h $(CC) $(CFLAGS) -Wall -c $(OBJ_DEFINES) sandbox_futils.c libsandbox.so: libsandbox.o sandbox_futils.o canonicalize.o $(LD) $^ -shared -fPIC -ldl -lc -o $@ libsandbox.o: libsandbox.c localdecls.h $(CC) $(CFLAGS) -Wall -c $(OBJ_DEFINES) libsandbox.c canonicalize.o: canonicalize.c $(CC) $(CFLAGS) -Wall -c $(OBJ_DEFINES) canonicalize.c localdecls.h: create-localdecls libctest.c ./create-localdecls install: all install -d -m 0755 $(DESTDIR)/lib install -d -m 0755 $(DESTDIR)/usr/lib/portage/bin install -d -m 0755 $(DESTDIR)/usr/lib/portage/lib install -m 0755 libsandbox.so $(DESTDIR)/lib install -m 0755 sandbox $(DESTDIR)/usr/lib/portage/bin install -m 0644 sandbox.bashrc $(DESTDIR)/usr/lib/portage/lib clean: rm -f $(TARGETS) rm -f *.o *~ core rm -f localdecls.h # vim:expandtab noai:cindent ai --- NEW FILE: canonicalize.c --- /* Return the canonical absolute name of a given file. Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ /* * $Header: /cvsroot/darwinfiles/portage/src/sandbox-1.1/canonicalize.c,v 1.1 2002/09/08 16:21:12 jimmacr Exp $ */ #include <stdlib.h> #include <string.h> #include <unistd.h> #include <limits.h> #include <sys/param.h> #include <sys/stat.h> #include <errno.h> #include <stddef.h> #ifndef __set_errno # define __set_errno(val) errno = (val) #endif /* Return the canonical absolute name of file NAME. A canonical name does not contain any `.', `..' components nor any repeated path separators ('/') or symlinks. All path components must exist. If RESOLVED is null, the result is malloc'd; otherwise, if the canonical name is PATH_MAX chars or more, returns null with `errno' set to ENAMETOOLONG; if the name fits in fewer than PATH_MAX chars, returns the name in RESOLVED. If the name cannot be resolved and RESOLVED is non-NULL, it contains the path of the first component that cannot be resolved. If the path can be resolved, RESOLVED holds the same value as the value returned. */ /* Modified: 19 Aug 2002; Martin Schlemmer <az...@ge...> * * Cleaned up unneeded stuff, and change so that it will not * resolve symlinks. Also prepended a 'e' to functions that * I did not rip out. * */ static char * ecanonicalize (const char *name, char *resolved) { char *rpath, *dest; const char *start, *end, *rpath_limit; long int path_max; if (name == NULL) { /* As per Single Unix Specification V2 we must return an error if either parameter is a null pointer. We extend this to allow the RESOLVED parameter to be NULL in case the we are expected to allocate the room for the return value. */ __set_errno (EINVAL); return NULL; } if (name[0] == '\0') { /* As per Single Unix Specification V2 we must return an error if the name argument points to an empty string. */ __set_errno (ENOENT); return NULL; } #ifdef PATH_MAX path_max = PATH_MAX; #else path_max = pathconf (name, _PC_PATH_MAX); if (path_max <= 0) path_max = 1024; #endif rpath = resolved ? alloca (path_max) : malloc (path_max); rpath_limit = rpath + path_max; if (name[0] != '/') { if (!getcwd (rpath, path_max)) { rpath[0] = '\0'; goto error; } dest = strchr (rpath, '\0'); } else { rpath[0] = '/'; dest = rpath + 1; } for (start = end = name; *start; start = end) { /* Skip sequence of multiple path-separators. */ while (*start == '/') ++start; /* Find end of path component. */ for (end = start; *end && *end != '/'; ++end) /* Nothing. */; if (end - start == 0) break; else if (end - start == 1 && start[0] == '.') /* nothing */; else if (end - start == 2 && start[0] == '.' && start[1] == '.') { /* Back up to previous component, ignore if at root already. */ if (dest > rpath + 1) while ((--dest)[-1] != '/'); } else { size_t new_size; if (dest[-1] != '/') *dest++ = '/'; if (dest + (end - start) >= rpath_limit) { ptrdiff_t dest_offset = dest - rpath; if (resolved) { __set_errno (ENAMETOOLONG); if (dest > rpath + 1) dest--; *dest = '\0'; goto error; } new_size = rpath_limit - rpath; if (end - start + 1 > path_max) new_size += end - start + 1; else new_size += path_max; rpath = realloc (rpath, new_size); rpath_limit = rpath + new_size; if (rpath == NULL) return NULL; dest = rpath + dest_offset; } dest = __mempcpy (dest, start, end - start); *dest = '\0'; } } #if 0 if (dest > rpath + 1 && dest[-1] == '/') --dest; #endif *dest = '\0'; return resolved ? memcpy (resolved, rpath, dest - rpath + 1) : rpath; error: if (resolved) strcpy (resolved, rpath); else free (rpath); return NULL; } char * erealpath (const char *name, char *resolved) { if (resolved == NULL) { __set_errno (EINVAL); return NULL; } return ecanonicalize (name, resolved); } // vim:expandtab noai:cindent ai --- NEW FILE: create-localdecls --- #!/bin/sh # This is a quick'n'dirty hack to make the program behave correctly # under different systems. # Example: # when using libc5, (f)trucate's offset argument type is size_t with # libc5, but it's off_t with libc6 (glibc2). # # Uhm... time to learn GNU autoconf :-) # # $Header: /cvsroot/darwinfiles/portage/src/sandbox-1.1/create-localdecls,v 1.1 2002/09/08 16:21:12 jimmacr Exp $ OUTFILE='localdecls.h' echo '/* This file is automatically generated *' > $OUTFILE echo ' * Modify create-localdecls instead of this */' >> $OUTFILE echo >> $OUTFILE echo '#ifndef __LOCALDECLS_H_' > $OUTFILE echo '#define __LOCALDECLS_H_' >> $OUTFILE echo >> $OUTFILE ### ### ### echo -n 'Checking truncate argument type... ' if grep -q 'truncate.*size_t' /usr/include/unistd.h ; then echo 'size_t' echo '#define TRUNCATE_T size_t' >> $OUTFILE else echo 'off_t' # At least, I HOPE it's off_t :-) echo '#define TRUNCATE_T off_t' >> $OUTFILE fi ### ### ### echo -n 'Checking libc version... ' gcc -Wall -o libctest libctest.c VERSION=`ldd libctest | grep libc\\.so | awk '{print $1}'` rm libctest echo $VERSION echo "#define LIBC_VERSION \"$VERSION\"" >> $OUTFILE if test "$VERSION" = 'libc.so.5' ; then echo '#define BROKEN_RTLD_NEXT' >> $OUTFILE echo '#define LIBC 5' >> $OUTFILE fi if test "$VERSION" = 'libc.so.6' ; then echo -n 'Checking glibc subversion... ' tmp="`ldd /bin/sh | grep libc.so 2> /dev/null`" LibcPath=`expr "$tmp" : '[^/]*\(/[^ ]*\)'` tmp="`strings $LibcPath | grep -i 'c library'`" OsLibcMajor=`expr "$tmp" : '.* \([0-9][0-9]*\)'` OsLibcMinor=`expr "$tmp" : '.* [0-9][0-9]*\.\([0-9][0-9]*\)'` case "$OsLibcMajor" in 2) # 2 is the glibc version case "$OsLibcMinor" in 0) echo '#define GLIBC_MINOR 0' >> $OUTFILE SUBVERSION='glibc-2.0' ;; 1) echo '#define GLIBC_MINOR 1' >> $OUTFILE SUBVERSION='glibc-2.1' ;; 2) echo '#define GLIBC_MINOR 2' >> $OUTFILE SUBVERSION='glibc-2.2' ;; *) echo 'Treated as glibc >= 2.1 (finger crossed)' echo '#define GLIBC_MINOR 1' >> $OUTFILE SUBVERSION='glibc-2.1' ;; esac ;; esac fi echo >> $OUTFILE echo '#endif' >> $OUTFILE echo --- NEW FILE: libctest.c --- /* Dummy program to check your libc version */ int main(void) { return 0; } --- NEW FILE: libsandbox.c --- /* S * Path sandbox for the gentoo linux portage package system, initially * based on the ROCK Linux Wrapper for getting a list of created files * * to integrate with bash, bash should have been built like this * * ./configure --prefix=<prefix> --host=<host> --without-gnu-malloc * * it's very important that the --enable-static-link option is NOT specified * * Copyright (C) 2001 Geert Bevin, Uwyn, http://www.uwyn.com * Distributed under the terms of the GNU General Public License, v2 or later * Author : Geert Bevin <gb...@uw...> * * Post Bevin leaving Gentoo ranks: * -------------------------------- * Ripped out all the wrappers, and implemented those of InstallWatch. * Losts of cleanups and bugfixes. Implement a execve that forces $LIBSANDBOX * in $LD_PRELOAD. Reformat the whole thing to look somewhat like the reworked [...1145 lines suppressed...] static int before_syscall_open_int(const char* func, const char* file, int flags) { if ((flags & O_WRONLY) || (flags & O_RDWR)) { return before_syscall("open_wr", file); } else { return before_syscall("open_rd", file); } } static int before_syscall_open_char(const char* func, const char* file, const char* mode) { if ((strcmp(mode, "r") == 0) || (strcmp(mode, "rb") == 0)) { return before_syscall("open_rd", file); } else { return before_syscall("open_wr", file); } } // vim:expandtab noai:cindent ai --- NEW FILE: sandbox.bashrc --- # Copyright (C) 2001 Geert Bevin, Uwyn, http://www.uwyn.com # Distributed under the terms of the GNU General Public License, v2 or later # Author : Geert Bevin <gb...@uw...> # $Header: /cvsroot/darwinfiles/portage/src/sandbox-1.1/sandbox.bashrc,v 1.1 2002/09/08 16:21:12 jimmacr Exp $ source /etc/profile export LD_PRELOAD="$SANDBOX_LIB" alias make="make LD_PRELOAD=$SANDBOX_LIB" alias su="su -c '/bin/bash -rcfile $SANDBOX_DIR/sandbox.bashrc'" --- NEW FILE: sandbox.c --- /* ** Path sandbox for the gentoo linux portage package system, initially ** based on the ROCK Linux Wrapper for getting a list of created files ** ** to integrate with bash, bash should have been built like this ** ** ./configure --prefix=<prefix> --host=<host> --without-gnu-malloc ** ** it's very important that the --enable-static-link option is NOT specified ** ** Copyright (C) 2001 Geert Bevin, Uwyn, http://www.uwyn.com ** Distributed under the terms of the GNU General Public License, v2 or later ** Author : Geert Bevin <gb...@uw...> ** $Header: /cvsroot/darwinfiles/portage/src/sandbox-1.1/sandbox.c,v 1.1 2002/09/08 16:21:12 jimmacr Exp $ */ #define _GNU_SOURCE #include <errno.h> #include <fcntl.h> #include <signal.h> #include <stdio.h> #include <stdlib.h> #include <limits.h> #include <string.h> #include <sys/file.h> #include <sys/stat.h> #include <sys/time.h> #include <sys/types.h> #include <sys/resource.h> #include <sys/wait.h> #include <unistd.h> #include <fcntl.h> #include "sandbox.h" int preload_adaptable = 1; int cleaned_up = 0; int print_debug = 0; /* Read pids file, and load active pids into an array. Return number of pids in array */ int load_active_pids(int fd, int **pids) { char *data = NULL; char *ptr = NULL, *ptr2 = NULL; int my_pid; int num_pids = 0; long len; pids[0] = NULL; len = file_length(fd); /* Allocate and zero datablock to read pids file */ data = (char *)malloc((len + 1)*sizeof(char)); memset(data, 0, len + 1); /* Start at beginning of file */ lseek(fd, 0L, SEEK_SET); /* read entire file into a buffer */ read(fd, data, len); ptr = data; /* Loop and read all pids */ while (1) { /* Find new line */ ptr2 = strchr(ptr, '\n'); if (ptr2 == NULL) break; /* No more PIDs */ /* clear the \n. And ptr should have a null-terminated decimal string */ ptr2[0] = 0; my_pid = atoi(ptr); /* If the PID is still alive, add it to our array */ if ((0 != my_pid) && (0 == kill(my_pid, 0))) { pids[0] = (int *)realloc(pids[0], (num_pids + 1)*sizeof(int)); pids[0][num_pids] = my_pid; num_pids++; } /* Put ptr past the NULL we just wrote */ ptr = ptr2 + 1; } if (data) free(data); return num_pids; } /* Read ld.so.preload file, and loads dirs into an array. Return number of entries in array */ int load_preload_libs(int fd, char ***preloads) { char *data = NULL; char *ptr = NULL, *ptr2 = NULL; int num_entries = 0; long len; preloads[0] = NULL; len = file_length(fd); /* Allocate and zero datablock to read pids file */ data = (char *)malloc((len + 1)*sizeof(char)); memset(data, 0, len + 1); /* Start at beginning of file */ lseek(fd, 0L, SEEK_SET); /* read entire file into a buffer */ read(fd, data, len); ptr = data; /* Loop and read all pids */ while (1) { /* Find new line */ ptr2 = strchr(ptr, '\n'); /* clear the \n. And ptr should have a null-terminated decimal string * Don't break from the loop though because the last line may not * terminated with a \n */ if (NULL != ptr2) ptr2[0] = 0; /* If listing does not match our libname, add it to the array */ if ((strlen(ptr)) && (NULL == strstr(ptr, LIB_NAME))) { preloads[0] = (char **)realloc(preloads[0], (num_entries + 1)*sizeof(char **)); preloads[0][num_entries] = strdup(ptr); num_entries++; } if (NULL == ptr2) break; /* No more PIDs */ /* Put ptr past the NULL we just wrote */ ptr = ptr2 + 1; } if (data) free(data); return num_entries; } void cleanup() { int i = 0; int success = 1; int pids_file = -1, num_of_pids = 0; int *pids_array = NULL; char pid_string[255]; #ifdef USE_LD_SO_PRELOAD int preload_file = -1, num_of_preloads = 0; char preload_entry[255]; char **preload_array = NULL; #endif /* remove this sandbox's bash pid from the global pids * file if it has rights to adapt the ld.so.preload file */ if ((1 == preload_adaptable) && (0 == cleaned_up)) { cleaned_up = 1; success = 1; if (print_debug) printf("Cleaning up pids file.\n"); /* Stat the PIDs file, make sure it exists and is a regular file */ if (file_exist(PIDS_FILE, 1) <= 0) { perror(">>> pids file is not a regular file"); success = 0; /* We should really not fail if the pidsfile is missing here, but * rather just exit cleanly, as there is still some cleanup to do */ return; } pids_file = file_open(PIDS_FILE, "r+", 0); if (-1 == pids_file) { success = 0; /* Nothing more to do here */ return; } /* Load "still active" pids into an array */ num_of_pids = load_active_pids(pids_file, &pids_array); //printf("pids: %d\r\n", num_of_pids); #ifdef USE_LD_SO_PRELOAD /* clean the /etc/ld.so.preload file if no other sandbox * processes are running anymore */ if (1 == num_of_pids) { success = 1; if (print_debug) printf("Cleaning up /etc/ld.so.preload.\n"); preload_file = file_open("/etc/ld.so.preload", "r+", 0); if (-1 != preload_file) { /* Load all the preload libraries into an array */ num_of_preloads = load_preload_libs(preload_file, &preload_array); //printf("num preloads: %d\r\n", num_of_preloads); /* Clear file */ file_truncate(preload_file); /* store the other preload libraries back into the /etc/ld.so.preload file */ if(num_of_preloads > 0) { for (i = 0; i < num_of_preloads; i++) { sprintf(preload_entry, "%s\n", preload_array[i]); if (write(preload_file, preload_entry, strlen(preload_entry)) != strlen(preload_entry)) { perror(">>> /etc/ld.so.preload file write"); success = 0; break; } } } /* Free memory used to store preload array */ for (i = 0; i < num_of_preloads; i++) { if (preload_array[i]) free(preload_array[i]); preload_array[i] = NULL; } if (preload_array) free(preload_array); preload_array = NULL; file_close(preload_file); preload_file = -1; } } #endif file_truncate(pids_file); /* if pids are still running, write only the running pids back to the file */ if(num_of_pids > 1) { for (i = 0; i < num_of_pids; i++) { sprintf(pid_string, "%d\n", pids_array[i]); if (write(pids_file, pid_string, strlen(pid_string)) != strlen(pid_string)) { perror(">>> pids file write"); success = 0; break; } } file_close(pids_file); pids_file = -1; } else { file_close(pids_file); pids_file = -1; /* remove the pidsfile, as this was the last sandbox */ unlink(PIDS_FILE); } if (pids_array != NULL) { free(pids_array); pids_array = NULL; } } if (0 == success) { return; } } void stop(int signum) { printf("Caught signal %d\r\n", signum); cleanup(); } void setenv_sandbox_write(char *home_dir, char *portage_tmp_dir, char *var_tmp_dir, char *tmp_dir) { char sandbox_write_var[1024]; if (!getenv(ENV_SANDBOX_WRITE)) { /* these should go into make.globals later on */ strcpy(sandbox_write_var, ""); strcat(sandbox_write_var, "/dev/zero:/dev/fd/:/dev/null:/dev/pts/:/dev/vc/:/dev/tty:/tmp/"); strcat(sandbox_write_var, ":"); strcat(sandbox_write_var, "/var/log/scrollkeeper.log"); strcat(sandbox_write_var, ":"); strcat(sandbox_write_var, home_dir); strcat(sandbox_write_var, "/.gconfd/lock"); strcat(sandbox_write_var, ":"); strcat(sandbox_write_var, home_dir); strcat(sandbox_write_var, "/.bash_history"); strcat(sandbox_write_var, ":"); strcat(sandbox_write_var, "/usr/tmp/conftest"); strcat(sandbox_write_var, ":"); strcat(sandbox_write_var, "/usr/lib/conftest"); strcat(sandbox_write_var, ":"); strcat(sandbox_write_var, "/usr/tmp/cf"); strcat(sandbox_write_var, ":"); strcat(sandbox_write_var, "/usr/lib/cf"); strcat(sandbox_write_var, ":"); if (NULL == portage_tmp_dir) { strcat(sandbox_write_var, tmp_dir); strcat(sandbox_write_var, ":"); strcat(sandbox_write_var, var_tmp_dir); strcat(sandbox_write_var, ":"); strcat(sandbox_write_var, "/tmp/"); strcat(sandbox_write_var, ":"); strcat(sandbox_write_var, "/var/tmp/"); /* How the heck is this possible?? we just set it above! */ } else if (0 == strcmp(sandbox_write_var, "/var/tmp/")) { strcat(sandbox_write_var, portage_tmp_dir); strcat(sandbox_write_var, ":"); strcat(sandbox_write_var, tmp_dir); strcat(sandbox_write_var, ":"); strcat(sandbox_write_var, "/tmp/"); /* Still don't think this is possible, am I just stupid or something? */ } else if (0 == strcmp(sandbox_write_var, "/tmp/")) { strcat(sandbox_write_var, portage_tmp_dir); strcat(sandbox_write_var, ":"); strcat(sandbox_write_var, var_tmp_dir); strcat(sandbox_write_var, ":"); strcat(sandbox_write_var, "/var/tmp/"); /* Amazing, one I think is possible */ } else { strcat(sandbox_write_var, portage_tmp_dir); strcat(sandbox_write_var, ":"); strcat(sandbox_write_var, tmp_dir); strcat(sandbox_write_var, ":"); strcat(sandbox_write_var, var_tmp_dir); strcat(sandbox_write_var, ":"); strcat(sandbox_write_var, "/tmp/"); strcat(sandbox_write_var, ":"); strcat(sandbox_write_var, "/var/tmp/"); } setenv(ENV_SANDBOX_WRITE, sandbox_write_var, 1); } } void setenv_sandbox_predict(char *home_dir) { char sandbox_predict_var[1024]; if (!getenv(ENV_SANDBOX_PREDICT)) { /* these should go into make.globals later on */ strcpy(sandbox_predict_var, ""); strcat(sandbox_predict_var, home_dir); strcat(sandbox_predict_var, "/."); strcat(sandbox_predict_var, ":"); strcat(sandbox_predict_var, "/usr/lib/python2.0/"); strcat(sandbox_predict_var, ":"); strcat(sandbox_predict_var, "/usr/lib/python2.1/"); strcat(sandbox_predict_var, ":"); strcat(sandbox_predict_var, "/usr/lib/python2.2/"); setenv(ENV_SANDBOX_PREDICT, sandbox_predict_var, 1); } } int print_sandbox_log(char *sandbox_log) { int sandbox_log_file = -1; char *beep_count_env = NULL; int i, beep_count = 0; long len = 0; char *buffer = NULL; sandbox_log_file=file_open(sandbox_log, "r", 0); if (-1 == sandbox_log_file) { return 0; } len = file_length(sandbox_log_file); buffer = (char *)malloc((len + 1)*sizeof(char)); memset(buffer, 0, len + 1); read(sandbox_log_file, buffer, len); file_close(sandbox_log_file); printf("\e[31;01m--------------------------- ACCESS VIOLATION SUMMARY ---------------------------\033[0m\n"); printf("\e[31;01mLOG FILE = \"%s\"\033[0m\n", sandbox_log); printf("\n"); printf("%s", buffer); if (buffer) free(buffer); buffer = NULL; printf("\e[31;01m--------------------------------------------------------------------------------\033[0m\n"); beep_count_env = getenv(ENV_SANDBOX_BEEP); if (beep_count_env) { beep_count = atoi(beep_count_env); } else { beep_count = DEFAULT_BEEP_COUNT; } for (i = 0; i < beep_count; i++) { fputc('\a', stderr); if (i < beep_count -1) { sleep(1); } } return 1; } int spawn_shell(char *argv_bash[]) { #ifdef USE_SYSTEM_SHELL int i = 0; char *sh = NULL; int first = 1; int ret; long len = 0; while (1) { if (NULL == argv_bash[i]) break; if (NULL != sh) len = strlen(sh); sh = (char *)realloc(sh, len+strlen(argv_bash[i]) + 5); if (first) { sh[0] = 0; first = 0; } strcat(sh, "\""); strcat(sh, argv_bash[i]); strcat(sh, "\" "); //printf("%s\n", argv_bash[i]); i++; } printf("%s\n", sh); ret = system(sh); if (sh) free(sh); sh = NULL; if (-1 == ret) return 0; return 1; #else # ifndef NO_FORK int pid; int status = 0; int ret = 0; pid = fork(); /* Child's process */ if (0 == pid) { # endif execv(argv_bash[0], argv_bash); # ifndef NO_FORK return 0; } else if (pid < 0) { return 0; } ret = waitpid(pid, &status, 0); if ((-1 == ret) || (status > 0)) return 0; # endif return 1; #endif } int main(int argc, char** argv) { int i = 0, success = 1; int preload_file = -1; int sandbox_log_presence = 0; int sandbox_log_file = -1; int pids_file = -1; long len; int *pids_array = NULL; int num_of_pids = 0; // char run_arg[255]; char portage_tmp_dir[PATH_MAX]; char var_tmp_dir[PATH_MAX]; char tmp_dir[PATH_MAX]; char sandbox_log[255]; char sandbox_debug_log[255]; char sandbox_dir[255]; char sandbox_lib[255]; char sandbox_rc[255]; char pid_string[255]; char **argv_bash = NULL; char *run_str = "-c"; char *home_dir = NULL; char *tmp_string = NULL; #ifdef USE_LD_SO_PRELOAD char **preload_array = NULL; int num_of_preloads = 0; #endif /* Only print info if called with no arguments .... */ if (argc < 2) { print_debug = 1; } if (print_debug) printf("========================== Gentoo linux path sandbox ===========================\n"); /* check if a sandbox is already running */ if (NULL != getenv(ENV_SANDBOX_ON)) { fprintf(stderr, "Not launching a new sandbox instance\nAnother one is already running in this process hierarchy.\n"); exit(1); } else { /* determine the location of all the sandbox support files */ if (print_debug) printf("Detection of the support files.\n"); /* Generate base sandbox path */ tmp_string = get_sandbox_path(argv[0]); strncpy(sandbox_dir, tmp_string, 254); if (tmp_string) free(tmp_string); tmp_string = NULL; strcat(sandbox_dir, "/"); /* Generate sandbox lib path */ tmp_string = get_sandbox_lib(sandbox_dir); strncpy(sandbox_lib, tmp_string, 254); if (tmp_string) free(tmp_string); tmp_string = NULL; /* Generate sandbox bashrc path */ tmp_string = get_sandbox_rc(sandbox_dir); strncpy(sandbox_rc, tmp_string, 254); if (tmp_string) free(tmp_string); tmp_string = NULL; /* verify the existance of required files */ if (print_debug) printf("Verification of the required files.\n"); if (file_exist(sandbox_lib, 0) <= 0) { fprintf(stderr, "Could not open the sandbox library at '%s'.\n", sandbox_lib); return -1; } else if (file_exist(sandbox_rc, 0) <= 0) { fprintf(stderr, "Could not open the sandbox rc file at '%s'.\n", sandbox_rc); return -1; } #ifdef USE_LD_SO_PRELOAD /* ensure that the /etc/ld.so.preload file contains an entry for the sandbox lib */ if (print_debug) printf("Setting up the ld.so.preload file.\n"); #endif /* check if the /etc/ld.so.preload is a regular file */ if (file_exist("/etc/ld.so.preload", 1) < 0) { fprintf(stderr, ">>> /etc/ld.so.preload file is not a regular file\n"); exit(1); } /* Our r+ also will create the file if it doesn't exist */ preload_file=file_open("/etc/ld.so.preload", "r+", 1, 0644); if (-1 == preload_file) { preload_adaptable = 0; /* exit(1);*/ } #ifdef USE_LD_SO_PRELOAD /* Load entries of preload table */ num_of_preloads = load_preload_libs(preload_file, &preload_array); /* Zero out our ld.so.preload file */ file_truncate(preload_file); /* Write contents of preload file */ for (i = 0; i < num_of_preloads + 1; i++) { /* First entry should be our sandbox library */ if (0 == i) { if (write(preload_file, sandbox_lib, strlen(sandbox_lib)) != strlen(sandbox_lib)) { perror(">>> /etc/ld.so.preload file write"); success = 0; break; } } else { /* Output all other preload entries */ if (write(preload_file, preload_array[i - 1], strlen(preload_array[i - 1])) != strlen(preload_array[i - 1])) { perror(">>> /etc/ld.so.preload file write"); success = 0; break; } } /* Don't forget the return character after each line! */ if (1 != write(preload_file, "\n", 1)) { perror(">>> /etc/ld.so.preload file write"); success = 0; break; } } for (i = 0; i < num_of_preloads; i++) { if (preload_array[i]) free(preload_array[i]); preload_array[i] = NULL; } if (preload_array) free(preload_array); num_of_preloads = 0; preload_array = NULL; #endif /* That's all we needed to do with the preload file */ file_close(preload_file); preload_file = -1; /* set up the required environment variables */ if (print_debug) printf("Setting up the required environment variables.\n"); /* Generate sandbox log full path */ tmp_string=get_sandbox_log(); strncpy(sandbox_log, tmp_string, 254); if (tmp_string) free(tmp_string); tmp_string = NULL; setenv(ENV_SANDBOX_LOG, sandbox_log, 1); snprintf(sandbox_debug_log, 254, "%s%s%s", DEBUG_LOG_FILE_PREFIX, pid_string, LOG_FILE_EXT); setenv(ENV_SANDBOX_DEBUG_LOG, sandbox_debug_log, 1); home_dir = getenv("HOME"); /* drobbins: we need to expand these paths using realpath() so that PORTAGE_TMPDIR * can contain symlinks (example, /var is a symlink, /var/tmp is a symlink.) Without * this, access is denied to /var/tmp, hurtin' ebuilds. */ realpath(getenv("PORTAGE_TMPDIR"),portage_tmp_dir); realpath("/var/tmp",var_tmp_dir); realpath("/tmp",tmp_dir); setenv(ENV_SANDBOX_DIR, sandbox_dir, 1); setenv(ENV_SANDBOX_LIB, sandbox_lib, 1); setenv("LD_PRELOAD", sandbox_lib, 1); if (!getenv(ENV_SANDBOX_DENY)) { setenv(ENV_SANDBOX_DENY, LD_PRELOAD_FILE, 1); } if (!getenv(ENV_SANDBOX_READ)) { setenv(ENV_SANDBOX_READ, "/", 1); } /* Set up Sandbox Write path */ setenv_sandbox_write(home_dir, portage_tmp_dir, var_tmp_dir, tmp_dir); setenv_sandbox_predict(home_dir); setenv(ENV_SANDBOX_ON, "1", 0); /* if the portage temp dir was present, cd into it */ if (NULL != portage_tmp_dir) { chdir(portage_tmp_dir); } argv_bash=(char **)malloc(6 * sizeof(char *)); argv_bash[0] = strdup("/bin/bash"); argv_bash[1] = strdup("-rcfile"); argv_bash[2] = strdup(sandbox_rc); if (argc < 2) { argv_bash[3] = NULL; } else { argv_bash[3] = strdup(run_str); /* "-c" */ } argv_bash[4] = NULL; /* strdup(run_arg); */ argv_bash[5] = NULL; if (argc >= 2) { for (i = 1; i< argc; i++) { if (NULL == argv_bash[4]) len = 0; else len = strlen(argv_bash[4]); argv_bash[4]=(char *)realloc(argv_bash[4], (len + strlen(argv[i]) + 2) * sizeof(char)); if (0 == len) argv_bash[4][0] = 0; if (1 != i) strcat(argv_bash[4], " "); strcat(argv_bash[4], argv[i]); } } #if 0 char* argv_bash[] = { "/bin/bash", "-rcfile", NULL, NULL, NULL, NULL }; /* adding additional bash arguments */ for (i = 1; i < argc; i++) { if (1 == i) { argv_bash[3] = run_str; argv_bash[4] = run_arg; strcpy(argv_bash[4], argv[i]); } else { strcat(argv_bash[4], " "); strcat(argv_bash[4], argv[i]); } } #endif /* set up the required signal handlers */ signal(SIGHUP, &stop); signal(SIGINT, &stop); signal(SIGQUIT, &stop); signal(SIGTERM, &stop); /* this one should NEVER be set in ebuilds, as it is the one * private thing libsandbox.so use to test if the sandbox * should be active for this pid, or not. * * azarah (3 Aug 2002) */ setenv("SANDBOX_ACTIVE", "armedandready", 1); /* Load our PID into PIDs file if environment is adaptable */ if (preload_adaptable) { success = 1; if (file_exist(PIDS_FILE, 1) < 0) { success = 0; fprintf(stderr, ">>> pids file is not a regular file"); } else { pids_file=file_open(PIDS_FILE, "r+", 1, 0644); if (-1 == pids_file) { success = 0; } else { /* Grab still active pids */ num_of_pids = load_active_pids(pids_file, &pids_array); /* Zero out file */ file_truncate(pids_file); /* Output active pids, and append our pid */ for (i = 0; i < num_of_pids + 1; i++) { /* Time for our entry */ if (i == num_of_pids) { sprintf(pid_string, "%d\n", getpid()); } else { sprintf(pid_string, "%d\n", pids_array[i]); } if (write(pids_file, pid_string, strlen(pid_string)) != strlen(pid_string)) { perror(">>> /etc/ld.so.preload file write"); success = 0; break; } } /* Clean pids_array */ if (pids_array) free(pids_array); pids_array = NULL; num_of_pids = 0; /* We're done with the pids file */ file_close(pids_file); } } /* Something went wrong, bail out */ if (success == 0) exit(1); } /* STARTING PROTECTED ENVIRONMENT */ if (print_debug) { printf("The protected environment has been started.\n"); printf("--------------------------------------------------------------------------------\n"); } if (print_debug) printf("Shell being started in forked process.\n"); /* Start Bash */ if (!spawn_shell(argv_bash)) { if (print_debug) fprintf(stderr, ">>> shell process failed to spawn\n"); success = 0; } /* Free bash stuff */ for (i = 0; i < 6; i++) { if (argv_bash[i]) free(argv_bash[i]); argv_bash[i] = NULL; } if (argv_bash) free(argv_bash); argv_bash = NULL; if (print_debug) { printf("Cleaning up sandbox process\n"); } cleanup(); if (print_debug) { printf("========================== Gentoo linux path sandbox ===========================\n"); printf("The protected environment has been shut down.\n"); } if (file_exist(sandbox_log, 0)) { sandbox_log_presence = 1; success = 1; if (!print_sandbox_log(sandbox_log)) { success = 0; } #if 0 if (!success) { exit(1); } #endif sandbox_log_file = -1; } else if (print_debug) { printf("--------------------------------------------------------------------------------\n"); } if ((sandbox_log_presence) || (!success)) { return 1; } else { return 0; } } } // vim:expandtab noai:cindent ai --- NEW FILE: sandbox.h --- /* * Copyright (C) 2002 Brad House <br...@ma...>, * Possibly based on code from Geert Bevin, Uwyn, http://www.uwyn.com * Distributed under the terms of the GNU General Public License, v2 or later * Author: Brad House <br...@ma...> * * $Header: /cvsroot/darwinfiles/portage/src/sandbox-1.1/sandbox.h,v 1.1 2002/09/08 16:21:12 jimmacr Exp $ */ #ifndef __SANDBOX_H__ #define __SANDBOX_H__ /* Uncomment below to use flock instead of fcntl (POSIX way) to lock/unlock files */ /* #define USE_FLOCK */ /* Uncomment below to use system() to execute the shell rather than execv */ /* #define USE_SYSTEM_SHELL */ /* Uncomment below to use /etc/ld.so.preload (could be very intrusive!!) */ /* #define USE_LD_SO_PRELOAD */ /* Uncommend to not have the protected shell forked, just run in parent process */ /* ONLY FOR DEBUGGING PURPOSES!! (strace needs it like that) */ /* #define NO_FORK */ #define LD_PRELOAD_FILE "/etc/ld.so.preload" #define LIB_NAME "libsandbox.so" #define BASHRC_NAME "sandbox.bashrc" #define PIDS_FILE "/tmp/sandboxpids.tmp" #define LOG_FILE_PREFIX "/tmp/sandbox-" #define DEBUG_LOG_FILE_PREFIX "/tmp/sandbox-debug-" #define LOG_FILE_EXT ".log" #define ENV_SANDBOX_DEBUG_LOG "SANDBOX_DEBUG_LOG" #define ENV_SANDBOX_LOG "SANDBOX_LOG" #define ENV_SANDBOX_DIR "SANDBOX_DIR" #define ENV_SANDBOX_LIB "SANDBOX_LIB" #define ENV_SANDBOX_DENY "SANDBOX_DENY" #define ENV_SANDBOX_READ "SANDBOX_READ" #define ENV_SANDBOX_WRITE "SANDBOX_WRITE" #define ENV_SANDBOX_PREDICT "SANDBOX_PREDICT" #define ENV_SANDBOX_ON "SANDBOX_ON" #define ENV_SANDBOX_BEEP "SANDBOX_BEEP" #define DEFAULT_BEEP_COUNT 3 char *get_sandbox_path(char *argv0); char *get_sandbox_lib(char *sb_path); char *get_sandbox_rc(char *sb_path); char *get_sandbox_log(); char *dirname(const char *path); int file_getmode(char *mode); long file_tell(int fp); int file_lock(int fd, int lock, char *filename); int file_unlock(int fd); int file_locktype(char *mode); int file_open(char *filename, char *mode, int perm_specified, ...); void file_close(int fd); long file_length(int fd); int file_truncate(int fd); int file_exist(char *filename, int checkmode); #endif // vim:expandtab noai:cindent ai --- NEW FILE: sandbox_futils.c --- /* * Copyright (C) 2002 Brad House <br...@ma...> * Distributed under the terms of the GNU General Public License, v2 or later * Author: Brad House <br...@ma...> * * $Header: /cvsroot/darwinfiles/portage/src/sandbox-1.1/sandbox_futils.c,v 1.1 2002/09/08 16:21:12 jimmacr Exp $ * */ #include <errno.h> #include <fcntl.h> #include <signal.h> #include <stdio.h> #include <stdlib.h> #include <limits.h> #include <string.h> #include <stdarg.h> #include <sys/file.h> #include <sys/stat.h> #include <sys/time.h> #include <sys/types.h> #include <sys/resource.h> #include <sys/wait.h> #include <unistd.h> #include <fcntl.h> #include "sandbox.h" char *get_sandbox_path(char *argv0) { char path[255]; char *cwd = NULL; /* ARGV[0] specifies full path */ if (argv0[0] == '/') { strncpy(path, argv0, 254); /* ARGV[0] specifies relative path */ } else { getcwd(cwd, 253); sprintf(path, "%s/%s", cwd, argv0); if (cwd) free(cwd); cwd = NULL; } /* Return just directory */ return(dirname(path)); } char *get_sandbox_lib(char *sb_path) { char path[255]; snprintf(path, 254, "/lib/%s", LIB_NAME); if (file_exist(path, 0) <= 0) { snprintf(path, 254, "%s%s", sb_path, LIB_NAME); } return(strdup(path)); } char *get_sandbox_rc(char *sb_path) { char path[255]; snprintf(path, 254, "/usr/lib/portage/lib/%s", BASHRC_NAME); if (file_exist(path, 0) <= 0) { snprintf(path, 254, "%s%s", sb_path, BASHRC_NAME); } return(strdup(path)); } char *get_sandbox_log() { char path[255]; char pid_string[20]; char *sandbox_log_env = NULL; sprintf(pid_string, "%d", getpid()); strcpy(path, LOG_FILE_PREFIX); sandbox_log_env = getenv(ENV_SANDBOX_LOG); if (sandbox_log_env) { strcat(path, sandbox_log_env); strcat(path, "-"); } strcat(path, pid_string); strcat(path, LOG_FILE_EXT); return(strdup(path)); } /* Obtain base directory name. Do not allow trailing / */ char *dirname(const char *path) { char *ret = NULL; char *ptr = NULL; int loc = 0, i; int cut_len = 0; /* don't think NULL will ever be passed, but just in case */ if (NULL == path) return(strdup(".")); /* Grab pointer to last slash */ ptr = strrchr(path, '/'); if (NULL == ptr) { return(strdup(".")); } /* decimal location of pointer */ loc = strlen(path)-strlen(ptr); /* Remove any trailing slash */ for (i = loc-1; i >= 0; i--) { if (path[i] != '/') { cut_len = i; break; } } /* It could have been just a plain /, return a 1byte 0 filled string */ if (0 == cut_len) return(strdup("")); /* Allocate memory, and return the directory */ ret = (char *)malloc((cut_len + 1) * sizeof(char)); memcpy(ret, path, cut_len); ret[cut_len] = 0; return(ret); } /* char* dirname(const char* path) { char* base = NULL; unsigned int length = 0; base = strrchr(path, '/'); if (NULL == base) { return strdup("."); } while (base > path && *base == '/') { base--; } length = (unsigned int) 1 + base - path; base = malloc(sizeof(char)*(length+1)); memmove(base, path, length); base[length] = 0; return base; }*/ /* Convert text (string) modes to integer values */ int file_getmode(char *mode) { int mde = 0; if (0 == strcasecmp(mode, "r+")) { mde = O_RDWR | O_CREAT; } else if (0 == strcasecmp(mode, "w+")) { mde = O_RDWR | O_CREAT | O_TRUNC; } else if (0 == strcasecmp(mode, "a+")) { mde = O_RDWR | O_CREAT | O_APPEND; } else if (0 == strcasecmp(mode, "r")) { mde = O_RDONLY; } else if (0 == strcasecmp(mode, "w")) { mde = O_WRONLY | O_CREAT | O_TRUNC; } else if (0 == strcasecmp(mode, "a")) { mde = O_WRONLY | O_APPEND | O_CREAT; } else { mde = O_RDONLY; } return(mde); } /* Get current position in file */ long file_tell(int fp) { return(lseek(fp, 0L, SEEK_CUR)); } /* lock the file, preferrably the POSIX way */ int file_lock(int fd, int lock, char *filename) { int err; #ifdef USE_FLOCK if (flock(fd, lock) < 0) { err = errno; fprintf(stderr, ">>> %s flock file lock: %s\n", filename, strerror(err)); return 0; } #else struct flock fl; fl.l_type = lock; fl.l_whence = SEEK_SET; fl.l_start = 0L; fl.l_len = 0L; fl.l_pid = getpid(); if (fcntl(fd, F_SETLKW, &fl) < 0) { err = errno; fprintf(stderr, ">>> %s fcntl file lock: %s\n", filename, strerror(err)); return 0; } #endif return 1; } /* unlock the file, preferrably the POSIX way */ int file_unlock(int fd) { #ifdef USE_FLOCK if (flock(fd, LOCK_UN) < 0) { perror(">>> flock file unlock"); return 0; } #else struct flock fl; fl.l_type = F_UNLCK; fl.l_whence = SEEK_SET; fl.l_start = 0L; fl.l_len = 0L; fl.l_pid = getpid(); if (fcntl(fd, F_SETLKW, &fl) < 0) { perror(">>> fcntl file unlock"); return 0; } #endif return 1; } /* Auto-determine from how the file was opened, what kind of lock to lock * the file with */ int file_locktype(char *mode) { #ifdef USE_FLOCK if (NULL != (strchr(mode, 'w')) || (NULL != strchr(mode, '+')) || (NULL != strchr(mode, 'a'))) return(LOCK_EX); return(LOCK_SH); #else if (NULL != (strchr(mode, 'w')) || (NULL != strchr(mode, '+')) || (NULL != strchr(mode, 'a'))) return(F_WRLCK); return(F_RDLCK); #endif } /* Use standard fopen style modes to open the specified file. Also auto-determines and * locks the file either in shared or exclusive mode depending on opening mode */ int file_open(char *filename, char *mode, int perm_specified, ...) { int fd; char error[250]; va_list ap; int perm; if (perm_specified) { va_start(ap, perm_specified); perm = va_arg(ap, int); va_end(ap); } if (perm_specified) { fd = open(filename, file_getmode(mode), perm); } else { fd = open(filename, file_getmode(mode)); } if (-1 == fd) { snprintf(error, 249, ">>> %s file mode: %s open", filename, mode); perror(error); return(fd); } /* Only lock the file if opening succeeded */ if (-1 != fd) { if (0 == file_lock(fd, file_locktype(mode), filename)) { close(fd); return -1; } } else { snprintf(error, 249, ">>> %s file mode:%s open", filename, mode); perror(error); } return(fd); } /* Close and unlock file */ void file_close(int fd) { if (-1 != fd) { file_unlock(fd); close(fd); } } /* Return length of file */ long file_length(int fd) { long pos, len; pos = file_tell(fd); len = lseek(fd, 0L, SEEK_END); lseek(fd, pos, SEEK_SET); return(len); } /* Zero out file */ int file_truncate(int fd) { lseek(fd, 0L, SEEK_SET); if (ftruncate(fd, 0) < 0) { perror(">>> file truncate"); return 0; } return 1; } /* Check to see if a file exists Return: 1 success, 0 file not found, -1 error */ int file_exist(char *filename, int checkmode) { struct stat mystat; /* Verify file exists and is regular file (not sym link) */ if (checkmode) { if (-1 == lstat(filename, &mystat)) { /* file doesn't exist */ if (ENOENT == errno) { return 0; } else { /* permission denied or other error */ perror(">>> stat file"); return -1; } } if (!S_ISREG(mystat.st_mode)) return -1; /* Just plain verify the file exists */ } else { if (-1 == stat(filename, &mystat)) { /* file does not exist */ if (ENOENT == errno) { return 0; } else { /* permission denied or other error */ perror(">>> stat file"); return -1; } } } return 1; } // vim:expandtab noai:cindent ai |
From: <ji...@us...> - 2002-09-08 16:20:43
|
Update of /cvsroot/darwinfiles/portage/src/sandbox-1.1 In directory usw-pr-cvs1:/tmp/cvs-serv32102/sandbox-1.1 Log Message: Directory /cvsroot/darwinfiles/portage/src/sandbox-1.1 added to the repository |
From: <ji...@us...> - 2002-09-08 16:20:16
|
Update of /cvsroot/darwinfiles/portage/pym In directory usw-pr-cvs1:/tmp/cvs-serv31897 Modified Files: portage.py portage_core.py portage_core2.py portagedb.py Log Message: Merged with portage-2.0.36 Index: portage.py =================================================================== RCS file: /cvsroot/darwinfiles/portage/pym/portage.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** portage.py 14 Aug 2002 02:54:57 -0000 1.3 --- portage.py 8 Sep 2002 16:20:08 -0000 1.4 *************** *** 3,7 **** # Distributed under the GNU Public License v2 ! VERSION="2.0.27" from stat import * --- 3,7 ---- # Distributed under the GNU Public License v2 ! VERSION="2.0.36" from stat import * *************** *** 10,15 **** import string,os,types,sys,shlex,shutil,xpak,fcntl,signal,time,cPickle,atexit,grp - ## Note: missingos removed until it will compile and work :( - #Secpass will be set to 1 if the user is root or in the wheel group. uid=os.getuid() --- 10,13 ---- *************** *** 75,87 **** starttime=int(time.time()) - #defined in doebuild as global - #dont set this to [], as it then gets seen as a list variable - #which gives tracebacks (usually if ctrl-c is hit very early) - buildphase="" - - #the build phases for which sandbox should be active - sandboxactive=["unpack","compile","clean","install","help","setup"] - #if the exithandler triggers before features has been initialized, then it's safe to assume - #that the sandbox isn't active. features=[] --- 73,76 ---- *************** *** 89,95 **** def exithandler(foo,bar): global features,secpass ! print "!!! Portage interrupted by SIGINT; exiting." ! #disable sandboxing to prevent problems ! #only do this if sandbox is in $FEATURES and we are root. if (secpass==2) and ("sandbox" in features): mypid=os.fork() --- 78,82 ---- def exithandler(foo,bar): global features,secpass ! #remove temp sandbox files if (secpass==2) and ("sandbox" in features): mypid=os.fork() *************** *** 97,107 **** myargs=[] mycommand="/usr/lib/portage/bin/testsandbox.sh" ! #if we are in the unpack,compile,clean or install phases, ! #there will already be one sandbox running for this call ! #to emerge ! if buildphase in sandboxactive: ! myargs=["testsandbox.sh","1"] ! else: ! myargs=["testsandbox.sh","0"] myenv={} os.execve(mycommand,myargs,myenv) --- 84,88 ---- myargs=[] mycommand="/usr/lib/portage/bin/testsandbox.sh" ! myargs=["testsandbox.sh","0"] myenv={} os.execve(mycommand,myargs,myenv) *************** *** 109,117 **** sys.exit(1) retval=os.waitpid(mypid,0)[1] ! print "PORTAGE: Checking for Sandbox ("+buildphase+")..." ! if retval==0: ! print "PORTAGE: No Sandbox running, deleting /etc/ld.so.preload!" ! if os.path.exists("/etc/ld.so.preload"): ! os.unlink("/etc/ld.so.preload") # 0=send to *everybody* in process group os.kill(0,signal.SIGKILL) --- 90,96 ---- sys.exit(1) retval=os.waitpid(mypid,0)[1] ! # if retval==0: ! # if os.path.exists("/tmp/sandboxpids.tmp"): ! # os.unlink("/tmp/sandboxpids.tmp") # 0=send to *everybody* in process group os.kill(0,signal.SIGKILL) *************** *** 283,287 **** pos=pos+1 ! specials={"KDEDIRS":[],"PATH":[],"CLASSPATH":[],"LDPATH":[],"MANPATH":[],"INFODIR":[],"ROOTPATH":[]} env={} --- 262,266 ---- pos=pos+1 ! specials={"KDEDIRS":[],"PATH":[],"CLASSPATH":[],"LDPATH":[],"MANPATH":[],"INFODIR":[],"ROOTPATH":[],"CONFIG_PROTECT":[],"CONFIG_PROTECT_MASK":[]} env={} *************** *** 342,351 **** continue outstring="export "+path+"='" ! for x in specials[path][:-1]: ! outstring=outstring+x+":" outstring=outstring+specials[path][-1]+"'" outfile.write(outstring+"\n") - #get it out of the way - # del specials[path] #create /etc/profile.env --- 321,332 ---- continue outstring="export "+path+"='" ! if path in ["CONFIG_PROTECT","CONFIG_PROTECT_MASK"]: ! for x in specials[path][:-1]: ! outstring += x+" " ! else: ! for x in specials[path][:-1]: ! outstring=outstring+x+":" outstring=outstring+specials[path][-1]+"'" outfile.write(outstring+"\n") #create /etc/profile.env *************** *** 797,802 **** to work.""" ! # we use the pid of the python instance to create a temp file ! # spawnebuild.sh and ebuild.sh uses to save/restore the environment. settings["PORTAGE_MASTER_PID"]=`os.getpid()` --- 778,782 ---- to work.""" ! # usefull if an ebuild or so needs to get the pid of our python process settings["PORTAGE_MASTER_PID"]=`os.getpid()` *************** *** 805,821 **** myargs=[] if ("sandbox" in features) and (not free): ! #only run sandbox for the following phases ! if buildphase in sandboxactive: ! mycommand="/usr/lib/portage/bin/sandbox" ! if debug: ! myargs=["sandbox",mystring] ! else: ! myargs=["sandbox",mystring] ! else: ! mycommand="/bin/bash" ! if debug: ! myargs=["bash","-x","-c",mystring] ! else: ! myargs=["bash","-c",mystring] else: mycommand="/bin/bash" --- 785,790 ---- myargs=[] if ("sandbox" in features) and (not free): ! mycommand="/usr/lib/portage/bin/sandbox" ! myargs=["sandbox",mystring] else: mycommand="/bin/bash" *************** *** 839,868 **** return 16 - def ebuildsh(mystring,debug=0): - "Spawn ebuild.sh, optionally in a sandbox" - - mylist=mystring.split() - for x in mylist: - global buildphase - buildphase=x - - #here we always want to call spawn with free=0, - #else the exit handler may not detect things properly - retval=spawn("/usr/sbin/ebuild.sh "+x,debug) - - #reset it again - buildphase="" - - #it is a batch call to ebuild.sh, so ebuild.sh should - #load the saved environment on next call. - settings["PORTAGE_RESTORE_ENV"]="1" - - if retval: - settings["PORTAGE_RESTORE_ENV"]="0" - return retval - - #reset it again - settings["PORTAGE_RESTORE_ENV"]="0" - def fetch(myuris): "fetch files. Will use digest file if available." --- 808,811 ---- *************** *** 1095,1108 **** settings["BUILD_PREFIX"]=settings["PORTAGE_TMPDIR"]+"/portage" settings["PKG_TMPDIR"]=settings["PORTAGE_TMPDIR"]+"/portage-pkg" ! if mydo!="depend": ! #depend may be run as non-root ! settings["BUILDDIR"]=settings["BUILD_PREFIX"]+"/"+settings["PF"] ! if not os.path.exists(settings["BUILDDIR"]): ! os.makedirs(settings["BUILDDIR"]) ! settings["T"]=settings["BUILDDIR"]+"/temp" ! if not os.path.exists(settings["T"]): ! os.makedirs(settings["T"]) ! settings["WORKDIR"]=settings["BUILDDIR"]+"/work" ! settings["D"]=settings["BUILDDIR"]+"/image/" if mydo=="unmerge": --- 1038,1051 ---- settings["BUILD_PREFIX"]=settings["PORTAGE_TMPDIR"]+"/portage" settings["PKG_TMPDIR"]=settings["PORTAGE_TMPDIR"]+"/portage-pkg" ! #depend may be run as non-root ! settings["BUILDDIR"]=settings["BUILD_PREFIX"]+"/"+settings["PF"] ! if not os.path.exists(settings["BUILDDIR"]) and mydo!="depend": ! os.makedirs(settings["BUILDDIR"]) ! # Should be ok again to set $T, as sandbox do not depend on it ! settings["T"]=settings["BUILDDIR"]+"/temp" ! if not os.path.exists(settings["T"]) and mydo!="depend": ! os.makedirs(settings["T"]) ! settings["WORKDIR"]=settings["BUILDDIR"]+"/work" ! settings["D"]=settings["BUILDDIR"]+"/image/" if mydo=="unmerge": *************** *** 1119,1129 **** settings["KV"]=mykv ! # if any of these are being called, handle them and stop now. if mydo in ["help","clean","setup","prerm","postrm","preinst","postinst","config"]: ! return ebuildsh(mydo,debug) # get possible slot information from the deps file if mydo=="depend": myso=getstatusoutput("/usr/sbin/ebuild.sh depend") return myso[0] try: --- 1062,1074 ---- settings["KV"]=mykv ! # if any of these are being called, handle them -- running them out of the sandbox -- and stop now. if mydo in ["help","clean","setup","prerm","postrm","preinst","postinst","config"]: ! return spawn("/usr/sbin/ebuild.sh "+mydo,debug,free=1) # get possible slot information from the deps file if mydo=="depend": myso=getstatusoutput("/usr/sbin/ebuild.sh depend") + if debug: + print myso[1] return myso[0] try: *************** *** 1181,1190 **** } if mydo in actionmap.keys(): ! return ebuildsh(actionmap[mydo],debug) elif mydo=="qmerge": #qmerge is specifically not supposed to do a runtime dep check return merge(settings["CATEGORY"],settings["PF"],settings["D"],settings["BUILDDIR"]+"/build-info",myroot) elif mydo=="merge": ! retval=ebuildsh("setup unpack compile install") if retval: return retval return merge(settings["CATEGORY"],settings["PF"],settings["D"],settings["BUILDDIR"]+"/build-info",myroot,myebuild=settings["EBUILD"]) --- 1126,1135 ---- } if mydo in actionmap.keys(): ! return spawn("/usr/sbin/ebuild.sh "+actionmap[mydo],debug) elif mydo=="qmerge": #qmerge is specifically not supposed to do a runtime dep check return merge(settings["CATEGORY"],settings["PF"],settings["D"],settings["BUILDDIR"]+"/build-info",myroot) elif mydo=="merge": ! retval=spawn("/usr/sbin/ebuild.sh setup unpack compile install") if retval: return retval return merge(settings["CATEGORY"],settings["PF"],settings["D"],settings["BUILDDIR"]+"/build-info",myroot,myebuild=settings["EBUILD"]) *************** *** 1211,1215 **** return 0 else: ! return ebuildsh("setup unpack compile install package") expandcache={} --- 1156,1160 ---- return 0 else: ! return spawn("/usr/sbin/ebuild.sh setup unpack compile install package") expandcache={} *************** *** 1325,1338 **** destorig=None #copy destnew file into place if sstat[ST_DEV]==dstat[ST_DEV]: ! #on the same fs try: os.rename(src,destnew) except: ! print "!!! rename fail 1 on",src,"->",destnew ! if destorig: ! os.unlink(destorig) ! return None ! else: #not on same fs try: --- 1270,1284 ---- destorig=None #copy destnew file into place + trycopy=1 if sstat[ST_DEV]==dstat[ST_DEV]: ! #on the same fs; note that a bind mount of the same filesystem will show up ! #as the same filesystem, but os.rename won't work, so we need to detect this and ! #fall back to copy, below... try: os.rename(src,destnew) + trycopy=0 except: ! pass ! if trycopy: #not on same fs try: *************** *** 1988,1995 **** myslash=mycpv.split("/") mysplit=pkgsplit(myslash[-1]) ! if len(myslash)==2: return myslash[0]+"/"+mysplit[0] ! else: return mysplit[0] def key_expand(mykey,mydb=None): --- 1934,1944 ---- myslash=mycpv.split("/") mysplit=pkgsplit(myslash[-1]) ! mylen=len(myslash) ! if mylen==2: return myslash[0]+"/"+mysplit[0] ! elif mylen==1: return mysplit[0] + else: + return mysplit def key_expand(mykey,mydb=None): *************** *** 2027,2030 **** --- 1976,1980 ---- myp=mysplit[0] else: + # "foo" ? myp=mycpv mykey=None *************** *** 2069,2073 **** return origdep ! def dep_expand(mydep,mydb): if not len(mydep): return mydep --- 2019,2023 ---- return origdep ! def dep_expand(mydep,mydb=None): if not len(mydep): return mydep *************** *** 2119,2123 **** return [1,[]] else: ! mylist=dep_listcleanup(dep_zapdeps(mysplit,mysplit2)) mydict={} for x in mylist: --- 2069,2074 ---- return [1,[]] else: ! mylist=flatten(dep_listcleanup(dep_zapdeps(mysplit,mysplit2))) ! #remove duplicates mydict={} for x in mylist: *************** *** 2421,2431 **** def counter_tick_core(myroot): "This method will grab the next COUNTER value and record it back to the global file. Returns new counter value." ! edbpath=myroot+"var/cache/edb/" ! cpath=edbpath+"counter" #We write our new counter value to a new file that gets moved into #place to avoid filesystem corruption on XFS (unexpected reboot.) - - newcpath=edbpath+"counter.new" if os.path.exists(cpath): cfile=open(cpath, "r") --- 2372,2379 ---- def counter_tick_core(myroot): "This method will grab the next COUNTER value and record it back to the global file. Returns new counter value." ! cpath=myroot+"var/cache/edb/counter" #We write our new counter value to a new file that gets moved into #place to avoid filesystem corruption on XFS (unexpected reboot.) if os.path.exists(cpath): cfile=open(cpath, "r") *************** *** 2433,2438 **** counter=long(cfile.readline()) except ValueError: ! print "portage: COUNTER was corrupted; resetting to value of 9999" ! counter=counter=long(9999) cfile.close() else: --- 2381,2386 ---- counter=long(cfile.readline()) except ValueError: ! counter=long(time.time()) ! print "portage: COUNTER was corrupted; resetting to value of",counter cfile.close() else: *************** *** 2441,2444 **** --- 2389,2393 ---- counter += 1 # update new global counter file + newcpath=cpath+".new" newcfile=open(newcpath,"w") newcfile.write(str(counter)) *************** *** 2447,2451 **** os.rename(newcpath,cpath) return counter - cptot=0 --- 2396,2399 ---- *************** *** 2467,2470 **** --- 2415,2446 ---- return counter_tick_core(self.root) + def cpv_counter(self,mycpv): + "This method will grab the next COUNTER value and record it back to the global file. Returns new counter value." + cpath=self.root+"var/db/pkg/"+mycpv+"/COUNTER" + + #We write our new counter value to a new file that gets moved into + #place to avoid filesystem corruption on XFS (unexpected reboot.) + corrupted=0 + if os.path.exists(cpath): + cfile=open(cpath, "r") + try: + counter=long(cfile.readline()) + except ValueError: + print "portage: COUNTER for",mycpv,"was corrupted; resetting to value of 0" + counter=long(0) + corrupted=1 + cfile.close() + else: + counter=long(0) + if corrupted: + newcpath=cpath+".new" + # update new global counter file + newcfile=open(newcpath,"w") + newcfile.write(str(counter)) + newcfile.close() + # now move global counter file into place + os.rename(newcpath,cpath) + return counter + def cpv_inject(self,mycpv): "injects a real package into our on-disk database; assumes mycpv is valid and doesn't already exist" *************** *** 2485,2489 **** mycpsplit=catpkgsplit(mycpv) mynewcpv=newcp+"-"+mycpsplit[2] ! mynewcat=mycpsplit[0] if mycpsplit[3]!="r0": mynewcpv += "-"+mycpsplit[3] --- 2461,2465 ---- mycpsplit=catpkgsplit(mycpv) mynewcpv=newcp+"-"+mycpsplit[2] ! mynewcat=newcp.split("/")[0] if mycpsplit[3]!="r0": mynewcpv += "-"+mycpsplit[3] *************** *** 2493,2502 **** if not os.path.exists(self.root+"var/db/pkg/"+mynewcat): #create the directory ! os.makedirs(self.root+"var/db/pkg"+mynewcat) newpath=self.root+"var/db/pkg/"+mynewcpv if os.path.exists(newpath): #dest already exists; keep this puppy where it is. continue - print "portage: vardbapi: moving",mycpv,"to",mynewcpv os.system("/bin/mv "+origpath+" "+newpath) --- 2469,2477 ---- if not os.path.exists(self.root+"var/db/pkg/"+mynewcat): #create the directory ! os.makedirs(self.root+"var/db/pkg/"+mynewcat) newpath=self.root+"var/db/pkg/"+mynewcpv if os.path.exists(newpath): #dest already exists; keep this puppy where it is. continue os.system("/bin/mv "+origpath+" "+newpath) *************** *** 2679,2700 **** return 0 - def gettimeval(self,mycatpkg): - """Get an integer time value that can be used to compare against other catpkgs; the timeval will try to use - COUNTER but will also take into account the start time of Portage and use mtimes of CONTENTS files if COUNTER - doesn't exist. The algorithm makes it safe to compare the timeval values of COUNTER-enabled and non-COUNTER - db entries. Assumes mycatpkg exists.""" - global starttime - rootp=self.root+"var/db/pkg/"+mycatpkg - if not os.path.exists(rootp+"/COUNTER"): - if not os.path.exists(rootp+"/CONTENTS"): - return 0 - else: - return os.stat(rootp+"/CONTENTS")[ST_MTIME] - else: - mycounterfile=open(rootp+"/COUNTER","r") - mycountervar=string.atoi(string.split(mycounterfile.readline())[0]) - mycounterfile.close() - return starttime+mycountervar - def populate(self): self.populated=1 --- 2654,2657 ---- *************** *** 2741,2744 **** --- 2698,2705 ---- mydbkey=dbcachedir+mycpv mycsplit=catpkgsplit(mycpv) + if not mycsplit: + #invalid cpv specified + print "portage: aux_get():",mycpv,"is not a valid cat/pkg-v string." + raise KeyError mysplit=mycpv.split("/") myebuild=self.findname(mycpv) *************** *** 2843,2849 **** #due to a stale or regenerated cache entry, we need to update our internal dictionary.... self.auxcache[mycpv]={"mtime":dmtime} ! for x in range(0,len(auxdbkeys)): ! self.auxcache[mycpv][auxdbkeys[x]]=mylines[x][:-1] ! #finally, we look at our internal cache entry and return the requested data. returnme=[] --- 2804,2813 ---- #due to a stale or regenerated cache entry, we need to update our internal dictionary.... self.auxcache[mycpv]={"mtime":dmtime} ! try: ! for x in range(0,len(auxdbkeys)): ! self.auxcache[mycpv][auxdbkeys[x]]=mylines[x][:-1] ! except IndexError: ! print "portage: aux_get(): error processing",auxdbkeys[x],"for",mycpv+"; exiting." ! sys.exit(1) #finally, we look at our internal cache entry and return the requested data. returnme=[] *************** *** 2859,2862 **** --- 2823,2829 ---- cps2=mykey.split("/") cps=catpkgsplit(mykey,0) + if not cps: + #invalid cat/pkg-v + return 0 if self.oroot: if os.path.exists(self.oroot+"/"+cps[0]+"/"+cps[1]+"/"+cps2[1]+".ebuild") or os.path.exists(self.oroot+"/"+cps[0]+"/"+cps[1]+"/"+cps2[1]+".ebuild"): *************** *** 2872,2875 **** --- 2839,2844 ---- try: for y in listdir(self.root+"/"+x): + if y=="CVS": + continue biglist.append(x+"/"+y) except: *************** *** 2879,2882 **** --- 2848,2853 ---- try: for y in listdir(self.oroot+"/"+x): + if y=="CVS": + continue mykey=x+"/"+y if not mykey in biglist: *************** *** 2991,2994 **** --- 2962,2969 ---- mykey=newlist[0] cpv=catpkgsplit(mykey) + if not cpv: + #invalid cat/pkg-v + print "portage: visible():",cpv,"is an invalid cat/pkg-v string. Aborting processing." + return [] mycp=cpv[0]+"/"+cpv[1] if maskdict.has_key(mycp): *************** *** 3209,3220 **** for x in mystuff: if x[-7:]==".ebuild": ! myebuildpath=self.dbdir+"/"+x+".ebuild" break #do prerm script if myebuildpath and os.path.exists(myebuildpath): a=doebuild(myebuildpath,"prerm",self.myroot) - if a: - print "!!! pkg_prerm() script failed; exiting." - sys.exit(a) mykeys=pkgfiles.keys() --- 3184,3192 ---- for x in mystuff: if x[-7:]==".ebuild": ! myebuildpath=self.dbdir+"/"+x break #do prerm script if myebuildpath and os.path.exists(myebuildpath): a=doebuild(myebuildpath,"prerm",self.myroot) mykeys=pkgfiles.keys() *************** *** 3251,3257 **** lmtime=`lstatobj[ST_MTIME]` #next line: we dont rely on mtimes for symlinks anymore. ! if (pkgfiles[obj][0] not in ("dir","fif","dev","sym")) and (lmtime != pkgfiles[obj][1]): ! print "--- !mtime", pkgfiles[obj][0], obj ! continue if pkgfiles[obj][0]=="dir": if not os.path.isdir(obj): --- 3223,3232 ---- lmtime=`lstatobj[ST_MTIME]` #next line: we dont rely on mtimes for symlinks anymore. ! try: ! if (pkgfiles[obj][0] not in ("dir","fif","dev","sym")) and (lmtime != pkgfiles[obj][1]): ! print "--- !mtime", pkgfiles[obj][0], obj ! continue ! except KeyError: ! print "--- !error",pkgfiles[obj][0],obj if pkgfiles[obj][0]=="dir": if not os.path.isdir(obj): *************** *** 3462,3468 **** if myebuildpath and os.path.exists(myebuildpath): a=doebuild(myebuildpath,"postrm",self.myroot) - if a: - print "!!! pkg_postrm() script failed; exiting." - sys.exit(a) def treewalk(self,srcroot,destroot,inforoot,myebuild): --- 3437,3440 ---- *************** *** 3492,3498 **** else: a=doebuild(inforoot+"/"+self.pkg+".ebuild","preinst",root) - if a: - print "!!! pkg_preinst() script failed; exiting." - sys.exit(a) # open CONTENTS file (possibly overwriting old one) for recording outfile=open(inforoot+"/CONTENTS","w") --- 3464,3467 ---- *************** *** 3563,3566 **** --- 3532,3538 ---- #convert a specific virtual like dev-lang/python-2.2 to dev-lang/python mysplit=catpkgsplit(mycatpkg) + if not mysplit: + print "portage: treewalk():",mycatpkg,"is an invalid PROVIDE entry; skipping." + continue mycatpkg=mysplit[0]+"/"+mysplit[1] if myvirts.has_key(mycatpkg): *************** *** 3579,3585 **** else: a=doebuild(inforoot+"/"+self.pkg+".ebuild","postinst",root) - if a: - print "!!! pkg_postinst() script failed; exiting." - sys.exit(a) #update environment settings, library paths env_update() --- 3551,3554 ---- *************** *** 3695,3698 **** --- 3664,3668 ---- print "!!!",mydest elif S_ISREG(mydmode): + cfgprot=0 # install of destination is blocked by an existing regular file; now, config file # management may come into play. *************** *** 3701,3766 **** # we have a protection path; enable config file management. destmd5=perform_md5(mydest) if cfgfiledict.has_key(myrealdest): - #this file has been merged in the past, either as the original file or as a ._cfg extension of original. - #we can skip the merging of this file. But we need to do one thing first, called "cycling". Let's say that - #since the last merge on this file, the user has copied /etc/._cfg0000_foo to /etc/foo. The ._cfg had - #position 4 in our md5 list (in cfgfiledict). Now that the file has been moved into place, we want to - #*throw away* md5s 0-3. Reasoning? By doing this, we discard expired md5sums, and also allow a *new* - #package to merge a "classic" version of the file (consider if the new version was buggy, so we reverted - #to the original... without this important code, the new "original" would not get merged since it had - #been merged before. if destmd5 in cfgfiledict[myrealdest]: ! cfgfiledict[myrealdest]=cfgfiledict[myrealdest][cfgfiledict[myrealdest].index(destmd5):] if mymd5==destmd5: ! #file already in place, so no need to merge this file. However, we need to update the ! #target file's times: os.utime(mydest,(thismtime,thismtime)) zing="---" moveme=0 elif cfgfiledict.has_key(myrealdest) and (mymd5 in cfgfiledict[myrealdest]): ! #ok, now that we've cycled cfgfiledict (see big paragraph above), it's safe to simply not merge this file ! #if it has been merged by us in the past. Thanks to the cycling, we can be do this with some assurance ! #that we are not being overly zealous in our desire to avoid merging files unnecessarily. ! zing="---" moveme=0 else: ! #don't overwrite -- ! # the files are not identical (from an md5 perspective); we cannot simply overwrite. ! pnum=-1 ! # set pmatch to the literal filename only ! pmatch=os.path.basename(mydest) ! # config protection filename format: ! # ._cfg0000_foo ! # positioning (for reference): ! # 0123456789012 ! mypfile="" ! for pfile in listdir(mydestdir): ! if pfile[0:5]!="._cfg": ! continue ! if pfile[10:]!=pmatch: ! continue ! try: ! newpnum=string.atoi(pfile[5:9]) ! if newpnum>pnum: ! pnum=newpnum ! mypfile=pfile ! except: ! continue ! pnum=pnum+1 ! # mypfile is set to the name of the most recent cfg management file currently on disk. ! # if their md5sums match, we overwrite the mypfile rather than creating a new .cfg file. ! # this keeps on-disk cfg management clutter to a minimum. ! cleanup=0 ! if mypfile: ! pmd5=perform_md5(mydestdir+"/"+mypfile) ! if mymd5==pmd5: ! mydest=(mydestdir+"/"+mypfile) ! cleanup=1 ! if not cleanup: ! # md5sums didn't match, so we create a new filename for merging. ! # we now have pnum set to the official 4-digit config that should be used for the file ! # we need to install. Set mydest to this new value. ! mydest=os.path.normpath(mydestdir+"/._cfg"+string.zfill(pnum,4)+"_"+pmatch) ! #add to our md5 list for future reference (will get written to /var/cache/edb/config) if not cfgfiledict.has_key(myrealdest): cfgfiledict[myrealdest]=[] --- 3671,3698 ---- # we have a protection path; enable config file management. destmd5=perform_md5(mydest) + cycled=0 if cfgfiledict.has_key(myrealdest): if destmd5 in cfgfiledict[myrealdest]: ! #cycle ! del cfgfiledict[myrealdest] ! cycled=1 if mymd5==destmd5: ! #file already in place; simply update mtimes of destination os.utime(mydest,(thismtime,thismtime)) zing="---" moveme=0 + elif cycled: + #mymd5!=destmd5 and we've cycled; move mysrc into place as a ._cfg file + moveme=1 + cfgfiledict[myrealdest]=[mymd5] + cfgprot=1 elif cfgfiledict.has_key(myrealdest) and (mymd5 in cfgfiledict[myrealdest]): ! #myd5!=destmd5, we haven't cycled, and the file we're merging has been already merged previously ! zing="-o-" moveme=0 else: ! #mymd5!=destmd5, we haven't cycled, and the file we're merging hasn't been merged before ! moveme=1 ! cfgprot=1 if not cfgfiledict.has_key(myrealdest): cfgfiledict[myrealdest]=[] *************** *** 3770,3773 **** --- 3702,3744 ---- if len(cfgfiledict[myrealdest])>16: del cfgfiledict[myrealdest][0] + + if cfgprot: + pnum=-1 + # set pmatch to the literal filename only + pmatch=os.path.basename(mydest) + # config protection filename format: + # ._cfg0000_foo + # positioning (for reference): + # 0123456789012 + mypfile="" + for pfile in listdir(mydestdir): + if pfile[0:5]!="._cfg": + continue + if pfile[10:]!=pmatch: + continue + try: + newpnum=string.atoi(pfile[5:9]) + if newpnum>pnum: + pnum=newpnum + mypfile=pfile + except: + continue + pnum=pnum+1 + # mypfile is set to the name of the most recent cfg management file currently on disk. + # if their md5sums match, we overwrite the mypfile rather than creating a new .cfg file. + # this keeps on-disk cfg management clutter to a minimum. + cleanup=0 + if mypfile: + pmd5=perform_md5(mydestdir+"/"+mypfile) + if mymd5==pmd5: + mydest=(mydestdir+"/"+mypfile) + cleanup=1 + if not cleanup: + # md5sums didn't match, so we create a new filename for merging. + # we now have pnum set to the official 4-digit config that should be used for the file + # we need to install. Set mydest to this new value. + mydest=os.path.normpath(mydestdir+"/._cfg"+string.zfill(pnum,4)+"_"+pmatch) + #add to our md5 list for future reference (will get written to /var/cache/edb/config) + # whether config protection or not, we merge the new file the same way. Unless moveme=0 (blocking directory) if moveme: *************** *** 3928,3933 **** if not os.path.exists(root+"var/tmp"): print ">>> "+root+"var/tmp doesn't exist, creating it..." ! os.mkdir(root+"var",0755) ! os.mkdir(root+"var/tmp",01777) cachedirs=["/var/cache/edb"] --- 3899,3911 ---- if not os.path.exists(root+"var/tmp"): print ">>> "+root+"var/tmp doesn't exist, creating it..." ! try: ! os.mkdir(root+"var",0755) ! except (OSError,IOError): ! pass ! try: ! os.mkdir(root+"var/tmp",01777) ! except: ! print "portage: couldn't create /var/tmp; exiting." ! sys.exit(1) cachedirs=["/var/cache/edb"] *************** *** 3972,3976 **** if not virts_p.has_key(vkeysplit[1]): virts_p[vkeysplit[1]]=virts[x] ! del x db["/"]={"virtuals":virts,"vartree":vartree("/",virts)} if root!="/": --- 3950,3954 ---- if not virts_p.has_key(vkeysplit[1]): virts_p[vkeysplit[1]]=virts[x] ! del x db["/"]={"virtuals":virts,"vartree":vartree("/",virts)} if root!="/": Index: portage_core.py =================================================================== RCS file: /cvsroot/darwinfiles/portage/pym/portage_core.py,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 Index: portage_core2.py =================================================================== RCS file: /cvsroot/darwinfiles/portage/pym/portage_core2.py,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 Index: portagedb.py =================================================================== RCS file: /cvsroot/darwinfiles/portage/pym/portagedb.py,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 |
From: <ji...@us...> - 2002-09-08 16:19:50
|
Update of /cvsroot/darwinfiles/portage/man In directory usw-pr-cvs1:/tmp/cvs-serv31821 Modified Files: ebuild.5 emerge.1 Added Files: etc-update.1 Log Message: Merged with portage-2.0.36 --- NEW FILE: etc-update.1 --- .TH etc-update "1" "March 2002" "gentoolkit 0.1.4" .SH NAME etc-update \- manual page for the etc-update program, a program that traverses your /etc directory, looking for suitable config file updates .SH SYNOPSIS .B etc-update .SH DESCRIPTION .I etc-update is supposed to be run after merging a new package, to see if there are updates to the configuration files in /etc. If a new configuration file will override an old one, .I etc-update will prompt the user for a decision. .PP .I etc-update will check all directories in \fI/etc/make.global\fR's \fICONFIG_PROTECT\fR variable. .SH OPTIONS .TP None. .SH AUTHORS Jochem Kossen and Leo Lipelis, 2002: etc-update .br Karl Trygve Kalleberg <ka...@ge...>, 2002: man page, fixes .SH "SEE ALSO" ebuild(5) .TP The \fI/usr/sbin/lintool\fR script. Index: ebuild.5 =================================================================== RCS file: /cvsroot/darwinfiles/portage/man/ebuild.5,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 Index: emerge.1 =================================================================== RCS file: /cvsroot/darwinfiles/portage/man/emerge.1,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** emerge.1 11 Aug 2002 02:09:33 -0000 1.1.1.1 --- emerge.1 8 Sep 2002 16:19:46 -0000 1.2 *************** *** 1,3 **** ! .TH "emerge" "1" "July 21, 2002" "portage 2.0.27" "" .SH "NAME" emerge \- Command\-line interface to the Portage system --- 1,3 ---- ! .TH "emerge" "1" "July 21, 2002" "portage 2.0.36" "" .SH "NAME" emerge \- Command\-line interface to the Portage system *************** *** 195,198 **** --- 195,204 ---- example, \fBUSE="\-x \-gnome" emerge mc\fR will emerge mc with those USE settings. + .LP + If \fBemerge --update system\fR or \fB emerge --update world\fR + fail with an error message, it may be that an ebuild uses some + newer feature not present in this version of \fBemerge\fR. You + can use \fBemerge --update portage\fR to upgrade to the lastest + version, which should support any necessary new features. .SH "SEE ALSO" \fBebuild(1) ebuild(5) make.defaults(5) make.conf(5)\fR |
From: <ji...@us...> - 2002-09-08 16:18:30
|
Update of /cvsroot/darwinfiles/portage/cnf In directory usw-pr-cvs1:/tmp/cvs-serv31508 Modified Files: make.globals Log Message: A few fixes Index: make.globals =================================================================== RCS file: /cvsroot/darwinfiles/portage/cnf/make.globals,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** make.globals 8 Sep 2002 16:16:35 -0000 1.3 --- make.globals 8 Sep 2002 16:18:27 -0000 1.4 *************** *** 3,8 **** USE_ORDER="env:conf:auto:defaults" ! GENTOO_MIRRORS="http://www.ibiblio.org/pub/Linux/distributions/gentoo" ! SYNC="rsync://rsync.gentoo.org/gentoo-portage" #CHOST="powerpc-apple-darwin5.5" # 10.1 --- 3,8 ---- USE_ORDER="env:conf:auto:defaults" ! GENTOO_MIRRORS="http://www.ibiblio.org/pub/Linux/distributions/gentoo/distfiles http://osdn.dl.sourceforge.net/sourceforge/darwinfiles" ! SYNC=="cvs://:pserver:ano...@cv...:/cvsroot/darwinfiles/packagetree" #CHOST="powerpc-apple-darwin5.5" # 10.1 |
From: <ji...@us...> - 2002-09-08 16:17:32
|
Update of /cvsroot/darwinfiles/portage/cnf In directory usw-pr-cvs1:/tmp/cvs-serv31249 Modified Files: make.conf Log Message: A few fixes Index: make.conf =================================================================== RCS file: /cvsroot/darwinfiles/portage/cnf/make.conf,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** make.conf 8 Sep 2002 16:16:35 -0000 1.4 --- make.conf 8 Sep 2002 16:17:29 -0000 1.5 *************** *** 39,44 **** # Examples: ! #CHOST="powerpc-apple-darwin5.5" 10.1 ! CHOST="powerpc-apple-darwin6.0" Jaguar 10.2 # PowerPC 750 > up: this works on G4s; --- 39,44 ---- # Examples: ! #CHOST="powerpc-apple-darwin5.5" # 10.1 ! CHOST="powerpc-apple-darwin6.0" # Jaguar 10.2 # PowerPC 750 > up: this works on G4s; |
From: <ji...@us...> - 2002-09-08 16:16:39
|
Update of /cvsroot/darwinfiles/portage/cnf In directory usw-pr-cvs1:/tmp/cvs-serv30966 Modified Files: make.conf make.globals Log Message: Added more CHOST lines Index: make.conf =================================================================== RCS file: /cvsroot/darwinfiles/portage/cnf/make.conf,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** make.conf 14 Aug 2002 02:59:44 -0000 1.3 --- make.conf 8 Sep 2002 16:16:35 -0000 1.4 *************** *** 7,12 **** # The main Gentoo Linux Portage server; specify a single Portage server. ! SYNC="rsync://rsync.gentoo.org/gentoo-portage" ! #SYNC="cvs://:pserver:ano...@cv...:/cvsroot/darwinfiles/packagetree" # Note: when using cvs, you must do a first inital checkout manually --- 7,12 ---- # The main Gentoo Linux Portage server; specify a single Portage server. ! #SYNC="rsync://rsync.gentoo.org/gentoo-portage" ! SYNC="cvs://:pserver:ano...@cv...:/cvsroot/darwinfiles/packagetree" # Note: when using cvs, you must do a first inital checkout manually *************** *** 39,44 **** # Examples: ! #These are all the same CHOST ! CHOST="powerpc-apple-darwin5.5" # PowerPC 750 > up: this works on G4s; --- 39,44 ---- # Examples: ! #CHOST="powerpc-apple-darwin5.5" 10.1 ! CHOST="powerpc-apple-darwin6.0" Jaguar 10.2 # PowerPC 750 > up: this works on G4s; Index: make.globals =================================================================== RCS file: /cvsroot/darwinfiles/portage/cnf/make.globals,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** make.globals 11 Aug 2002 02:52:52 -0000 1.2 --- make.globals 8 Sep 2002 16:16:35 -0000 1.3 *************** *** 6,10 **** SYNC="rsync://rsync.gentoo.org/gentoo-portage" ! CHOST="powerpc-apple-darwin5.5" PORTAGE_TMPDIR=/var/tmp --- 6,11 ---- SYNC="rsync://rsync.gentoo.org/gentoo-portage" ! #CHOST="powerpc-apple-darwin5.5" # 10.1 ! CHOST="powerpc-apple-darwin6.0" # Jaguar 10.2 PORTAGE_TMPDIR=/var/tmp |
From: <ji...@us...> - 2002-09-08 16:16:39
|
Update of /cvsroot/darwinfiles/portage/cnf/make.profile In directory usw-pr-cvs1:/tmp/cvs-serv30966/make.profile Modified Files: make.defaults Log Message: Added more CHOST lines Index: make.defaults =================================================================== RCS file: /cvsroot/darwinfiles/portage/cnf/make.profile/make.defaults,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** make.defaults 11 Aug 2002 02:51:22 -0000 1.1 --- make.defaults 8 Sep 2002 16:16:35 -0000 1.2 *************** *** 6,10 **** # Host-type ! CHOST=powerpc-apple-darwin5.5 PLATFORM=$CHOST --- 6,11 ---- # Host-type ! #CHOST="powerpc-apple-darwin5.5" # 10.1 ! CHOST="powerpc-apple-darwin6.0" # Jaguar 10.2 PLATFORM=$CHOST |
From: <ji...@us...> - 2002-09-08 16:16:07
|
Update of /cvsroot/darwinfiles/portage/cnf In directory usw-pr-cvs1:/tmp/cvs-serv30853 Added Files: etc-update.conf Log Message: Merged With portage-2.0.36 --- NEW FILE: etc-update.conf --- # edit the lines below to your liking # arguments used whenever rm is called rm_opts="-i" # arguments used whenever mv is called mv_opts="-i" # arguments used whenever cp is called cp_opts="-i" # pager for use with diff commands (see NOTE_2) pager="less" #pager="" # vim-users: you CAN use vimdiff for diff_command. (see NOTE_1) diff_command="diff -uN %file1 %file2" #diff_command="vim -d %file1 %file2" # vim-users: don't use vimdiff for merging (see NOTE_1) merge_command="sdiff -s -o %merged %orig %new" # EXPLANATION # # pager: # # Examples of pager usage: # pager="" # don't use a pager # pager="less -E" # less # pager="more" # more # # # diff_command: # # Arguments: # %file1 [REQUIRED] # %file2 [REQUIRED] # # Examples of diff_command: # diff_command="diff -uN %file1 %file2" # diff # diff_command="vim -d %file1 %file2" # vimdiff # # # merge_command: # # Arguments: # %orig [REQUIRED] # %new [REQUIRED] # %merged [REQUIRED] # # Examples of merge_command: # merge_command="sdiff -s -o %merged %old %new" # sdiff # # NOTE_1: Editors such as vim/vimdiff are not usable for the merge_command # because it is not known what filenames the produced files have (the user can # choose while using those programs) # NOTE_2: Make sure pager is set to "" when using an editor as diff_command! |
From: <ji...@us...> - 2002-09-08 16:13:11
|
Update of /cvsroot/darwinfiles/portage/bin In directory usw-pr-cvs1:/tmp/cvs-serv30224 Modified Files: dobin dohtml dojar doman ebuild.sh emerge pdb pdb.cgi repoman Added Files: dolib.a dolib.so etc-update newlib.a newlib.so preplib.so Log Message: Merged With portage-2.0.36 --- NEW FILE: dolib.a --- #!/bin/bash if [ ${#} -lt 1 ] then echo "${0}: at least one argument needed" exit 1 fi if [ ! -d ${D}${DESTTREE}/lib ] then install -d ${D}${DESTTREE}/lib fi for x in "$@" do if [ -e ${x} ] then install -m0644 ${x} ${D}${DESTTREE}/lib else echo "${0}: ${x} does not exist" fi done --- NEW FILE: dolib.so --- #!/bin/bash if [ ${#} -lt 1 ] then echo "${0}: at least one argument needed" exit 1 fi if [ ! -d ${D}${DESTTREE}/lib ] then install -d ${D}${DESTTREE}/lib fi for x in "$@" do if [ -e ${x} ] then if [ -z "$DEBUGBUILD" ] then strip --strip-debug ${x} fi install -m0755 ${x} ${D}${DESTTREE}/lib else echo "${0}: ${x} does not exist" fi done --- NEW FILE: etc-update --- #!/bin/bash # Copyright 2002 Gentoo Technologies, Inc. # Distributed under the terms of the GNU Public License, v2 or later # Author Brandon Low <los...@ge...> # # Previous version (from which I've borrowed a few bits) by: # Jochem Kossen <j.k...@ho...> # Leo Lipelis <ae...@ge...> # Karl Trygve Kalleberg <ka...@ge...> # # $Header: /cvsroot/darwinfiles/portage/bin/etc-update,v 1.1 2002/09/08 16:13:04 jimmacr Exp $ 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\ *=\ *\"\(.*\)\"/\1/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*_\)\(/.*$\):\1\2\3\%\2\%\3:" | sort -t'%' -k3 -k2 | 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 if [[ -z `diff -Nua ${rpath}/${rfile} ${rpath}/${rfile:10}| grep "^[+-][^+-]"|grep -v '# .Header:.*'` ]]; then 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 ]; do 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 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 (( ${mode} == 0 )); then cat ${TMP}/menuitems echo -n "Please select a file to edit by entering the corresponding number (-1 to exit): " 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} == 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 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 if (( ${my_input} == 0 )); then my_input=1 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 ( echo "Showing differences between ${ofile} and ${file}" `echo "${diff_command}" | sed -e "s:%file1:${ofile}:" \ -e "s:%file2:${file}:"` ) # | ${pager} 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 case ${my_input} in 1) echo "Replacing ${ofile} with ${file}" mv ${mv_opts} ${file} ${ofile} 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) 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) 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=/tmp/$$ rm -rf ${TMP} 2> /dev/null mkdir ${TMP} || die "failed mkdir command!" 1 # I need the CONFIG_PROTECT value source /etc/make.globals # load etc-config's configuration 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` 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="" rm_opts="" mv_opts="" cp_opts="" pager=""P 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 "No files to work on!" 0 fi sel_file if (( ${input} != -1 )); then do_file fi done die "User termination!" 0 --- NEW FILE: newlib.a --- #!/bin/bash rm -rf ${T}/${2} cp ${1} ${T}/${2} dolib.a ${T}/${2} --- NEW FILE: newlib.so --- #!/bin/bash rm -rf ${T}/${2} cp ${1} ${T}/${2} dolib.so ${T}/${2} --- NEW FILE: preplib.so --- #!/bin/bash if [ -n "${DEBUGBUILD}" ] then exit fi for x in $@ do strip --strip-debug ${D}${x}/*.so* done Index: dobin =================================================================== RCS file: /cvsroot/darwinfiles/portage/bin/dobin,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** dobin 11 Aug 2002 02:09:32 -0000 1.1.1.1 --- dobin 8 Sep 2002 16:13:03 -0000 1.2 *************** *** 28,31 **** install -m0755 --owner=root --group=root ${x} ${D}${DESTTREE}/bin fi ! done --- 28,31 ---- install -m0755 --owner=root --group=root ${x} ${D}${DESTTREE}/bin fi ! done Index: dohtml =================================================================== RCS file: /cvsroot/darwinfiles/portage/bin/dohtml,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 Index: dojar =================================================================== RCS file: /cvsroot/darwinfiles/portage/bin/dojar,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 Index: doman =================================================================== RCS file: /cvsroot/darwinfiles/portage/bin/doman,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** doman 11 Aug 2002 02:09:32 -0000 1.1.1.1 --- doman 8 Sep 2002 16:13:04 -0000 1.2 *************** *** 26,31 **** for x in "$@" do ! md=${x##*.} ! mandir=man${md:0:1} if [ -e ${x} ] then --- 26,38 ---- for x in "$@" do ! suf=${x##*.} ! if [ "$suf" = "gz" ] ! then ! realname=${x%.*} ! else ! realname=$x ! fi ! lastcomp=${realname##*.} ! mandir=man${lastcomp:0:1} if [ -e ${x} ] then *************** *** 35,39 **** fi install -m0644 ${x} ${D}${myloc}${myext}/man/${mandir} ! gzip -f -9 ${D}${myloc}${myext}/man/${mandir}/${x##*/} else echo "doman: ${x} does not exist." --- 42,49 ---- fi install -m0644 ${x} ${D}${myloc}${myext}/man/${mandir} ! if [ "$suf" != "gz" ] ! then ! gzip -f -9 ${D}${myloc}${myext}/man/${mandir}/${x##*/} ! fi else echo "doman: ${x} does not exist." Index: ebuild.sh =================================================================== RCS file: /cvsroot/darwinfiles/portage/bin/ebuild.sh,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** ebuild.sh 11 Aug 2002 02:09:32 -0000 1.1.1.1 --- ebuild.sh 8 Sep 2002 16:13:04 -0000 1.2 *************** *** 1,80 **** #!/bin/bash - # This should be the first thing sourced in this script, - # else we may set some variables to stale values. - if [ -n "$T" ] - then - # If $T is defined, then we're not simply calculating dependencies and - # can backup/restore our env otherwise, we don't wanna try it. - - # Save the environment apon exit - trap "esave_ebuild_env" EXIT - - # Calls ebuild.sh with the required arguments, restoring a saved - # environment if needed. - if [ "${PORTAGE_RESTORE_ENV}" = "1" ] && \ - [ -f ${T}/saved_ebuild_env_${PORTAGE_MASTER_PID} ] - then - set -f - source ${T}/saved_ebuild_env_${PORTAGE_MASTER_PID} &> /dev/null - set +f - # Do not use from saved environ. - unset SANDBOX_ON - fi - fi - - # Save the current environment to file. - esave_ebuild_env() { - # turn off globbing. - set -f - # unset this function, else we get problems on - # restore. Problem is that because we take out - # PORTAGE_RESTORE_ENV and PORTAGE_MASTER_PID, this - # function gets saved incomplete. - unset esave_ebuild_env - # we do not want to save critical variables - set | awk '!/PORTAGE_RESTORE_ENV|PORTAGE_MASTER_PID/ { print $0 }' \ - > ${T}/saved_ebuild_env_${PORTAGE_MASTER_PID} - set +f - } - - if [ -n "$#" ] then ARGS="${*}" ! fi ! ! ! # Do not use SANDBOX_ON from saved env ! #unset SANDBOX_ON use() { ! local x xopts flag opts ! ! # Splice off the use flag and space-separate its options ! flag="${1%%:*}" ! if [ "$flag" != "$1" ] ! then ! opts="${1#*:}" ! opts="${opts//,/ }" ! else ! opts= ! fi ! ! for x in $USE do ! # If there are options specified, make sure all of them are on. ! if [ "${x%%:*}" == "$flag" ] then ! xopts="${x#*:}" ! xopts=" ${xopts//,/ } " ! for i in $opts ! do ! if [ "${xopts/ $i /}" == "${xopts}" ] ! then ! return 1 ! fi ! done ! echo "$1" return 0 fi --- 1,16 ---- #!/bin/bash if [ -n "$#" ] then ARGS="${*}" ! fi use() { ! local x ! for x in ${USE} do ! if [ "${x}" = "${1}" ] then ! echo "${x}" return 0 fi *************** *** 95,98 **** --- 31,39 ---- fi + # Custom version of esyslog() to take care of the "Red Star" bug + # if no logger is running (tipically during bootstrap) + esyslog() { + return 0 + } #The following diefunc() and aliases come from Aron Griffis -- an excellent bash coder -- thanks! *************** *** 196,219 **** local x local y ! for x in "$@" do echo ">>> Unpacking ${x}" y="$(echo $x | sed 's:.*\.\(tar\)\.[a-zA-Z0-9]*:\1:')" case "${x##*.}" in tar) ! tar x --no-same-owner -f ${DISTDIR}/${x} || die ;; tgz) ! tar xz --no-same-owner -f ${DISTDIR}/${x} || die ;; tbz2) ! tar xj --no-same-owner -f ${DISTDIR}/${x} || die ;; ZIP|zip) ! unzip ${DISTDIR}/${x} || die ;; gz|Z|z) if [ "${y}" == "tar" ]; then ! tar xz --no-same-owner -f ${DISTDIR}/${x} || die else gzip -dc ${DISTDIR}/${x} > ${x%.*} --- 137,162 ---- local x local y ! local myfail ! for x in $@ do + myfail="failure unpacking ${x}" echo ">>> Unpacking ${x}" y="$(echo $x | sed 's:.*\.\(tar\)\.[a-zA-Z0-9]*:\1:')" case "${x##*.}" in tar) ! tar x --no-same-owner -f ${DISTDIR}/${x} || die "$myfail" ;; tgz) ! tar xz --no-same-owner -f ${DISTDIR}/${x} || die "$myfail" ;; tbz2) ! tar xj --no-same-owner -f ${DISTDIR}/${x} || die "$myfail" ;; ZIP|zip) ! unzip ${DISTDIR}/${x} || die "$myfail" ;; gz|Z|z) if [ "${y}" == "tar" ]; then ! tar xz --no-same-owner -f ${DISTDIR}/${x} || die "$myfail" else gzip -dc ${DISTDIR}/${x} > ${x%.*} *************** *** 222,233 **** bz2) if [ "${y}" == "tar" ]; then ! tar xj --no-same-owner -f ${DISTDIR}/${x} || die else ! bzip2 -dc ${DISTDIR}/${x} > ${x%.*} fi ;; *) ! echo '!!!'" Error: couldn't unpack ${x}: file format not recognized" ! exit 1 ;; esac --- 165,175 ---- bz2) if [ "${y}" == "tar" ]; then ! tar xj --no-same-owner -f ${DISTDIR}/${x} || die "$myfail" else ! bzip2 -dc ${DISTDIR}/${x} > ${x%.*} || die "$myfail" fi ;; *) ! die "unpack ${x}: file format not recognized" ;; esac *************** *** 244,257 **** --sysconfdir=/etc \ --localstatedir=/var/lib \ ! "$@" || return 1 else ! return 1 ! fi ! ! return } einstall() { ! if [ -f ./[mM]akefile ] ; then make prefix=${D}/usr \ mandir=${D}/usr/share/man \ --- 186,197 ---- --sysconfdir=/etc \ --localstatedir=/var/lib \ ! "$@" || die "econf failed" else ! die "no configure script found" ! fi } einstall() { ! if [ -f ./[mM]akefile -o -f ./GNUmakefile ] ; then make prefix=${D}/usr \ mandir=${D}/usr/share/man \ *************** *** 260,269 **** sysconfdir=${D}/etc \ localstatedir=${D}/var/lib \ ! "$@" install || exit 1 else ! exit 1 ! fi ! ! return } --- 200,207 ---- sysconfdir=${D}/etc \ localstatedir=${D}/var/lib \ ! "$@" install || die "einstall failed" else ! die "no Makefile found" ! fi } *************** *** 274,283 **** src_unpack() { ! unpack ${A} } src_compile() { ! if [ -x ./configure ] ; then ! econf || die "econf failed" emake || die "emake failed" fi --- 212,224 ---- src_unpack() { ! if [ "${A}" != "" ] ! then ! unpack ${A} || die "unpack failed" ! fi } src_compile() { ! if [ -x ./configure ] ; then ! econf emake || die "emake failed" fi *************** *** 323,340 **** } - dyn_touch() { - local x - for x in $AA - do - if [ -e ${DISTDIR}/${x} ] - then - touch ${DISTDIR}/${x} - fi - done - } - dyn_setup() { ! pkg_setup } --- 264,270 ---- } dyn_setup() { ! pkg_setup || die "pkg_setup function failed; exiting." } *************** *** 346,350 **** local x local checkme ! for x in $AA do echo ">>> Checking ${x}'s mtime..." --- 276,280 ---- local x local checkme ! for x in ${AA} do echo ">>> Checking ${x}'s mtime..." *************** *** 375,379 **** cd ${WORKDIR} echo ">>> Unpacking source..." ! src_unpack echo ">>> Source unpacked." cd .. --- 305,310 ---- cd ${WORKDIR} echo ">>> Unpacking source..." ! src_unpack ! #|| abort_unpack "fail" echo ">>> Source unpacked." cd .. *************** *** 382,397 **** dyn_clean() { ! if [ -d ${WORKDIR} ] ! then ! rm -rf ${WORKDIR} ! fi ! if [ -d ${BUILDDIR}/image ] ! then ! rm -rf ${BUILDDIR}/image ! fi ! if [ -d ${BUILDDIR}/build-info ] ! then ! rm -rf ${BUILDDIR}/build-info ! fi rm -rf ${BUILDDIR}/.compiled } --- 313,319 ---- dyn_clean() { ! rm -rf ${WORKDIR} ! rm -rf ${BUILDDIR}/image ! rm -rf ${BUILDDIR}/build-info rm -rf ${BUILDDIR}/.compiled } *************** *** 435,438 **** --- 357,361 ---- fi } + docinto() { if [ $1 = "/" ] *************** *** 502,544 **** } abort_compile() { ! echo ! echo '*** Compilation Aborted ***' ! echo ! cd ${BUILDDIR} #original dir ! rm -f .compiled ! trap SIGINT SIGQUIT ! exit 1 } abort_unpack() { ! echo ! echo '*** Unpack Aborted ***' ! echo ! cd ${BUILDDIR} #original dir ! rm -f .unpacked ! rm -rf work ! trap SIGINT SIGQUIT ! exit 1 } abort_package() { ! echo ! echo '*** Packaging Aborted ***' ! echo ! cd ${BUILDDIR} #original dir ! rm -f .packaged rm -f ${PKGDIR}/All/${PF}.t* - trap SIGINT SIGQUIT exit 1 } ! abort_image() { ! echo ! echo '*** Imaging Aborted ***' ! echo ! cd ${BUILDDIR} #original dir ! rm -rf image ! trap SIGINT SIGQUIT exit 1 } --- 425,467 ---- } + 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_install() { ! abort_handler "src_install" $1 ! rm -rf ${BUILDDIR}/image exit 1 } *************** *** 549,553 **** if [ ${BUILDDIR}/.compiled -nt ${WORKDIR} ] then ! echo ">>> It appears that ${PN} is already compiled. skipping." echo ">>> (clean to force compilation)" trap SIGINT SIGQUIT --- 472,476 ---- if [ ${BUILDDIR}/.compiled -nt ${WORKDIR} ] then ! echo ">>> It appears that ${PN} is already compiled; skipping." echo ">>> (clean to force compilation)" trap SIGINT SIGQUIT *************** *** 561,572 **** #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" ! #some users have $TMPDIR to a custom dir in thier home ... #this will cause sandbox errors with some ./configure #scripts, so set it to $T. export TMPDIR="${T}" src_compile cd ${BUILDDIR} touch .compiled --- 484,496 ---- #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" ! #some users have $TMPDIR to a custom dir in their home ... #this will cause sandbox errors with some ./configure #scripts, so set it to $T. export TMPDIR="${T}" src_compile + #|| abort_compile "fail" cd ${BUILDDIR} touch .compiled *************** *** 608,612 **** install -d ${PKGDIR}/${CATEGORY} fi ! ln -sf ${PKGDIR}/All/${PF}.tbz2 ${PKGDIR}/${CATEGORY}/${PF}.tbz2 echo ">>> Done." cd ${BUILDDIR} --- 532,536 ---- install -d ${PKGDIR}/${CATEGORY} fi ! ln -sf ../All/${PF}.tbz2 ${PKGDIR}/${CATEGORY}/${PF}.tbz2 echo ">>> Done." cd ${BUILDDIR} *************** *** 617,621 **** dyn_install() { local ROOT ! trap "abort_image" SIGINT SIGQUIT rm -rf ${BUILDDIR}/image mkdir ${BUILDDIR}/image --- 541,545 ---- dyn_install() { local ROOT ! trap "abort_install" SIGINT SIGQUIT rm -rf ${BUILDDIR}/image mkdir ${BUILDDIR}/image *************** *** 636,641 **** #scripts, so set it to $T. export TMPDIR="${T}" ! src_install ! prepall cd ${D} echo ">>> Completed installing into ${D}" --- 560,566 ---- #scripts, so set it to $T. export TMPDIR="${T}" ! src_install ! #|| abort_install "fail" ! prepall cd ${D} echo ">>> Completed installing into ${D}" *************** *** 787,803 **** # Sources all eclasses in parameters inherit() { - - while [ "$1" ]; do - - # any future resolution code goes here - local location - location="${ECLASSDIR}/${1}.eclass" - - debug-print "inherit: $1 -> $location" - - source "$location" || die "died sourcing $location in inherit()" - - shift done --- 712,737 ---- # Sources all eclasses in parameters inherit() { + local location + while [ "$1" ] + do + # any future resolution code goes here + if [ -n "$PORTDIR_OVERLAY" ] + then + location="${PORTDIR_OVERLAY}/eclass/${1}.eclass" + if [ -e "$location" ] + then + debug-print "inherit: $1 -> $location" + source "$location" || die "died sourcing $location in inherit()" + #continue processing, skip sourcing of one in $ECLASSDIR + continue + fi + fi + + location="${ECLASSDIR}/${1}.eclass" + debug-print "inherit: $1 -> $location" + source "$location" || die "died sourcing $location in inherit()" + + shift done *************** *** 845,854 **** # --- functions end, main part begins --- export SANDBOX_ON="1" ! source ${EBUILD} ! if [ $? -ne 0 ] ! then ! #abort if there was a parse problem ! exit 1 ! fi #a reasonable default for $S if [ "$S" = "" ] --- 779,783 ---- # --- functions end, main part begins --- export SANDBOX_ON="1" ! source ${EBUILD} || die "error sourcing ebuild" #a reasonable default for $S if [ "$S" = "" ] *************** *** 873,877 **** set +f ! for myarg in $ARGS do case $myarg in --- 802,806 ---- set +f ! for myarg in $* do case $myarg in *************** *** 881,887 **** --- 810,818 ---- 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 *************** *** 897,903 **** --- 828,836 ---- 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 *************** *** 918,922 **** fi ;; ! touch|package|rpm) export SANDBOX_ON="0" if [ "$PORTAGE_DEBUG" = "0" ] --- 851,855 ---- fi ;; ! package|rpm) export SANDBOX_ON="0" if [ "$PORTAGE_DEBUG" = "0" ] *************** *** 958,961 **** --- 891,895 ---- echo dyn_help + exit 1 ;; esac Index: emerge =================================================================== RCS file: /cvsroot/darwinfiles/portage/bin/emerge,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** emerge 11 Aug 2002 02:09:33 -0000 1.1.1.1 --- emerge 8 Sep 2002 16:13:04 -0000 1.2 *************** *** 130,134 **** print " installed when it really isn't. Handy if you roll your own" print " packages. Example: " ! print " "+bold("emerge inject gentoo-sources-2.4.19") print print turquoise("Options:") --- 130,135 ---- print " installed when it really isn't. Handy if you roll your own" print " packages. Example: " ! #NOTE: this next line *needs* the "sys-kernel/"; *please* don't remove it! ! print " "+bold("emerge inject sys-kernel/gentoo-sources-2.4.19") print print turquoise("Options:") *************** *** 323,332 **** elif (not myaction) and (x in actions): myaction=x ! else: # this little conditional helps tab completion ! if x[-1]=="/": ! myfiles.append(x[:-1]) ! else: ! myfiles.append(x) # Also allow -S to invoke search action (-sS) --- 324,341 ---- elif (not myaction) and (x in actions): myaction=x ! elif x[-1]=="/": # this little conditional helps tab completion ! myfiles.append(x[:-1]) ! #elif (myaction) and (x in actions): ! # #catch "world system" and "world foo" issues.... ! # print "emerge: please specify either \""+myaction+"\" or \""+x+"\", but not both." ! # sys.exit(1) ! else: ! myfiles.append(x) ! ! 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) ! # Also allow -S to invoke search action (-sS) *************** *** 387,392 **** sys.stdout.flush() package_parts=package.split("/") if re.search(self.searchkey.lower(), package_parts[1].lower()): ! self.matches["pkg"].append(package) elif self.searchdesc: # DESCRIPTION searching #description searching is a bit broken because we use visible packages rather than --- 396,404 ---- sys.stdout.flush() package_parts=package.split("/") + masked=0 if re.search(self.searchkey.lower(), package_parts[1].lower()): ! if not portage.portdb.xmatch("match-visible",package): ! masked=1 ! self.matches["pkg"].append([package,masked]) elif self.searchdesc: # DESCRIPTION searching #description searching is a bit broken because we use visible packages rather than *************** *** 395,403 **** if not full_package: #no match found; we don't want to query description ! full_package="" continue - full_desc = portage.portdb.aux_get(full_package,["DESCRIPTION"])[0] if re.search(self.searchkey.lower(), full_desc.lower()): ! self.matches["desc"].append(full_package) self.mlen=0 for mtype in self.matches.keys(): --- 407,422 ---- 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 re.search(self.searchkey.lower(), full_desc.lower()): ! self.matches["desc"].append([full_package,masked]) self.mlen=0 for mtype in self.matches.keys(): *************** *** 411,433 **** print " " for mtype in self.matches.keys(): ! for match in self.matches[mtype]: if mtype=="pkg": full_package = portage.portdb.xmatch("bestmatch-visible",match) if not full_package: ! #it's masked; we do filtering here because it's theoretically faster ! full_package="" else: full_package=match if full_package: ! desc, homepage = portage.portdb.aux_get(full_package,["DESCRIPTION","HOMEPAGE"]) ! print green("*")+" "+white(match) ! print " ", "Latest version Available:",self.getVersion(full_package, search.VERSION_RELEASE) print " ", self.getInstallationStatus(match) print " ", "Homepage:",homepage print " ", "Description:",desc print " " - else: - print green("*")+" "+white(match)+" "+red("[ Masked ]") - print " " # --- 430,457 ---- print " " for mtype in self.matches.keys(): ! for match,masked in self.matches[mtype]: if mtype=="pkg": 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 if full_package: ! try: ! desc, homepage = portage.portdb.aux_get(full_package,["DESCRIPTION","HOMEPAGE"]) ! except KeyError: ! print "emerge: search: aux_get() failed, skipping" ! continue ! if masked: ! print green("*")+" "+white(match)+" "+red("[ Masked ]") ! else: ! print green("*")+" "+white(match) ! print " ", "Latest version available:",self.getVersion(full_package, search.VERSION_RELEASE) print " ", self.getInstallationStatus(match) print " ", "Homepage:",homepage print " ", "Description:",desc print " " # *************** *** 438,445 **** result = "" version = self.getVersion(installed_package,search.VERSION_RELEASE) ! if len(version) > 1: ! result = "Latest version Installed: "+version else: ! result = "Latest version Installed: [ Not Installed ]" return result --- 462,469 ---- result = "" version = self.getVersion(installed_package,search.VERSION_RELEASE) ! if len(version) > 0: ! result = "Latest version installed: "+version else: ! result = "Latest version installed: [ Not Installed ]" return result *************** *** 502,506 **** global olddbapi self.myaction=myaction - self.myopts=myopts virts=portage.getvirtuals("/") self.digraph=portage.digraph() --- 526,529 ---- *************** *** 519,522 **** --- 542,558 ---- #portage.db["/"]["vartree"].virtual={"virtual/glibc":"sys-libs/glibc"} self.outdatedpackages=[] + self.mydbapi={} + if "--update" in myopts: + #for --update, we want to rebuild an entire empty tree of dependencies, and then we won't merge was is already merged. + self.mydbapi["/"]=self.fakedbapi + else: + self.mydbapi["/"]=portage.db["/"]["vartree"].dbapi + if portage.root!="/": + if "--update" in myopts: + self.mydbapi[portage.root]=self.fakedbapi + else: + self.mydbapi[portage.root]=portage.db[portage.root]["vartree"].dbapi + if "--usepkg" in myopts: + portage.db["/"]["bintree"].populate() def create(self,mybigkey,myparent=None,addme=1): *************** *** 524,529 **** 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)""" ! #if mybigkey==None: ! # return #update our groovy spinner global spinner, spinpos --- 560,568 ---- 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)""" ! 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 our groovy spinner global spinner, spinpos *************** *** 533,545 **** mytype,myroot,mykey=mybigkey ! #select the correct /var database that we'll be checking against vardbapi=portage.db[myroot]["vartree"].dbapi ! if "--update" in self.myopts: ! #for --update, we want to rebuild an entire empty tree of dependencies, and then we won't merge was is already merged. ! mydbapi=self.fakedbapi ! else: ! mydbapi=vardbapi ! merging=1 #this is where we add the node to the list of packages to merge --- 572,580 ---- mytype,myroot,mykey=mybigkey ! #select the correct /var database that we'll be checking against vardbapi=portage.db[myroot]["vartree"].dbapi ! ! merging=1 #this is where we add the node to the list of packages to merge *************** *** 549,558 **** #we've encountered a "blocks" node. We will totally ignore this node and not add it to our digraph if it doesn't #apply to us. ! if myparent and mydbapi.match(mykey): #otherwise, encode parent information where we would normally write "(no)merge" and continue: mybigkey.append(myparent.split()[2]) parenttype,parentroot,parentkey,mergeme=string.split(myparent) ! mykexp=portage.dep_expand(mykey,mydbapi) ! pakexp=portage.dep_expand(parentkey,mydbapi) myrealkey=portage.dep_getkey(mykexp) parealkey=portage.dep_getkey(pakexp) --- 584,593 ---- #we've encountered a "blocks" node. We will totally ignore this node and not add it to our digraph if it doesn't #apply to us. ! if myparent and self.mydbapi[myroot].match(mykey): #otherwise, encode parent information where we would normally write "(no)merge" and continue: mybigkey.append(myparent.split()[2]) parenttype,parentroot,parentkey,mergeme=string.split(myparent) ! mykexp=portage.dep_expand(mykey,self.mydbapi[myroot]) ! pakexp=portage.dep_expand(parentkey,self.mydbapi[myroot]) myrealkey=portage.dep_getkey(mykexp) parealkey=portage.dep_getkey(pakexp) *************** *** 561,565 **** #since our blocks doesn't match any installed packages, it doesn't apply to us and we can ignore it. return 1 ! elif "--emptytree" in self.myopts: #if we are in "--emptytree" mode, then we want to merge the package even if it is already installed. mybigkey.append("merge") --- 596,600 ---- #since our blocks doesn't match any installed packages, it doesn't apply to us and we can ignore it. return 1 ! elif "--emptytree" in myopts: #if we are in "--emptytree" mode, then we want to merge the package even if it is already installed. mybigkey.append("merge") *************** *** 567,571 **** #we're doing a normal merge and processing an item specified on the command-line. #So we need to check for the --noreplace option. ! if "--noreplace" in self.myopts: if not vardbapi.cpv_exists(mykey): #the package isn't on the system, so merge it. --- 602,606 ---- #we're doing a normal merge and processing an item specified on the command-line. #So we need to check for the --noreplace option. ! if "--noreplace" in myopts: if not vardbapi.cpv_exists(mykey): #the package isn't on the system, so merge it. *************** *** 584,592 **** mybigkey.append("nomerge") merging=0 ! #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 "--nodeps" in self.myopts: #if we are not processing dependencies, then, err... abort here and don't process dependencies :) return 1 --- 619,631 ---- mybigkey.append("nomerge") merging=0 + else: + mybigkey.append("nomerge") + #special "--onlydeps" mode + merging=2 ! #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 "--nodeps" in myopts: #if we are not processing dependencies, then, err... abort here and don't process dependencies :) return 1 *************** *** 616,627 **** #myebuild=portage.db[myroot]["porttree"].getname(mykey) try: ! edepend=portage.db[myroot]["porttree"].dbapi.aux_get(mykey,["DEPEND","RDEPEND"]) except (KeyError,IOError): print "emerge: create(): aux_get() error on",mykey+"; aborting..." sys.exit(1) - mydep={} if myroot=="/": mydep["/"]=edepend[0]+" "+edepend[1] else: # We can no longer do this: mydep["/"],mydep[myroot]=edepend --- 655,668 ---- #myebuild=portage.db[myroot]["porttree"].getname(mykey) try: ! edepend=portage.portdb.aux_get(mykey,["DEPEND","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[0]+" "+edepend[1] + if self.select_dep("/",edepend[0]+" "+edepend[1],myparent=mp): + return 1 else: # We can no longer do this: mydep["/"],mydep[myroot]=edepend *************** *** 629,693 **** mydep["/"]=edepend[0] mydep[myroot]=edepend[1] ! ! #Cycle through all our dependencies by their "root" (root fs where they will be installed): ! for myroot in mydep.keys(): ! ! mycheck=portage.dep_check(mydep[myroot],mydbapi) ! if mycheck[0]==0: ! print "emerge: error merging",mytype,mykey+": invalid dependency in:" ! print white("\n'"+mydep[myroot]+"'") ! print ">>> Please report this ebuild error to http://bugs.gentoo.org.\n" ! return 0 ! #Now, handle unsatisfied dependencies ! for x in mycheck[1]: ! if addme: ! parent=string.join(mybigkey) ! else: ! #--onlydeps is specified and addme is off; this means that our parent doesn't exist so set parent to None ! parent=None ! # support mutual exclusive deps ! mydep2=x ! if mydep2[0]=="!": ! mydep2=x[1:] ! ! if x[0]=="!": ! #add our blocker; it will be ignored later if necessary (if we are remerging the same pkg, for example) ! #myk=["blocks",myroot,portage.dep_expand(mydep2,mydbapi)] ! myk=["blocks",myroot,mydep2] ! else: ! #We are not processing a blocker but a normal dependency ! myeb=portage.db[portage.root]["porttree"].dep_bestmatch(mydep2) ! if not myeb: ! if not mykey: ! print "\n!!! Error: couldn't find match for \""+x+"\"" ! else: ! print "\n!!! Error: couldn't find match for \""+x+"\" in",mykey ! print ! sys.exit(1) ! if "--usepkg" in self.myopts: ! #If we want to use packages, see if we have a pre-built one... ! mypk=portage.db[portage.root]["bintree"].dbapi.match(x) ! if myeb in mypk: ! #Use it only if it's exactly the version we want. ! myk=["binary",portage.root,myeb] ! else: ! myk=["ebuild",myroot,myeb] else: ! myk=["ebuild",myroot,myeb] ! ! hacko=myk[:] ! hacko2=myk[:] ! hacko.append("merge") ! hacko2.append("nomerge") ! ! if not self.digraph.hasnode(string.join(hacko)): ! if not self.digraph.hasnode(string.join(hacko2)): ! #this conditional is needed to prevent infinite recursion on already-processed deps ! self.create(myk,parent) return 1 ! def altlist(self): mygraph=self.digraph.copy() --- 670,757 ---- mydep["/"]=edepend[0] mydep[myroot]=edepend[1] ! if self.select_dep("/",mydep["/"],myparent=mp): ! if self.select_dep(myroot,mydep[myroot],myparent=mp): ! return 1 ! return 0 ! ! 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": ! mytbz2=xpak.tbz2(x) ! mykey=mytbz2.getelements("CATEGORY")[0]+"/"+os.path.basename(x)[:-5] ! 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": ! mykey=os.path.basename(os.path.abspath(x+"/../.."))+"/"+os.path.basename(x)[:-7] ! 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: ! mykey=portage.dep_expand(x,portage.portdb) ! #select needs to return 0 on dep_check failure ! if not self.select_dep(portage.root,mykey,arg=x): ! return (0,myfavorites) ! elif not "--oneshot" in myopts: ! myfavorites.append(mykey) ! return (1,myfavorites) ! def select_dep(self,myroot,depstring,myparent=None,arg=None): ! "given a dependency string, create the appropriate depgraph and return 1 on success and 0 on failure" ! if not arg: ! #processing dependencies ! mycheck=portage.dep_check(depstring,self.mydbapi[myroot]) ! if not mycheck[0]: ! return 0 ! mymerge=mycheck[1] ! else: ! #we're processing a command-line argument; unconditionally merge it even if it's already merged ! mymerge=[depstring] ! for x in mymerge: ! if x[0]=="!": ! #add our blocker; it will be ignored later if necessary (if we are remerging the same pkg, for example) ! myk=["blocks",myroot,x[1:]] ! else: ! #We are not processing a blocker but a normal dependency ! myeb=portage.portdb.xmatch("bestmatch-visible",x) ! if not myeb: ! if not arg: ! xinfo='"'+x+'"' else: ! xinfo='"'+arg+'"' ! if myparent: ! xinfo += " (from "+myparent+")" ! alleb=portage.portdb.xmatch("match-all",x) ! if alleb: ! print "\n\nemerge: all ebuilds that could satisfy "+xinfo+" have been masked." ! else: ! print "\n\nemerge: there are no masked or unmasked ebuilds to satisfy "+xinfo+"." ! return 0 + 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 + self.create(myk,myparent) + else: + #if mysource is not set, then we are a command-line dependency and should not be added + #if --onlydeps is specified. + self.create(myk,myparent,"--onlydeps" not in myopts) return 1 ! ! def altlist(self): mygraph=self.digraph.copy() *************** *** 711,715 **** #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 self.myopts: # if not portage.db["/"]["vartree"].exists_specific(splitski[2]): # portage.db["/"]["merge"].append(splitski) --- 775,779 ---- #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) *************** *** 753,760 **** #THIS NEXT BUNCH OF CODE NEEDS TO BE REPLACED TO SUPPORT WORLD ANTI-DEPS #if mydep2[0]=="!":, etc. ! if "--usepkg" in self.myopts: mypk=portage.db[portage.root]["bintree"].dep_bestmatch(mydep) if myeb==mypk: ! myk=["binary ",portage.root,mypk] else: myk=["ebuild",portage.root,myeb] --- 817,824 ---- #THIS NEXT BUNCH OF CODE NEEDS TO BE REPLACED TO SUPPORT WORLD ANTI-DEPS #if mydep2[0]=="!":, etc. ! if "--usepkg" in myopts: mypk=portage.db[portage.root]["bintree"].dep_bestmatch(mydep) if myeb==mypk: ! myk=["binary",portage.root,mypk] else: myk=["ebuild",portage.root,myeb] *************** *** 784,788 **** sys.exit(1) ! if "--usepkg" in self.myopts: mypk=portage.db[portage.root]["bintree"].dep_bestmatch(mydep) if myeb==mypk: --- 848,852 ---- sys.exit(1) ! if "--usepkg" in myopts: mypk=portage.db[portage.root]["bintree"].dep_bestmatch(mydep) if myeb==mypk: *************** *** 812,819 **** print else: - #if ("--update" in self.myopts) and (portage.db[x[1]]["vartree"].exists_specific(x[2])): - # print "DEBUG: removing",x[2],"from list" - # #already merged, continue - # continue if x[3]=="nomerge": continue --- 876,879 ---- *************** *** 845,854 **** #(emerge is already handling that) y=portage.portdb.findname(x[2]) ! if ("--update" in self.myopts) and (portage.db[x[1]]["vartree"].exists_specific(x[2])): #already merged, continue continue print ">>> emerge",x[2],"to",x[1] if x[0]=="ebuild": ! if "--fetchonly" in self.myopts: retval=portage.doebuild(y,"fetch",myroot,edebug) if retval: --- 905,914 ---- #(emerge is already handling that) y=portage.portdb.findname(x[2]) ! if ("--update" in myopts) and (portage.db[x[1]]["vartree"].exists_specific(x[2])): #already merged, continue continue print ">>> emerge",x[2],"to",x[1] if x[0]=="ebuild": ! if "--fetchonly" in myopts: retval=portage.doebuild(y,"fetch",myroot,edebug) if retval: *************** *** 857,869 **** print returnme=1 ! elif "--buildpkg" in self.myopts: #create pkg, then merge pkg retval=portage.doebuild(y,"clean",myroot,edebug) if retval: - print "!!! emerge aborting on ",y,"." sys.exit(1) retval=portage.doebuild(y,"package",myroot,edebug) if retval: - print "!!! emerge aborting on ",y,"." sys.exit(1) #dynamically update our database --- 917,927 ---- print returnme=1 ! elif "--buildpkg" in myopts: #create pkg, then merge pkg retval=portage.doebuild(y,"clean",myroot,edebug) if retval: sys.exit(1) retval=portage.doebuild(y,"package",myroot,edebug) if retval: sys.exit(1) #dynamically update our database *************** *** 872,885 **** retval=portage.pkgmerge(mytbz2,myroot) if retval==None: - print "!!! emerge aborting on ",y,"." sys.exit(1) else: retval=portage.doebuild(y,"clean",myroot,edebug) if retval: - print "!!! emerge aborting on ",y,"." sys.exit(1) retval=portage.doebuild(y,"merge",myroot,edebug) if retval: - print "!!! emerge aborting on ",y,"." sys.exit(1) #dynamically update our database --- 930,940 ---- *************** *** 889,899 **** retval=portage.pkgmerge(mytbz2,x[1]) if retval==None: - print "!!! emerge aborting on ",y,"." sys.exit(1) #need to check for errors portage.db[x[1]]["vartree"].inject(x[2]) ! if (not "--fetchonly" in self.myopts) and (x[2] in favorites): ! mysplit=portage.catpkgsplit(x[2]) ! myfavkey=mysplit[0]+"/"+mysplit[1] myfavs=portage.grabfile(myroot+"var/cache/edb/world") myfavdict=genericdict(myfavs) --- 944,952 ---- retval=portage.pkgmerge(mytbz2,x[1]) if retval==None: sys.exit(1) #need to check for errors portage.db[x[1]]["vartree"].inject(x[2]) ! myfavkey=portage.cpv_getkey(x[2]) ! if (not "--fetchonly" in myopts) and (myfavkey in favorites): myfavs=portage.grabfile(myroot+"var/cache/edb/world") myfavdict=genericdict(myfavs) *************** *** 903,918 **** #we don't have a favorites entry for this package yet; add one myfavdict[myfavkey]=myfavkey - print print ">>> Recording",myfavkey,"in \"world\" favorites file..." - print portage.writedict(myfavdict,myroot+"var/cache/edb/world",writekey=0) ! if "--autoclean" in self.myopts: retval=portage.doebuild(y,"clean",myroot,edebug) if retval: - print "!!! emerge aborting on ",y,"." sys.exit(1) #my doing an exit this way, --fetchonly can continue to try to #fetch everything even if a particular download fails. ! if "--fetchonly" in self.myopts: if returnme: print "\n\n!!! Some fetch errors were encountered. Please see above for details.\n\n" --- 956,968 ---- #we don't have a favorites entry for this package yet; add one myfavdict[myfavkey]=myfavkey print ">>> Recording",myfavkey,"in \"world\" favorites file..." portage.writedict(myfavdict,myroot+"var/cache/edb/world",writekey=0) ! if "--autoclean" in myopts: retval=portage.doebuild(y,"clean",myroot,edebug) if retval: sys.exit(1) #my doing an exit this way, --fetchonly can continue to try to #fetch everything even if a particular download fails. ! if "--fetchonly" in myopts: if returnme: print "\n\n!!! Some fetch errors were encountered. Please see above for details.\n\n" *************** *** 1006,1010 **** if not slotmap.has_key(myslot): slotmap[myslot]={} ! slotmap[myslot][localtree.gettimeval(mypkg)]=mypkg for myslot in slotmap.keys(): counterkeys=slotmap[myslot].keys() --- 1056,1060 ---- 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() *************** *** 1081,1084 **** --- 1131,1136 ---- #unmerge... retval=portage.unmerge(mysplit[0],mysplit[1],portage.root) + #run ldconfig, etc... + portage.env_update() if not numselected: return 0 *************** *** 1198,1202 **** print "!!! existing",cvsdir+"/gentoo-x86 directory; exiting." sys.exit(1) ! if not portage.spawn("cd "+cvsdir+"; cvs -d "+cvsroot+" co gentoo-x86",free=1): print "!!! cvs checkout error; exiting." sys.exit(1) --- 1250,1254 ---- print "!!! existing",cvsdir+"/gentoo-x86 directory; exiting." sys.exit(1) ! if not portage.spawn("cd "+cvsdir+"; cvs -z3 -d "+cvsroot+" co gentoo-x86",free=1): print "!!! cvs checkout error; exiting." sys.exit(1) *************** *** 1207,1211 **** #cvs update print ">>> starting cvs update with "+syncuri+"..." ! sys.exit(portage.spawn("cd "+myportdir+"; cvs -q update -dP",free=1)) else: print "!!! rsync setting: ",syncuri,"not recognized; exiting." --- 1259,1263 ---- #cvs update print ">>> starting cvs update with "+syncuri+"..." ! sys.exit(portage.spawn("cd "+myportdir+"; cvs -z3 -q update -dP",free=1)) else: print "!!! rsync setting: ",syncuri,"not recognized; exiting." *************** *** 1273,1279 **** elif "search"==myaction: if not myfiles: ! print ! print "No search terms provided." ! print else: searchinstance = search() --- 1325,1329 ---- elif "search"==myaction: if not myfiles: ! print "emerge: no search terms provided." else: searchinstance = search() *************** *** 1286,1294 **** searchinstance.output() elif "inject"==myaction: if "--pretend" in myopts: print "emerge: the \"inject\" action does not support \"--pretend.\"" sys.exit(1) for x in myfiles: ! if not portage.catpkgsplit(x): print "!!!",x,"is not a specific cat/pkg-version, skipping..." continue --- 1336,1348 ---- 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: ! mycps=portage.catpkgsplit(x) ! if (not mycps) or (mycps[0]=="null"): print "!!!",x,"is not a specific cat/pkg-version, skipping..." continue *************** *** 1318,1350 **** else: if not myfiles: ! post_emerge() #we don't have any files to process; skip this step and exit print "Calculating dependencies ", ! for mypkg in myfiles: ! if mypkg[-5:]==".tbz2": ! mytype="binary" ! mytbz2=xpak.tbz2(mypkg) ! mykey=mytbz2.getelements("CATEGORY")[0]+"/"+os.path.basename(mypkg)[:-5] ! elif mypkg[-7:]==".ebuild": ! mytype="ebuild" ! mykey=os.path.basename(os.path.abspath(mypkg+"/../.."))+"/"+os.path.basename(mypkg)[:-7] ! else: ! mykey="" ! if "--usepkg" in myopts: ! mykey=portage.db[portage.root]["bintree"].dep_bestmatch(mypkg) ! mytype="binary" ! if not mykey: ! mykey=portage.db[portage.root]["porttree"].dep_bestmatch(mypkg) ! mytype="ebuild" ! if not mykey: ! print "!!! Couldn't find match for",mypkg+"; aborting." ! sys.exit(1) ! # else: ! # print "!!! Error:",x,"is neither an ebuild nor a .tbz2 package." ! # sys.exit(1) ! if not "--oneshot" in myopts: ! favorites.append(mykey) ! if not mydepgraph.create([mytype,portage.root,mykey],None,"--onlydeps" not in myopts): ! sys.exit(1) print "\b\b ...done!" if "--pretend" in myopts: --- 1372,1383 ---- 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 ", ! retval,favorites=mydepgraph.select_files(myfiles) ! if not retval: ! sys.exit(1) print "\b\b ...done!" if "--pretend" in myopts: Index: pdb =================================================================== RCS file: /cvsroot/darwinfiles/portage/bin/pdb,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 Index: pdb.cgi =================================================================== RCS file: /cvsroot/darwinfiles/portage/bin/pdb.cgi,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 Index: repoman =================================================================== RCS file: /cvsroot/darwinfiles/portage/bin/repoman,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 |
From: <ji...@us...> - 2002-09-08 13:25:03
|
Update of /cvsroot/darwinfiles/packagetree/sys-apps/gawk In directory usw-pr-cvs1:/tmp/cvs-serv21578 Modified Files: gawk-3.1.0-r3.ebuild gawk-3.1.1.ebuild Log Message: Fixed for darwin Index: gawk-3.1.0-r3.ebuild =================================================================== RCS file: /cvsroot/darwinfiles/packagetree/sys-apps/gawk/gawk-3.1.0-r3.ebuild,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** gawk-3.1.0-r3.ebuild 8 Sep 2002 13:07:54 -0000 1.1 --- gawk-3.1.0-r3.ebuild 8 Sep 2002 13:24:59 -0000 1.2 *************** *** 7,16 **** SRC_URI="ftp://gatekeeper.dec.com/pub/GNU/gawk/${P}.tar.gz" HOMEPAGE="http://www.gnu.org/software/gawk/gawk.html" ! KEYWORDS="x86 ppc sparc sparc64" SLOT="0" LICENSE="GPL-2" ! DEPEND="virtual/glibc ! nls? ( sys-devel/gettext )" src_compile() { --- 7,15 ---- SRC_URI="ftp://gatekeeper.dec.com/pub/GNU/gawk/${P}.tar.gz" HOMEPAGE="http://www.gnu.org/software/gawk/gawk.html" ! KEYWORDS="ppc" SLOT="0" LICENSE="GPL-2" ! DEPEND="nls? ( sys-devel/gettext )" src_compile() { Index: gawk-3.1.1.ebuild =================================================================== RCS file: /cvsroot/darwinfiles/packagetree/sys-apps/gawk/gawk-3.1.1.ebuild,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** gawk-3.1.1.ebuild 8 Sep 2002 13:07:54 -0000 1.1 --- gawk-3.1.1.ebuild 8 Sep 2002 13:24:59 -0000 1.2 *************** *** 7,16 **** SRC_URI="ftp://gatekeeper.dec.com/pub/GNU/gawk/${P}.tar.gz" HOMEPAGE="http://www.gnu.org/software/gawk/gawk.html" ! KEYWORDS="x86 ppc sparc sparc64" SLOT="0" LICENSE="GPL-2" ! DEPEND="virtual/glibc ! nls? ( sys-devel/gettext )" src_compile() { --- 7,15 ---- SRC_URI="ftp://gatekeeper.dec.com/pub/GNU/gawk/${P}.tar.gz" HOMEPAGE="http://www.gnu.org/software/gawk/gawk.html" ! KEYWORDS="ppc" SLOT="0" LICENSE="GPL-2" ! DEPEND="nls? ( sys-devel/gettext )" src_compile() { |
From: <ji...@us...> - 2002-09-08 13:08:19
|
Update of /cvsroot/darwinfiles/packagetree/sys-apps/gawk/files In directory usw-pr-cvs1:/tmp/cvs-serv17932 Added Files: digest-gawk-3.1.0-r3 digest-gawk-3.1.1 Log Message: Adding Gawk --- NEW FILE: digest-gawk-3.1.0-r3 --- MD5 789d223fc7ee4ada694071e04124a3ae gawk-3.1.0.tar.gz 1614873 --- NEW FILE: digest-gawk-3.1.1 --- MD5 47e3754195bf32c8b78ad632bab903cd gawk-3.1.1.tar.gz 1875134 |
From: <ji...@us...> - 2002-09-08 13:07:57
|
Update of /cvsroot/darwinfiles/packagetree/sys-apps/gawk In directory usw-pr-cvs1:/tmp/cvs-serv17803 Added Files: ChangeLog gawk-3.1.0-r3.ebuild gawk-3.1.1.ebuild Log Message: Adding Gawk --- NEW FILE: ChangeLog --- # ChangeLog for sys-apps/gawk # Copyright 2002 Gentoo Technologies, Inc.; Distributed under the GPL # $Header: /cvsroot/darwinfiles/packagetree/sys-apps/gawk/ChangeLog,v 1.1 2002/09/08 13:07:54 jimmacr Exp $ *gawk-3.1.1 (21 Jul 2002) 21 Jul 2002; Martin Schlemmmer <az...@ge...> : Update version. *gawk-3.1.0-r3 (21 Jul 2002) 21 Jul 2002; Martin Schlemmer <az...@ge...> : Move /usr/bin/awk to /bin/awk for upcomming baselayout. *gawk-3.1.0-r2 (26 Jun 2002) 14 Jul 2002; phoen][x <ph...@ge...> gawk-3.1.0-r2.ebuild : Added KEYWORDS, SLOT. 26 Jun 2002; Martin Schlemmer <az...@ge...> : Add /bin/awk compat symlink, closing bug #3288. *gawk-3.1.0-r1 (12 Mar 2002) 14 Jul 2002; phoen][x <ph...@ge...> gawk-3.1.0-r1.ebuild : Added KEYWORDS, SLOT. 12 Mar 2002; Seemant Kulleen <se...@ge...> ChangeLog : Added USE dependent nls compilation *gawk-3.1.0 (1 Feb 2002) 1 Feb 2002; G.Bevin <gb...@ge...> ChangeLog : Added initial ChangeLog which should be updated whenever the package is updated in any way. This changelog is targetted to users. This means that the comments should well explained and written in clean English. The details about writing correct changelogs are explained in the skel.ChangeLog file which you can find in the root directory of the portage repository. --- NEW FILE: gawk-3.1.0-r3.ebuild --- # Copyright 1999-2002 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License, v2 or later # $Header: /cvsroot/darwinfiles/packagetree/sys-apps/gawk/gawk-3.1.0-r3.ebuild,v 1.1 2002/09/08 13:07:54 jimmacr Exp $ S=${WORKDIR}/${P} DESCRIPTION="GNU awk pattern-matching language" SRC_URI="ftp://gatekeeper.dec.com/pub/GNU/gawk/${P}.tar.gz" HOMEPAGE="http://www.gnu.org/software/gawk/gawk.html" KEYWORDS="x86 ppc sparc sparc64" SLOT="0" LICENSE="GPL-2" DEPEND="virtual/glibc nls? ( sys-devel/gettext )" src_compile() { local myconf="" use nls || myconf="${myconf} --disable-nls" ./configure --prefix=/usr \ --libexecdir=/usr/lib/awk \ --mandir=/usr/share/man \ --infodir=/usr/share/info \ --host=${CHOST} \ ${myconf} || die emake || die } src_install() { make prefix=${D}/usr \ bindir=${D}/bin \ mandir=${D}/usr/share/man \ infodir=${D}/usr/share/info \ libexecdir=${D}/usr/lib/awk \ install || die cd ${D}/bin rm -f gawk ln -s gawk-${PV} gawk #compat symlink dodir /usr/bin cd ${D}/usr/bin ln -s /bin/gawk-${PV} awk ln -s /bin/gawk-${PV} gawk cd ${S} if [ -z "`use build`" ] then dosym gawk.1.gz /usr/share/man/man1/awk.1.gz dodoc ChangeLog ACKNOWLEDGMENT COPYING FUTURES dodoc LIMITATIONS NEWS PROBLEMS README docinto README_d dodoc README_d/* docinto atari dodoc atari/ChangeLog atari/README.1st docinto awklib dodoc awklib/ChangeLog docinto pc dodoc pc/ChangeLog docinto posix dodoc posix/ChangeLog else rm -rf ${D}/usr/share fi } --- NEW FILE: gawk-3.1.1.ebuild --- # Copyright 1999-2002 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License, v2 or later # $Header: /cvsroot/darwinfiles/packagetree/sys-apps/gawk/gawk-3.1.1.ebuild,v 1.1 2002/09/08 13:07:54 jimmacr Exp $ S=${WORKDIR}/${P} DESCRIPTION="GNU awk pattern-matching language" SRC_URI="ftp://gatekeeper.dec.com/pub/GNU/gawk/${P}.tar.gz" HOMEPAGE="http://www.gnu.org/software/gawk/gawk.html" KEYWORDS="x86 ppc sparc sparc64" SLOT="0" LICENSE="GPL-2" DEPEND="virtual/glibc nls? ( sys-devel/gettext )" src_compile() { local myconf="" use nls || myconf="${myconf} --disable-nls" ./configure --prefix=/usr \ --libexecdir=/usr/lib/awk \ --mandir=/usr/share/man \ --infodir=/usr/share/info \ --host=${CHOST} \ ${myconf} || die emake || die } src_install() { make prefix=${D}/usr \ bindir=${D}/bin \ mandir=${D}/usr/share/man \ infodir=${D}/usr/share/info \ libexecdir=${D}/usr/lib/awk \ install || die cd ${D}/bin rm -f gawk ln -s gawk-${PV} gawk #compat symlink dodir /usr/bin cd ${D}/usr/bin ln -s /bin/gawk-${PV} awk ln -s /bin/gawk-${PV} gawk cd ${S} if [ -z "`use build`" ] then dosym gawk.1.gz /usr/share/man/man1/awk.1.gz dodoc ChangeLog ACKNOWLEDGMENT COPYING FUTURES dodoc LIMITATIONS NEWS PROBLEMS README docinto README_d dodoc README_d/* docinto atari dodoc atari/ChangeLog atari/README.1st docinto awklib dodoc awklib/ChangeLog docinto pc dodoc pc/ChangeLog docinto posix dodoc posix/ChangeLog else rm -rf ${D}/usr/share fi } |
From: <ji...@us...> - 2002-09-08 13:07:42
|
Update of /cvsroot/darwinfiles/packagetree/sys-apps/gawk/files In directory usw-pr-cvs1:/tmp/cvs-serv17756/files Log Message: Directory /cvsroot/darwinfiles/packagetree/sys-apps/gawk/files added to the repository |