diff options
author | cvs-fast-export <cvs-fast-export> | 2005-07-20 14:22:48 +0000 |
---|---|---|
committer | cvs-fast-export <cvs-fast-export> | 2005-07-20 14:22:48 +0000 |
commit | fdd8e5bea1b83b33ee1bec133ade79c1644944f4 (patch) | |
tree | 77196821008d258ea0d1c21f97e8b46c938ea0b6 | |
parent | removed hardcoded paths, split inherit into two seperate chunks (internal, an... (diff) | |
download | portage-cvs-rewrite-ignore.tar.gz portage-cvs-rewrite-ignore.tar.bz2 portage-cvs-rewrite-ignore.zip |
Synthetic commit for incomplete tag rewrite-ignorerewrite-ignore
322 files changed, 0 insertions, 54413 deletions
diff --git a/AUTHORS b/AUTHORS deleted file mode 100644 index e69de29..0000000 --- a/AUTHORS +++ /dev/null diff --git a/COPYING b/COPYING deleted file mode 100644 index d60c31a..0000000 --- a/COPYING +++ /dev/null @@ -1,340 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - <one line to give the program's name and a brief idea of what it does.> - Copyright (C) <year> <name of author> - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - <signature of Ty Coon>, 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. diff --git a/ChangeLog.000 b/ChangeLog.000 deleted file mode 100644 index 06895ac..0000000 --- a/ChangeLog.000 +++ /dev/null @@ -1,4288 +0,0 @@ -# ChangeLog for Portage; the Gentoo Linux ports system -# Copyright 1999-2004 Gentoo Foundation; Distributed under the GPL v2 -# $Id: ChangeLog.000,v 1.3 2004/10/04 13:58:57 vapier Exp $ - - *** THIS IS FOR ARCHIVAL PURPOSES ONLY -- DO NOT MODIFY *** - *** THIS IS FOR ARCHIVAL PURPOSES ONLY -- DO NOT MODIFY *** - *** THIS IS FOR ARCHIVAL PURPOSES ONLY -- DO NOT MODIFY *** - *** THIS IS FOR ARCHIVAL PURPOSES ONLY -- DO NOT MODIFY *** - *** THIS IS FOR ARCHIVAL PURPOSES ONLY -- DO NOT MODIFY *** - *** THIS IS FOR ARCHIVAL PURPOSES ONLY -- DO NOT MODIFY *** - *** THIS IS FOR ARCHIVAL PURPOSES ONLY -- DO NOT MODIFY *** - *** THIS IS FOR ARCHIVAL PURPOSES ONLY -- DO NOT MODIFY *** - *** THIS IS FOR ARCHIVAL PURPOSES ONLY -- DO NOT MODIFY *** - - 21 Jan 2004; Nicholas Jones <carpaski@gentoo.org> ebuild.sh: TGL's fixes - for exec/child/wait problems. Unset GREP_OPTIONS GREP_COLOR. has() and use() - no longer attempt to determine if they are to be quiet or noisy -- They - default to noisy -- useq() and hasq() are the non-verbose versions. - EBUILD_PHASE set to add a hack-ish way around global scope calls in - eclasses -- NOTHING SHOULD BE CALLED IN THE GLOBAL SCOPE. Touchup to the - inherit() code that should finally allow the removal of the ECLASS and - INHERITED settings. Removed tty (use/has) calls. Removed dirname calls -- - portage.py handles setting the dbkey filename now. - - 21 Jan 2004; Nicholas Jones <carpaski@gentoo.org> emerge: Ed Catmur's - (with a little TGL added in) patch for --ask. Added a 'metadata' target - that skips the sync and only updates the cache. FEATURES="getbinpkg" added. - TGL's exit code fixes. Fixed match code for -S so it doesn't complain about - specific and double versions. Unmerge via dbpath fix. Rewrote rsync's - options that supports --verbose and --quiet operation now and can force - checksumming all files using --debug. Sort the files in the cache update - so it's a little more predictable. - - 21 Jan 2004; Nicholas Jones <carpaski@gentoo.org> prepstrip: changed - --strip-debug to --strip-unneeded. - - 21 Jan 2004; Nicholas Jones <carpaski@gentoo.org> getbinpkg.py: Updates to - enable HTTP/HTTPS authentication. - - 21 Jan 2004; Nicholas Jones <carpaski@gentoo.org> portage.py: best_from_dict - added to grab the best entry from set of dicts using a list of the keys for - priority. jstubb's patch to fix listdir -- splits it into a cache and list - setup. jstubb's patch for varexpand to handle $VAR better. Latexer's patch - for KernelVersion code to use Makefiles instead of the version.h. Modules - are loaded from /etc/portage/modules or defaults, whichever works. Fixed - the /etc/make.profile-is-missing traceback. Spawn can be given 3 pipes to - redirect stdin,stdout,stderr to specific outputs, terminals, or files. - TGL's patch for cache functions in portage.py so that they do not cache at - inappropriate times. PORTAGE_TMPFS is now used if set as a temporary file - operation area -- recommended to actually be a ramfs/tmpfs filesystem for - speed. Genone enhanced the deprecated profile patch. - - 31 Jan 2004; Masatomo Nakano <nakano@gentoo.org> emerge: Fixed --skipfirst - bug. This closes #36880. - - 29 Jan 2004; Masatomo Nakano <nakano@gentoo.org> emerge: TGL's patch - for imporving overlay verbose. This closes #39765. - - 27 Jan 2004; Masatomo Nakano <nakano@gentoo.org> portage.py: Fixed - autouse bug. autouse were ignored. - - 21 Jan 2004; Nicholas Jones <carpaski@gentoo.org> emerge: Output failed - cache updates during emerge sync. - - 21 Jan 2004; Nicholas Jones <carpaski@gentoo.org> *: VDB_PATH fixes. - - 21 Jan 2004; Nicholas Jones <carpaski@gentoo.org> portage.py: Only use - custom profiles when not called by repoman. ROOT never changes profile - roots, only custom/system profiles var/cache/edb/virtuals. Sandbox fix - where sandbox was creating an invalid logfile (not giving a summary) - due to a '/' in SANDBOX_LOG. Turned down the Lockfile output. Double - check the INCOMPLETE MERGE identifications as it can be caused by cache. - - 24 Jan 2004; <nakano@gentoo.org> emerge: Improved timestamp check - when 'emerge sync'. Added catching amiguous error when unmerge. - This closes #24325. - - 23 Jan 2004; <nakano@gentoo.org> emerge, portage.py: Fixed 2 bugs. - Portage doesn't read local virtuals file, which happens on only cvs - version. package is blocked by itself. - - 21 Jan 2004; Nicholas Jones <carpaski@gentoo.org> portage.py, emerge: - Fix from genone for emerge's direct reading of packages and his patch - that also adds in /etc/portage/profile as a stacked profile. - - 21 Jan 2004; Nicholas Jones <carpaski@gentoo.org> portage.py: Completed - inheritence capabilities for portage.config reading some files. Moved a - copy of the getvirtuals() function into settings to handle multiple - profiles properly. - -*portage-2.0.50_pre17/18/19 (21 Jan 2004): Modules for DBs and quick fixes - - 21 Jan 2004; Nicholas Jones <carpaski@gentoo.org> *: Moved all references - to var/db/pkg to portage.VDB_PATH --- This will change again -- NEED TO - BE MOVED INTO A PATH/CONSTANTS SETUP. - - 21 Jan 2004; Nicholas Jones <carpaski@gentoo.org> dosed: Quick fix for - the basename missing/misplaced issue. - - 21 Jan 2004; Nicholas Jones <carpaski@gentoo.org> ebuild.sh: Added - /dev/console to PREDICT to attempt a workaround for a serial console - bug. dbkey is now set through portage.py/doebuild to allow for modular - db code. - - 21 Jan 2004; Nicholas Jones <carpaski@gentoo.org> emerge: regen doesn't - require root anymore. Edited the timestamp check to be a little more - friendly -- delete the portdir timestamp and it won't use the alternate. - Fix some permission settings. Added some warnings in for cachedirs that - are very likely to ruin your system. Cleaned out some of the eclass code - that isnt valid any longer. - - 21 Jan 2004; Nicholas Jones <carpaski@gentoo.org> portageq: Added vdb_path - as a target to get the db directory. Quickpkg uses this. - - 21 Jan 2004; Nicholas Jones <carpaski@gentoo.org> portage.py: Added - load_mod() -- grabs a class/function from a module and passes it back - without loading the module into the global scope. Added unique_array() - which eliminates duplicates from an array. grab_stacked() operates like - the other grab* and getconfig functions, but takes a filename and a set - of paths that it will apply incrementally or clobbers -- for profile - inheritance. getconfig no longer exits on non-existance returns None. - Class config now should be passed a profile path and a set of incremental - values instead of using the globals -- defaults to using the globals - presently and print an error message. Adding support for module configs - as a set of strings 'class.subclass.objectmodule':'module.to.use.object' - for load_mod and the database modules. Profile inheritance started. Killed - the eclass() super-function and replaced it with class eclass_cache that - is visible and conceptually simpler -- Also uses the plugable modules. - Cleaned out the sync calls for the DBs. MASSIVE simplification of the - aux_get code -- removed memory-caching in favor of system cache (actually - faster in all cases so far -- P100 and P4-2.2G). Lockfile usage around the - cachefile. - - 21 Jan 2004; Nicholas Jones <carpaski@gentoo.org> portage_db_*: Updated - the API a little but to have permissions set properly. A little more - reorganization and removed the keycount checks. - - 21 Jan 2004; Masatomo Nakano <nakano@gentoo.org> emerge: download size - should not be displayed when the package is nomerge with --tree. - - 20 Jan 2004; Masatomo Nakano <nakano@gentoo.org> portage.py: Reverted - ambiguity package fix in cpv_expand(). - - 20 Jan 2004; Masatomo Nakano <nakano@gentoo.org> emerge: Moved - backup timestamp.chk file from portage tree to PORTAGE_TMPDIR. - - 20 Jan 2004; Masatomo Nakano <nakano@gentoo.org> emerge: Reverted the - backing up the timestamp.chk fix. - - 20 Jan 2004; Masatomo Nakano <nakano@gentoo.org> emerge: Improved the - list of --tree by TGL's patch. This should close #38070. - - 20 Jan 2004; Masatomo Nakano <nakano@gentoo.org> emerge: Removed debug - message without --debug. This should close #23840. - - 19 Jan 2004; Masatomo Nakano <nakano@gentoo.org> emerge: Improved - timestamp check of rsync. This should close #37403. - - 19 Jan 2004; Masatomo Nakano <nakano@gentoo.org> portage.py: Improved - regeneration ld.so.cache. This should close #37858. - - 19 Jan 2004; Masatomo Nakano <nakano@gentoo.org> emerge: Fixed bug which - emerge doesn't block same package but different version. - (example: DEPEND="!<cat/pkg-1.0.0" in cat/pkg-1.0.0.ebuild) - - 19 Jan 2004; Masatomo Nakano <nakano@gentoo.org> portage.py: - Modified cpv_expand() to check package.mask. This should close #38592. - - 19 Jan 2004; Masatomo Nakano <nakano@gentoo.org> portage.py: Escaped - regualar expression for replace entry in fixdbentries(). - - 18 Jan 2004; Masatomo Nakano <nakano@gentoo.org> portage.py: - Fixed AUTOCLEAN delay problem in .50pre* by TGL's patch. This close - #38189. Fixed unmerge failture bug when 'ebuild foo-1.0.0 unmerge'. - These close #38189, #38366 - - 18 Jan 2004; Masatomo Nakano <nakano@gentoo.org> emerge, portage.py: - Fixed "ebuild /foo/bar-1.0.0.ebuild unmerge" and "emerge bar-1.0.0 unmerge" - problems. This should close #38420. - - 17 Jan 2004; Masatomo Nakano <nakano@gentoo.org> portage.py: Fixed - "!<=" style block problem. Fixed symlink with absolute path - problem in treewalk(). - -*portage-2.0.50_pre16 (13 Jan 2004): Quick Fixes -- ~arch version - - 13 Jan 2004; Nicholas Jones <carpaski@gentoo.org> portage.py: Removed an - unnecessary depend call that double eclass-using ebuild's cache regen - time. - -*portage-2.0.50_pre15 (12 Jan 2004): Quick Fixes -- ~arch version - - 12 Jan 2004; Nicholas Jones <carpaski@gentoo.org> portage.py: Unmerge - traceback fix. - -*portage-2.0.50_pre14 (12 Jan 2004): Quick Fixes -- ~arch version - - 12 Jan 2004; Nicholas Jones <carpaski@gentoo.org> emerge: Fix for - traceback on '-S'. - - 12 Jan 2004; Nicholas Jones <carpaski@gentoo.org> repoman: Fix for - traceback on --help. - - 12 Jan 2004; Nicholas Jones <carpaski@gentoo.org> sandbox: Fix for - sandboxpids.tmp file accesses. - - 12 Jan 2004; Nicholas Jones <carpaski@gentoo.org> portage.py: Sandbox, as - above. Catch invalid package names and print a sane message about it. - -*portage-2.0.50_pre13 (11 Jan 2004): Fixes - - 11 Jan 2004; Nicholas Jones <carpaski@gentoo.org> cnf/*: Updated the - Advanced masking section to aid the reduction of user complaints and - requests for unreasable usage of ACCEPT_KEYWORDS. - - 11 Jan 2004; Nicholas Jones <carpaski@gentoo.org> portage.py: A counter - fix was fixed to actually check the counters of all CP versions to ensure - the new counter is higher than all existing ones. Modified the dblink - class to have class lockfiles for the db and tmpdb dirs as well as lock - other files before editing. Reorganization of the merge code in dblink - so that the tmpdb is filled immediately after preinst and prior to the - actual FS merging -- COUNTER and CONTENTS go directly into the tmpdb - and not into the infodir. - -*portage-2.0.50_pre11/12 (09 Dec 2003): repoman/binpkg/exit conditions - - 09 Jan 2004; Nicholas Jones <carpaski@gentoo.org> emerge: getbinpkgonly - fixes for emerge -G world, should behave properly now instead of using - ebuild masks. Only downloads immediately before a merge -- fetchonly now - applies to binary packages. - - 08 Jan 2004; Masatomo Nakano <nakano@gentoo.org> repoman: Ignore other - arches check in repoman when --ignore-other-arches(-I). - -*portage-2.0.50_pre10 (06 Dec 2003): API change + enhancements - - 06 Jan 2004; Nicholas Jones <carpaski@gentoo.org> ebuild.sh: Fix for - dyn_preinst being called before IMAGE was set -- IMAGE is now valid - in pkg_preinst. Added suidctl for SELinux. - - 06 Jan 2004; Nicholas Jones <carpaski@gentoo.org> emerge: Added -P to - initial cvs checkout. - - 06 Jan 2004; Nicholas Jones <carpaski@gentoo.org> quickpkg: Fix for - the 'tar up /' problem. - - 06 Jan 2004; Nicholas Jones <carpaski@gentoo.org> portage.py: Caught a - traceback generated by bad depend atoms for repoman. Fixes from genone - for package.*. Fixed the checks for doebuild calls in treewalk that was - ignoring exit conditions for ebuilds. - - 04 Jan 2004; Masatomo Nakano <nakano@gentoo.org> repoman: Added PDEPEND - dependency check. This closes #24796 - - 04 Jan 2004; Masatomo Nakano <nakano@gentoo.org> repoman, portage.py: - Added new dependency check to repoman. This closes #36887. - - 03 Jan 2004; Masatomo Nakano <nakano@gentoo.org> emerge: Modified - to specific port number in emerge sync. This closes #36994 - - 02 Jan 2004; Masatomo Nakano <nakano@gentoo.org> portage.py: Fixed - a problem that emerge doesn't block package when it's required. - It happens in .50_pre*. - - 02 Jan 2004; Masatomo Nakano <nakano@gentoo.org> portage.py: Fixed - issue with getsize() when --debug. - - 02 Jan 2004; Masatomo Nakano <nakano@gentoo.org> portage.py: Fixed - issue with virtual. This closes bug #9050, #22225, #29499. - - 01 Jan 2004; Masatomo Nakano <nakano@gentoo.org> ebuild, emerge, portage.py: - Fixed issue with not cleaning up temp directory. This closes bug #34967. - - 31 Dec 2003; Masatomo Nakano <nakano@gentoo.org> emerge: - Fixed 'emerge sync' issue which continuously connects to same host. - - 31 Dec 2003; Nicholas Jones <carpaski@gentoo.org> emerge: Found the line - that was causing the package dir to be printed... It was a spawn call. - - 31 Dec 2003; Nicholas Jones <carpaski@gentoo.org> portage.py: Fix for - the symlink corruption in the db from the movefile() bug. - - 29 Dec 2003; Masatomo Nakano <nakano@gentoo.org> portage.py: - Fixed bug which emerge stops when no denpendencies exist in || ( ) - by USE flags. This closes #36568. - - 29 Dec 2003; Masatomo Nakano <nakano@gentoo.org> emerge, portage.py: - Added an ambiguity package check when emerge. This closes bug #22700. - -*portage-2.0.50_pre9 (24 Dec 2003): API change + enhancements - - 24 Dec 2003; Nicholas Jones <carpaski@gentoo.org> ebuild.sh: Added - PORTAGE_TMPDIR to SANDBOX_READ/WRITE to ensure it works. SpanKY's - patch for use negation added (use !foo). pkg_setup doesn't die on - a non-zero exit status. - - 24 Dec 2003; Nicholas Jones <carpaski@gentoo.org> emerge: using os.uname - instead of calling out to uname. - - 24 Dec 2003; Nicholas Jones <carpaski@gentoo.org> quickpkg: Added SpanKY's - patch for delayed exit/error conditions. - - 24 Dec 2003; Nicholas Jones <carpaski@gentoo.org> xpak.py: chdir's added - to the getcwd fix for missing dirs. - - 24 Dec 2003; Masatomo Nakano <nakano@gentoo.org> emerge: Added OVERLAY - directories display for --verbose. - -*portage-2.0.50_pre8 (24 Dec 2003): API change + enhancements - - 22 Dec 2003; Nicholas Jones <carpaski@gentoo.org> ebuild.sh: Added - /proc/self/maps to SANDBOX_PREDICT, and /dev/shm to read/write. - - 22 Dec 2003; Nicholas Jones <carpaski@gentoo.org> emerge: Added automake - and autoconf versions to the output of emerge info. - - 22 Dec 2003; Nicholas Jones <carpaski@gentoo.org> etc-update: Added - edit merged file option -- defaults to EDITOR var or "nano -w". - - 22 Dec 2003; Nicholas Jones <carpaski@gentoo.org> portage.py: Use - os.uname instead of calling out to uname which might not exist. - -*portage-2.0.50_pre7 (22 Dec 2003): API change + enhancements - - 22 Dec 2003; Nicholas Jones <carpaski@gentoo.org> ebuild.sh: patch to - quote most of the path operators that might involve spaces. - - 22 Dec 2003; Nicholas Jones <carpaski@gentoo.org> portage.py: Fix for - invalid entries in package.keywords. Character chopping on mirrors - fixed again. - - 21 Dec 2003; Masatomo Nakano <nakano@gentoo.org> bin/ebuild, bin/emerge, - pym/portage.py: Changed to show disabled USE flags from use.mask when - using emerge -vp. And fixed use.mask issue. - - 20 Dec 2003; Nicholas Jones <carpaski@gentoo.org> portage.py: Rewrote - match_from_list -- Simplified and made pkgcmp and match_from_list - properly compare package names. - - 20 Dec 2003; Nicholas Jones <carpaski@gentoo.org> repoman: Fix for mysigs - traceback when signing. - - 20 Dec 2003; Nicholas Jones <carpaski@gentoo.org> portage.py: Added - PYTHONPATH to the specials list -- created a colon_seperated list. - Fixed reset() in class config so that you can specify keeping the - pkg dictionary when resetting the values. - - 19 Dec 2003; Masatomo Nakano <nakano@gentoo.org> repoman: Added check - whether "ebuild foo.ebuild digest" succeeds. - - 19 Dec 2003; Nicholas Jones <carpaski@gentoo.org> portage.py: Fix for - pkg settings being maintained after an unmerge. - - 19 Dec 2003; Nicholas Jones <carpaski@gentoo.org> pym/portage_db_*: Moved - to using cPickle instead of marshal. More standardization of the API. - - 18 Dec 2003; Masatomo Nakano <nakano@gentoo.org> repoman: Added virtual - dependency check on each arch. - - 17 Dec 2003; Nicholas Jones <carpaski@gentoo.org> portage.py: Fixed a - permission issue involving $T and userpriv. Lockfile touchup. - - 17 Dec 2003; Nicholas Jones <carpaski@gentoo.org> portage_db_*: Added - templates and db for cache interfaces. Presently have a anydbm and a - flat file interface working. See the test for operations. - - 15 Dec 2003; Nicholas Jones <carpaski@gentoo.org> emerge: Added a call - to portageq that causes python to create optimized modules prior to it - ending up inside the sandbox. Added more output and logging to sync. - - 15 Dec 2003; Nicholas Jones <carpaski@gentoo.org> prepstrip: 'tree' is not - the same as 'true'. - - 15 Dec 2003; Nicholas Jones <carpaski@gentoo.org> portage.py: invalid - settings in package.keywords caused a traceback -- fixed with error message. - -*portage-2.0.50_pre1 (12 Dec 2003): API change + enhancements - - 10 Dec 2003; Nicholas Jones <carpaski@gentoo.org> chkcontents: Uses portage - functions to do md5sum calcs. - - 10 Dec 2003; Nicholas Jones <carpaski@gentoo.org> ebuild.sh: Removed try() - as it isn't used, and was deprecated for a long while. Genone's fetching - size display added for --verbose. License display added. Added a little - debug for IUSE so we can figure out the binary package --verbose IUSE - issues that are randomly reported. XXXXXXXXXXXXXXXXXXX's 'buildsyspkg' - patch for building only system packages into tbz2s. Unmerge fix for new - settings instances. RSYNC_RATELIMIT added. - - 10 Dec 2003; Nicholas Jones <carpaski@gentoo.org> portage.py: ADA path - variables added to specials for env_update. Error messaeg correction for - make.defaults syntax errors. Unmerge now uses the environment file, if it - exists, to get the complete environment back to perform unmerge operations. - load_infodir() uses pkg settings completely now. Fixed the passing of - settings in unmerge and dblink. Fixed an issue regarding unlinking lockfiles - while inside of a sandbox. - - 09 Dec 2003; Nicholas Jones <carpaski@gentoo.org> ebuild.sh, *.sh: - Moved helper scripts into bin/functions and made them sourceable -- they - now will die in cases where sub-parts fail. dodoc and keepdir are now - recursive-capable. - - 09 Dec 2003; Nicholas Jones <carpaski@gentoo.org> emerge: emerge.log now - set as portage:portage with 0660 perms. --debug now enables tracebacks - for dep generation instead of moving code out of the try block. - - 09 Dec 2003; Nicholas Jones <carpaski@gentoo.org> g-cpan.pl: rac's patch - to get arch list from portage's list of arches in the profiles. - - 09 Dec 2003; Nicholas Jones <carpaski@gentoo.org> repoman: Moved a bit of - the existing gpg code around -- it might work as is, but requires 'sign' - in features. Fixed a potential for repoman to miss updates that should - get a new manifest and commit. Fixed digest/manifest generation for - non-packagedir runs of repoman. - - 09 Dec 2003; Nicholas Jones <carpaski@gentoo.org> emergehelp.py, make.conf, - getbinpkg.py: Message touch ups. - - 09 Dec 2003; Nicholas Jones <carpaski@gentoo.org> portage.py: load_infodir() - uses pkg settings now instead of env and backup. Genone's custom mirror - patch included. Added some missing 'strict' flags for recursion in digest*(). - Refixed the invalidentry stuff that was lost across patch merges. Fix for - pkg-keywords from genone included. Genone's deprecated profile patch for - reporting to a user that their current profile is deprecated. Message about - missing arch.list instead of spouting invalid keywords messages. - - 08 Dec 2003; Masatomo Nakano <nakano@gentoo.org> repoman: - Added all arch dependency check. This closes bug #24160. - - 07 Dec 2003; Masatomo Nakano <nakano@gentoo.org> emerge,portage.py: - Fixed bugs. 1.--debug doesn't work 2.Portage breaks files - in /var/db/*/*. 3.No stop if dependency problem happens. - They are only cvs version problems. - - 01 Dec 2003; Masatomo Nakano <nakano@gentoo.org> emerge: Fixed bug which - always remakes info dir file. - - 29 Nov 2003; Masatomo Nakano <nakano@gentoo.org> portage.py: Fixed issue with - ebuild name rule. Fixed typo with variable name. - This closes bug #17172,#34666 - - 29 Nov 2003; Masatomo Nakano <nakano@gentoo.org> emerge: Fixed issue with - lacking the "setting" argument for pkgmerge() - - 29 Nov 2003; Masatomo Nakano <nakano@gentoo.org> emerge: fixed rsync bug. - This closes bug #34660. - - 28 Nov 2003; Nicholas Jones <carpaski@gentoo.org> portage.py: Migration - to non-global settings started -- class config has new functionality and - is locked after portage is finished initializing -- changes cannot be made - to the global instance of config 'settings' -- reset() is now functional, - setcpv() loads PKGUSE from /etc/portage/package.use, load_infodir() loads - all small files (under 4k) from the vardb directory of an installed package - so that operations have the same post* settings as they had at merge time. - Begin modifications to spawn() to allow for files/pipes to be used for - IO instead of using getstatusoutput which does not take an environment - parameter like execve(). check_config_instance() ensures that the provided - parameter is a 'class config' instance -- for ensuring that everything is - being passed properly with the changes. Fix for the local FS mirror issue - where it removed the first '/' instead of the last one. doebuild() cleanups - for readability and pkguse enhancements -- also remove getstatusoutput() - usage for depend so that we don't have to modify the active environment. - Fix for symlink mtime values returned from movefile. (Nakano) SLOTMOVE - added to global update functionality to fix some issues where a package - suddenly must become slotted. portdbapi takes a root parameter instead - of using settings. Slightly more useful output from depend. binarytree() - now takes a pkgdir instead of using settings. Portage will now die if - ebuild.sh exits on a signal. - - Moved some functions around and renamed them for general use -- derived - from match2 in class portagetree: - match_to_list() find all atoms in a list that match a given package. - best_match_to_list() determines the most specific match. Needs work. - match_from_list() find all packages in a list that match a given atom. - - 28 Nov 2003; Nicholas Jones <carpaski@gentoo.org> emerge: Fixed an issue - with searchdesc wanting root permissions if run as non-root. Migrated to - the non-global config class. EMERGE_FROM added for the dyn_preinst patch - -- Indicates if a merge is occuring from an ebuild or from a binary. Patch - for rsync timestamp checking from Nakano. - - 28 Nov 2003; Nicholas Jones <carpaski@gentoo.org> ebuild.sh: Save PKGUSE. - Pebeneto's patch for dyn_preinst and SELinux added as a fix for binary - and ebuild merges. Added a kill for portage during the depend phase so - that portage will actually die if you control-C. - - 28 Nov 2003; Nicholas Jones <carpaski@gentoo.org> *: MASSIVE set of changes - to start using locally defined 'class config' instances. This allows us to - start working on some parallelism among other things. Created this way: - mysettings = portage.config(clone=portage.settings) - - The Following functions now take a 'config' parameter: - spawn(), fetch(), digestgen(), digestcheck(), spawnebuild(), doebuild(), - merge(), dep_opconvert(), dep_check(), dblink.__init__() - - package.keywords is now implemented curtasy of genone/max. PKGUSE was - rewritten for the global config killing and is also included. X11 man - pages now found and zipped correctly. SYS.PATH fixes for the python - migration -- issue actually only shows up on 2.2 systems because of how - compiled modules are used if found regardless of the original source's - existance. - - 28 Nov 2003; Nicholas Jones <carpaski@gentoo.org> tabcheck.py: An easier - way to make sure that all the python stuff is correctly using tabs and - not mixing spaces. - - 28 Nov 2003; Nicholas Jones <carpaski@gentoo.org> xpak, xpak.py: Fixes - to ensure that it works if the current dir is missing and that the python - path gets set properly. - - 22 Nov 2003; Daniel Robbins <drobbins@gentoo.org> portage.py: Fixed - calls in vartree method to invalidentry().... made them call call - self.dbapi.invalidentry() (there were multiple wrong method calls.) - - 10 Nov 2003; Nicholas Jones <carpaski@gentoo.org> md5check.py: Checks all - digests and SRC_URIs for filenames and associated MD5s. Reports collisions - between versions/packages, missing, and extra lines in digests. - -*portage-2.0.49-r17/18 (10 Nov 2003): Fixes - - 10 Nov 2003; Nicholas Jones <carpaski@gentoo.org> *: Changed portage to - be the first path in sys.path for all python scripts. Also enabled - optimizations from the scripts to ensure everything imported is built - for speed. ebuild: applied fix for the '//' root breaking the db[]. - prepstrip: etdyn quickfix - - 10 Nov 2003; Nicholas Jones <carpaski@gentoo.org> portage.py: fix for - RESTRICT=nouserpriv. GENTOO_MIRRORS can have paths set to take files - from. Fixes for mishandled cache data regarding *pkgsplit(). Fixes for - '*' being returned as part of a package split. An 'invalidentry()' fix - for a traceback. Nakano's fixes for virtual removals not working properly, - sandbox violations during pkg_nofetch, || depend selection. Genone's - fixpackages speedup. - - 10 Nov 2003; Nicholas Jones <carpaski@gentoo.org> ebuild.sh: PORTAGE_TMPDIR - fix for distcc. Variable passing bug patch for export_functions. Exit 1 - added for nofetch to stop sandbox violation. Nakano's --tree patch added. - Improved the unmerge messages to denote what kind of unmerge fails. Info - pages regex pattern adjusted to allow most any name for a page. - - 10 Nov 2003; Nicholas Jones <carpaski@gentoo.org> repoman: genone's xml - linting additions. - - 01 Nov 2003; Robin H. Johnson <robbat2@gentoo.org> pym/cvstree.py: - fix bug #32071, by properly escaping a string to not be a regex. Checked - thru entire *.py tree and found this is the only mis-use of strings that - need to be escaped. - - 31 Oct 2003; Daniel Robbins <drobbins@gentoo.org> portage.py: /lib/modules - now gets "unmerge protection." This is half of the config protection - functionality. It means that anything in /lib/modules will not be deleted - when a package is unmerged (often automatically when a user merges a - kernel module ebuild for a new kernel.) This solves the "my module - disappeared!" issue. This closes bug #1477. - - 31 Oct 2003; Daniel Robbins <drobbins@gentoo.org> emerge: Should no longer - spit out wacky "!!! no match found" warnings when auto-cleaning. - - 30 Oct 2003; Daniel Robbins <drobbins@gentoo.org> portage.py: Only run - depscan.sh if it exists on disk. This allows Portage to run inside a stage1 - where /sbin/depscan.sh doesn't exist. - - 30 Oct 2003; Daniel Robbins <drobbins@gentoo.org> portage.py: Applied fix to - allow multi-level "use? ( )" in SRC_URI, closing bug #16159. - -*portage-2.0.49-r15/16 (21 Oct 2003): Fixes - - 21 Oct 2003; Nicholas Jones <carpaski@gentoo.org> fix-db.py: was broken - for python2.3 -- fixed now. - - 21 Oct 2003; Nicholas Jones <carpaski@gentoo.org> portage.py: Added - lockfiles to prelink md5 checks. Fixed caching bug where cache objects - were passed back as pointers instead of copies. Added 'invalidentry' - function to handle lockfiles -- It tests/deletes them using unlockfile. - Added fix-db.py to the 'databases is broken' messages. - - 21 Oct 2003; Nicholas Jones <carpaski@gentoo.org> ebuild.sh: added CDPATH - to unset. SELinux fix for sandbox. - -*portage-2.0.49-r13/14 (10 Oct 2003): Fixes - - 10 Oct 2003; Nicholas Jones <carpaski@gentoo.org> *: Full adaptations - for python2.3 implemented. Installation setup for /usr/lib/portage/pym - instead of site-packages. Fix for Old-Instance unmerging which stopped - happening due to changed path names. Binaries shouldn't merge under - fetchonly. - -*portage-2.0.49-r11/12 (08 Oct 2003): Internal Only. - -*portage-2.0.49-r10 (08 Oct 2003): Fixes - - 08 Oct 2003; Nicholas Jones <carpaski@gentoo.org> portage.py: Fixed a - seemingly random traceback involving lockfiles -- Categories weren't - being created before a lockfile was attempted in the category directory. - More enhancements to aid migration to python-2.3. Added writemsg() as - a general function for outputting information -- Takes an argument that - is interpreted as debug level and prints synchronisly to stderr. Yanked - domenu pending a GLEP. - -*portage-2.0.49-r9 (07 Oct 2003): Fixes - - 07 Oct 2003; Nicholas Jones <carpaski@gentoo.org> portage.py: Atomic lock - updates and self.create() fixes. Counter enhancements. - -*portage-2.0.49-r8 (05 Oct 2003): - - 05 Oct 2003; Nicholas Jones <carpaski@gentoo.org> *: Changed #! line to - use /usr/bin/python to aid in migration. - - 05 Oct 2003; Nicholas Jones <carpaski@gentoo.org> ebuild.sh: More use/has - output fixups. - - 05 Oct 2003; Nicholas Jones <carpaski@gentoo.org> emerge: General cleanups. - Added in baselayout info to emerge info. --skipfirst isn't a persistent - option on resume anymore. - - 05 Oct 2003; Nicholas Jones <carpaski@gentoo.org> fix-db.py: New script to - aid in diagnosing and eventually fixing /var/db issues. It makes almost no - modifications at the moment. - - 05 Oct 2003; Nicholas Jones <carpaski@gentoo.org> prepstrip: Addition of - a condition for etdyn binaries -- they list as shared objects but aren't. - - 05 Oct 2003; Nicholas Jones <carpaski@gentoo.org> repoman: Added non-cvs - patch -- repoman can be used outside of cvs trees for scanning/checking. - Added a masking fix for packages that use 'arch?' dependencies. Permission - fix on stats pickle. - - 05 Oct 2003; Nicholas Jones <carpaski@gentoo.org> portage.py: Subversion - directories are ignored along with CVS in listdir() when ignorecvs is set. - USE_EXPAND is fixed. Global and package counter fixes. ATOMIC VARDB moves - are now implemented -- Still need a way to recover broken operations. - Counter functions are now implemented in dbapi only. vardbapi now implements - aux_get for all possible files listed in the package's info directory. New - functions: lockfile()/lockdir(), unlockfile()/unlockdir(). - -*portage-2.0.49-r7 (26 Sep 2003): Binary package fixes + spacing issues. - - 26 Sep 2003; Nicholas Jones <carpaski@gentoo.org> emerge.sh: Spacing fixes - for tab/space mixes. glob fix for getgccversion(). - - 26 Sep 2003; Nicholas Jones <carpaski@gentoo.org> portage.py: Fix for binary - use flag tb. - - 26 Sep 2003; Nicholas Jones <carpaski@gentoo.org> xpak.py: Fix for scan() - tb when file is invalid or shorter than XPAK header length. - -*portage-2.0.49-r6 (23 Sep 2003): SELinux, DistCC, and pretend output fixes. - - 23 Sep 2003; Nicholas Jones <carpaski@gentoo.org> ebuild.sh: selinux context - fixes -- using ${T} now. DISTCC_DIR added by default and given an addwrite. - - 23 Sep 2003; Nicholas Jones <carpaski@gentoo.org> emerge: gccversion() added - to help distcc and the version checking calls that break distcc permissions. - Fix for create() and the useflag passing from binary packages. When using - pkgs, is_newer_ver_installed() no longer trashes ebuild names. Don't look - for fetch restrictions with binary packages. Included a modified patch that - shows only in-slot versions for packages during pretend output -- In-slot - now shows up exactly as a single-slot package would -- New slots show up - as new packages -- proper output. Killed debug for everything except regen - which now shows the deps being regenerated. Fixed regen to ignore keywords - just like sync does already... should fix a few missing cache entry problems - on rsync1 and speed up sync times all around. - - 23 Sep 2003; Nicholas Jones <carpaski@gentoo.org> portage.py: Additions for - distcc support. - - -*portage-2.0.49-r5 (19 Sep 2003): Fixes - - 19 Sep 2003; Nicholas Jones <carpaski@gentoo.org> ebuild.sh: Make - DISTCC_DIR set if not defined. - - 19 Sep 2003; Nicholas Jones <carpaski@gentoo.org> emerge: Fix for -U - introduced bugs with Str+None tracebacks. Mild change to log info -- Added - short pkgname before ebuild. Eclassdb changes and flush/save calls. - - 19 Sep 2003; Nicholas Jones <carpaski@gentoo.org> portage.py: Unregister - signal handling after receiving the signal and resend the signal we got. - Run depscan during env-update. Migrated eclass stuff into it's own pickle. - Code for moving /var/cache/edb/dep into a pickle for each category added -- - disabled via hardcoded value presently. Removed some try blocks in favor - of detecting the cause of an error first -- Hopefully gives a little speed - up. Cache fixes and useful output added. A tbz2 moving bug where an error - was printed about files the destination existing already is now fixed. The - dircache is cleared on every unmerge now, to ensure the cache does not - interfere. bzip2 is spawned with the quiet flag now. Update list is sorted - for proper year/quarter order now. -arch isn't an invalid keywork anymore. - Generic pickle reading and writing functions added. - -*portage-2.0.49-r4 (10 Sep 2003): Fixes - - 10 Sep 2003; Nicholas Jones <carpaski@gentoo.org> *: Added the facility - to incorporate binary package use flags when calculating deps. Changes in - -r2 and -r3 included quick fixes to SELinux code and the addition of - LINGUAS to USE_EXPAND. - -*portage-2.0.49-r1 (25 Aug 2003): Fixes - - 25 Aug 2003; Nicholas Jones <carpaski@gentoo.org> emerge: -K traceback fix. - Made fetchonly quit traversing the merge code after fetching. - - 25 Aug 2003; Nicholas Jones <carpaski@gentoo.org> portage.py: Removed - auxcache saving code -- A few bugs and caching problems need to be resolved. - Moved a block of code in aux_get inside of an existing conditional -- Should - provide a small speedup. - -*portage-2.0.49 (22 Aug 2003): GRP downloading, Selinux, General Fixes - - 22 Aug 2003; Nicholas Jones <carpaski@gentoo.org> portage.py: Make - auxcache saving more friendly. - -*portage-2.0.49_pre20/21 (20 Aug 2003): Fixes + security enhancements - - 20 Aug 2003; Nicholas Jones <carpaski@gentoo.org> portage.py: Fix for - auxcache saving. - -*portage-2.0.49_pre19 (20 Aug 2003): Fixes + security enhancements - - 20 Aug 2003; Nicholas Jones <carpaski@gentoo.org> *: Updates to Wayne's - modifications on dispatch-conf. - - 20 Aug 2003; Nicholas Jones <carpaski@gentoo.org> ebuild.sh: sfperms - added to strip permissions if set in features. selinux context support. - Nakano's cleanups for unmerge output. Added distcc and ccache versions - into emerge info's output. 'autoaddcvs' FEATURE is documented in make.conf. - - 20 Aug 2003; Nicholas Jones <carpaski@gentoo.org> portage.py: Selinux code - added. No longer traceback on cp_list for categories. Added in a patch to - use a pickle for auxcache storing. Should help slow IO boxes. - -*portage-2.0.49_pre18 (15 Aug 2003): Fixes. - - 15 Aug 2003; Nicholas Jones <carpaski@gentoo.org> ebuild.sh: Nakano's - fix for a glob expansion bug on a tar call. - - 15 Aug 2003; Nicholas Jones <carpaski@gentoo.org> emerge: Nakano's fixes - for exiting on a signal and incorrect output for the unmerge screen. - - 15 Aug 2003; Nicholas Jones <carpaski@gentoo.org> portage.py: Added in - patch to shuffle thirdparty mirrors. Nakano's fixes for digests+fetching - bugs/messages/errors. Virtual stripping fix. - - 15 Aug 2003; Nicholas Jones <carpaski@gentoo.org> *: Fix to emerge -V - and related output. Typo fixes. Parent thread no longer drops root in - userpriv. 'autoaddcvs' feature now determines if portage will auto-add - files to cvs. Virtuals fix for an empty key line. Added user categories - file as /etc/portage/categories. - -*portage-2.0.49_pre17 (30 Jul 2003): Resuming/wget GRP, Sandbox updates - - 30 Jul 2003; Nicholas Jones <carpaski@gentoo.org> *: GRP updates to - use RESUMECOMMAND to determine how to download GRP binaries. Adjustments - to the portage.spawn() code to try and speed it up by eliminating the - copy phase (copy-on-write forking). Massive messages for corrupt FS issues. - Movefile() checks to ensure we actually complete the moves. Killed the - broken pipe message for tbz2 extraction. - -*portage-2.0.49_pre16 (29 Jul 2003): Touchups - - 29 Jul 2003; Nicholas Jones <carpaski@gentoo.org> *: Clean up the debug - output and quickfix downloading tbz2s. - -*portage-2.0.49_pre15 (29 Jul 2003): Fixes - - 29 Jul 2003; Nicholas Jones <carpaski@gentoo.org> repoman: imported time. - - 29 Jul 2003; Nicholas Jones <carpaski@gentoo.org> emerge: Corrected the - logic used to determine whether a package or an ebuild is used when given - the option. - - 29 Jul 2003; Nicholas Jones <carpaski@gentoo.org> portage.py: Changed a - lot of calls using 'print' into sys.stderr.write() calls. Added try/except - around the source lstat to catch funky errors where the file doesn't really - exist -- Presents descriptions to users about what to do. Added more catches - for movefile() calls to ensure it dies on failures. Changed the tbz2 - extraction call to stop the 'cat: broken pipe' message. - -*portage-2.0.49_pre14/48-r7 (24 Jul 2003): Fixes and getbinpkg caching - - 22 Jul 2003; Nicholas Jones <carpaski@gentoo.org> *: Typo fixes for - the ECLASS_DEPTH comparisons in ebuild.sh. Traceback fixes for blocking - packages in depclean and in pretend. Caching added to getbinpkg code -- - generation of cache supported, but cachefile is staticly located. Langs - patch from Nakano in bug #9988 included. - -*portage-2.0.49_pre13 (22 Jul 2003): Fixes - - 22 Jul 2003; Nicholas Jones <carpaski@gentoo.org> doman: Doesn't gzip - .keep files now. - - 22 Jul 2003; Nicholas Jones <carpaski@gentoo.org> ebuild.sh: USERLAND - fix. ** ECLASS depth tracker and additions to the new depend code. ** - - 22 Jul 2003; Nicholas Jones <carpaski@gentoo.org> emerge: Fetch restriction - now adds a red F to the pretend output. Made the blockers message better. - Added 'local' to rsync excludes to allow the category to be added for admins. - - 22 Jul 2003; Nicholas Jones <carpaski@gentoo.org> portage.py: Fixed a TB - caused by a missing 'strict' reference --- Needs to be fixed better. Fixed - a typo in the populate code for bintree/getbinpkg. - -*portage-2.0.49_pre11 (16 Jul 2003): GRP, General, VIDEO_CARDS/INPUT_DEVICES - - 16 Jul 2003; Nicholas Jones <carpaski@gentoo.org> quickpkg: SpanKY's - friendly edition now included. - - 16 Jul 2003; Nicholas Jones <carpaski@gentoo.org> portage.py: USE_EXPAND - support for expanding bash variables into USE --- VIDEO_CARDS="blah" - USE="video_cards_blah". Added a notice about fetching metadata so you - can see that it's happening. - - 16 Jul 2003; Nicholas Jones <carpaski@gentoo.org> make.globals*: Added - default CHUNKSIZE for binhosts. Added defaults for USE_EXPAND which is - used to expand variables into USE from the give names. - - 16 Jul 2003; Nicholas Jones <carpaski@gentoo.org> *: Debug removal. - -*portage-2.0.49_pre10 (16 Jul 2003): GRP and General Fixes - - 16 Jul 2003; Nicholas Jones <carpaski@gentoo.org> *: - Quick fix for a breakage in the GRP --getbinpkg code. - -*portage-2.0.49_pre9 (16 Jul 2003): GRP and General Fixes - - 16 Jul 2003; Nicholas Jones <carpaski@gentoo.org> ebuild.sh: add - LDFLAGS and ASFLAGS. Exports are only done if vars are already set. - - 16 Jul 2003; Nicholas Jones <carpaski@gentoo.org> emerge: Added support for - --getbinpkg and --getbinpkgonly --- GRP complement. Fixes for blocking- - not-working bug - - 16 Jul 2003; Nicholas Jones <carpaski@gentoo.org> repoman: Patch to detect - incomplete digests. - - 16 Jul 2003; Nicholas Jones <carpaski@gentoo.org> portage.py: ebuild fetch - now checks md5sums (run from ebuild). Support for getbinpkg. - - 16 Jul 2003; Nicholas Jones <carpaski@gentoo.org> xpak.py: Added more in- - memory operations support. - - 16 Jul 2003; Nicholas Jones <carpaski@gentoo.org> getbinpkg.py: Supporting - code for binary package retrieval. - -*portage-2.0.48-r2 (29 Jun 2003): Fixes and Multiple Overlays - - 29 Jun 2003; Nicholas Jones <carpaski@gentoo.org> ebuild.sh: Fixed the - commands for tar. - - 29 Jun 2003; Nicholas Jones <carpaski@gentoo.org> emerge: Mode the chdir - to fix the spanky bugs down to post_emerge to fix the "can't merge an - ebuild file with an absolute path" bug. - - 29 Jun 2003; Nicholas Jones <carpaski@gentoo.org> portage.py: Added function - suffix_array(array,suffix) which takes an array and adds suffix to the end - of each element. Added 'cd / ;' into the getstatusoutput() calls to ldconfig. - Added a check so that portage doesn't try to add files/dir from a non-cvs - directory. Added 'manifest' target to ebuild/portage to only adjust the - manifest. Added Multiple overlay support -- Should be fairly thorough -- - needs more debug though. Fixed portdbapi::new_protect_filename(). - -*portage-2.0.48-r2 (29 Jun 2003): Cleanups and Fixes (testing) - - 29 Jun 2003; Nicholas Jones <carpaski@gentoo.org> ebuild.sh: Lots of - consistency cleanups. Added more files to the var/db data for future - use. Added more die conditions to failure points. Fixed/Hacked a fix - into the inherit-not-dieing problem. Set TMPDIR and TMP globally. Added - notice for multiple inheritance. Fixed inheritance problem with multiple - inheritance clobbering previous list of eclasses. Basic support for - multiple overlays added to ebuild.sh. - - 29 Jun 2003; Nicholas Jones <carpaski@gentoo.org> emerge: SRC_URI fix for - 'rm /etc/*' problem. Spanky bug: chdir to / to avoid problems when merging - from inside a builddir that gets deleted. - - 29 Jun 2003; Nicholas Jones <carpaski@gentoo.org> etc-update: Added notice - for symlinks in cfg_prot setups. - - 29 Jun 2003; Nicholas Jones <carpaski@gentoo.org> repoman: complain if - FEATURES=cvs not set. - - 29 Jun 2003; Nicholas Jones <carpaski@gentoo.org> portage.py: Added in - a work around for the 'USE=+useflag' users. Added support for nouserpriv - via RESTRICT. Fix the bug with ROOTs with no previous file causing a TB - from counter_tick(). Make symlinks follow config_protect just like normal - files. - - 10 Jun 2003; Daniel Robbins <drobbins@gentoo.org> ebuild.sh, portage.py, - various commands in bin/, cnf/make.conf.mac, cnf/make.globals.mac: - Added preliminary Mac OS X/BSD support. - - 06 Jun 2003; Daniel Robbins <drobbins@gentoo.org> ebuild.sh: new eclass - dependency implementation to totally isolate eclass dependency tweaks - from in-ebuild dependency tweaks. eclasses now absolutely do not touch - DEPEND and RDEPEND. Any dependencies added by eclasses are transferred - to another variable and added in to DEPEND and RDEPEND after the entire - ebuild has been processed, and after RDEPEND has optionally inherited a - value from DEPEND due to it being unset. The result of this change is - that inherit statements no longer need to be placed strategically in an - ebuild so that they are after the DEPEND and RDEPEND, and fix a host of - other eclass mis-use/side-effect bugs. - -*portage-2.0.48-r1 (29 May 2003): Touchups. - - 29 May 2003; Nicholas Jones <carpaski@gentoo.org> ebuild.sh: Quick fixes - to a couple of rare bugs. Added some quoting to $S. Removed the DISTCC - hosts variable. Moved build-info's creation around so that it actually - works for non-portage-compiled merges. - - 29 May 2003; Nicholas Jones <carpaski@gentoo.org> repoman: Quick fix for - the files-dir-not-added lack of notification. Added in a fix for a possible - security problem with the repoman commit messages and symlink-attacks. - - 29 May 2003; Nicholas Jones <carpaski@gentoo.org> cnf/*: Added in a diff - from 'Danny' that contained a SYNC cleanup and expanded explanation. :) - - 29 May 2003; Nicholas Jones <carpaski@gentoo.org> output.py: Fixed the - TitleBar and unset TERM issues. - - 29 May 2003; Nicholas Jones <carpaski@gentoo.org> portage.py: Added new - functions to aid in determining virtuals. cpv_all() added to dbapi -- it - displays all versions instead of just package names -- cp_all() now calls - this function to gain it's data. get_provide() and get_all_provides() added - to collect PROVIDE info from vartree packages. getallcpv() added to vartree - to reference the dbapi call. Always set ignoring errors on findname now. - Cleaned up the virtuals-trimming code. Don't mention the fixpackages script - if the user doesn't have any packages. - -*portage-2.0.48 (20 May 2003): Cleanups Release. - - 20 May 2003; Nicholas Jones <carpaski@gentoo.org> emerge: Tiny cleanups. - Fixed the profile information in emerge -V for symlinks that have a - trailing '/' in them. Fix 'emerge -s' filesize lookups to use a new - function finddigest() from dbapi. - - 20 May 2003; Nicholas Jones <carpaski@gentoo.org> emergehelp.py: Updated. - - 20 May 2003; Nicholas Jones <carpaski@gentoo.org> etc-update: Small - fixups for pager issues. Made the nothing-to-do exit message 'happier'. - - 20 May 2003; Nicholas Jones <carpaski@gentoo.org> extra-functions.sh: - Beat the debian-utils requirement out of the functions. Prefers them, - but falls back to already-existing tools otherwise. - - 20 May 2003; Nicholas Jones <carpaski@gentoo.org> fixpackages: 75% - overhaul to match the new handling of update code. - - 20 May 2003; Nicholas Jones <carpaski@gentoo.org> quickpkg: Understands - "--help" as an option now. - - 20 May 2003; Nicholas Jones <carpaski@gentoo.org> man/*: Simple updates. - - 20 May 2003; Nicholas Jones <carpaski@gentoo.org> portage.py: fetch() - now calculates md5sums when doing a fetchonly. finddigest() added for - finding digests -- gets overlay digests if existing. Binary packages - are only updated when explicitly requested via fixpackages as a command - or a FEATURES setting. Clear the dircache after portage initializes to - reduce memory consumption. - -*portage-2.0.48_pre6 (12 Apr 2003): General cleanups and fixes. - - 12 May 2003; Nicholas Jones <carpaski@gentoo.org> portage.py: Additions - to better handle overlay ebuilds with regard to metadata cache. aux_get - calls findname2() which returns (location,in_overlay) -- findname() is - a wrapper for findname2(). Extra debugging fixes for findname() issues. - - 12 May 2003; Nicholas Jones <carpaski@gentoo.org> ebuild.sh: Code - cleanups and a chgrp/chown pass to move all portage-owned files to - root ownership -- Two pass to leave specific-group and specific-owner - settings alone. - - 12 May 2003; Nicholas Jones <carpaski@gentoo.org> emerge: code cleanups - and comment touchups. - - 12 May 2003; Nicholas Jones <carpaski@gentoo.org> emergehelp.py: Updates - for --debug, --digest, and --skipfirst. - - 12 May 2003; Nicholas Jones <carpaski@gentoo.org> g-cpan.pl: Added more - arches to the KEYWORDS. Made it copy files back to distfiles. - - 12 May 2003; Nicholas Jones <carpaski@gentoo.org> prepstrip: Removed ${D} - from the outputted filenames during stripping. - - 12 May 2003; Nicholas Jones <carpaski@gentoo.org> man/* cnf/*: - documentation updates. - -*portage-2.0.48_pre5 (29 Apr 2003): Cleanups and polish. - - 29 Apr 2003; Nicholas Jones <carpaski@gentoo.org> portage.py: Another - typo fix. - -*portage-2.0.48_pre4 (28 Apr 2003): Cleanups and polish. - - 28 Apr 2003; Nicholas Jones <carpaski@gentoo.org> portage.py: Quick fix - for a traceback/typo in the 'emerge -C' code. - -*portage-2.0.48_pre3 (28 Apr 2003): Cleanups and polish. - - 28 Apr 2003; Nicholas Jones <carpaski@gentoo.org> portage.py: listdir() - now takes care of non-existance errors instead of propagating them --- can - take EmptyOnError=1 as a param to return [] instead of None. All calls to - portage's listdir() have been updated to the new conventions. listdir() - ignores .# files from cvs now when ignorecvs=1 is set. Fixes for another - world-depleting bug. If findname() is passed a virtual, it now informs - the user to report a bug, instead of weird tracebacks. Added code in - dblink::unmerge() to remove stale virtual entries when set under trimworld. - - 28 Apr 2003; Nicholas Jones <carpaski@gentoo.org> etc-update: enabled the - diff pager again. - - 28 Apr 2003; Nicholas Jones <carpaski@gentoo.org> emerge: --changelog - implies --pretend. Spelling fixes. Added --skipfirst to allow the first - package in a resume operation to be skipped over --- allows -e to rebuild - almost everything, even under weird circumstances. Located another missed - world-file-depleting bug in unmerge() calls. Included a patch to fix an - off-by-one bug in depclean. - - 27 Apr 2003; Nicholas Jones <carpaski@gentoo.org> portage.py: Fix for - listdir() running on a non-existant dir -- returns None. Sets generated - files to the portage group -- Manifest & digests. Some coloring additions. - Handling of 'strict' features added. TEMPORARY addition of 'manifest' USE - flag so this can go mainstream now. Fixes in doebuild() to get unmerge - working again for ebuild. Debug code added to findname to help figuring - out the seemingly random tracebacks -- suspect is pkgsplit(). Unmasking - code for package.mask added in -- works just like mask, and can override - specific versions or ranges -- One per line: /etc/portage/package.unmask. - Security fix for python cPickle code -- mtimedb could create arbitrary - execution of code bug. Global update notices/info. Fixes for loops over - listdir() that depended upon raised errors to determine code flow. - - 27 Apr 2003; Nicholas Jones <carpaski@gentoo.org> cvstree.py: Added in - 'removed' status checks. - - 27 Apr 2003; Nicholas Jones <carpaski@gentoo.org> repoman: Added in more - cvs checks. /space/cvsroot is now complained about. - - 27 Apr 2003; Nicholas Jones <carpaski@gentoo.org> emerge: Added in - PORTAGE_CALLER support to identify it as a 'do_update()' candidate. - - 27 Apr 2003; Nicholas Jones <carpaski@gentoo.org> dodoc: Check sizes to - prevent 0 byte files from being added. - -*portage-2.0.48_pre2 (10 Apr 2003): Digests & Repoman - - 16 Apr 2003; Nicholas Jones <carpaski@gentoo.org> repoman: Added CVS/Root - checks to ensure Manifests will be correct. Fixed local use-flag bug. - Commented out the no-stable code, as it can't be implemented well as is. - - 16 Apr 2003; Nicholas Jones <carpaski@gentoo.org> prepstrip: Fixed a - problem where files were not being stripped. - - 16 Apr 2003; Nicholas Jones <carpaski@gentoo.org> ebuild.sh: Added in - a call to 'make -n' when under the --debug flag. - -*portage-2.0.48_pre1 (10 Apr 2003): Digests & Repoman - - 10 Apr 2003; Nicholas Jones <carpaski@gentoo.org> prepstrip: fix it so - that it actually strips and provides reasonable info. - - 10 Apr 2003; Nicholas Jones <carpaski@gentoo.org> repoman: Added short - option for pretend. Added pretend capability to the majority of the - commit code. Bug fix for local IUSE code. Added in support for removed - cvs files. - - 10 Apr 2003; Nicholas Jones <carpaski@gentoo.org> portage.py: Changed - 'manifest' to 'Manifest'. Removed the requirement that Manifests exist -- - complain about it, but only die if 'strict' is set. - -*portage-2.0.47-r15 (09 Apr 2003): New digests/manifests, touchups. - - 09 Apr 2003; Nicholas Jones <carpaski@gentoo.org> bin/*: Fixes for Cross- - compiling. - - 09 Apr 2003; Nicholas Jones <carpaski@gentoo.org> repoman: Quick touchups - in the category- and repository-level manifest calls. - - 09 Apr 2003; Nicholas Jones <carpaski@gentoo.org> cnf/*: Added/sync'd - PORTAGE_NICENESS. - - 09 Apr 2003; Nicholas Jones <carpaski@gentoo.org> portage.py: Fixed hole - in the listdir code that occured on cache expiration in the -r14 changes. - -*portage-2.0.47-r14 (09 Apr 2003): - - 09 Apr 2003; Nicholas Jones <carpaski@gentoo.org> bin/*: Removed DEBUGBUILD - in favor of FEATURES/RESTRICT settings of nostrip. - - 09 Apr 2003; Nicholas Jones <carpaski@gentoo.org> ebuild: Removed root - restriction so that digests can be made as non-root. - - 09 Apr 2003; Nicholas Jones <carpaski@gentoo.org> emerge: Added niceness - - 09 Apr 2003; Nicholas Jones <carpaski@gentoo.org> repoman: Added the - nostable/allmasked check in. Small cleanups. Move to 'manifests' instead - of enhanced digests. Added filters on $Id and $Header. Fixed commitmsg - and added short options. - - 09 Apr 2003; Nicholas Jones <carpaski@gentoo.org> cvstree.py: More features - added. pathdata() provides dir or file info. isadded() gives cvs status. - - 09 Apr 2003; Nicholas Jones <carpaski@gentoo.org> portage.py: listdir() - enhancements. Debug removal. Broke up the digest creation functions to - make them a little more generic. Added manifest code into the digest - calls. Moved code in doebuild() around to allow for non-root calls for - devs and repoman. Added 'PORTAGE_CALLER' env var to prevent repeated - running of unnecessary functions. - -*portage-2.0.47-r13 (02 Apr 2003): Fixes & Security -- Repoman+Digests - - 02 Apr 2003; Nicholas Jones <carpaski@gentoo.org> emerge: Added debug to - the dep selection code in depgraph. - - 02 Apr 2003; Nicholas Jones <carpaski@gentoo.org> cvstree.py: Added new - module to handle cvs information without having to ask 'cvs status' many - times to determine file locations. - - 02 Apr 2003; Nicholas Jones <carpaski@gentoo.org> repoman: Major fix ups - to ease the introduction of enhanced digests. Intelligent cvs queries - and use of the new cvstree module for information about files in the tree. - Auto-digests, auto-fetches trivial cvs changes, detects changelogs that - exist but have not been added to cvs, and detects '*' in KEYWORDS. - - 02 Apr 2003; Nicholas Jones <carpaski@gentoo.org> *: A typo fix or two. - prepstrip: fixup for sed's issues with '\000' (made it \001). - -*portage-2.0.47-r12 (27 Mar 2003): Fixes & Security -- Repoman+Digests - - 27 Mar 2003; Nicholas Jones <carpaski@gentoo.org> portage.py: Moved all - initialization error messages to stderr.write() calls so that the output - doesn't get mixed will called data. Added a warning about not being in - the portage group. Color touchups. Digest path fixups. - - 27 Mar 2003; Nicholas Jones <carpaski@gentoo.org> repoman: Significant - additions to the commit code to nicely handle the changes for enhanced - digests. Added --commitmsg and --commitmsgfile flags to allow easier - scripting. Added a REPOMAN environment variable to prevent portage from - running do_updates(). Added 'grouplist' which makes groupings of subparts - from a list of parts. Added do* functions to manage the recursion into - the dirs of the repository. - - 27 Mar 2003; Nicholas Jones <carpaski@gentoo.org> xpak.py: Change from - lstat to stat... We're not concerned with links. Return 0 on not found. - - 27 Mar 2003; Nicholas Jones <carpaski@gentoo.org> portageq: added new - functions: best_visible, mass_best_visible, all_best_visible. - - 27 Mar 2003; Nicholas Jones <carpaski@gentoo.org> emerge: Added '--digest' - to force recreation of digests from the command line. Fixed portage version - comparisions for the 'update portage please' notices. - - 27 Mar 2003; Nicholas Jones <carpaski@gentoo.org> ebuild.sh: Added an - extra rm of the 'successful' file. - - 26 Mar 2003; Alain Penders <alain@gentoo.org> portageq: added - mass_best_version method to help GUIs resolve best versions. - -*portage-2.0.47-r11 (22 Mar 2003): Fixes & Security -- Winding up 2.0 series. - - 22 Mar 2003; Nicholas Jones <carpaski@gentoo.org> portage.py: listdir() - now is capable of recursive calls and listing only files. Used in new - additions to digestgen() and digestcheck() for ebuilds and files/* -- - listdir(dir,recursive=0,filesonly=0). Digests now must contain all files - from files/ and also the ebuild -- non-archives are prefixed with '/'. - Full tbz2 fixes are now implemented... They can take a while to perform - so status thingies are provided. update_ents() provides a batch-update - as it would take rediculous amounts of time otherwise. - - 22 Mar 2003; Nicholas Jones <carpaski@gentoo.org> : fixpackages calls - portageexit() to save the mtimedb state so it actually works. :) - - 22 Mar 2003; Nicholas Jones <carpaski@gentoo.org> emerge: Added - 'xtermTitle' calls to emergelog to set the title during phases of merging. - Added more emergelog calls to provide more specific information. - - 22 Mar 2003; Nicholas Jones <carpaski@gentoo.org> : Added two scripts to - aid portage. 'fixdbentries' takes (old, new, path) and does an inteligent - sed on all the db entries that should be changed. Used by global moves and - in the tbz2 fixes. 'fixpackages' expires the updates timestamp and reloads - portage to force do_updates() to run. Added missing Header lines. - - 22 Mar 2003; Nicholas Jones <carpaski@gentoo.org> xpak.py: Correct off-by-8 - bug in last commit. infosize does not contain the full size... Offset - begins _after_ the marker -- Added xpaksize for complete offset from EOF. - - 22 Mar 2003; Nicholas Jones <carpaski@gentoo.org> portage.py: Fix for - die-on-wheel-group-missing bug. The logfiles don't cause the counter - to be incremented and now match the merged package's COUNTER value. - get_counter_tick_core(root) does not increment the counter. Sandbox is - now working in all enabled cases, instead of just usersandbox. /var/db - and binaries (assuming they are RW) are now updated to contain the proper - info --- Added a 'fixdbentries' script to perform the updates to the data, - and added a 'move_ent' function to class binarytree (not fakedbapi). Added - a 'ebuild does not exist' error for the case of ebuilds in a wrongly named - directory. Added a notice for invalid tbz2's. Removed the 'make.defaults' - missing notice :-/. Duplicated the bintree creation so that it would be - available for do_update(). Catch when 'updates' is missing from mtimedb. - - 22 Mar 2003; Nicholas Jones <carpaski@gentoo.org> output.py: Added xterm - title bar function to set the titles... xtermTitle(mystring). Only set - if using color and terminal is [axE]term. - - 22 Mar 2003; Nicholas Jones <carpaski@gentoo.org> repoman: Additions - courtesy of Gerk and Vladamir... Checks all portage variables. Runs - a check against invalid (but still parsable) syntax errors in names. - Checks for invalid IUSE from use.desc and use.local.desc. Checks that - licenses are valid. Checks for legal keywords with a default set or - keywords.desc, if available. 'missingvar' tests moved to aux_get() calls. - - 22 Mar 2003; Nicholas Jones <carpaski@gentoo.org> prepstrip: Added test - to allow cross-compile-stripping to work properly. Rewrite the script to - be whitespace-aware and recursively process directories at level 1. - - 22 Mar 2003; Nicholas Jones <carpaski@gentoo.org> prepallstrip: Removed - all code from this script and made it a call to "prepstrip $D". - - 22 Mar 2003; Nicholas Jones <carpaski@gentoo.org> g-cpan.pl: Add in chomps - for the portageq calls. - - 22 Mar 2003; Nicholas Jones <carpaski@gentoo.org> emerge: Allow - --fetchonly of block'd packages. - - 22 Mar 2003; Nicholas Jones <carpaski@gentoo.org> ebuild.sh: Cleanups and - corrections for sandbox which has been disabled and broken for a couple - revisions now. use_{enable,with} die messages removed as they are in sub- - shells when used and won't kill the merge --- Moved to echo >&2. - - 21 Mar 2003; Nicholas Jones <carpaski@gentoo.org> xpak.py: Updates to make - the xpak code self-sustaining. Added basic documentation to the functions - and a description of the format in the comments at the top of the module. - -*portage-2.0.47-r10 (13 Mar 2003): Fixes -- Winding up 2.0 series. - - 13 Mar 2003; Nicholas Jones <carpaski@gentoo.org> portage.py: Less strict - check of permissions when fixing permissions for userpriv -- only requires - 02070 and group portage instead of 02770 for check. - - 13 Mar 2003; Nicholas Jones <carpaski@gentoo.org> g-cpan.pl: Fix to the - call to portageq. - - 13 Mar 2003; Nicholas Jones <carpaski@gentoo.org> etc-update: Fix for - deleted files in a CONFIG_PROTECT situation. - - 13 Mar 2003; Nicholas Jones <carpaski@gentoo.org> emerge: fix for keepwork - and keeptemp ** MUST ENSURE THAT CLEAN CLEANS BEFORE A FULL MERGE. - - 12 Mar 2003; Nicholas Jones <carpaski@gentoo.org> emerge: Added more - conditions on rsync -- Proper error detection. Rsync failures will not - cause a cache regeneration. Portage no longer considers masked portages - candidates for 'An update to portage'. - -*portage-2.0.47-r9 (10 Mar 2003): Fixes -- cvs-src, ebuild.sh, repoman - - 10 Mar 2003; Nicholas Jones <carpaski@gentoo.org> make.conf*: Adjusted - the LOGDIR message and change the default location to /var/log/portage. - - 10 Mar 2003; Nicholas Jones <carpaski@gentoo.org> repoman: One more fix - for the PORTDIR setting -- '/usr/portage' was matching '/usr/portage.cvs'. - - 10 Mar 2003; Nicholas Jones <carpaski@gentoo.org> etc-update: Added the - capability to automerge all files in the list -- with out without prompts. - - 10 Mar 2003; Nicholas Jones <carpaski@gentoo.org> emerge: Added messages - on failure to create a depgraph -- Helps with bad DEPEND detection. Made - 'emerge sync' stop if it fails, and not update cache. - - 10 Mar 2003; Nicholas Jones <carpaski@gentoo.org> ebuild.sh: added an - external extra_functions.sh file with extra functions for portage -- - it is flag-o-matic and pieces of eutils presently. Removed libdir/incdir - from einstall(). Added 'keepwork' to keep the source code after a package - is merged. Removed the 'local' declaration of ROOT in dyn_install() -- - this fixes has_version in src_install(). Fixed the sourcing of environment - so that variables are peristent across stages of a merge. Removed the - SANDBOX vars from the environment file, as that upsets SANDBOX. - - 10 Mar 2003; Nicholas Jones <carpaski@gentoo.org> portage.py: Fixes to - permission problems with cvs-src and ccache (removed nested try's). Log - counter fix -- One log per package now. - -*portage-2.0.47-r8 (02 Mar 2003): Fixes -- cvs-src, ebuild.sh, repoman - - 02 Mar 2003; Nicholas Jones <carpaski@gentoo.org> *: Fixes to eclass - errors and messages -- raise on not found. emerge --debug works for - ebuilds with syntax errors now -- needs better implimentation though, - debug=0 in params can't be used due to scope limits. - - 28 Feb 2003; Nicholas Jones <carpaski@gentoo.org> *: reorg ebuild.sh again - to ensure that aliases are expanded properly. Repoman now determines the - proper PORTDIR to set when loading portage to scan the cvs tree. portage.py - fixes for cvs-src permission problems with userpriv. - -*portage-2.0.47-r7 (27 Feb 2003): Quick fix for eerror() problem. - -*portage-2.0.47-r6 (26 Feb 2003): Drop deprecated warnings for new syntax. - - 26 Feb 2003; Alain Penders <alain@gentoo.org> emerge: Drop deprecated - warnings for new syntax. Don't make people switch to the new syntax - until it's agreed on by everyone. - -*portage-2.0.47-r5 (26 Feb 2003): Wicked Fast, BugFree v3.1, UserPriv - - 26 Feb 2003; Nicholas Jones <carpaski@gentoo.org> *: Update docs and help - again to drop --system and --world, and pull them from emerge's command - line. General cleanups. - - 26 Feb 2003; Nicholas Jones <carpaski@gentoo.org> emerge/portage.py: Fixes - to the cache directory permissions -- all dirs are properly owned by group - portage now. Add CCACHE_SIZE setting so we set a value for ccache. If the - dirs are set to the wrong perms, make sure they get changed recursively. - - 26 Feb 2003; Nicholas Jones <carpaski@gentoo.org> ebuild.sh: Rearraged the - code blocks so that they are easier to follow -- no more code in between - functions. All code follows function definitions now. - -*portage-2.0.47-r4 (25 Feb 2003): Wicked Fast, BugFree v3, UserPriv - - 25 Feb 2003; Nicholas Jones <carpaski@gentoo.org> *: Update docs and help - to match the deprecation of actions without '--' preceding them. - - 25 Feb 2003; Nicholas Jones <carpaski@gentoo.org> portage.py: Message - updates. Fix secpass for portage user. Set PORTAGE_GID for ebuild.sh to - use regardless of GID in use (wheel/portage). Only try and delete things - in PORTAGE_TMPDIR if we have perms to do it... see secpass note. Moved the - cachedir creation after settings in created so that we can use spawn instead - of system for the calls to 'chown/chmod -R'. Fix the note on make.defaults. - Fix for the 404 catcher in the fetch code. - - 25 Feb 2003; Nicholas Jones <carpaski@gentoo.org> emerge: Move all actions - into '--action' form -- Notify of deprecated usages. Moved the functions - from the top of emerge down below the command line parser for readability. - Kill FEATURES=noauto if we're running emerge -- it can break things. Make - -U imply -u so people aren't confused. --debug now enables all debug - variables in portage. Fix wheel/portage group requirements messages. Get - the current portage version when doing rsync via the portage tree's files - and not the loaded cache so that it is aware of changes immediately instead - of the next run. - - 25 Feb 2003; Nicholas Jones <carpaski@gentoo.org> ebuild.sh: Try to change - to good a good path at the start of the ebuild to prevent operations from - happening in places like home. After the ebuild's install phase, check to - see if any unsafe perm combo's exist and die if they do. Fix permissions - on the cachedir as we're changing them to root:portage. &> on environment - file prevented it from actually creating the file -- changed to 2>. Change - 'true' to 'exit 0' to be a bit more explicit about what we're doing. - - 24 Feb 2003; Alain Penders <alain@gentoo.org> repoman: Added nested/sub-shell - die testing. - - 23 Feb 2003; Alain Penders <alain@gentoo.org>: Added bin/portageq tool to - provide access to portage internal information without using APIs that - are changing. All tools that currently access portage information by - importing portage.py and poking around in it should switch to using this - tool instead. Changed some tools in bin/ to use it, so those won't break - either. - -*portage-2.0.47-r3 (17 Feb 2003): Wicked Fast, BugFree v2, UserPriv - - 22 Feb 2003; Nicholas Jones <carpaski@gentoo.org> bin/: added dispatch-conf - and db-fix.pl to the bins. Looking at dispatch-conf to replace etc-update - written by Jeremy Wohl (bug 14079). db-fix.pl is a rescue tool that Blizzy - wrote up to recreate/repair counter files in the DB -- shouldn't be needed - anymore as portage fixes the counter at every load of the counter, but we - will hang on to it just in case. - - 22 Feb 2003; Nicholas Jones <carpaski@gentoo.org> portage.py: moved the - wheelgid references to portage_gid references. Wheel is being deprecated. - Added notice to baselayout message that group portage controls everything - now. Killed the BASH_ENV settings -- moved the reference to /etc/portage/ - in case it's desired in some way -- This fixes AROUND ONE HUNDRED reports - on 2.0.47-r2. Try/catch invalid tbz2's -- should fix a couple bad tarball - bugs. Make the prelink call spawn'd without sandbox. buildpkg/userpriv - fix via actionmap (Jasmin Buchert; bug 16106). - - 22 Feb 2003; Nicholas Jones <carpaski@gentoo.org> emerge: --upgradeonly - added from jrray's patch; added some slot handling. --deep got a short - flag 'D'. 'info' can be run by non-root. '--quiet' kills all but package - names on searches. Basic slot detection added to the pretend output so - that it doesn't always say downgrade. Ignore block list when fetching. - Can use RSYNC_EXCLUDEFROM to select a from for rsync to --exclude-from; - (Michael Sterrett; Bug 15882). 'emerge rsync' deletes the dbcachedir - before it begins updates. Catch exceptions during rsync cache regen. - - 22 Feb 2003; Nicholas Jones <carpaski@gentoo.org> ebuild.sh: General fixes - to the spelling of things. 'cd $PORT_TMPDIR' corrected to the actual vars - name. Stripping distcc from PATH if it is there before portage sets it. - Same with ccache. If we try to compile with out unpacking, complain. Make - sure to chown files to user portage. - - 22 Feb 2003; Nicholas Jones <carpaski@gentoo.org> cnf/*: CFLAGS notes, - pentium4 breaks things. Added more descriptions for FEATURES. Added - RSYNC_EXCLUDEFROM description. - - 22 Feb 2003; Nicholas Jones <carpaski@gentoo.org> *: Updates to the - copyright headers. - -*portage-2.0.47-r2 (17 Feb 2003): Wicked Fast, BugFree, UserPriv - - 18 Feb 2003; Alain Penders <alain@gentoo.org> portage-2.0.47-r2.ebuild: - If $PORTAGE_TEST is set, skip the beeps/delay messages. Needed to make - the regression test scripts bearable :-) - - 17 Feb 2003; Nicholas Jones <carpaski@gentoo.org> portage.py: Fixed the - depcache code once again -- ebuild and cache were never set to the same - mtimes. Removed last os.system() call. - - 17 Feb 2003; Nicholas Jones <carpaski@gentoo.org> repoman: catdir fix. - Added 'emerge-webrsync' from gentoolkit so users can use snapshots on - initial installs. - - 17 Feb 2003; Nicholas Jones <carpaski@gentoo.org> emergehelp.py: Updated - it to the current calls and conventions. Added comments about etc-update - and emerge-webrsync. - - 17 Feb 2003; Nicholas Jones <carpaski@gentoo.org> emerge: Changed the - search code around to use compiled re's instead of .lower() searches. - Trivial touchups in spacing. Only write worldfile if not --pretend. Fix - losing-packages-to-be-merged during merge bug. Allow options to change - in a --resume call so that --buildpkg and such may be added. - - 17 Feb 2003; Nicholas Jones <carpaski@gentoo.org> ebuild.sh: Added a - PREROOTPATH to allow special paths to be added prior to root and ebuild's - required pathes. ${S} is now generated prior to sourcing an ebuild so - that it is available in the ebuild at source-time, as opposed to in the - phases. - -*portage-2.0.47-r1 (16 Feb 2003): Wicked Fast + UserPriv - - 16 Feb 2003; Nicholas Jones <carpaski@gentoo.org> portage.py: Changed a - few os.system calls to spawn calls. Added userpriv in features check to - spawn. HOME is now placed in BUILD_PREFIX/homedir when userpriv is enabled. - Valid command for doebuild() moved to the top of the function. Reorganized - the directory creation code in doebuild(). HOME is cleaned for every merge - if in userpriv. LOG_COUNTER fix for the per-ebuild logs -- Only one value - is used per $PF now. - - 16 Feb 2003; Nicholas Jones <carpaski@gentoo.org> emerge: Adjusted options - to remove --autoclean and make it on-by-default unless killed in FEATURES - with 'noclean'. Removed debug for --resume. Added RSYNC_TIMEOUT as some - dialup and other users are experiencing problems with rsync never finishing - a connection. Added check at the end of an rsync to notify the user when - a new version of portage is available. Added --pretend capability/fix to - the --resume code. No resume data and a --resume is no longer a failure. - - 16 Feb 2003; Nicholas Jones <carpaski@gentoo.org> ebuild.sh: Updates to - logic of ${T}/successful handling to allow proper cleaning. dyn_clean() - will do a recursive dir removal after cleaning specific files. Recursive - chown removed. CCACHE_DIR handled in portage.py now. Removed a few comments - and unnecessary checks. - - 16 Feb 2003; Nicholas Jones <carpaski@gentoo.org> cnf/*: added comments - on FEATURES=noclean,noauto,userpriv,usersandbox - - 15 Feb 2003; Nicholas Jones <carpaski@gentoo.org> emerge: Alain changed - the .config() call in the search class to a .settings[] -- Speedup. - - 14 Feb 2003; Nicholas Jones <carpaski@gentoo.org> portage.py: Added - resume to mtimedbkeys. - - 14 Feb 2003; Nicholas Jones <carpaski@gentoo.org> emerge: --columns - flag to support column output in --pretend. --resume support added - to restart portage with the package list with which it stopped -- data - is stored in mtimedb. Added '--verbose' to 'emerge info' to display - all variables in settings. - - 13 Feb 2003; Nicholas Jones <carpaski@gentoo.org> ebuild.sh: Fix to - distcc and ccache to prevent them from calling themselves if they - catch themselves in the path -- double path problem. - - 13 Feb 2003; Nicholas Jones <carpaski@gentoo.org> portage.py: Fixes to - the aux_get() code for metacache updates to eclass deps. Debug output - removal. - - 13 Feb 2003; Nicholas Jones <carpaski@gentoo.org> emerge: More fixes - to the calls to aux_get() for metacache code. Rearranged the option and - action arrays. Added --nospinner flag. - - 13 Feb 2003; Nicholas Jones <carpaski@gentoo.org> emerge: Reorg of flags. - Addition of --noconfmem to prevent portage from yanking already-merged - config files. Extra message in --version about missing gcc and sourcing - /etc/profile to get it. Yanked the majority of the rsync cachedb update - code -- Moved it to aux_get. - - 13 Feb 2003; Nicholas Jones <carpaski@gentoo.org> portage.py: Typo fixes. - aux_get() now has a metacachedb param for using metadata cache over the - initial call to doebuild() -- Should speed up rsync users regen time. - Added support for --noconfmem via settings["NOCONFMEM"] in treewalk(). - Added sys.exit(1) on failure to move files during merge. Comment - realignment. - - 11 Feb 2003; Nicholas Jones <carpaski@gentoo.org> portage.py: Fix the - depcache code by adding in a missing stat call after regeneration. - Call portageexit() in exithandler() so that mtimedb gets written out - on cancelled runs. Add in --quiet option. Currently only kills the - processing messages on emerge regen. - - 11 Feb 2003; Nicholas Jones <carpaski@gentoo.org> ebuild.sh: Fix the - eclass code to remove the double inherits cause by eclasses managing - that on their own. - -*portage-2.0.46-r12 (07 Feb 2003): Fixups - - 07 Feb 2003; Nicholas Jones <carpaski@gentoo.org> portage.py: Move - logdir check/generation code so that it's created before 'clean'. Fix - the usemask/archkeys bug and a related bug with the var enabled. Fix - to movefile() code to ensure symlinks are handled properly. - - 07 Feb 2003; Nicholas Jones <carpaski@gentoo.org> ebuild.sh: Make per- - ebuild logs use the counter to get a chronological list instead of a - timestamp based one. - - 07 Feb 2003; Nicholas Jones <carpaski@gentoo.org> emerge: If a package - is requested to be updated but is not merged, still add it to world. - - 07 Feb 2003; Nicholas Jones <carpaski@gentoo.org> *: Update to help. - Mostly comments on --verbose. Clarification on make.conf* mirrorselect. - -*portage-2.0.46-r11 (04 Feb 2003): Fixups - - 04 Feb 2003; Nicholas Jones <carpaski@gentoo.org> ebuild.sh: distcc - fixups along with ccache fixups from the bug 13897 effort. Added more - varaibles to the build data output. Allow CC/CXX to be set if they are - not set in environment. - - 04 Feb 2003; Nicholas Jones <carpaski@gentoo.org> portage.py: Removed an - unnecessary call to os.unlink() in movefile that resulted in it failing - when moving files across devices. HTML 404 catcher -- if the distfile is - a reasonable size, and it's got <title>.*(not found|404).*</title> in it - it will be deleted and the next mirror persued. - -*portage-2.0.46-r10 (03 Feb 2003): Feature/Function Cleanups - - 03 Feb 2003; Nicholas Jones <carpaski@gentoo.org> portage.py: Added - quotes to fallback checksum code to ensure it works on space-containing - filenames. Error message added in writedict. Worldfile-depleeting bug - fixed -- 'emerge -e world'+AUTOCLEAN would cause every package in world - to be removed from the worldfile to be removed. - - 03 Feb 2003; Nicholas Jones <carpaski@gentoo.org> make.conf: updated the - commentary about AUTOCLEAN. - - 03 Feb 2003; Nicholas Jones <carpaski@gentoo.org> etc-update: Added in - automerge functionality for trivial changes. Comments and whitespace - are just merged without asking when it's enabled. - - 03 Feb 2003; Nicholas Jones <carpaski@gentoo.org> emerge: redundant cmd - line flags warning. Show enabled/disabled USE flags on -vp (Masatomo - Nakano). Missing changelog fix for --changelog. Added an rsync timeout - of 60 seconds and a message on fail due to timeout. - - 03 Feb 2003; Nicholas Jones <carpaski@gentoo.org> ebuild.sh: CC/CXX fix - to override profile.env settings. FEATURES=distcc support to get past - profile.env's CC settings/lockdown. If CBUILD is defined, it is appended - to econf's output in a --build= statement. Added .unpacked marker to - the unpack code to ensure a proper unpack phase. - - 01 Feb 2003; Nicholas Jones <carpaski@gentoo.org> portage.py: Adjusted - the arch.list code to be a general masking setup. /etc/make.profile/ - and /etc/portage/ have use.mask files that are concatenated. On fetch, - if downloader reports failure, then check that filesize<digestfilesize - and continue onto the next mirror before dying. - - 27 Jan 2003; Nicholas Jones <carpaski@gentoo.org> ebuild.sh/portage.py: - eclass fixups for newdepend issues where newdepend operates on RDEPEND - prior to it being set to default by ebuild.sh. Repoman fix for multi- - arch failures by excluding /usr/portage/profiles/arch.list entries from - consideration, excluding $ARCH. - -*portage-2.0.46-r9 (14 Jan 2003): portage restart fix - 15 Jan 2003; Nicholas Jones <carpaski@gentoo.org> emerge: fixed the - missing tabs from the cvs diff backport. - -*portage-2.0.46-r8 (14 Jan 2003): touchup KV{,ERS} for public stable - -*portage-2.0.46-r7 (14 Jan 2003): Backport from cvs and fixes. - portage-2.0.46* :: EXCUDES ALL PORTIONS RELATING SPECIFICALLY TO USERPRIV - - 14 Jan 2003; Nicholas Jones <carpaski@gentoo.org> portage.py: Persistant - KV and KVERS on depend calls. Sandbox violation of do_upgrade() caught. - - 14 Jan 2003; Nicholas Jones <carpaski@gentoo.org> emerge: --buildpkg - touchups and forward porting of some of 2.0.46-r6. Restart on -r0/proper - versions of portage due to VERSION not matching pkgsplit output fixed. - - 14 Jan 2003; Nicholas Jones <carpaski@gentoo.org> ebuild.sh: 20% speedup - in dep generation by removing all external app calls. Moved KVERS to - portage to make it persistent during dep calls. Other code moved into - conditionals based on $*!=depend. chmod's swaped with umask. - - 11 Jan 2003; Jack Morgan <jmorgan@gentoo.org> cnf/make.conf.sparc: - updated make.conf.sparc to add CFLAGS for sparc32 and sparc64 - - 08 Jan 2003; Nicholas Jones <carpaski@gentoo.org> bin/g-cpan.pl: - Added from bug 3450 -- Creates and merges perl module ebuilds on-the-fly - from cpan and merges them. - - 08 Jan 2003; Mark Guertin <gerk@gentoo.org> cnf/make.conf.ppc: - updated make.conf.ppc to remove G3 options for CFLAGS and other - small tweaks - -*portage-2.0.47 (06 Jan 2003): UserPriv - - 06 Jan 2003; Nicholas Jones <carpaski@gentoo.org> portage.py: - Forced HOME to BUILD_PREFIX regardless of user. Added in a 'rm -Rf' notice - to readonly-fs/Full-Disk notices. Disabled the usepkg on buildpkg function - of portage. digraph.hasallzeros() added -- Determines if tree is zero depth. - - 06 Jan 2003; Nicholas Jones <carpaski@gentoo.org> cnf/*: Added in the - PORT_LOGDIR option and description. Also added a GENTOO_MIRRORS section - back into the make.conf* files so that users are aware that they need to - specify ibiblio. Killed the linefeeds in the sparc conf. - - 06 Jan 2003; Nicholas Jones <carpaski@gentoo.org> emerge: options and - actions fixup. Added new short options and long options. --buildpkgonly - now works and restricts the process to deplists of zero depth. Updated - the help for portage, and created a seperate shorthelp function with - the terse, options-only, versions of the regular help. Fixed the env_update - call after --fetchonly runs. - - 06 Jan 2003; Nicholas Jones <carpaski@gentoo.org> ebuild.sh: - touchups to the user priv and logging code to kill the invalid user - messages when portage:portage doesn't exist on the system. - -*portage-2.0.47_pre4 (03 Jan 2003): UserPriv Works + Per-Ebuild logging - - 04 Jan 2003; Nicholas Jones <carpaski@gentoo.org> portage.py: - tokenize() fixups to remedy the || reduce problems. - - 04 Jan 2003; Nicholas Jones <carpaski@gentoo.org> prepall: - Fixup for '//' problem. - - 03 Jan 2003; Nicholas Jones <carpaski@gentoo.org> ebuild.sh: - Support for per-ebuild logging via PORT_LOGDIR variable. ebuild.sh - now can do usermode compiles _and_ maintain the enviroment with a - few minor restrictions like changing portage variables. - -*portage-2.0.47_pre3 (02 Jan 2003): Forward port of fixes & New fixes - - 02 Jan 2003; Nicholas Jones <carpaski@gentoo.org> emerge: - tbz2 handling improved -- checks current, pkgdir/All/x, pkgdir/x. - -r0 removal on current ver to stop people from complaining about it. - More info added to 'emerge info' output. - - 02 Jan 2003; Nicholas Jones <carpaski@gentoo.org> portage.py: - Spaces in filenames fix for prelink-capable systems. Exception caused - by invalid or unsatisfiable '||' dependancies caught and warned about. - auxdbkey order fix. dbcachedir now ensures a '/' before the cache dir. - - 02 Jan 2003; Nicholas Jones <carpaski@gentoo.org> prep*: - Fixes from Azarah to make the included files more proper. - - 26 Dec 2002; Phil Bordelon <sunflare@gentoo.org> man/emerge.1: - Added documentation of the --deep option. - -*portage-2.0.46-r5 (30 Dec 2002): Touchups and sparc confs - - 30 Dec 2002; Nicholas Jones <carpaski@gentoo.org> *: - fix for prelink unmerge problems. small touches to outputs. - sparc configs added. Azarah's fixups for the prep* scripts. - Changes to 'emerge info' output. tbz2 prefixes PKGDIR/All if the - tbz2 doesn't exist in the current dir. - -*portage-2.0.46-r3 (24 Dec 2002): Backport of fixes in 2.0.47_pre2 - -*portage-2.0.47_pre2 (24 Dec 2002): Feature: userpriv compiles - - Tokenizer fixup courtasy of Evgeny Roubinchtein. unalias -a in ebuild.sh. - Moved the help() to emergehelp.py. prepallman fixup for missed symlinks. - More info provided for portage-user-missing message. FEATURES=sandboxuser - not provides sandbox in compile phase along with userpriv. mtimedb - exception should actually be caught now. - -*portage-2.0.47_pre1 (21 Dec 2002): Feature: userpriv compiles - - 21 Dec 2002; Nicholas Jones <carpaski@gentoo.org> *: - ebuild.sh: portage user setup. dyn_setup is always run before calls to - unpack,compile,install. emerge: infodirs cleanup, traceback on invalid - dir fix. Proper regen on info change. portage.py: uid/gid discovery and - check code. PRELINK_PATH and PRELINK_PATH_MASK added and renamed. Made - HOME set to BUILD_PREFIX when HOME is unset. Patched in UserPriv compile - code and checks and complaints to ensure smooth integration. Reorganized - chown calls to ensure things get set right for userpriv and not. Sandbox: - UID check to prevent non-root errors patched in. - -*portage-2.0.46-r2 (18 Dec 2002): Feature Stable Release Prelink + Bug Fixes - - 18 Dec 2002; Nicholas Jones <carpaski@gentoo.org> portage.py, emerge: - Traceback fix for blocking packages in the restart check in emerge. Added - missing import for commands in portage.py. - -*portage-2.0.46 (18 Dec 2002): Feature Stable Release Prelink + Bug Fixes - - 18 Dec 2002; Nicholas Jones <carpaski@gentoo.org> portage.py: - PRELINK_MASK adds ignore paths for prelink.conf. Error message - adjustments for appearance/readability. auxdbkey changes. - - 18 Dec 2002; Nicholas Jones <carpaski@gentoo.org> emerge: - --changelog displays changelogs of packages on update. gcc version - fix for --version. Missing indent in masked output corrected. Some - color additions. Prelink code removed -- Users can do it instead. - - 18 Dec 2002; Nicholas Jones <carpaski@gentoo.org> ebuild.sh: - use_{enable,with}() work now. Rearranged auxdbkeys again. - - 17 Dec 2002; Martin Schlemmer <azarah@gentoo.org> bin/ebuild.sh: - Regenerate /lib/cpp and /usr/bin/cc in pkg_setup if they are not - files to ease the broken pkg_postrm() some gcc have. - -*portage-2.0.46_pre2 (15 Dec 2002): Feature Prerelease: prelink - - 15 Dec 2002; Nicholas Jones <carpaski@gentoo.org> emerge/portage.py: - Fixups. PRELINK_MASK code. 'prelink -af' in post_emerge(). - - 15 Dec 2002; Mark Guertin <gerk@gentoo.org> cnf.make.conf.ppc: - updated incorrect CFLAG option and appended -mabi=altivec info - -*portage-2.0.46_pre1 (15 Dec 2002): Feature Prerelease: prelink - - 15 Dec 2002; Nicholas Jones <carpaski@gentoo.org> portage.py: Counter - fixups. Prelink code. - - 15 Dec 2002; Nicholas Jones <carpaski@gentoo.org> bin/f*: Made them - loop over multiple files instead of just doing one. - - 13 Dec 2002; Nicholas Jones <carpaski@gentoo.org> emerge/portage.py: - Added disabled prelink code. Needs a little more work. Gave portage the - ability to restart on upgrades to the portage version. Ebuilds for prior - versions will intentionally die on upgrade. USE=build disables it so - bootstrap isn't affected. - -*portage-2.0.45-r5 (13 Dec 2002): Feature addition: PDEPEND+fixes - - 13 Dec 2002; Nicholas Jones <carpaski@gentoo.org> emerge/portage.py: - Added restart on portage upgrade code and adjusted ebuild to accomplish - this until version matches -r5. - -*portage-2.0.45-r4 (11 Dec 2002): Feature addition: PDEPEND - - 11 Dec 2002; Nicholas Jones <carpaski@gentoo.org> ebuild.sh/portage.py: - Added [CDEPEND, PDEPEND, REBUILD] to auxdbkeys and updated ebuild.sh. - Prevented autoclean on fetchonly. - - 11 Dec 2002; Nicholas Jones <carpaski@gentoo.org> emerge: - Added support for PDEPEND. Rewrote some dep handling variables for - readability and ease of use. - -*portage-2.0.45-r3 (09 Dec 2002): Touchups. - - 09 Dec 2002; Nicholas Jones <carpaski@gentoo.org> ebuild.sh: Fixed - use_enable() and use_with() so that they actually work -- also don't - have to specify 2nd parameter, 1st is assumed. - - 09 Dec 2002; Nicholas Jones <carpaski@gentoo.org> emerge: Added previous - version/downgrade messages to --pretend. Extra message to notify of dep - calculation failure as bad deps can exit portage without error. - - 09 Dec 2002; Nicholas Jones <carpaski@gentoo.org> portage.py: Attempt - at fixing the sandbox-crashes-missing-HOME bug. Added a try/catch around - the virts/'del x' code to prevent tracebacks on boxes without a virtuals - file. - - 06 Dec 2002; Nicholas Jones <carpaski@gentoo.org> emerge: Fixed 'xfrom' - variable-used-before-assignment message on masked ebuilds. - - 06 Dec 2002; Nicholas Jones <carpaski@gentoo.org> portage.py: Disabled - writes to DBs when sandbox is enabled. - - 03 Dec 2002; Nicholas Jones <carpaski@gentoo.org> portage.py: Fixed a - nice bug where python was writing 'L' at the end of long() types for - mtimes. - -*portage-2.0.45 (02 Dec 2002): More bug fixes for stable. - - 02 Dec 2002; Nicholas Jones <carpaski@gentoo.org> portage.py, output.py: - Added several color options and functions to output.py. 'DO NOT EDIT' - notices added to .env generated profile settings files. Touchups and - nofetch() call for restricted fetches. Moved some file IO code for - SLOTs into a try/catch. { mtimedb fixups. Eclass aux_get() error fix. - aux_get() error fix via try/catch with magically-missing ebuild when - doing stat on it. Enabled full eclass()/inherit code. Added code to - flushmtimedb() entries by key name. } <-- aux_get() fixups. Made - starttime into a long... time.time() is apparently overflowing int(). - - 02 Dec 2002; Nicholas Jones <carpaski@gentoo.org> bin/*: - prep*: Fixed missed man pages and corrected loops to be fairly complete - in the included files. quickpkg: Loop to do each in $@ (Peter Sharp). - - 02 Dec 2002; Nicholas Jones <carpaski@gentoo.org> emerge: - Yank '++' from searches and make it '\+\+' so that it works. Reformated - 'all ebuilds are masked' message to be a little more obvious. env_update() - AFTER autoclean... not in autoclean -- Fixes ldconfig issues. Typo fixes. - - 02 Dec 2002; Nicholas Jones <carpaski@gentoo.org> ebuild.sh: - Added has(), general use()-like function -- 'has this_thing $VAR' returns - shell true or false. Added has_version(), portage call to determine if - a specified DEPEND-atom is installed -- 'has_version ">=mozilla-1.2"' - returns shell true or false. Added best_version(), portage call to - get the best/most-recently-merged version of a DEPEND-atom statement -- - 'best_version ">=mozilla-1.0"' prints a string. pkg_nofetch() displays - SRC_URIs by default on RESTRICT -- Can be redefined to display custom - messages. die() on unpack() failure added. Courtasy of SpanKY: Added - use_with() and use_enable() for --with-thing and --enable-thing. - 'use_with gd libgd' would print --with-libgd if gd was in USE and - --without-libgd if not. - - 19 Nov 2002; Martin Schlemmer <azarah@gentoo.org> cnf/etc-update.conf: - Add 'menu' config item and note about it needing dev-utils/dialog, as - a lot of users do not know about this nifty feature. - - 14 Nov 2002; Phil Bordelon <sunflare@gentoo.org> man/emerge.1: - Cleaned up the more recent edits to the man page to more closely - match the previous format, fix various typos, and so on. Expanded - the REPORTING BUGS section, and made the PACKAGE MASKING part of the - NOTES a stand-alone section. - -*portage-2.0.44 (11 Nov 2002): bug fixes and 1.2 rescue/install setup - - 11 Nov 2002; Nicholas Jones <carpaski@gentoo.org> *: - bin/*: fixes for spaces-in-filename issues, lots of quotes added. conf/*: - touched up comments and warning. Added RSYNC_RETRIES. ebuild.sh: exit now - reports the failing ebuild's $CATEGORY/$PF. Added EXTRA_ECONF to econf(). - emake: added EXTRA_EMAKE. emerge: RSYNC_RETRIES curtasy of Christopher - Sharp. Random comment fixes. portage.py: Random touchups. KV extraction - fixup for new ROOTs. ARCH missing in profile fix. Fix for packages/All - missing dir traceback. INFOPATH/INFODIR fix. Added INFOPATH to specials. - portage.py: Touchups to the mtimedb-touching code. Fixes for the broken - os.path.normpath() leading '//' bug. Added a modified chuck of Phoen][x's - dist size patch. - - 09 Nov 2002; Nicholas Jones <carpaski@gentoo.org> portage.py: - Fixups for KV. - - 08 Nov 2002; Nicholas Jones <carpaski@gentoo.org> emerge: - Fix for missing-glibc-bug in --version. - - 08 Nov 2002; Nicholas Jones <carpaski@gentoo.org> portage.py: - Fix for cfgdictfile traceback when ROOT != '/'. Fix for missing kernel - headers -- checks usr/src/linux, then /usr/include, then if merging - from sys-kernel ignore error. - - 07 Nov 2002; Nicholas Jones <carpaski@gentoo.org> portage.py: - Fix (part 2) for the USE="-*" arch-missing problem. - - 03 Nov 2002; Nicholas Jones <carpaski@gentoo.org> portage.py: - eclass() function uses a caching and cPickle storing method to determine - currency of eclass-derived depcache entries. All previous methods are - already removed. eclass_save() is called via store() now. Stripped some - cruft from aux_get(). Error message touchups. - - 03 Nov 2002; Nicholas Jones <carpaski@gentoo.org> emerge: - A couple message touchups. - - 29 Oct 2002; Nicholas Jones <carpaski@gentoo.org> emerge: - Moved the autoclean section under the --pretend check so it doesn't flip - out when running '-f'. Preliminary support for binary-only methods. - --usepkgonly (implies --usepkg) to force errors is binaries don't exist. - - 27 Oct 2002; Daniel Robbins <drobbins@gentoo.org> new*: changed "&&" to "||" - to provide even better protection against mis-use of these commands. - -*portage-2.0.43 (27 Oct 2002): Bug fix release - - 27 Oct 2002; Nicholas Jones <carpaski@gentoo.org> emerge: - AUTOCLEAN="yes" on by default. Added in a clean phase after the merge - phase so clashing library versions do not remain installed when ldconfig - is run. This should close up the symlinks-being-removed bugs. - - 27 Oct 2002; Nicholas Jones <carpaski@gentoo.org> cnf/*: - Miscelaneous typo fixes. Added PORTDIR_OVERLAY description in make.conf. - - 26 Oct 2002; J Robert Ray <jrray@gentoo.org> portage.py: - Don't act like the download failed if after successfully downloading - a file its size doesn't match the file size in the digest. Treat - this as a mismatched digest condition instead. - - 26 Oct 2002; Nicholas Jones <carpaski@gentoo.org> portage.py: - Reversed the defaults on env_update() so it does a full ldconfig instead - of a non-symlink ldconfig. Fixed the typo in the 'invalid conf' notices. - -*portage-2.0.42 (24 Oct 2002): Bug fix release - - 24 Oct 2002; Nicholas Jones <carpaski@gentoo.org> make.defaults.5: - Removed this file. It is horribly out of date and completely - wrong to boot. Users shouldn't be modifying the 3 lines in this file - anyway. They are obvious if you understand conf and defaults. - - 24 Oct 2002; Nicholas Jones <carpaski@gentoo.org> emerge: - Added missing return statements to select_dep() that caused unmet packages - to be ignored. Touchups to 'emerge info' and 'emerge --version' output. - Added --delete to --delete-after so that it actually deletes in rsync. - - 24 Oct 2002; Nicholas Jones <carpaski@gentoo.org> portage.py: - Warning touchups. Replaced constants (9) to index("INHERITED"). - - 23 Oct 2002; Nicholas Jones <carpaski@gentoo.org> bin/new*: - Fix for "running as a root user" bug... code does 'rm -rf /' if - variables aren't defined in environment... That's a bad thing. - - 23 Oct 2002; Nicholas Jones <carpaski@gentoo.org> portage.py: - Possible fix for the aux_get() issues and IUSE. - - 22 Oct 2002; Nicholas Jones <carpaski@gentoo.org> portage.py: - noauto got lost in some weird conflicts of .38, added it back. - - 22 Oct 2002; Nicholas Jones <carpaski@gentoo.org> emerge: - Primitive logging via emergelog(). countdown(N,str) function does N second - countdowns of the action 'str'. Error messages on dependency traceback - via try/except on select_dep(). Removed the 'unavailable' warning. Message - updates. Added logging of basic actions to /var/log/emerge.log. Added - package/to-go counter. 'emerge info' displays a number of useful variables - that is good for bug reports. - - 22 Oct 2002; Nicholas Jones <carpaski@gentoo.org> prepallstrip: - Bug 9508, fix for MSB architectures strip. Previous check assumed only - LSB objects could/should be stripped. (*LSB -> *SB) [Joky@#gentoo-sparc] - -*portage-2.0.41 (20 Oct 2002): Bug fix release - - 20 Oct 2002; Nicholas Jones <carpaski@gentoo.org> portage.py: - stickies=[] lists the variables that will be kept/used as sticky vars, - not yet implimented. Fixed several relative symlink bugs by adding - abssymlink() to portage to determine real/absolute targets. env_update() - modified to fix bug 9308 symlinks bug. Bug 8348, request for error messages - instead of tracebacks/dies on parse errors, now caught on a per file basis - for system config files, includes descriptive messages. Fix for missing - profile traceback in new prepend'd-arch code. Typo fixes in symlink code. - DISABLED 'KEYWORD="" == available' code, DEFAULT IS MASKED NOW. Major - update to masking code, CONFIG_PROTECT can be layered with _MASKs, and - update_protect() now sets the self.protect* variables. Condensed and - reordered the unmerge code, now checks existance, cfgprotect, then mtimes. - - 20 Oct 2002; Nicholas Jones <carpaski@gentoo.org> emerge: - Bug 8767: Added 'buildpkg' to FEATURES to specify always-buildpkg. - Updated the --version output to display profile and gcc version. - Bug 8083: Eliminate spinner when terminal is not a tty. Bug 7688: - fixed search vs. searchdesc differences by adding 'cat/pack' split. - Bug 9308: Symlinks were being killed by ldconfig, fixed by changing - how/when ldconfig was allowed to set symlinks. rsync command touchups, - --delete-after so that a failed rsync won't leave a user - without/with-few packages in portage. More warnings to depclean. - - 20 Oct 2002; Nicholas Jones <carpaski@gentoo.org> ebuild.sh: - Added die to gzip in unpack() - - 20 Oct 2002; Nicholas Jones <carpaski@gentoo.org> make.conf*: - Added in useful variables and descriptions+warnings of their uses. - - 20 Oct 2002; Nicholas Jones <carpaski@gentoo.org> make.globals*: - Added in large "do not edit" message. - - 16 Oct 2002; Nicholas Jones <carpaski@gentoo.org> portage.py: - Fixed an mtimes issue. --update on a package might yank non-cfgprot - files during the clean-phase because they didn't have mtimes updated. - - 15 Oct 2002; Nicholas Jones <carpaski@gentoo.org> portage.py: - Added 'IUSE' to the auxdbkey list. Fixed random aux_get() errors - caused by random empty files in the dep cache. - - 15 Oct 2002; Nicholas Jones <carpaski@gentoo.org> ebuild.sh - Actually committed the --host portion of econf. - - 15 Oct 2002; Martin Schlemmer <azarah@gentoo.org> portage.py, missingos.c: - Remove testsandbox.sh, and comment code in portage.py that still - used it to no real use. Add another '\' to the 'missingos_mknod__doc__' - string in src/python-missingos/missingos.c to fix failure with gcc-3.3. - -*portage-2.0.40 (13 Sep 2002): Bug fix release - - 15 Oct 2002; Nicholas Jones <carpaski@gentoo.org> portage.py, emerge: - emerge depclean -- Removes all packages that are not explicitly or - dependency merged. - - 15 Oct 2002; Nicholas Jones <carpaski@gentoo.org> ebuild.sh: - depend now prints IUSE. Doesn't do anything with it yet. - unpack() -- unzip silently overwrites files (). - econf() -- now specifies '--host=${CHOST}' - - 15 Oct 2002; Nicholas Jones <carpaski@gentoo.org> make.globals: - Touch ups + warning. - - 15 Oct 2002; Brandon Low <lostlogic@gentoo.org> etc-update: - Make etc-update find all the same CONFIG_PROTECT files as portage - by importing it's settings from portage. - -*portage-2.0.39 (13 Sep 2002): Bug fix release - - 13 Oct 2002; Nicholas Jones <carpaski@gentoo.org> portage.py: - Bug 5926 -- If the fetchonly AND pretend flags are specified, then - portage should give a list of all the SRC_URIs so that they can be - downloaded or sent into another app. Made sandbox display name in - 'ps' as '[$PF] sandbox'. - - 13 Oct 2002; Nicholas Jones <carpaski@gentoo.org> emerge: - Bug 5926 -- See portage.py for today. (emerge -pf) - Typo fixes. - - 13 Oct 2002; Nicholas Jones <carpaski@gentoo.org> ebuild.sh: - Added -q to unzip to make it quiet like the others. - Bug 6033 -- Fix for infinate loop in eclasses in portage overlay. - - 12 Oct 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: fix for - doebuild() so that our rsync mirror will contain full digests and not just - partial digests for x86. - - 12 Oct 2002; Nicholas Jones <carpaski@gentoo.org> emerge: - Added --progress to rsync. This puts the file progress meters - back on. Users have requested this, and it's not detrimental. - Just creates a lot of output, as the man page says: "It gives - bored users something to look at." - - 12 Oct 2002; Nicholas Jones <carpaski@gentoo.org> portage.py: - Bug 6361 -- Added checking on directories to ensure that we can - write to them before we try and traceback. Also added pieces to - functions so that return conditions are propagated back to emerge - so that it actually dies on errors. Message on condition details - restart process. - - 11 Oct 2002; Nicholas Jones <carpaski@gentoo.org> make*globals: - Removed the tomcat configs from CONFIG_PROTECT - - 11 Oct 2002; Nicholas Jones <carpaski@gentoo.org> doman: - Bug 8208 -- Added flags and auto-location support for 'x' manpages. - Added not-an-man-page message. - - 11 Oct 2002; Nicholas Jones <carpaski@gentoo.org> dohtml: - Bug 8208 -- Added 'js' to the include list, and added '-A' as an - append flag. '-a' was a filter-down-to. - - 11 Oct 2002; Nicholas Jones <carpaski@gentoo.org> portage.py: - Bug 8964 -- Fix for read-only traceback in digestgen(). - Bug 8949 -- Fix for read-only traceback in doebuild() - Bug 8284 -- Prepend ARCH _after_ use order processing. Prevents -* - from killing the ARCH flag. Bug 7596 -- Set an mtime of 0 into - CONTENTS if the file already exists on the FS. Allows the entry - to be in the CONTENTS file. Condensed the protect/protect-mask - code into one function in class dblink. Revised code to allow - multi-level protects and masks. - - 10 Oct 2002; Nicholas Jones <carpaski@gentoo.org> emerge: - Bug 8552 -- typo fixes - - 10 Oct 2002; Mark Guertin <gerk@gentoo.org> cnf/make.conf.ppc : - Fixed type in reccomended CFLAGS for generic ppc (was 02, corrected - to O2) - - 09 Oct 2002; Nicholas Jones <carpaski@gentoo.org> portage.py: - Fixed a bug where files less than 2 characters in /etc/env.d - weren't checked correctly, and tracebacked env_update() - - 07 Oct 2002; Martin Schlemmer <azarah@gentoo.org> ebuild.sh: - Also set $TMP, as MDK among distros sets this, and it causes - breakage during bootstrap. This should close bug #8101. - - 07 Oct 2002; Mark Guertin <gerk@gentoo.org> man/ebuild.5 : - Updated the man page to include missing functions in portage - - 05 Oct 2002; Mark Guertin <gerk@gentoo.org> cnf/make.conf cnf/make.conf.ppc: - Fixed typo (missing "/") in make.conf and make.conf.ppc, bug #7944 - - 28 Sep 2002; Daniel Robbins <drobbins@gentoo.org> ebuild.sh: remove - deprecated "ld.so" from newdepend. - -*portage-2.0.38 (25 Sep 2002): Bug fix release - - 25 Sep 2002; Daniel Robbins <drobbins@gentoo.org> emerge: now "emerge world" - and "emerge system" don't replace packages. This closes bug #8282. - - 21 Sep 2002; Daniel Robbins <drobbins@gentoo.org> portage-2.0.38.ebuild: - Added additional perm check for /var/cache/edb/dep dirs and fixed perm - settings in the ebuild's pkg_postinst(); this should close bug #7719. - - 21 Sep 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: Added - carpaski's patch to add PF to the sandbox's argv[0], closing bug #8141. - - 19 Sep 2002; Daniel Robbins <drobbins@gentoo.org> emerge: tweaked emerge so - that "--pretend" displays don't show "N" all the time. - - 19 Sep 2002; Daniel Robbins <drobbins@gentoo.org> ebuild.sh: tweaked help to - not list deprecated options. - - 25 Sep 2002; Maik Schreiber <blizzy@gentoo.org> cnf/make.globals, - cnf/make.globals.ppc: Added /opt/jakarta/tomcat/conf to CONFIG_PROTECT. Note - by drobbins: this will be removed soon when this gets moved to an /etc/env.d - file in the tomcat package. - -*portage-2.0.37 (19 Sep 2002): Gentoo Linux 1.4_rc1 version - - 10 Sep 2002; Mark Guertin <gerk@gentoo.org> cnf/make.conf.ppc : Backed down - CFLAGS from -O3 to -O2 on ppc as -O3 has proven to be unreliable on all - PowerPC-based machines - - 09 Sep 2002; Daniel Robbins <drobbins@gentoo.org> emerge: new parameterized - create() engine, security pass fixes ("emerge" as non-root doesn't print - "root access required" but shows help instead), emerge --pretend output fixes - ("to /" lines are dropped and only displayed if installation root != "/".) - New (and currently unofficial and undocumented) "--deep" and "--selective" - options that correspond to their respective create() parameters. Using - "--deep" will enable "deep emerging" -- updating all deps even if the parent - doesn't need updating. The new parametrized create() is also much cleaner - than the previous incarnation. - - 09 Sep 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: os.chdir() -> - chdir() fix, enhanced fetch() digest corruption handling. - - 06 Sep 2002; Mark Guertin <gerk@gentoo.org> cnf/make.globals.ppc : - Updated make.globals.ppc to reflect new CFLAGS for 1.4 release - -*portage-2.0.36 (04 Sep 2002): Gentoo Linux 1.4_rc1 version - - 04 Sep 2002; Daniel Robbins <drobbins@gentoo.org> emerge: "--onlydeps" was - mostly broken since the most recent emerge code restructure. Now fixed, - closing bug #7442. - - 04 Sep 2002: Daniel Robbins <drobbins@gentoo.org> etc-update.conf: added - missing etc-update config file. - - 04 Sep 2002: Daniel Robbins <drobbins@gentoo.org> 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 <drobbins@gentoo.org> etc-update, - man/etc-update.1: new program for updating config files. - - 03 Sep 2002; Daniel Robbins <drobbins@gentoo.org> ebuild.sh: upgraded - inherit() to support $PORTDIR_OVERLAY, closing bug #6033. - - 03 Sep 2002; Daniel Robbins <drobbins@gentoo.org> emerge: calls to "cvs" now - use "-z3" compression option, closing bug #5982. - - 03 Sep 2002; Daniel Robbins <drobbins@gentoo.org> 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 <drobbins@gentoo.org> ebuild.sh: einstall now - sees "GNUmakefile", closing bug #4895. - - 03 Sep 2002; Daniel Robbins <drobbins@gentoo.org> ebuild.sh: typo fixes, - closing bug #7263. - - 03 Sep 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: /var/tmp - creation now works even if /tmp already exists, closing bug #7376. - - 02 Sep 2002; Daniel Robbins <drobbins@gentoo.org> 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 <drobbins@gentoo.org>: 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 <azarah@gentoo.org> 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 <danarmak@gentoo.org> 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 <drobbins@gentoo.org> : some additional clean-ups - for the make.conf(.ppc) files. - - 30 Aug 2002; Daniel Robbins <drobbins@gentoo.org> 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 <drobbins@gentoo.org> 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 <gerk@gentoo.org> 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 <drobbins@gentoo.org> emerge: favorites weren't - working since 2.0.30; they're working again now. This closes bug #7225. - - 29 Aug 2002; Phil Bordelon <sunflare@gentoo.org> 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 <drobbins@gentoo.org> 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 <drobbins@gentoo.org> 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 <drobbins@gentoo.org> 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 <drobbins@gentoo.org> portage.py, emerge: rewrote - gettimeval() as cpv_counter() and updated it to handle corrupt COUNTER files, - closing bug #6763. - - 28 Aug 2002; Daniel Robbins <drobbins@gentoo.org> emerge: "emerge search" now - displays information for masked packages if possible, closing bug #6823. - - 28 Aug 2002; Daniel Robbins <drobbins@gentoo.org> 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 <drobbins@gentoo.org> 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 <drobbins@gentoo.org> doman: fixed some typos, - closing bug #7152. - - 28 Aug 2002; Daniel Robbins <drobbins@gentoo.org> 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 <azarah@gentoo.org> 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 <drobbins@gentoo.org> portage.py: improved error - handling/detection of bad pkgsplit() and catpkgsplit() calls; should close - bug #6803, #6853. - - 26 Aug 2002; Daniel Robbins <drobbins@gentoo.org> 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 <drobbins@gentoo.org> 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 <azarah@gentoo.org> emerge: fixed an - indentation problem of the 'else:' at line 1304. - - 20 Aug 2002; Daniel Robbins <drobbins@gentoo.org> emerge: removed stray - "DEBUG:" output, closing bug #6732. - -*portage-2.0.29 (18 Aug 2002) - - 18 Aug 2002; Daniel Robbins <drobbins@gentoo.org> emerge, portage.py, - ebuild.sh: making some effort to make output cleaner and less cluttered, - particularly with error handling. - - 18 Aug 2002; Daniel Robbins <drobbins@gentoo.org> 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 <drobbins@gentoo.org> 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 <drobbins@gentoo.org> 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 <drobbins@gentoo.org> portage.py: portdb's - cp_all() now skips "CVS" directories, closing bug #6662. - - 18 Aug 2002; Daniel Robbins <drobbins@gentoo.org> 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 <drobbins@gentoo.org> ebuild.sh: removed - deprecated "ld.so" dependency from Dan Armak's newdepend() function. - - 17 Aug 2002; Daniel Robbins <drobbins@gentoo.org> 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 <drobbins@gentoo.org> 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 <drobbins@gentoo.org> 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 <drobbins@gentoo.org> emerge: now calls - env-update() after an unmerge() run (to fix library paths, links, etc.) - Closes bug #6511. - - 16 Aug 2002; Daniel Robbins <drobbins@gentoo.org> doman: now handles already- - gzipped man pages correctly, closing bug #6544. - - 16 Aug 2002; Daniel Robbins <drobbins@gentoo.org> emerge: fixed a bug where a - dep specified on the command-line with --usepkg would use an old package if - it happened to match the dep. Now, it will use the ebuild instead, just like - how deps of deps are treated. - -*portage-2.0.27 (06 Aug 2002) - - 07 Aug 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: removed some - beta extended USE functionality to speed up regenerate(); as we are likely - not going to need extended USE for a good while. - - 07 Aug 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: ebuild.sh now - supports "config" (pkg_config) again. - - 06 Aug 2002; Dan Armak <danarmak@gentoo.org> ebuild.sh: change debug-print() - to exit if $T is not defined, i.e. if emerge is running in dependency - detection mode and isn't actually emerging everything. This fixes bug #4932 - (the "eclass-debug.log is created in /" problem). - - 06 Aug 2002; Nicholas Jones <carpaski@gentoo.org> ebuild.sh: Fixed a - case-check problem that prevented tar.Z from being un-tar'd. This closes bug - #6126. - - 06 Aug 2002; Martin Schlemmer <azarah@gentoo.org> portage.py, ebuild.sh: - Remove "setup" from 'sandboxactive' in portage.py, as we are not running - pkg_setup() in a sandbox anymore. Move the restoring of the old env code - to be the first thing in ebuild.sh, just to ensure we dont mess anything - up when greping/awking during saving it. - -*portage-2.0.26 (06 Aug 2002) - - 06 Aug 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: on unmerge, - entries are now removed from the world file if 1) the dependency refers to - the cat/pkg being unmerged, and 2) the dependency matches the current version - being unmerged, and 3) unmerging this package will leave no other packages on - this system that will match this world entry. This closes bug #3409. - - 06 Aug 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: new global - update support. You can now add an entry to a file in - /usr/portage/profiles/updates/, something like "move x11-base/xfree - x11-base/xfree86". Portage will then update the /var/db/pkg db on user's - boxes so that any xfree packages are renamed to xfree86; it will also update - the world and virtuals files appropriately. We are naming the update files - "3Q-2002", etc. -- for third quarter in 2002. This way, we don't bog - Portage down by having it run through all our directives. It will only look - at update files whose mtimes have changed. Closes bug #4753, #5463, - - 06 Aug 2002; Daniel Robbins <drobbins@gentoo.org> ebuild.sh: tweaked Azarah's - environment-saving patch to not be enabled when $T is not defined -- this - closes bug #6070 and should speed up dep calculations too. Also tweaked - ebuild.sh so that pkg_setup() is run *outside* of the sandbox. This is - important because piping stuff around tends to require temp files to be - created; pkg_setup() being in the sandbox prevents this from happening. - - 06 Aug 2002; Martin Schlemmer <azarah@gentoo.org> ebuild.sh : Unset - esave_ebuild_env in esave_ebuild_env(), otherwise the sourced copy messes - saving of the environment. - - 05 Aug 2002; Phil Bordelon <sunflare@gentoo.org> emerge.1: Updated the man - page to match the current version of 2.0.25. - - 05 Aug 2002; Phil Bordelon <sunflare@gentoo.org> emerge.1: Updated the man - page to match the current version of 2.0.25. - -*portage-2.0.25 (05 Aug 2002) - - 05 Aug 2002; Daniel Robbins <drobbins@gentoo.org> src/sandbox/Makefile: - removed -march=i386 added in Azarah's patch; breaks things for PPC, Sparc. - - 05 Aug 2002; Daniel Robbins <drobbins@gentoo.org> emerge: logic error fix for - description searching, closing bug #6031. - -*portage-2.0.24 (04 Aug 2002) - - 04 Aug 2002; Daniel Robbins <drobbins@gentoo.org> output.py, emerge: rewrote - our output.py module (it was weird) and tweaked emerge so that colorization - will be disabled if NOCOLOR is set to "yes" or "true" *or* if sys.stdout isn't - a tty. This means that if you pipe things to "less", colorization will get - automatically disabled. Yay! This closes bug #5714, - - 04 Aug 2002; Daniel Robbins <drobbins@gentoo.org> ebuild.sh: default - src_compile now properly uses "die" instead of "return 1." This closes bug - #2981. - - 04 Aug 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: "=foo/bar-1.0*" - now matches "foo/bar-1.0_{alpha|beta|pre|rc}{int}" but not - "foo/bar-1.1_{alpha_beta_pre_rc}{int}". This closes bug #5874; gcc-3.2_pre - is now considered a "3.2" rather than a very late "3.1" when doing "*" - matching. - - 04 Aug 2002; Daniel Robbins <drobbins@gentoo.org> ebuild.sh: Applied - carpaski's patch to allow "unpack" to also handle regular .gz or .bz2 files; - in which case the unpacked files are placed directly in ${WORKDIR}. Closing - bug #5867. - - 04 Aug 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: tweaked - exithandler() to only do its sandbox clean-up if we happen to be the root - user. Closes bug #5859. - - 04 Aug 2002; Daniel Robbins <drobbins@gentoo.org> emerge: search now lists - masked packages correctly. Closes bug #5854 (pending QA verification.) - - 04 Aug 2002; Phil Bordelon <sunflare@lsu.edu> emerge.1: The emerge man page - now reflects the fact that emerge sync|rsync always does a --clean now. Also - bumped the release number to 2.0.23. - - 03 Aug 2002; Martin Schlemmer <azarah@gentoo.org> portage.py, emerge.sh, - sandbox.c libsandbox.c: Updated sandbox.c and libsandbox.c to use an internal - env variable, $SANDBOX_ACTIVE to determine if sandbox should really be active - or not. With it only checking $SANDBOX_ON, some instances NOT running in a - sandbox, but that set SANDBOX_ON while an actual sandbox was running, caused - the sandbox to activate for this process. Added in support for a more phased - calls to ebuild.sh again. This is this time done with support to save the - current environment of ebuild.sh to the next call that should handle problems - with pkg_setup() setting env variables. Closes bugs #5853, #5817, #5950. - -*portage-2.0.23 (01 Aug 2002) - - 01 Aug 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: - ${ROOT}var/cache/edb and friends will get created if they don't exist, - closing bug #5813. - - 01 Aug 2002; Daniel Robbins <drobbins@gentoo.org> emerge: rewrote the emerge - search code, making it fully API-compliant and much more streamlined and - compact. This rewrite should fix the problem where emerge search doesn't - support Portage overlays (bug #5783.) - - 31 Jul 2002; Phil Bordelon <sunflare@gentoo.org> emerge.1: Documented the - fact that emerge clean does not remove unslotted ebuilds. Bumped the man - page revision number to 2.0.22. - -*portage-2.0.22 (29 Jul 2002) - - 29 Jul 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: fetch() didn't - handle resuming downloads properly when the first attempt aborted - prematurely. The fall back to the alternate location would not resume the - download. This should now be fixed. Closes bug #5655. - - 29 Jul 2002; Daniel Robbins <drobbins@gentoo.org> portage.py, ebuild.sh: I - had some code in spawn() from one of Azarah's patches that I forgot to - remove; it caused the sandbox to be disabled all the time. I removed this - code, and then I tweaked ebuild.sh so that the sandbox runs in a "deny by - default" configuration. Before, you could add lines to the main ebuild - (outside of a function) and it would bypass the sandbox; no more. Closes - bugs #5740, #5744. - - 29 Jul 2002; Daniel Robbins <drobbins@gentoo.org> emerge: --help and - --version now work for non-root users as they should. --clean has been - deprecated. This closes bug #5658. - -*portage-2.0.21 (28 Jul 2002) - - 28 Jul 2002; Daniel Robbins <drobbins@gentoo.org> portage.py, emerge: Added - beta "Portage tree overlay" support. By setting PORTDIR_OVERLAY to point to - a local directory tree, you can cause Portage to look for ebuilds in - PORTDIR_OVERLAY first before consulting the regular PORTDIR. Using this - feature, it's possible to have your PORTDIR set up to rsync but still be able - to have locally-created ebuilds in your PORTDIR_OVERLAY tree. For example, - you would place your ebuild in PORTDIR_OVERLAY/sys-apps/foo/. - - 27 Jul 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: another - dep_opconvert() USE-handling bug-fix. Working OK for Azarah now. - - 27 Jul 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: small logic - error fix in dep_opconvert() to fix up USE handling. - - 27 Jul 2002; Daniel Robbins <drobbins@gentoo.org> emerge: security modes now - work correctly; root access now required for merging. The new security pass - code was missing a check that is now present. - -*portage-2.0.20 (27 Jul 2002) - - 27 Jul 2002; Daniel Robbins <drobbins@gentoo.org> portage.py, emerge, - repoman: Rewrote a good deal of our dependency-checking code, including all - of dep_opconvert(). Results? repoman will now auto-enable all USE variables - (even ! use variables will get enabled) resulting in thorough checks of all - specified dependencies. DEPEND="foo? bar : oni" and DEPEND="foo? ( bar oni ) - : ( meep barf )" now works correctly. DEPEND="|| ( foo bar oni )" now works - correctly and will try to satisfy "foo" (the first package) if none are - installed. DEPEND="!foo? ( bar )" now works correctly; it was not working - before. This should generally mean that our dependency system is now working - as expected. - - 27 Jul 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: changed - counter_tick() method so that bulk of code is in the counter_tick_code() - helper function; then created a new method for fakedbapi that calls - counter_tick(). This fixes "--emptytree" issues with emerge, since emerge - still expects counter_tick() to exist as a method. - - 27 Jul 2002; Daniel Robbins <drobbins@gentoo.org> portage.py, emerge: removed - a DEBUG: print and a stray "raise IndexError" that I used for debugging. - -*portage-2.0.19 (26 Jul 2002) - - 26 Jul 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: Portage is now - eclass-friendly when it comes to regenerating cache entries. This closes bug - #4843. - - 26 Jul 2002; Daniel Robbins <drobbins@gentoo.org> portage.py, emerge: Closed - bug #5524. Packages "emerge inject"ed will no longer get auto-cleaned - indiscriminantly. Injected packages now have an official COUNTER so that - emerge clean doesn't get confused and schedule the package for removal. Also - modularized and improved the counter-handling functions and changed the - counter update method so that systems with XFS filesystems that die - unexpectedly will no longer get corrupted COUNTER files. This should solve - the an entire class of "my counter is corrupt" issues for XFS users. - - 26 Jul 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: added exception - handler to getcontents() so that it will gracefully ignore (with a warning) - corrupt CONTENTS file lines. This closes bug #5464. - - 26 Jul 2002; Daniel Robbins <drobbins@gentoo.org> emerge: fixed a single-line - indentation error that resulted in "emerge clean" ignoring some files. This - closes bug #5597,#4364. - - 25 Jul 2002; Daniel Robbins <drobbins@gentoo.org> emerge: --noreplace is now - off by default and works again; --onlydeps appears to be working again; and - merge() will merge things as specified in display(), which was not the case - before (I rolled 2.0.18 before fixing a few things I forgot about) - -*portage-2.0.18 (25 Jul 2002) - - 25 Jul 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: Close bug - #5580; pkg_setup() now gets called during all build-related stages. - - 24 Jul 2002; Daniel Robbins <drobbins@gentoo.org> portage.py, emerge: rewrote - create() function, closing bug #5469. Also added freeze() and melt() methods - to portdbapi to enhance performance. create() is now extensively commented - and even understandable. - - 24 Jul 2002; Daniel Robbins <drobbins@gentoo.org> emerge: the "rsync --clean" - option has been deprecated. Cleaning is now on by default, closing bug - #5527. - - 24 Jul 2002; Daniel Robbins <drobbins@gentoo.org> portage.py, make.globals: - It should now be safe to do what Spider did in the gconf ebuild and add - CONFIG_PROTECT and CONFIG_PROTECT_MASK to /etc/env.d entries. Both variables - are now incremental, just like USE, and you can use "-path" to turn a path - off, or add CONFIG_PROTECT{_MASK}="path" to *add* a path to the list (this - will not overwrite "parent" settings. Also added "/etc/env.d/" to - CONFIG_PROTECT_MASK in /etc/make.globals. Also, very importantly, /etc/env.d - is now hard-coded into CONFIG_PROTECT_MASK as it was in earlier versions of - Portage and cannot be removed. - - 24 Jul 2002: Daniel Robbins <drobbins@gentoo.org> emerge, portage.py: two - fixes; first, I removed xcache.p support from portage.py. The code was - designed based on the false theory that directory mtimes are updated whenever - an object inside that directory is modified. That is not the case -- it - happens when the directory listing itself changes. Also fixed overly verbose - emerge merging error. - - 23 Jul 2002; Phil Bordelon <sunflare@gentoo.org> emerge.1: Updated the man - page to match some changes in the latest version of portage, along with some - fixes recommended by drobbins. - -*portage-2.0.17 (23 Jul 2002) - - 23 Jul 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: fixed a bug - pointed out by trance -- dep_nomatch() was still using the old (deleted) - match() function. Now it's using a new match() method. - -*portage-2.0.16 (22 Jul 2002) - - 22 Jul 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: changed xcache - behavior so that the cache gets totally thrown away when the masks are - updated. Also revamped carpaski's code so we can avoid loading xcache from - disk if we simply plan to throw it away. This necessitated the creation of a - new file in /var/cache/edb: mtimes. This file stores mtimes for various - important filesystem objects. Also added support to not regenerate the GNU - info directory index if the mtime on /usr/share/info has not changed since - previous invocation. - - 22 Jul 2002; Daniel Robbins <drobbins@gentoo.org> portage.py, emerge: moved - security handling code from emerge to portage.py; also moved group "wheel" - check to portage.py. Added additional security checks and permissions fixes - to the cache handling functions. - - 22 Jul 2002: Daniel Robbins <drobbins@gentoo.org> emerge: fixed a bug - reported by woodchip related to merging packages. When using --usepkg, a - package wouldn't be used if there was a newer unmasked version of the ebuild - available, even if the package in question was the right selection. - - 22 Jul 2002; Daniel Robbins <drobbins@gentoo.org> emerge: fixed create() code - and consolidated some functions. My goal is to simplify the emerge code - until it's clean, at which point we can begin adding new features to emerge - like more SLOT-friendly decision making. - - 22 Jul 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: was able to - remove 130 or so lines of code by depreciating the match() function (replaced - by the match2() method.) I also rennovated the binarytree code to take - advantage of fakedbapi. - - 22 Jul 2002; Nicholas Jones <carpaski@gentoo.org> portage.py: added the - xcache.p fix and updated the version to 2.0.16pre (from 2.0.12) -- Also added - in a try/except inside the store() (atexit) for xcache.p to give hints - instead of tracebacks. - - 22 Jul 2002; Nicholas Jones <carpaski@gentoo.org> emerge: added the - description searching code and added a spinner to the search. - - 21 Jul 2002; Phil Bordelon <sunflare@gentoo.org> emerge.1: Finished the - rewrite of the emerge man page. - - 21 Jul 2002; Phil Bordelon <sunflare@gentoo.org> emerge: Readded the sync - help to the list of help options now that emerge --help sync works again. - -*portage-2.0.15 (16 Jul 2002) - - 15 Jul 2002; Daniel Robbins <drobbins@gentoo.org> emake: no longer falls back - to plain old "make" if parallel make fails. I believe it's best to fix the - problem (turn parallel make off in the ebuild) rather than tweak emake to - avoid it. - - 15 Jul 2002; Daniel Robbins <drobbins@gentoo.org> emerge: rewrote some code, - cleaning things up and removing redundant functions. Starting to - de-cruftify. - - 15 Jul 2002; Daniel Robbins <drobbins@gentoo.org> emerge: fix for permissions - when updating the cache using server-generated entries. - -*portage-2.0.14 (15 Jul 2002) - - 15 Jul 2002; Daniel Robbins <drobbins@gentoo.org> ebuild.sh: ccache bug fix; - removed extra "!". Ccache should now get enabled properly. Also, INHERITED - variable is now getting added to the dep cache entries for future - eclass-friendly caching. - - 15 Jul 2002: Daniel Robbins <drobbins@gentoo.org> portage.py: Portage now - *persistently* caches xmatch() calculations. This appears to speed things up - but we will need to limit the size of the new xcache.p in future versions of - Portage. - - 15 Jul 2002; Daniel Robbins <drobbins@gentoo.org> portage.py, emerge: Portage - now has keyword-based masking enabled. It also has server-side caching - enabled to eliminate "emerge pre-Calculating dependencies... delay" for - end-users. There is now an undocumented "regen" option for emerge that tells - Portage to ensure that all entries in /var/cache/edb/dep are up-to-date. - This is intended mainly for developers, as the server-side caching feature - should ensure that all dep cache entries are up-to-date for end-users. - - 15 Jul 2002; Daniel Robbins <drobbins@gentoo.org> repoman: repoman now checks - for ebuilds that generate output as well as ebuilds that return a non-zero - error code when sourced. For this test to detect all failures, you need to - wipe out your /var/cache/edb/dep/* before running repoman. This design quirk - is necessary to preserve existing emerge behavior. - - 13 Jul 2002: Daniel Robbins <drobbins@gentoo.org> portage.py: Removed - Azarah's ebuildsh() function as it breaks pkg_setup() again. pkg_setup() - needs to be called as part of the same process as any other ebuil.sh command - so that environment vars set in pkg_setup() are preserved through the rest of - the build process. - - 13 Jul 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: changed calling - convention for doebuild("depend"). - - 13 Jul 2002; Daniel Robbins <drobbins@gentoo.org> ebuild.sh: removed - erroneous "local dbkeys" that was outside of a function. This fixes some - cache update problems. Added INHERIT to our cache entries so we can - correctly update the cache for eclass ebuilds. - - 12 Jul 2002; Dan Armak <danarmak@gentoo.org> make.globals, make.globals.ppc: - remove default KDE2DIR, KDE3DIR settings and comments. The kde eclasses will - now handle the case where they are not defined. This will be used with kde - 3.1 and later, and the difference between their default value and them not - being defined is important. - -*portage-2.0.13 (11 Jul 2002) - - 11 Jul 2002; Daniel Robbins <drobbins@gentoo.org> tarball.sh: our tarball - script didn't clean the src/sandbox directory before creating our distribution - tarball. This resulted in src/sandbox/sandbox (the executable) being distributed, - and the "make" in the ebuild thinking everything was up-to-date. The result? - Everyone in the world got a sandbox compiled with gcc 3.1. This has been - fixed, closing bug #4867, #4851. - - 10 Jul 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: removed some - bogus code that snuck in. pkg_setup() is no longer called when installing a - tbz2. All tbz2 stuff should be done in pkg_pre/postinst(). - -*portage-2.0.12 (10 Jul 2002) - - 10 Jul 2002; Daniel Robbins <drobbins@gentoo.org> ccache support is now - controlled via a "ccache" FEATURES variable, which is enabled in make.globals - my default. ccache support can now be turned off by adding a - FEATURES="-ccache" to /etc/make.conf. Also, CCACHE_DIR correctly detected - and utilized. - - 10 Jul 2002; Daniel Robbins <drobbins@gentoo.org> emerge: "emerge --help - rsync" now works correctly and displays rync help rather than rsyncing. This - closes bug #4438, #4629. - - 10 Jul 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: Portage now - prints a friendly error if PORTAGE_TMPDIR doesn't exist or is not a - directory. This effectively closes bug #4360. - - 10 Jul 2002; Daniel Robbins <drobbins@gentoo.org> emerge: the "inject", - "sync" and "rsync" actions no longer allow "--pretend" or "-p" to be - specified. This closes bug #4352. - - 10 Jul 2002; Daniel Robbins <drobbins@gentoo.org> sandbox.c: use realpath() - to expand the PORTAGE_TMPDIR, /var/tmp, /tmp paths. This allows write access - to these directories even if /var or /var/tmp is a symlink, for example. - Without this fix, access to these directories will be denied by the sandbox, - creating a bunch of problems. Closes bugs #4256, #2379, #4625, #2931, #4829. - - 10 Jul 2002; Daniel Robbins <drobbins@gentoo.org> megadigest, megadownload, - megatouch, pkgsearch: removed from the bin/ directory; deprecated. - - 10 Jul 2002; Daniel Robbins <drobbins@gentoo.org> emerge, quickpkg: remove - hard-coded references to "/usr/portage" in "emerge search", quickpkg. Now - correctly uses PORTDIR instead. Closes bug #4836. - - 10 Jul 2002; Daniel Robbins <drobbins@gentoo.org> emerge: emerge now checks - to see if the "wheel" group exists before running; if it doesn't, it exits - with a polite error message. Closes bug #4736. - - 08 Jul 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: changed the - unmerge() code so that it doesn't use mtimes to test whether a symlink - should be unmerged, since mtimes and symlinks are weird partners. Instead, - we save unmerging of our symlinks until the end of the code, and unmerge - them only if their target no longer exists. This closes bug #4491. - - 08 Jul 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: check whether - ebuild actually exists immediately before running pkg_postint() and - pkg_preinst() from the dblink merge() method. Also change all PKG_TMPDIR - references to PORTAGE_TMPDIR plus suffix, closing bug #4447, #4853. - -*portage-2.0.11 (07 Jul 2002) - - 07 Jul 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: rewrote - portdbapi's xmatch() and visible() to fix significant bugs. Logic errors in - both methods caused ~ deps to not work correctly. After the rewrite, - dependency checking is now 44% faster. - - 07 Jul 2002; Daniel Robbins <drobbins@gentoo.org> repoman, portage.py: Added - new DEPEND and RDEPEND.badmasked categories to repoman. repoman now checks - dependencies of masked packages using *all* ebuilds, rather than trying to - match them against all visible ebuilds. DEPEND.bad and RDEPEND.bad (used to - be ".unsolvable") now only tally visible ebuilds, not masked ones. - -*portage-2.0.10 (06 Jul 2002) - - 05 Jul 2002; Daniel Robbins <drobbins@gentoo.org> portage.py, repoman: Added - new capabilities to repoman -- the ability to detect unsolvable DEPEND and - RDEPEND variables, missing DESCRIPTION, LICENSE, KEYWORDS and SLOT. Fixed - repoman so that adding a comment with quotes in it doesn't break things. - Added a few tiny extensions to portage.py to support the new repoman - features. - - 03 Jul 2002; Martin Schlemmer <azarah@gentoo.org> ebuild.sh: some ebuilds - like gcc do not use $S to build the package in, and this causes generated .la - files (libtool) to contain $WORKDIR in them. We thus export $WORKDIR in - ebuild.sh as well, to go along with fixes to the libtool-portage patch. - - 02 Jul 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: pkg_setup() now - gets called before a tbz2 is installed, and pkg_preinst() and postinst() get - called at the right times as well. - - 01 Jul 2002; Phil Bordelon <sunflare@gentoo.org> emerge: "emerge --help - rsync" does an rsync instead of printing help. Until this is fixed, I - removed it from the list of detailed help options. - -*portage-2.0.9 (01 Jul 2002) - - 01 Jul 2002; Daniel Robbins <drobbins@gentoo.org> Added missing .match() - method to portdbapi. - - 01 Jul 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: Added new - operator for dependencies: DEPEND="foo? bar : oni" will use oni if foo isn't - set. Added "||" support back after removing it from my working copy; looks - ok. - - 29 Jun 2002; Daniel Robbins <drobbins@gentoo.org> portage.py, make.globals, - make.globals.ppc: internalized definitions of BUILDDIR and PKG_TMPDIR in - order to make things work as expected when one sets PORTAGE_TMPDIR. The new - config file var expansion algorithm made this change necessary. - - 29 Jun 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: fix doebuild() - so that pkg_setup() gets called when a .tbz2 package is being built. This - closes bug #3673. - - 29 Jun 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: tweaked the - aux_get() code to automatically regenerate cache files if they have the - incorrect number of entries. Added an additional fix to this code on 01 Jul - 2002. - - 29 Jun 2002; Martin Schlemmer <azarah@gentoo.org> portage.py: merge in some - of the missing ld.so.preload fixes again. - - 29 Jun 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: new version - with highly-optimized dependency calculation caching, particularly for - portdbapi. Includes new three-level caching portdbapi xmatch() method. - - 27 Jun 2002; Grant Goodyear <g2boojum@gentoo.org> ebuild.sh: Added keepdir() - function so that it no longer has to be hardcoded in ebuilds. - -*portage-2.0.8 (27 Jun 2002) - - 27 Jun 2002; Daniel Robbins <drobbins@gentoo.org> emerge: in an attempt to - provide a predictable release of Portage, I'm reverting the "emerge - --pretend" "fix" in Portage-2.0.6. It ignores custom USE settings when - calculating child deps, which makes things tricky for users. We'll use the - "expected" (old) behavior for now until we have a solution for this USE - issue. - - 27 Jun 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: fixed handling - of ! deps in match(), closing bug #4219. Thanks Spidler! - - 27 Jun 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: disabled USE - regeneration on reset() for performance purposes. - -*portage-2.0.7 (26 Jun 2002) - - 26 Jun 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: add a friendly - error handler for aux_get() so that flaky ebuilds don't cause it to trip up - with a cryptic traceback; users will get a friendly error message instead. - Also, temporarily disable keyword-based masking, since it currently slows - down Portage by quite a bit since it causes a much greater set of ebuilds to - be cached. - -*portage-2.0.6 (25 Jun 2002) - - 25 Jun 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: rewrote the - config file code to make things more sane, consistent, and made infinite - loops during variable expansion a thing of the past. This closes bug #3952. - - 25 Jun 2002; Daniel Robbins <drobbins@gentoo.org> emerge, portage.py, - ebuild.sh: "emerge --pretend" and "emerge search" now work for the root user - as well as any users in the "wheel" group. emerge will now gracefully exit - if "emerge search" is run by someone not in the "wheel" group. This closes - bug #4121. - - 25 Jun 2002; Martin Schlemmer <azarah@gentoo.org> bin/{dolib.so,preplib.so}: - Also change "strip --strip-unneeded" to "strip --strip-debug" for these. - Look at bugs #2702,#3929,#4027 for more info. - - 25 Jun 2002; Daniel Robbins <drobbins@gentoo.org> emerge: "emerge -u" now - correctly scans dependencies of packages, even if they are up-to-date, to - determine if any of their dependencies need updating. Previously, up-to-date - packages were not scanned in this way, which was a bug. - - 24 Jun 2002; Daniel Robbins <drobbins@gentoo.org> ebuild.sh: Portage will now - automatically take advantage of ccache if the >=dev-util/ccache-1.9 ebuild is - installed. Removing /var/cache/ccache hole in the sandbox. - -*portage-2.0.5 (24 Jun 2002) - - 23 Jun 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: basic keyword- - based masking is now active. New support for KEYWORDS in ebuilds and - ACCEPT_KEYWORDS in profiles. - - 23 Jun 2002; Daniel Robbins <drobbins@gentoo.org> conf files: removed - references to non-functional FTP_PROXY and HTTP_PROXY and added a note about - how to use the correct vars (ftp_proxy and http_proxy.) Closes bug #1664. - Also added note about RSYNC_PROXY, closing bug #2332. - - 23 Jun 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: removed - "dependency too short" checks which weren't working and were causing deps - like "mc" and "ed" to be rejected as invalid rather than being expanded. - - 23 Jun 2002; Daniel Robbins <drobbins@gentoo.org> emerge: upgraded "clean" - code to be more robust, consistent. Closes bug #3967. - -*portage-2.0.4 (20 Jun 2002) - - 20 Jun 2002; Daniel Robbins <drobbins@gentoo.org> in the 2.0.4 ebuild itself: - added back tbz2tool symlink which was mistakenly removed. Also changed the - way we compile portage.py stuff so that we remove the previously compiled - files, just in case clock skew cause them to seem more recent than they - really are. Python byte-code compilation moved to pkg_postinst() - - 20 Jun 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: fixed up the - fetch() code so that invalid digests don't cause a traceback. - - 20 Jun 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: some of the new - transplanted virtuals code assumed that profiledir was set, which is not - required. This code has now been fixed to not make that assumption. - -*portage-2.0.3 (20 Jun 2002) - - 20 Jun 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: fixed two typos - pointed out by stroke and g2boojum. These fix unmerge and some aspect of - virtuals handling, which was previously causing a traceback. - - 19 Jun 2002; Daniel Robbins <drobbins@gentoo.org> emerge: emerge -eup world - now will ignore world entries if it isn't really installed locally; in 2.0.1, - --emptytree would auto-enable all world entries, leading to inconsistent - package lists between --emptytree and without. - -*portage-2.0.2 (19 Jun 2002) - - 19 Jun 2002; Daniel Robbins <drobbins@gentoo.org> make.conf.ppc, - make.globals.ppc: integrated these files into our sources. - - 19 Jun 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: fixed a bug - where ROOT="" would not get properly converted to ROOT="/". - - 18 Jun 2002; Daniel Robbins <drobbins@gentoo.org> emerge: Portage 2.0+ has - fixed "!" depend matching support, but some code in emerge was designed to - anticipate the incorrect behavior. This emerge code has been fixed to work - correctly. This closes my part of bug #3834. - - 18 Jun 2002; Daniel Robbins <drobbins@gentoo.org> portage.py, emerge: fixed - bug #2444, where emerge fails when "--emptytree" and "--onlydeps" are used at - the same time. - - 18 Jun 2002; Daniel Robbins <drobbins@gentoo.org> portage.py, emerge: new - fakedbapi for doing emptytree calculations; emptytree upgrades in emerge. - "emerge -upe world" now works correctly, accounting for items in the world - profile. Yay! Bugs #3832 and #1911 fixed. - - 18 Jun 2002; Daniel Robbins <drobbins@gentoo.org> portage.py, emerge: - Integrated new aux_get() method into our portdbapi. aux_get() provides a - standardized way to get cached information about ebuilds, and is now fully - integrated into Portage and emerge search. - - 18 Jun 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: fixed a bug - where dep_nomatch() was testing for None rather than a "zero" condition, - causing dep_nomatch() to choke on match()'s [] return value. - - 17 Jun 2002; Daniel Robbins <drobbins@gentoo.org> emerge: added an exception - handler to catch invalid regular expressions and avoid a traceback. - - 17 Jun 2002; Daniel Robbins <drobbins@gentoo.org> sandbox.c: added - /var/cache/ccache to sandbox "write ok" list, closing bug #3028. - -*portage-2.0.1 (16 Jun 2002) - - 16 Jun 2002; Daniel Robbins <drobbins@gentoo.org> portage.py, emerge: fixed a - virtuals expansion bug that would cause virtuals to be consulted too early. - -*portage-2.0 (16 Jun 2002) - - 16 Jun 2002; Daniel Robbins <drobbins@gentoo.org> portage.py, ebuild.sh, - emerge: turbo-ified Portage, new Portage db API and many other fixes. - Unmerging now works again (bug introduced several releases ago.) I - originally wanted to hold off on releasing 2.0, but since several major bugs - are fixed, we need to get these fixes out to our users ASAP. We will be - releasing 2.1 in about a week which should include additional refinements. - - 16 Jun 2002; Daniel Robbins <drobbins@gentoo.org> repoman: New repoman - commit/check QA tool for developers. - - 10 Jun 2002; Dan Armak <danarmak@gentoo.org> make.conf: Update the ibiblio - mirror path; it is now www.ibiblio.org/pub/Linux/distributions/gentoo. - - 10 Jun 2002; Martin Schlemmer <azarah@gentoo.org> ebuild.sh : Some users have - $TMPDIR to a custom dir in their home ...this will cause sandbox errors with - some ./configure scripts or libtool, so set it to $T. - - 10 Jun 2002; Martin Schlemmer <azarah@gentoo.org> portage.py : Merge in the - ld.so.preload changes. Also updated spawn() to only run sandbox if - buildphase is one of clean, unpack, compile or install. This should fix the - handler not detecting some instances of sandbox running. Updated ebuildsh() - to set buildphase="" on spawn exit. - - 10 Jun 2002; Martin Schlemmer <azarah@gentoo.org> - portage.py.ldsopreload,testsandbox.sh : Add support to test if another - sandbox is running, if so dont delete /etc/ld.so.preload on kill. I did not - commit this to portage.py, as it is a bit more changes than we originally - though. - - 05 Jun 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: doebuild() now - has proper logic for digest generation. Digest will now get regenerated if - "ebuild digest" is run, even if "digest" is in FEATURES. - - 04 Jun 2002; Daniel Robbins <drobbins@gentoo.org> emerge: fixed typo in - "inject" documentation. - - 02 Jun 2002; Martin Schlemmer <azarah@gentoo.org> bin/dosym: changed the - command used from "ln -sf" to "ln -snf" as it created a symlink in the target - directory if the linkname already existed (only if the target is a - directory). Im guessing this should be fixed in the python merged code if - symlinks are not unlinked before the new is merged into place .. will add a - bug later. - -*portage-1.9.14 (01 Jun 2002) - - 01 Jun 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: when a file to - be merged is identical to the one currently on disk (using the md5 test), we - now at least correctly update the target's mtime and atime so that cleaning - will work correctly. - - 27 May 2002; Daniel Robbins <drobbins@gentoo.org> bin/do*: changed "return"s - to "exit 1". Closes bug #3078. - -*portage-1.9.13 (21 May 2002) - - 21 May 2002; Grant Goodyear <g2boojum@gentoo.org> emerge.1: Updated man page. - Thanks to carpaski@twobit.net. - - 20 May 2002; Daniel Robbins <drobbins@gentoo.org> emerge: a fix for dep - regeneration; stale dep cache entries should now be properly regenerated. - -*portage-1.9.12 (16 May 2002) - - 16 May 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: the settings - for A and AA were swapped; this has now been fixed, closing bug #1634. - - 15 May 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: fixed up some - quirks in the new fetch code which were reported by Wout Mertens. Thanks - Wout! - -*portage-1.9.11 (13 May 2002) - - 13 May 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: addition of - third-party mirroring code. "mirror://sourceforge/foo.tar.gz" will use the - /usr/portage/profiles/thirdpartymirrors file to define the mirror it will - download from. Multiple mirrors for a single keyword can be specified on a - single line. This code was based on the good work of Ryan Phillips. - - 13 May 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: (entry on behalf - of jnelson) -- we now have new KV detection/setting code that uses - /usr/src/linux/include/linux/version.h to determine the kernel version -- the - right way of doing things. KV is set to "" if the kernel is not available or - not configured. - - 13 May 2002; Daniel Robbins <drobbins@gentoo.org> emerge: "abspath[x]" => - "abspath(x)" typo fix. Also added 2-liner to allow for "emerge unmerge" to - specify "foo/bar-1.0" rather than requiring "=foo/bar-1.0." Also fixed - problems when specifying the names of actual ebuilds in /var/db/pkg to - unmerge. - -*portage-1.9.9 (06 May 2002) ?? - - 08 May 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: An empty - USE_ORDER (due to an out-of-date /etc/make.globals) would cause USE to always - be empty. I added a reasonable default USE_ORDER if USE_ORDER is not found - in any of the config files, fixing this problem. - - 06 May 2002; Daniel Robbins <drobbins@gentoo.org> emerge: post bug #1841 - cleanups; converted from .hasnode() to .dep_match() (correct) in - getworldlist(). - -*portage-1.9.8 (06 May 2002) - - 06 May 2002; Daniel Robbins <drobbins@gentoo.org> emerge: 2 fixes that seemed - to get fried/zapped: bug #1841 and fixing an emerge sync error code to be - more understandable. - -*portage-1.9.7 (06 May 2002) - - 06 May 2002; Daniel Robbins <drobbins@gentoo.org> portage.py, emerge: initial - bunch of robustness/error-handling fixes. Emerge should now report a - comprehensible error message for errors in DEPEND and RDEPEND rather than - giving a traceback. Fixed dep_depreduce() to catch errors rather than - passing them on to dep_bestmatch() (which doesn't check for errors and - assumes correct input) - - 02 May 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: typo fix for - S_ISFIFO call; thanks woodchip! - -*portage-1.9.6 (02 May 2002) - - 02 May 2002; Daniel Robbins <drobbins@gentoo.org> make.conf: SYNC variable - correctly set to use our DNS round-robin system (rsync.gentoo.org). - -*portage-1.9.6_pre2 (01 May 2002) - - 01 May 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: config file - protection upgrade; we now record md5sums of previously-merged config protect - files in /var/cache/edb/config; we use this information to avoid merging - files that have been merged by us before (if it is safe to do so). This - doesn't solve the problem of rolling back to a previously-merged version of - a config file; we need to add cvs headers to every config file to get that - to work. - -*portage-1.9.6_pre1 (01 May 2002) - - 01 May 2002; Daniel Robbins <drobbins@gentoo.org> emerge: added "inject" - capability to artificially satisfy a dep -- for situations when you don't - want Portage to do it for you because you've taken care of it already. - - 01 May 2002; Daniel Robbins <drobbins@gentoo.org> portage.py, emerge: totally - rewrote emerge's unmerge code. The original code (added by Bevin) was a bit - too cryptic and "big" for my taste. Also added two new capabilities to - portage.py's vartree: .getslot() and .gettimeval(). getslot() returns the - slot value of a cat/pkg-v, if any, and gettimeval() returns a "time value" - (based on mtime/COUNTER value) that can be used to determine the order in - which packages got merged. The purpose of these improvements were to revamp - the existing Portage code that could only unmerge a db entry if there was a - corresponding ebuild file. This conflicted with the ability to "inject" - packages (see above), so it needed to be changed. Also fixed some bugs along - the way. - - 01 May 2002; Daniel Robbins <drobbins@gentoo.org> ebuild.sh: einstall now - accepts arguments, closing bug #2275. Thanks seemant! :) - - 01 May 2002; Daniel Robbins <drobbins@gentoo.org> make.globals: switch SYNC - var from cvs.gentoo.org to rsync.gentoo.org, and gentoo-x86-portage to - gentoo-portage. - - 30 Apr 2002; Daniel Robbins <drobbins@gentoo.org> emerge: now checks for - errors (caused by bad deps) returned by create() and syscreate(). - -*portage-1.9.5 (29 Apr 2002) - - 29 Apr 2002; Daniel Robbins <drobbins@gentoo.org> ebuild.sh: added jnelson's - KV_extract.awk script which extracts the kernel version from the actual - kernel sources Makefile, making our KV setting much more robust! Thanks Jon - :) - - 29 Apr 2002; Daniel Robbins <drobbins@gentoo.org> emerge: correctly fixed - emerge search examples to use single quotes (to turn off globbing.) This - closes bug #1609. - - 29 Apr 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: virtual entries - for no-longer-installed packages now get automatically removed on unmerge. - This closes bug #2255 and #1891 (Thilo Bangert's comment on #1891 is also - fixed.) - -*portage-1.9.4 (29 Apr 2002) - - 29 Apr 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: Added support - for RESTRICT="nomirror". If "mirror" is defined in FEATURES and "nomirror" - is defined in RESTRICT, then files will not be fetched. - - 29 Apr 2002; Daniel Robbins <drobbins@gentoo.org> emerge: Fixed docs for - "unmerge", added docs for "--oneshot". Closes bugs #2156 and #2182. - - 29 Apr 2002; Daniel Robbins <drobbins@gentoo.org> ebuild.sh: Fix for USE - troubles; confirmed by Azarah as working :) Also, we now strip the path - from "KV" as we should. - -*portage-1.9.4_pre1 (26 Apr 2002) - - 26 Apr 2002; Daniel Robbins <drobbins@gentoo.org> tarball.sh: no longer - necessary for VERSION to equal "@portage_version@" to get the version - auto-set. VERSION can now be set to anything and tarball.sh will get it - right. - - 26 Apr 2002; Daniel Robbins <drobbins@gentoo.org> emerge: I've started work - on revamping/improving the "blocks" system to get ready to fix bug #1891. - Already fixed a bug where "blocks" ("!" deps) print out the wrong blocking - package name. This is now fixed. Blocks need additional testing. - - 26 Apr 2002; Daniel Robbins <drobbins@gentoo.org> portage.py, ebuild.sh, use: - "use" is now a bash builtin function rather than an external python-based - command. This appears to fix the USE inconstencies, as it should, thereby - closing bug #2000. - -*portage-1.9.3 (24 Apr 2002) - - 24 Apr 2002; Jon Nelson <jnelson@gentoo.org>: portage.py, chkcontents: - Emulate fchksum's md5 checksum routine. Closes bug #2787. - - 23 Apr 2002; Daniel Robbins <drobbins@gentoo.org>: emerge: invalid - short options result in an exit. Closes bug #2025. - - 22 Apr 2002; Daniel Robbins <drobbins@gentoo.org>: emerge: rsync zlib - compression enabled by default. - -*portage-1.9.2 (21 Apr 2002) - - 21 Apr 2002; Daniel Robbins <drobbins@gentoo.org>: portage.py: signal - handler now zaps /etc/ld.so.preload if it's there -- this prevents it - from hanging around and causing sandbox badness. - - 21 Apr 2002; Daniel Robbins <drobbins@gentoo.org>: emerge: fixed an - error where --emptytree mode wouldn't really have a fully empty tree, - due to the emptytree.inject() coming before the emptytree.root=None; - the inject() caused a recalc of the USE vars, which caused the tree - to become partially populated and it wasn't cleared. This closes bug - #1897. - - 21 Apr 2002; Daniel Robbins <drobbins@gentoo.org>: portage.py: package - building now executes the "setup" stage along with the unpack, compile, - install stages so that global variables can be shared. This fixes an issue - with woodchip's new apache ebuild and closes bug #1813. - -*portage-1.9.1 (16 Apr 2002) - - 16 Apr 2002; Daniel Robbins <drobbins@gentoo.org>: tiny (and forgotten) - quick fix. - -*portage-1.9.0 (16 Apr 2002) - - 16 Apr 2002; Daniel Robbins <drobbins@gentoo.org>: portage.py: fetching - should now try *all* alternate download locations, closing bug #1544. - Yay! - - 15 Apr 2002; Daniel Robbins <drobbins@gentoo.org>: emerge: "emerge R" now - works correctly, closing bug #1094. - - 15 Apr 2002; Daniel Robbins <drobbins@gentoo.org>: ebuild.sh: *'s and ?'s in - DEPEND and SRC_URI syntax should no longer get glob-expanded to files in - /usr/portage. This fixes some cryptic bugs. It also closes bug #1473. - - 15 Apr 2002; Daniel Robbins <drobbins@gentoo.org>: portage.py: emerge --debug - now works again. Closes bug #1437. - - 15 Apr 2002; Daniel Robbins <drobbins@gentoo.org>: portage.py: moved argument - check to the beginning of the doebuild() function to prevent "ebuild - foo.ebuild fart" from causing the md5sums to be checked before recognizing - that "fart" is not a valid command. Closes bug #1823. - - 15 Apr 2002; Daniel Robbins <drobbins@gentoo.org>: portage.py: 'USE="-foo" - emerge bar' should now work correctly and consistently. Fixes to the config - class. Closes bug #1455. - - 15 Apr 2002; Daniel Robbins <drobbins@gentoo.org>: portage.py: applied - jnelson's patch to properly kill all children when interrupted with ^C - - 15 Apr 2002; Donny Davies <woodchip@gentoo.org>: make.conf: added a - RESUMECOMMAND for lukemftp. - - 15 Apr 2002; Daniel Robbins <drobbins@gentoo.org>: portage.py: fixed up some - "zing" logic inside the merge code (fixing variable being used before - assignment errors) - - 15 Apr 2002; Jon Nelson <jnelson@gentoo.org>: src/sandbox/Makefile, - src/sandbox/problems/Makefile, src/sandbox/problems/sandbox_dev_fd_foo.c, - src/sandbox/sandbox.c: Cleaned up Makefiles somewhat to take advantage of GNU - Make, added '/dev/zero' and /dev/fd/' (<- note trailing slash) to the list of - items accessible safely from the sandbox. Added sandbox_dev_fd_foo.c to test - for /dev/fd/<xx>. The test is almost verbatim from the autoconf test suite. - - 13 Apr 2002; Martin Schlemmer <azarah@gentoo.org>: ebuild.sh: - Export $S and $D in dyn_compile and dyn_install, as our patched - version of libtool uses these to fixup .la files. - -*portage-1.8.19 (09 Apr 2002) - - 08 Apr 2002; Geert Bevin <gbevin@gentoo.org>: emerge: Removed --all switch to - emerge unmerge and clea. Added emerge prune which is the same as old emerge - unmerge. Emerge unmerge removes all instances again without any proctedtion, - as before. Added reporting of Omitted versions due to dep selectors. - Renamed Removing and Keeping to Selected and Protected - - 08 Apr 2002; Geert Bevin <gbevin@gentoo.org>: emerge, portage.py: Better - unmerge and clean reporting. Added homepage output to emerge --search. - Bugfix when specifying a package without category that doesn't exist. - -*portage-1.8.18 (07 Apr 2002) - - 07 Apr 2002; Geert Bevin <gbevin@gentoo.org>: make.globals, emerge: - Simplified unmerge functionality. Deprecated the CLEANMODE var, - emerge clean now removes both revisions and slots automatically, - emerge unmerge now removes all versions and revisions by default. - Both understand world and system targets, and the --all option which doesn't - check which packages are old and outdated. - Documentation fixes. - AUTOCLEAN var addition and added the autoclean functionality. - -*portage-1.8.17 (05 Apr 2002) - - 05 Apr 2002; Daniel Robbins <drobbins@gentoo.org>: portage.py: no longer - print out the counter number after a merge. This information should not - need to be known by end-users. - - 05 Apr 2002; Daniel Robbins <drobbins@gentoo.org>: sandbox.c: patched to - allow access to /dev/vc from sandbox, allowing vim and screen to compile - correctly from console. - - 05 Apr 2002; Daniel Robbins <drobbins@gentoo.org>: portage.py: fixed a bug - that prevented md5 digests from being compared on archives. - - 04 Apr 2002; Daniel Robbins <drobbins@gentoo.org>: portage.py: Parse errors - in /etc/env.d files no longer cause a traceback. - -*portage-1.8.16 (04 Apr 2002) - - 04 Apr 2002; Geert Bevin <gbevin@gentoo.org> portage.py, emerge : Forgot to - commit my changes, this is an assembled version of both drobbins's and my - changes - -*portage-1.8.15 (04 Apr 2002) - - 04 Apr 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: Fixed a - semi-long standing bug where I was comparing atimes rather than mtimes when - seeing if dep caches were stale. This fixes a bug originally reported by Dan - Armak. - -*portage-1.8.14 (04 Apr 2002) - - 04 Apr 2002; Geert Bevin <gbevin@gentoo.org> emerge: - Fixed short options for --all, --safe and clean. - -*portage-1.8.13 (04 Apr 2002) - - 04 Apr 2002; Geert Bevin <gbevin@gentoo.org> portage.py, emerge: - Added emerge --all clean and emerge --safe unmerge. - Made the counter updates atomic so that multiple merges can happen without - risking counter clashes. - Updated --help. - Fixed short options bug that prevented two seperate short options to be - specified successively. - -*portage-1.8.12 (04 Apr 2002) - - 04 Apr 2002; Geert Bevin <gbevin@gentoo.org> portage.py, emerge: - implemented "emerge clean" with oldrevs, oldversions and oldslots options for - the make.conf/make.globals CLEANMODE variable. - - 03 Apr 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: Added an - indentation fix to prevent merge from dying if a file attempts to install - itself on top of an existing directory. Closes bug #1498. - -*portage-1.8.11.1 (03 Apr 2002) - - 03 Apr 2002; Geert Bevin <gbevin@gentoo.org> portage.py: important fixes - for movefile() -- changed the order of ownership / permissions settings since - suid/guid bits were overwritten, added support back for 'ebuild config' since - it was accidentally left out - -*portage-1.8.11 (02 Apr 2002) - - 02 Apr 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: important fixes - for movefile() -- ownership now preserved across filesystems, mv -f fallback - for special files, other optimizations and robustness improvements. Important - fixes all-round. - - 02 Apr 2002; Geert Bevin <gbevin@gentoo.org> emerge: - fixed bad indentation of a part of the code that made unmerging multiple - packages behave badly - -*portage-1.8.10 (01 Apr 2002) - - 01 Apr 2002; Daniel Robbins <drobbins@gentoo.org> make.globals: removed USE - settings from make.globals. - - 01 Apr 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: In trying to fix - the glibc merge bug, we rewrote movefile() and it now runs blazingly fast. I - also tweaked the code to remove the need for an ">>> Updating mtimes..." - stage. This is all done dynamically now. *Much* faster. And hopefully - solid for glibc upgraders. - -*portage-1.8.9.4 (01 Apr 2002) - - 31 Mar 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: adapted - movefile() which should preserves timestamps and ownership on files and - symlinks it moves. - -*portage-1.8.9.3 (31 Mar 2002) - - 31 Mar 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: promising - rewrite of movefile() not only will probably fix glibc merge bug but also - speeds up merging at least 20x! Calling "mv" for every file really make - things super-slow! - -*portage-1.8.9.2 (31 Mar 2002) - - 31 Mar 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: desperate attempt - to fix movefile() bug... a hack really. glibc merges still dying. - -*portage-1.8.9.1 (31 Mar 2002) - - 31 Mar 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: it appears that - movefile() (using "/bin/mv") can still die if moving a new symlink on top of - an existing library symlink. Upon failure, we now use a fallback mechanism - to use "/bin/sln" to create the new symlink safely. - -*portage-1.8.9 (30 Mar 2002) - - 30 Mar 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: tiny cosmetic - fix for digest generation. - - 30 Mar 2002; Daniel Robbins <drobbins@gentoo.org> emerge: entries in the - world profile will be ignored if at least one version of the package in - question isn't already merged. Prevents "--update world" from remerging - packages that have since been unmerged. - - 30 Mar 2002; Daniel Robbins <drobbins@gentoo.org> various: changing all - references from /usr/bin/python to /usr/bin/python2.2. - - 30 Mar 2002; Daniel Robbins <drobbins@gentoo.org> db-update.py: moving this - script here from FILESDIR. - - 30 Mar 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: stuff doesn't - get added to the world profile if it is already an essential ("*") package in - the system profile. Keeps things clean and flexible. - -*portage-1.8.9_pre38 (30 Mar 2002) - - 30 Mar 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: resolve_key() - didn't call load() on mapped virtuals, resulting in inconsistent resolution - of virtual keys. Now fixed; thanks to woodchip for the bug report. - -*portage-1.8.9_pre37 (30 Mar 2002) - - 30 Mar 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: specific - provides (dev-lang/python-2.2) will be converted to their generic form - (dev-lang/python) before being recorded. - -*portage-1.8.9_pre36 (30 Mar 2002) - - 30 Mar 2002; Daniel Robbins <drobbins@gentoo.org> portage.py, emerge: new - virtuals fixes and a db-upgrade.py script in the ebuild to solve another - virtuals problem. - -*portage-1.8.9_pre35 (29 Mar 2002) - - 29 Mar 2002; Daniel Robbins <drobbins@gentoo.org> portage.py, emerge: digest - generation fixes; emerge --update will now update dependents even if the main - package hasn't been updated. getdict() fix, fixing a traceback. - -*portage-1.8.9_pre34 (28 Mar 2002) - - 28 Mar 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: Added an indent - fix for the new virtuals code, eliminating a traceback. Tweaked digest handling, - fixing a cosmetic error. - -*portage-1.8.9_pre33 (28 Mar 2002) - - 28 Mar 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: tweaked digest - creation in doebuild() to hopefully avoid creating digests twice. I hope I - didn't break anything in the process. - - 28 Mar 2002: Daniel Robbins <drobbins@gentoo.org> portage.py, emerge: "emerge - update" is now "emerge --update"; "world" added back. New world - implementation that works like this ... if you type "emerge media-gfx/gimp", - media-gfx/gimp will be added to the "world" favorites file in - /var/cache/edb/world. This world file is added to the system profile in - order to create the set of "world" packages to merge. You can manually put - specific deps (for pinning) in /var/cache/edb/world and they won't get - overwritten. To prevent a package that you specify on the emerge - command-line from being added to the world profile, use the "--oneshot" - option, which tells emerge that it should be merged once but not updated. - - 28 Mar 2002: Daniel Robbins <drobbins@gentoo.org> portage.py: New virtuals - implementation; new virtual info is recorded in /var/cache/edb/virtuals; - virtuals data is created by merging the profile virtual info with the new - edb/virtuals file. Note: We no longer add virtual package entries to - /var/db/pkg. This change solves the bug where virtual files get auto-updated - by pkg-update, and also solves the bug where doing an "emerge --update world" - will cause ssmtp to be merged in order to satisfy the virtual/mta dep (which - you already have satisfied by postfix, for example). Now, postfix will be - updated if necessary, but that's it. :) - -*portage-1.8.9_pre32 (22 Mar 2002) - - 22 Mar 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: fixed a bug - related to scanning for available binary packages, which would cause emerge - to die. - - 21 Mar 2002; Dan Armak <danarmak@gentoo.org> portage.py: added ECLASSDIR - (=$PORTDIR/eclass) to settings exported by python side to bash side. - ebuild.sh: remove ECLASSDIR setting to use the one now provided by - portage.py. Also, clean inherit() and make it use debug-print(). - -*portage-1.8.9_pre31 (21 Mar 2002) - - 21 Mar 2002; Daniel Robbins <drobbins@gentoo.org> ebuild.sh: Added Dan - Armak's patch to enable eclasses. :) - - 21 Mar 2002; Grant Goodyear <g2boojum@gentoo.org> portage.py: - Added a drobbins patch to at line 469. Should fix emerge rsync - problem when /etc/make.profile doesn't exist. - -*portage-1.8.9_pre30 (20 Mar 2002) - - 20 Mar 2002; Daniel Robbins <drobbins@gentoo.org> portage.py, emerge: emerge - --emptytree now works again and I added a new --nodeps option to emerge as - well. - -*portage-1.8.9_pre29 (20 Mar 2002) - - 20 Mar 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: CONTENTS files - now record the correct path when ROOT!="/". - -*portage-1.8.9_pre28 (20 Mar 2002) - - 20 Mar 2002; Daniel Robbins <drobbins@gentoo.org> portage.py, emerge: an - /etc/make.profile dir is now optional and portage will work if it's missing - or is a broken symlink. - - 20 Mar 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: fix load() - method in packagetree() class. - -*portage-1.8.9_pre27 (19 Mar 2002) - - 19 Mar 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: - /etc/make.profile/packages wasn't correctly masking core system packages; - fixed. - -*portage-1.8.9_pre26 (18 Mar 2002) - - 18 Mar 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: configuration - settings don't get loaded from ${ROOT}/etc anymore, just /etc. This - simplifies the creation of a new build image. - - 18 Mar 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: Don't expect a - digest file if SRC_URI is set to "" or undefined. - - 18 Mar 2002; Daniel Robbins <drobbins@gentoo.org>: RDEPEND was getting set - to DEPEND even if there was an RDEPEND="" in the ebuild. This has now been - fixed and RDEPEND will only get to DEPEND if RDEPEND has unset (not "unset - or null", as it was before this fix.) - - 18 Mar 2002; Daniel Robbins <drobbins@gentoo.org>: emerge: circular - dependencies error will result in the digraph dependencies being printed to - stdout, greatly simplifying debugging. - - 18 Mar 2002; Geert Bevin <gbevin@gentoo.org>: src/sandbox/problems: Added - several sample implementations to reproduce reported bugs. - - 18 Mar 2002; Geert Bevin <gbevin@gentoo.org>: libsandbox.c: All paths are now - checked for multiple successive slashes anywhere, this closes bug 827. - Performance should be slightly improved for other apps on the system for who - the sandbox is not turned on. - - 14 Mar 2002; Daniel Robbins <drobbins@gentoo.org>: output.py: quick fix to - turn off white color output -- not good for terminals with white background. - This closes bug #1135. - - 11 Mar 2002; Daniel Robbins <drobbins@gentoo.org>: Applied karltk's version - information patch. Portage.py now contains version information, and this - info is reported by "emerge --version". Thanks Karl! :) - -*portage-1.8.9_pre25 (11 Mar 2002) - - 10 Mar 2002; Daniel Robbins <drobbins@gentoo.org> portage.py, emerge: roll - back portagetree incremental db optimizations to fix an important bug (no - package.mask calculations being done.) Emerge will now abort if a dependency - can't be satisfied rather than printing just a warning. - -*portage-1.8.9_pre24 (09 Mar 2002) - - 09 Mar 2002; Daniel Robbins <drobbins@gentoo.org> emerge: fixed missing - "--clean" option so "--clean rsync" should work again. Also converted emerge - to work with our new db layout (db objects are in the portage module now). - - 09 Mar 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: Added USE - ordering, a concept envisioned by Vitaly Kushneriuk. The idea is to allow - customization of how Portage resolves USE variables. The default is - "env:conf:auto:defaults" (set in the USE_ORDER variable -- this default is - now in make.globals but as always you should set your custom USE_ORDER in - make.conf if desired.) So, my default, USE settings will be calculated as - follows. The USE variables will be grabbed from the - /etc/make.profile/make.defaults file (this is "defaults".) Then, the - /etc/make.profile/use.defaults file will be consulted. This file lists (one - per line) a USE variable and a corresponding dependency. If the dependency - is satisfied, the USE variable is auto-enabled and added to our working list - (this is "auto"). Then /etc/make.conf is consulted, so that the user has the - option of force-enabling (with USE="foo") or force-disabling (with - USE="-foo") any USE variables as desired (this is "conf".) Then, the - environment is consulted, allowing easy modifications from the command-line - (this is "env"). Also added is the ability for USE settings to be - dynamically regenerated in an efficient way as packages are merged. So, - right after xfree is emerged, the "X" use variable can be immediately - auto-enabled. Thanks to Vitaly for providing the vision for this. - -*portage-1.8.9_pre23 (08 Mar 2002) - - 09 Mar 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: our portage - tree and /var/db/pkg tree now uses incremental caching rather than doing - an exhaustive scan on startup. This should speed up this respective code - by 2-30x depending on how many packages you're emerging. This involved - quite a few changes to the code, and there could be some bugs, although I - tried to be very careful. These changes could also break code that access - internal .tree[] dictionaries directly. - - 08 Mar 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: SRC_URIs with - USE-enabled ( ) clauses in them weren't working because I was iterating - through multi-level lists without flatten()ing them. Now fixed. - - 07 Mar 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: We no longer - depend upon a file being unmerged. We try to unlink during unmerge() in a - "try" clause, with an exception for OSError. If the directory is immutable - then Portage continues gracefully. This closes a bug reported by Verwilst -- - unmerging an old baselayout would die when it tried to delete /dev/shm. - Fixed in Portage to eliminate these kinds of problems in the future. - -*portage-1.8.9_pre22 (07 Mar 2002) - - 07 Mar 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: I had - sys.exit() in doebuild()'s fetch section. Converted to "return 1" and - "return 0" to be emerge --fetchonly friendly. Thanks to Dan Armak for the - bug report. - -*portage-1.8.9_pre21 (07 Mar 2002) - - 07 Mar 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: fixed symlink - merge bug related to "safe" emerges. This should fix problems of Portage - dying when merging certain things. I'm hoping that this fix will give us a - solid merge implementation. It should. Thanks to Bart Verwilst for tracking - down a merge problem that I could reproduce. - -*portage-1.8.9_pre20 (06 Mar 2002) - - 06 Mar 2002; Daniel Robbins <drobbins@gentoo.org> ebuild.sh, others: users - can now forcefully disable stripping of their ebuild binaries by adding a - RESTRICT="nostrip" to their ebuild. Additionally, the DEBUG variable has - been renamed to DEBUGBUILD to prevent namespace collisions. This closes bug - #868. - - 06 Mar 2002; Daniel Robbins <drobbins@gentoo.org> portage.py : Fixed a - long-standing bug where the pkg_preinst() and pkg_postinst() functions being - called came from the existing package ebuild in /var/db/pkg rather than the - new ebuild being merged. pkg_prerm() and pkg_postrm() still use the ebuild - in /var/db/pkg, which is correct. Thanks to Dan Armak for tracking down this - bug. - -*portage-1.8.9_pre19 (05 Mar 2002) - - 05 Mar 2002; Daniel Robbins <drobbins@gentoo.org> portage.py : Fixed two bugs - reported by Dan Armak relating to incomplete (not missing) message digests. - They should now get regenerated automatically is "digest" is in FEATURES and - not confuse the fetch code. - -*portage-1.8.9_pre18 (04 Mar 2002) - - 04 Mar 2002; Daniel Robbins <drobbins@gentoo.org> portage.py : Bug fix in - dep_bestmatch(); rev comparison now works correctly and dep_bestmatch will - properly handle 2-digit revisions in particular. This closes bug #952. - - 04 Mar 2002; Daniel Robbins <drobbins@gentoo.org> portage.py : Thanks to a - bug report by Bruce Locke, the long-standing bug where symlinks with - different mtimes would still get unmerged is now fixed. This allows glibc - (of all things) to be unmerged safely. We needed this fix. Closes bug #964. - - 03 Mar 2002; Daniel Robbins <drobbins@gentoo.org> portage.py : KDEDIR -> - KDEDIRS (fixing my typo) - -*portage-1.8.9_pre17 (27 Feb 2002) - - 27 Feb 2002; Daniel Robbins <drobbins@gentoo.org> emerge : --help - documentation is now up-to-date; short options tweaked. - - 26 Feb 2002; Daniel Robbins <drobbins@gentoo.org> portage.py : Fixed an - unmerge error caused by digests now being recorded in lowercase. unmerge now - compensates for 100% backwards compatibility. Moved "continue" outside of - "try" block since this is disallowed in Python. This fixes a python warning - during fetch. - - 26 Feb 2002; Geert Bevin <gbevin@gentoo.org> bin/dohtml : Added support for - installing .gif files too since quite some docs still ship with those instead - of .jpg or .png. - -*portage-1.8.9_pre16 (25 Feb 2002) - - 25 Feb 2002; Daniel Robbins <drobbins@gentoo.org> emerge : emerge syntax - changed back to "classic" style; replaced dots with spinner, did a major code - cleanup and removed pieces that will be rewritten for 1.8.9 final. emerge - documentation isn't up-to-date at all; I'm holding off on the --help rewrite - until after 1.8.9 features have been finalized (soon!) - - 25 Feb 2002; Daniel Robbins <drobbins@gentoo.org> : Added RESTRICT variable - to ebuilds. If RESTRICT="fetch" is set in the ebuild, it means that the - files listed in SRC_URI are simply filenames and that the real files must be - downloaded manually. This allows us to deal with realplayer, since - overriding dyn_fetch is no longer an option now that we have the fetch code - in python. Also added a cosmetic tweak to emerge during info file - regeneration. - - 25 Feb 2002; Daniel Robbins <drobbins@gentoo.org> cnf/* : updated ${x} -> - ${URI} in $FETCHCOMMAND. - - 24 Feb 2002; Daniel Robbins <drobbins@gentoo.org> Fixed another fetch bug - where the download wouldn't cycle to alternate mirrors (it'd get stuck on - the first download location) - -*portage-1.8.9_pre15 (24 Feb 2002) - - 24 Feb 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: some fixing of - the merge code; added automatic digest generation when "digest" is in - FEATURES; made the fetch() code not depend on a pre-existing digest. This - should fix all known digest/fetch issues. - -*portage-1.8.9_pre14 (23 Feb 2002) - - 23 Feb 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: If you have a - file that's hosted directly on our master ibiblio mirror, you can specify - it in SRC_URI as "http://mirror/myfile.tar.bz2". "http://mirror" will be - expanded to the first mirror defined in GENTOO_MIRRORS, or our master ibiblio - mirror if no mirrors are defined. Groovy. This closes bug #627. - - 23 Feb 2002; Daniel Robbins <drobbins@gentoo.org> make.globals, emerge, - portage.py: wget is no longer hardcoded; FETCHCOMMAND is enabled again, but - uses ${FILE} and ${URI} instead of ${x} and ${y} now. Added download - resuming, which requires the definition of RESUMECOMMAND (added to - make.globals). Updated spawn() so that when it's called as spawn(foo,free=1) - as an argument, sandboxing is turned off. Replaced all calls to - os.system(foo) with spawn(foo,free=1), since os.system() messes with signal - handling. Added a default SIGINT signal handler to portage.py so that ^C - interrupts are handled correctly (portage will immediately exit with a return - code of 1). This has been tested and works for ebuild and emerge. These - additions should also close bug #407 and #760. - - 23 Feb 2002; Daniel Robbins <drobbins@gentoo.org> emerge: spython -> python - fix; resolution of cvs merge conflict. Removed edepend assignment bug - reintroduced in Geert's commit; added comment explaining why the new code is - needed so it doesn't get removed again ;) - - 22 Feb 2002; Geert Bevin <gbevin@gentoo.org> emerge: removed spurious cvs - conflict lines fixed bug in the cleanup code where different slots weren't - handled too well - -*portage-1.8.9_pre13 (22 Feb 2002) - - 22 Feb 2002; Daniel Robbins <drobbins@gentoo.org> various: fix /bin/sh - symlink merge problems and massively simplified movefile() code. Added back - some emerge code so that "emerge --search rsync" doesn't run rsync. - -*portage 1.8.9_pre12 (22 Feb 2002) - - 22 Feb 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: everything - should now generate *lowercase* md5sums, fixing problems with digest - backwards compatibility. - - 22 Feb 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: changed - position of digest generation call so that "ebuild digest" now works if the - sources have not yet been downloaded. - -*portage 1.8.9_pre11 (22 Feb 2002) - - 22 Feb 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: unmerging now - works correctly. - -*portage 1.8.9_pre10 (22 Feb 2002) - - 22 Feb 2002; Daniel Robbins <drobbins@gentoo.org>: "emerge" didn't like the - new portage.py (fixed); A merge database bug (fixed). Fixing the merge bug - should also result in merges happening much faster than before, maybe up to 3 - times as fast. We no longer resolve symlinks when testing protection paths. - -*portage 1.8.9_pre9 (21 Feb 2002) - - 21 Feb 2002; Daniel Robbins <drobbins@gentoo.org>: moved entirety of Portage - download/digest code from ebuild.sh (bash) to portage.py (python). No - support for custom FETCHCOMMANDs yet, but that's coming soon. Good news is - that it appears to work well and allowed some cleanups and optimizations to - doebuild(). SYNC support added. See cnf/make.conf for more info -- - basically, "emerge rsync" (now callable via "emerge sync" as well) supports a - configurable "Portage server" that begins either with "rsync://" or "cvs://". - "emerge sync" is now not only a clean front-end, but a configurable front-end - to the Portage update process. I also removed dependency checking from - 'ebuild'. This allowed me to removed some redundant code from portage.py, - and seemed fine to do since 'ebuild' is more and more becoming a low-level - developer tool. - - 21 Feb 2002; Daniel Robbins <drobbins@gentoo.org>: rewrite of cumulative USE - setting code so that the new FEATURES (what used to be called MAINTAINER) is - now cumulative and supports "-" and "-*" options. FEATURES is expanded using - all config files, while USE ignores make.globals but uses everything else. - Optimization of a couple parts of doebuild(). Upgraded expandpath() and used - it in one place where it was removed accidentally (in the new merge code.) - Master category list is now stored externally in - ${PORTDIR}/profiles/categories for ease of maintenance. - - 21 Feb 2002; Daniel Robbins <drobbins@gentoo.org> emerge: now supports the - EMERGE_OPTS make.conf variable for enabling emerge options by default. - Closes bug #605. - - 21 Feb 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: dep_match() now - works with * deps (again? Looks like the code got ripped out somehow); this - closes bug #490. - - 21 Feb 2002; Daniel Robbins <drobbins@gentoo.org> global change from - "spython" -> "python", now that Portage is slick enough to update shared - libraries correctly. - - 21 Feb 2002; Grant Goodyear <g2boojum@gentoo.org> bin/chkcontents, - man/chkcontents.1: New script to compare what's in a package's CONTENTS file - with what's actually on the filesystem. Useful for discovering that a - package "collision" has occurred. - - 21 Feb 2002; Daniel Robbins <drobbins@gentoo.org> ebuild.sh, portage.py: - Dependencies should be no longer checked during the "unpack" stage. This - closes bug #231. Added the $KV kernel version variable to ebuild.sh so that - it's available for all ebuilds. This closes bug #599. - - 21 Feb 2002; Daniel Robbins <drobbins@gentoo.org> ebuild.sh: S now defaults - to ${WORKDIR}/${P} if it isn't defined. That's right. Defining S is now - optional :) This should eliminate around 1000 lines from our ports tree. - - 20 Feb 2002; Daniel Robbins <drobbins@gentoo.org> portage.py: Fixed some - major bugs in the new merge/config protect code. Merging and config - protection should now work. - - 18 Feb 2002; Daniel Robbins <drobbins@gentoo.org> portage.py, emerge, - ebuild.sh : Rewrote merge code. Should merge symlinks only *after* the - target has been merged (needs testing). Added lots of comments. Split - dblink.merge() into 2 new functions -- .walktree() and .mergeme(). - Cleaned/optimized merging a good deal. Added special "-*" USE variable to - unset *all* USE variables defined up until that point. - - 18 Feb 2002; Daniel Robbins <drobbins@gentoo.org> portage.py, emerge, - ebuild.sh : Fixed USE bug (config.reset() threw away our cumulative USE), - streamlined turbo dep calculations by moving edb cache entry creation to - ebuild.sh. Started coding new dblink.merge() method that should be much - cleaner, faster and merge symlinks safely. - - 17 Feb 2002; Daniel Robbins <drobbins@gentoo.org> portage.py : Added - cumulative USE variable support. The final USE var is calculated - cumulatively starting with make.profile, then make.conf, and then the - environment. Any "-foo" option in USE will turn off a previously-defined USE - setting. So, if you want to use the profile-default USE settings except turn - "X" off, you add 'USE="-X"' to /etc/make.conf and that's it. This greatly - simplifies USE variable maintenance since developers can now easily add new - USE variables that default to 'on'. Simply add the USE variable and then add - it to make.profile. It will then be included in everyone's USE variables - automatically unless they explicitly "-newvar" in /etc/make.conf or in the - local environment. This also enables easy one-shot disabling of USE - variables. For example, to merge xchat without GNOME support (when "gnome" - is in your /etc/make.conf USE variable), simply type "USE="-gnome" emerge - net-irc/xchat". This is a lot easier than temporarily tweaking - /etc/make.conf. - - 17 Feb 2002: Daniel Robbins <drobbins@gentoo.org> emerge : Added a quick hack - to cache ebuild dependency info using extended attributes on XFS filesystems. - Gives a factor of 10 speedup for dependency calculations. Will look into a - generic caching solution that should offer similar performance increases on - all filesystems. Note: the fact that this hack is on CVS means that emerge - is currently in a hyper-experimental state and shouldn't be used right now. - - 16 Feb 2002; G.Bevin <gbevin@gentoo.org> emerge : added support for 'emerge - cat/pkg-version' instead of always having to require 'emerge cat/pkg' - - 15 Feb 2002; G.Bevin <gbevin@gentoo.org> emerge : reimplemented the display - of cleaned packages to clearly show all versions that are about to be removed - and which versions are going to stay - - 13 Feb 2002; D.Robbins <drobbins@gentoo.org> emerge : - added --emptytree option - - 13 Feb 2002; G.Bevin <gbevin@gentoo.org> emerge, portage.py : - fixed little bug where emerge --clean rsync wasn't correctly handled anymore - implemented all new functionalities of emerge --clean, this adds --slots, - --versions and --all options together with world and system modes - - 12 Feb 2002; G.Bevin <gbevin@gentoo.org> emerge, portage.py : - changed emerge --zap to emerge --clean - removed parts of the already implemented slots functionality to be able to - fall back to a more flexible implementation. Binary compatible slots will now - mostly influence emerge during the --clean operation - - 12 Feb 2002; G.Bevin <gbevin@gentoo.org> emerge : - added fallback check in case UNMERGE_DELAY hasn't been defined in - make.globals or make.conf - -*portage 1.8.9_pre8 (18 Feb 2002) - - 12 Feb 2002; G.Bevin <gbevin@gentoo.org> emerge : - changed the rebuild code to use depgraph instead, dramatically reducing code - duplication - - 11 Feb 2002; G.Bevin <gbevin@gentoo.org> emerge : - changed indentation of a code part that wasn't at the right level. It got the - count of the non slot packages during --zap completely wrong - -*portage 1.8.9_pre7 (11 Feb 2002) - - 11 Feb 2002; G.Bevin <gbevin@gentoo.org> portage.py : - fixed bug in packagetree.dep_match() where a ~ dependency is returned as a - string instead of as a list - - 11 Feb 2002; G.Bevin <gbevin@gentoo.org> emerge : - - removed support for --all and world in 'emerge --unmerge', by default now - all matching packages are removed since with the new slots functionality - old package versions should not exists anymore - - colored package name red too when a blocking package is found during - pretend operation - - changed emerge invocation arguments to be in a new universal interface - format this has been decided to be : - 'emerge --action --option --option [packageset]' - some features however don't respect this, but that's since they are not - package installation related and are easier to use as straight commands - eg: emerge rsync - - added UNMERGE_DELAY var to make.globals and support it in emerge to obtain - the number of seconds to wait - - support for NOCOLOR="yes" as wel as NOCOLOR="true" - - major speedups for emerge -search - - added formatted package descriptions of the matches from emerge --search - that nicely wrap at 80 chars - - rewrote retrieval of package descriptions to support descriptions that are - specified on multiple lines - - added support for 'noslot' to --zap, --update and --rebuild - - 11 Feb 2002; G.Bevin <gbevin@gentoo.org> sandbox.c, libsandbox.c : - added checks to see if the files where information is written to are really - regular files and not symlinks - -*portage 1.8.9_pre6 (10 Feb 2002) - - 10 Feb 2002; G.Bevin <gbevin@gentoo.org> emerge : - added support for 'emerge --unmerge world' which removes all old package - versions from the system - made 'emerge --unmerge' take binary compatibility slots into account, this - prevents that packages with different versions but also different slots, are - being unmerged - added support for "--verbose" in "emerge rebuild" and "emerge world" to - provide details about packages that aren't in the local tree anymore and to - notify the user about which packages don't support slots - - 9 Feb 2002; G.Bevin <gbevin@gentoo.org> emerge : - added support for the rebuild mode which rebuilds all the packages on your - system for which a corresponding package could be found in to portage tree - - 9 Feb 2002; G.Bevin <gbevin@gentoo.org> portage.py : - renamed getEbuildPaths() or vartree to getebuildpaths() - fixed bug in the merging of binary packages - - 7 Feb 2002; G.Bevin <gbevin@gentoo.org> xpack.py : - added additional argument to tbz2.getfile() which allows default content to - be provided when the requested file couldn't be found in the tbz2 archive - - 7 Feb 2002; G.Bevin <gbevin@gentoo.org> ebuild.sh : - added SLOT information as the third entry in the temporary deps file that is - generated during ebuild depend, - - 7 Feb 2002; G.Bevin <gbevin@gentoo.org> portage.py : - obtain SLOT information from the deps file instead of using the slotgrab() - function, removed slotgrab() function, updated some comments - - 7 Feb 2002; G.Bevin <gbevin@gentoo.org> emerge : - added SLOT information to the generated edepend var for binary packages - -*portage 1.8.9_pre5 (6 Feb 2002) - - 6 Feb 2002; G.Bevin <gbevin@gentoo.org> portage.py : - fixed bugs where the old instance wasn't unmerged correctly if slots are - identical, but ebuild version numbers not - - 6 Feb 2002; Grant Goodyear <g2boojum@gentoo.org> cnf/make.conf : - Copied proxy lines from make.globals (bug 431). - - 6 Feb 2002; Vitaly Kushneriuk <vitaly@gentoo.org> portage.py : - added missing SLOT param to merge(...). - -*portage 1.8.9_pre4 (6 Feb 2002) - - 6 Feb 2002; G.Bevin <gbevin@gentoo.org> portage.py : - fixed some bugs in the handling of PROVIDES and virtual packages together - with slots, they used code that wasn't upudated to the new dblink constructor - virtuals now use "" as slot, resulting in normally to same behaviour as what - has been done before. - - 5 Feb 2002; G.Bevin <gbevin@gentoo.org> emerge : - sorted the packages to unmerge since this makes package names with revision - endings appear before plain version numbers. This makes the unmerge code - first remove the old and non slot aware packages before removing the newer - alternative which is in fact exactly the same apart from the revision - identifier. - -*portage 1.8.9_pre3 (5 Feb 2002) - - 5 Feb 2002; G.Bevin <gbevin@gentoo.org> portage.py : - only let the backward compatibility algorithm kick in during unmerge since - it's impossible to correctly detect is in general. - -*portage 1.8.9_pre2 (5 Feb 2002) - - 5 Feb 2002; G.Bevin <gbevin@gentoo.org> portage.py : - fixed bug in the backward compatibility algorithm - -*portage 1.8.9_pre1 (5 Feb 2002) - - 4 Feb 2002; G.Bevin <gbevin@gentoo.org> ebuild.sh, emerge, portage.py : - added binary compatibility slots, this also contains additional code to keep - the unmerging of packages backwards compatible. - - 4 Feb 2002; G.Bevin <gbevin@gentoo.org> portage.py : - added back support for the "ebuild help" command which seems to have - disappeared somewhere along the updates - - 4 Feb 2002; G.Bevin <gbevin@gentoo.org> make.conf, make.globals : - added description and default entry for the imlib USE variable - added flag to prozilla to disable prozilla's waiting for a user's keypress - when a failure occurs - - 4 Feb 2002; G.Bevin <gbevin@gentoo.org> output.py : - bugfix, write read() function instead of red(), doh ! - - 4 Feb 2002; G.Bevin <gbevin@gentoo.org> emerge, portage.py : - implemented the ! dependency which prevents incompatible packages to be - installed on the same system at the same time - - 4 Feb 2002; G.Bevin <gbevin@gentoo.org> emerge : - most emerge invocation options now have alternative short flags - - 4 Feb 2002; G.Bevin <gbevin@gentoo.org> emerge : - emerge now doesn't unmerge the last version of an installed version by - default anymore, to really remove all instanced of packages the --all flag - has to be used, the --safe flag is deprecated - - 3 Feb 2002; G.Bevin <gbevin@gentoo.org> output.py, emerge,make.globals : - all output can now be turned to black and white by using the functions in - output.py, this determines the mode by checking to NOCOLOR variable in - make.conf or make.globals - - 3 Feb 2002; G.Bevin <gbevin@gentoo.org> emerge : - made it possible to run emerge --help and --search as non root - -*portage 1.8.8-r1 (1 Feb 2002) - - 1 Feb 2002; G.Bevin <gbevin@gentoo.org> portage.py, ebuild.sh, ebuild.5 : - added support for a pkg_setup() function which is executed before anything - else and can be typically used for package configuration actions or required - system checks - - 1 Feb 2002; G.Bevin <gbevin@gentoo.org> portage.py : - implemented the noauto MAINTAINER flags for all relevant ebuild commands - - 1 Feb 2002; G.Bevin <gbevin@gentoo.org> portage.py : - make env-update disregard backup files - - 1 Feb 2002; G.Bevin <gbevin@gentoo.org> emerge : - added --pretend support instead of interactively asking to proceed, - also added a delay before unmerging though to be sure - -*portage 1.8.8 (1 Feb 2002) - - 1 Feb 2002; G.Bevin <gbevin@gentoo.org> emerge : - added --safe switch to complement the --unmerge option - - 1 Feb 2002; G.Bevin <gbevin@gentoo.org> portage.py : - rewrote the packagename without category support to also graceously handle - deps specifiers at the beginning, this shouldn't be used in the ebuilds, but - are very handy when using emerge --unmerge - - 1 Feb 2002; G.Bevin <gbevin@gentoo.org> emerge : - added emerge --unmerge support - - 1 Feb 2002; G.Bevin <gbevin@gentoo.org> portage.py : - added packagename without category support in the dep_match function - -*portage 1.8.7 (30 Jan 2002) - - 30 Jan 2002; G.Bevin <gbevin@gentoo.org> portage.py : - integrated and slightly adapted Brent Rahn's code to support package names - without category - - 30 Jan 2002; G.Bevin <gbevin@gentoo.org> ebuild.sh : - integrated and fixed Azarah's patch to fix the wrongly generated archive size - in the digests - -*portage 1.8.6-r3 (28 Jan 2002) - - 28 Jan 2002; G.Bevin <gbevin@gentoo.org> portage.py : - disabled warnings about non existant config file paths - - 28 Jan 2002; G.Bevin <gbevin@gentoo.org> emerge : - added verwilst pkgsearch code, which was turned into a seperate class and - refactored for clarity and execution speed - - 28 Jan 2002; G.Bevin <gbevin@gentoo.org> portage.py : - renamed _xxx vars to _prepart in Vitaly's code addition - -*portage 1.8.6-r2 (27 Jan 2002) - - 24 Jan 2002; Vitaly Kushneriuk <vitaly@gentoo.org> portage.py : - Fixed version compare code Also added test script to test future versions. - -*portage 1.8.6-r1 (24 Jan 2002) - - 24 Jan 2002; Karl Trygve Kalleberg <karltk@gentoo.org> dojar: - Fixed typos. - -*portage 1.8.6 (23 Jan 2002) - - 22 Jan 2002; G.Bevin <gbevin@gentoo.org> libsandbox.c : - added an additional check for SANDBOX_ON to optimize the speed in the execvp - function call. Also removed error messages being printed when the PATH var - isn't set. - - 20 Jan 2002; Karl Trygve Kalleberg <karltk@gentoo.org> dojar : - added dojar shell command as a java JAR handler - - 17 Jan 2002; Daniel Robbins <drobbins@gentoo.org> : - The package chosen by "emerge sys-apps/shadow" now matches that chosen in an - emerge update or emerge system. I forgot to add some "*" dep code to the - dep_nomatch() method; this is now fixed. - -*portage 1.8.5 (13 Jan 2002) - - 13 Jan 2002; G.Bevin <gbevin@gentoo.org> ebuilds.sh, portage.py: - added fine grained maintainer settings - -*portage 1.8.4 (13 Jan 2002) - - 12 Jan 2002; Daniel Robbins <drobbins@gentoo.org> : - "emerge sys-apps/bash/" now works. (trailing "/" stripped to make - tab-completion users happy) This fixes bug #119 - - 12 Jan 2002; Daniel Robbins <drobbins@gentoo.org> : - Portage should no longer bomb out if the current working directory doesn't - exist (has been deleted from underneath). - - 12 Jan 2002; Daniel Robbins <drobbins@gentoo.org> : - added "--world" option for "emerge update". This tells Portage to update - the base system *as well as* upgrade any packages that are currently - installed but have new versions available. This is your standard full system - update command. This fixes bug #122 - - 12 Jan 2002; Daniel Robbins <drobbins@gentoo.org> : - Added an expandpath() cache which speeds up merging dramatically. - -*portage 1.8.3 (11 Jan 2002) - - 11 Jan 2002; Mikael Hallendal <hallski@gentoo.org> ebuild.sh: - added functions econf and einstall. Also made src_compile having a default - implementation. - -*portage 1.8.2 (07 Jan 2002) - - 07 Jan 2002; G.Bevin <gbevin@gentoo.org> : - sandbox included in portage - -*portage 1.8.1 (30 Dec 2001) - - 29 Dec 2001; Daniel Robbins <drobbins@gentoo.org> : - "emerge update" is now functional! Although the algorithm really should be - sound, it is still considered in testing since we may need to tweak some - dependencies. - - 27 Dec 2001; Daniel Robbins <drobbins@gentoo.org> : - Removed objprelink from the default USE variable. - -*portage 1.8.0 (22 Dec 2001) - - 22 Dec 2001; Daniel Robbins <drobbins@gentoo.org> : - I messed up the "transparent .so library" update. Included is the correct - fix, which seems to allow glibc to update on my system without any tricks. - I just merged a new glibc while in X, without using any of glibc's old - pkg_postinst/pkg_preinst hacks. - - 21 Dec 2001; Daniel Robbins <drobbins@gentoo.org> make.defaults.5, make.conf.5 : - Moved make.defaults.5 to make.conf.5 and updated contents. - -*portage 1.7.8 (21 Dec 2001) - - 21 Dec 2001; Daniel Robbins <drobbins@gentoo.org> portage.py : - ebuild install doesn't throw away the compile directory if ebuild has been - changed and MAINTAINER is set; we now use mv -f to move files into location - on the filesystem, making our library install method even more robust. It - should now be totally safe to upgrade glibc while in X and playing music - with xmms and surfing the Web and compiling 20 applications at once :) - -* portage 1.7.7 (14 Dec 2001) - - 14 Dec 2001; Aron Griffis <agriffis@gentoo.org>: portage.py : - movefile() now unlink()s the destination file first which solves shared - library install problems. - -* portage 1.7.6 (13 Dec 2001) - - 10 Dec 2001; Daniel Robbins <drobbins@gentoo.org> portage.py : - env_update() now generates an /etc/csh.env file in csh shell format. - -* portage 1.7.5 (13 Dec 2001) - - 10 Dec 2001; Daniel Robbins <drobbins@gentoo.org> portage.py : - added a little fix so a ~ dep isn't satisfied by a *much* later installed - version; i.e. ~media-libs/freetype-1.3.1 satisfied by - media-libs/freetype-2.0.5 being installed. - - 30 Nov 2001; Daniel Robbins <drobbins@gentoo.org> ebuild : - added a KeyboardInterrupt handler so ^C'ing a running ebuild process doesn't - produce a Python traceback. - -* portage 1.7.4 (29 Nov 2001) - - 29 Nov 2001; Daniel Robbins <drobbins@gentoo.org> portage.py : - removed an unnecessary quirk in the code preventing virtual packages from - being in any other category but "virtual". - - 25 Nov 2001; Daniel Robbins <drobbins@gentoo.org> emerge : - info file detection code has been improved. - -* portage 1.7.3 (20 Nov 2001) - - 20 Nov 2001; Daniel Robbins <drobbins@gentoo.org> pdb, pdb.cgi, xpak : - used /usr/bin/python instead of /usr/bin/spython. Fixed. - -* portage 1.7.2 (13 Nov 2001) - - 13 Nov 2001; Aron Griffis <agriffis@gentoo.org> : - emake will now try to build in parallel, and if it fails, will retry in - non-parallel mode. - - 13 Nov 2001; Daniel Robbins <drobbins@gentoo.org> ebuild.sh : - an ebuild that used an archive with a name that was part of another archive - would cause Portage to mess up the digest check. No longer. - - 31 Oct 2001; Donny Davies <woodchip@gentoo.org> make.conf, make.globals : - comments about merging the fetch programs before trying to use them. - -* portage 1.7.1 (30 Oct 2001) - - 30 Oct 2001; Daniel Robbins <drobbins@gentoo.org> portage.py : - I accidentally broke "=" deps by being sloppy when I added "*" deps. Trivial - fix applied. - -* portage 1.7 (29 Oct 2001) - - 29 Oct 2001; Daniel Robbins <drobbins@gentoo.org> portage.py : - strange typo fix in the empty() digraph method. - -* portage 1.6.12 (29 Oct 2001) - - 29 Oct 2001; Daniel Robbins <drobbins@gentoo.org> portage.py : - "*" deps now implemented. "=sys/foo-1*" matches the latest 1.x version/rev of - sys/foo, but will not match a 2.x version. - - 26 Oct 2001; Daniel Robbins <drobbins@gentoo.org> portage.py : - various new categories added. - -Portage 1.6.11, released 18 Oct 2001 -==================================== - - *portage.py; device nodes are now not unmerged at all. - - -Portage 1.6.10, released 18 Oct 2001 -=================================== - - *ebuild.sh: A and AA fix; now any A="foo" lines in the ebuild are ignored, - allowing ebuilds with them to continue working. - - *portage.py: remove gnome-apps, gnome-office, gnome-libs, add gnome-extra - categories. - - *ebuild.sh, portage.py: You can now use USE variables in SRC_URI to - conditionally include archives. In MAINTAINER mode, all archives are - automatically included so that maintainers can check SRC_URIs and also - generate complete digests. A new file-based DEPEND and RDEPEND-passing - mechanism has been added. - - *ebuild.sh Now adds filesize to the digest files - -Portage 1.6.9, released 15 Sep 2001 -=================================== - - *portage.py - unmerge() now does not touch device nodes. Unlinking them or touching them - in any way is bad practice. - - -Portage 1.6.8, released 12 Sep 2001 -=================================== - - *portage.py - movefile() will now unlink() destfile if it is a symlink. Should fix - problems where file gets created at symlink target rather than replacing - the symlink. - - *queryhost.sh (agriffis) - Parallel pinging and other fixes. - -Portage 1.6.7, released 05 Sep 2001 -=================================== - - *portage.py - (last-minute fix) - CONFIG_PROTECT unmerge protection is now observed for symlinks, fifos and - device nodes. - - *portage.py - Fixes for unmerging CONFIG_PROTECTed files. Protected files are now *not* - unlinked from the filesystem. Messier but safer, and simplifies package - upgrades. - - *emerge - Emerge output cleanups for GNU info directory generation. New --verbose - mode; new CONFIG_PROTECT scanning feature to let people know when there are - config files to be updated. New "--help config" docs to explain how to - do it. - -Portage 1.6.6, released 01 Sep 2001 -==================================== - - *portage.py - Upgraded directory merging over existing objects. Existing symlinks that - point to existing directories will be kept and used as is; directories will - be used as-is; any other objects (broken symlinks, files) will be copied - to origfilename.backup and a ne directory will be created in its place. - -Portage 1.6.5, released 31 Aug 2001 -==================================== - - *emerge - Fixes for handling multiple ebuilds, packages and/or dependencies on - the command-line. - - *portage.py - An optimization to the digraph class so that the firstzero() method finds - matches in close to the order that keys were added to the digraph. diff --git a/INSTALL b/INSTALL deleted file mode 100644 index 54caf7c..0000000 --- a/INSTALL +++ /dev/null @@ -1,229 +0,0 @@ -Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software -Foundation, Inc. - - This file is free documentation; the Free Software Foundation gives -unlimited permission to copy, distribute and modify it. - -Basic Installation -================== - - These are generic installation instructions. - - The `configure' shell script attempts to guess correct values for -various system-dependent variables used during compilation. It uses -those values to create a `Makefile' in each directory of the package. -It may also create one or more `.h' files containing system-dependent -definitions. Finally, it creates a shell script `config.status' that -you can run in the future to recreate the current configuration, and a -file `config.log' containing compiler output (useful mainly for -debugging `configure'). - - It can also use an optional file (typically called `config.cache' -and enabled with `--cache-file=config.cache' or simply `-C') that saves -the results of its tests to speed up reconfiguring. (Caching is -disabled by default to prevent problems with accidental use of stale -cache files.) - - If you need to do unusual things to compile the package, please try -to figure out how `configure' could check whether to do them, and mail -diffs or instructions to the address given in the `README' so they can -be considered for the next release. If you are using the cache, and at -some point `config.cache' contains results you don't want to keep, you -may remove or edit it. - - The file `configure.ac' (or `configure.in') is used to create -`configure' by a program called `autoconf'. You only need -`configure.ac' if you want to change it or regenerate `configure' using -a newer version of `autoconf'. - -The simplest way to compile this package is: - - 1. `cd' to the directory containing the package's source code and type - `./configure' to configure the package for your system. If you're - using `csh' on an old version of System V, you might need to type - `sh ./configure' instead to prevent `csh' from trying to execute - `configure' itself. - - Running `configure' takes awhile. While running, it prints some - messages telling which features it is checking for. - - 2. Type `make' to compile the package. - - 3. Optionally, type `make check' to run any self-tests that come with - the package. - - 4. Type `make install' to install the programs and any data files and - documentation. - - 5. You can remove the program binaries and object files from the - source code directory by typing `make clean'. To also remove the - files that `configure' created (so you can compile the package for - a different kind of computer), type `make distclean'. There is - also a `make maintainer-clean' target, but that is intended mainly - for the package's developers. If you use it, you may have to get - all sorts of other programs in order to regenerate files that came - with the distribution. - -Compilers and Options -===================== - - Some systems require unusual options for compilation or linking that -the `configure' script does not know about. Run `./configure --help' -for details on some of the pertinent environment variables. - - You can give `configure' initial values for configuration parameters -by setting variables in the command line or in the environment. Here -is an example: - - ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix - - *Note Defining Variables::, for more details. - -Compiling For Multiple Architectures -==================================== - - You can compile the package for more than one kind of computer at the -same time, by placing the object files for each architecture in their -own directory. To do this, you must use a version of `make' that -supports the `VPATH' variable, such as GNU `make'. `cd' to the -directory where you want the object files and executables to go and run -the `configure' script. `configure' automatically checks for the -source code in the directory that `configure' is in and in `..'. - - If you have to use a `make' that does not support the `VPATH' -variable, you have to compile the package for one architecture at a -time in the source code directory. After you have installed the -package for one architecture, use `make distclean' before reconfiguring -for another architecture. - -Installation Names -================== - - By default, `make install' will install the package's files in -`/usr/local/bin', `/usr/local/man', etc. You can specify an -installation prefix other than `/usr/local' by giving `configure' the -option `--prefix=PATH'. - - You can specify separate installation prefixes for -architecture-specific files and architecture-independent files. If you -give `configure' the option `--exec-prefix=PATH', the package will use -PATH as the prefix for installing programs and libraries. -Documentation and other data files will still use the regular prefix. - - In addition, if you use an unusual directory layout you can give -options like `--bindir=PATH' to specify different values for particular -kinds of files. Run `configure --help' for a list of the directories -you can set and what kinds of files go in them. - - If the package supports it, you can cause programs to be installed -with an extra prefix or suffix on their names by giving `configure' the -option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. - -Optional Features -================= - - Some packages pay attention to `--enable-FEATURE' options to -`configure', where FEATURE indicates an optional part of the package. -They may also pay attention to `--with-PACKAGE' options, where PACKAGE -is something like `gnu-as' or `x' (for the X Window System). The -`README' should mention any `--enable-' and `--with-' options that the -package recognizes. - - For packages that use the X Window System, `configure' can usually -find the X include and library files automatically, but if it doesn't, -you can use the `configure' options `--x-includes=DIR' and -`--x-libraries=DIR' to specify their locations. - -Specifying the System Type -========================== - - There may be some features `configure' cannot figure out -automatically, but needs to determine by the type of machine the package -will run on. Usually, assuming the package is built to be run on the -_same_ architectures, `configure' can figure that out, but if it prints -a message saying it cannot guess the machine type, give it the -`--build=TYPE' option. TYPE can either be a short name for the system -type, such as `sun4', or a canonical name which has the form: - - CPU-COMPANY-SYSTEM - -where SYSTEM can have one of these forms: - - OS KERNEL-OS - - See the file `config.sub' for the possible values of each field. If -`config.sub' isn't included in this package, then this package doesn't -need to know the machine type. - - If you are _building_ compiler tools for cross-compiling, you should -use the `--target=TYPE' option to select the type of system they will -produce code for. - - If you want to _use_ a cross compiler, that generates code for a -platform different from the build platform, you should specify the -"host" platform (i.e., that on which the generated programs will -eventually be run) with `--host=TYPE'. - -Sharing Defaults -================ - - If you want to set default values for `configure' scripts to share, -you can create a site shell script called `config.site' that gives -default values for variables like `CC', `cache_file', and `prefix'. -`configure' looks for `PREFIX/share/config.site' if it exists, then -`PREFIX/etc/config.site' if it exists. Or, you can set the -`CONFIG_SITE' environment variable to the location of the site script. -A warning: not all `configure' scripts look for a site script. - -Defining Variables -================== - - Variables not defined in a site shell script can be set in the -environment passed to `configure'. However, some packages may run -configure again during the build, and the customized values of these -variables may be lost. In order to avoid this problem, you should set -them in the `configure' command line, using `VAR=value'. For example: - - ./configure CC=/usr/local2/bin/gcc - -will cause the specified gcc to be used as the C compiler (unless it is -overridden in the site shell script). - -`configure' Invocation -====================== - - `configure' recognizes the following options to control how it -operates. - -`--help' -`-h' - Print a summary of the options to `configure', and exit. - -`--version' -`-V' - Print the version of Autoconf used to generate the `configure' - script, and exit. - -`--cache-file=FILE' - Enable the cache: use and save the results of the tests in FILE, - traditionally `config.cache'. FILE defaults to `/dev/null' to - disable caching. - -`--config-cache' -`-C' - Alias for `--cache-file=config.cache'. - -`--quiet' -`--silent' -`-q' - Do not print messages saying which checks are being made. To - suppress all normal output, redirect it to `/dev/null' (any error - messages will still be shown). - -`--srcdir=DIR' - Look for the package's source code in directory DIR. Usually - `configure' can determine that directory automatically. - -`configure' also accepts some other, not widely useful, options. Run -`configure --help' for more details. - @@ -1,6 +0,0 @@ -- pkg_setup and sandbox -^^^ either integrate useradd/groupadd hijacks, or just disable sandbox - for setup till it's ready to go. -- eclasses showing up in -vp -^^^ Not an issue. cleanse your cache, check the changelog. - diff --git a/Makefile.am b/Makefile.am deleted file mode 100644 index 51b6bc6..0000000 --- a/Makefile.am +++ /dev/null @@ -1,3 +0,0 @@ -SUBDIRS = src man bin pym - -AUTOMAKE_OPTIONS = dist-bzip2 no-dist-gzip @@ -1,57 +0,0 @@ -# TODO list for Portage; the Gentoo package system -# $Id: TODO,v 1.12 2005/05/04 01:08:11 vapier Exp $ - -# -# Add your name to the top of any item you are working actively on -# and then commit. Be sure you have a current copy of this file. -# - -Legend: - '*' Just do it. '#' Tricky - '!' Difficult '@' Restricted in some way - - File "/usr/lib/portage/pym/portage_locks.py", line 46, in lockfile - myfd = os.open(lockfilename, os.O_CREAT|os.O_RDWR,0660) - OSError: [Errno 13] Permission denied: '/var/tmp/portage/tmpfs/aux_db_key_temp' - - - - -* Clean should only produce output for 'emerge clean' - -# Stop using mtimes for packages. Have portage look up all files in the - vardb to ensure that a file isn't duplicated and unmerge it if not. - Potentially slow... Need some way to speed it up... hash of filenames? - -# Virtuals. /var/cache/edb/virtuals -- Effectively remove it. - /etc/portage/virtuals is a user-modifiable version that acts like an - incremental applied on top of an ON-DEMAND virtual calculation system. - Virtuals should be calculated from /var/db/pkg EVERY time it is requested. - -# Repoman needs to ignore all user-set info in /etc/portage - It's not relevant to deployed users and will probably be a general gotcha. - -# Multiple rsync repos. - bug 28796 -- Enable metadata caches for them. - -# STICKIES and related enhancements: - bug 9379, bug 13616, Aether's config code - -# Determine file lock status before starting downloads -- Prevent races/deletes - Patches exist for this. Integrate and find all colliding descriptors/cmds. - Create a fileIO layer? (wget and other external calls are a problem) - -* Add category support to searches... emerge -s @catgory - -@ rsync - track changes based in subtrees to reduce filetree expense. - Possible plans: - Use md5's of tree file list + md5 of subtree -- client-side burden. - Maintain hash of changes on rsync1 -- Server-side burden. ** - Implement CVSUP. ** - -# 'emerge sync' timestamp awareness -- Make sure IP is associated and not - used at random as servers may differ. bug 21794 - -! Rename all undocumented variables used in bash to prefixed values that - are not easy to accidently duplicate. Prevent ebuilds from clobbering - system variables. diff --git a/aclocal.m4 b/aclocal.m4 deleted file mode 100644 index ad8d501..0000000 --- a/aclocal.m4 +++ /dev/null @@ -1,908 +0,0 @@ -# generated automatically by aclocal 1.8.5 -*- Autoconf -*- - -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 -# Free Software Foundation, Inc. -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -# -*- Autoconf -*- -# Copyright (C) 2002, 2003 Free Software Foundation, Inc. -# Generated from amversion.in; do not edit by hand. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - -# AM_AUTOMAKE_VERSION(VERSION) -# ---------------------------- -# Automake X.Y traces this macro to ensure aclocal.m4 has been -# generated from the m4 files accompanying Automake X.Y. -AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.8"]) - -# AM_SET_CURRENT_AUTOMAKE_VERSION -# ------------------------------- -# Call AM_AUTOMAKE_VERSION so it can be traced. -# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. -AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], - [AM_AUTOMAKE_VERSION([1.8.5])]) - -# AM_AUX_DIR_EXPAND - -# Copyright (C) 2001, 2003 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets -# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to -# `$srcdir', `$srcdir/..', or `$srcdir/../..'. -# -# Of course, Automake must honor this variable whenever it calls a -# tool from the auxiliary directory. The problem is that $srcdir (and -# therefore $ac_aux_dir as well) can be either absolute or relative, -# depending on how configure is run. This is pretty annoying, since -# it makes $ac_aux_dir quite unusable in subdirectories: in the top -# source directory, any form will work fine, but in subdirectories a -# relative path needs to be adjusted first. -# -# $ac_aux_dir/missing -# fails when called from a subdirectory if $ac_aux_dir is relative -# $top_srcdir/$ac_aux_dir/missing -# fails if $ac_aux_dir is absolute, -# fails when called from a subdirectory in a VPATH build with -# a relative $ac_aux_dir -# -# The reason of the latter failure is that $top_srcdir and $ac_aux_dir -# are both prefixed by $srcdir. In an in-source build this is usually -# harmless because $srcdir is `.', but things will broke when you -# start a VPATH build or use an absolute $srcdir. -# -# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, -# iff we strip the leading $srcdir from $ac_aux_dir. That would be: -# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` -# and then we would define $MISSING as -# MISSING="\${SHELL} $am_aux_dir/missing" -# This will work as long as MISSING is not called from configure, because -# unfortunately $(top_srcdir) has no meaning in configure. -# However there are other variables, like CC, which are often used in -# configure, and could therefore not use this "fixed" $ac_aux_dir. -# -# Another solution, used here, is to always expand $ac_aux_dir to an -# absolute PATH. The drawback is that using absolute paths prevent a -# configured tree to be moved without reconfiguration. - -AC_DEFUN([AM_AUX_DIR_EXPAND], -[dnl Rely on autoconf to set up CDPATH properly. -AC_PREREQ([2.50])dnl -# expand $ac_aux_dir to an absolute path -am_aux_dir=`cd $ac_aux_dir && pwd` -]) - -# AM_CONDITIONAL -*- Autoconf -*- - -# Copyright (C) 1997, 2000, 2001, 2003 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -# serial 6 - -# AM_CONDITIONAL(NAME, SHELL-CONDITION) -# ------------------------------------- -# Define a conditional. -AC_DEFUN([AM_CONDITIONAL], -[AC_PREREQ(2.52)dnl - ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], - [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl -AC_SUBST([$1_TRUE]) -AC_SUBST([$1_FALSE]) -if $2; then - $1_TRUE= - $1_FALSE='#' -else - $1_TRUE='#' - $1_FALSE= -fi -AC_CONFIG_COMMANDS_PRE( -[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then - AC_MSG_ERROR([conditional "$1" was never defined. -Usually this means the macro was only invoked conditionally.]) -fi])]) - -# serial 7 -*- Autoconf -*- - -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 -# Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - - -# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be -# written in clear, in which case automake, when reading aclocal.m4, -# will think it sees a *use*, and therefore will trigger all it's -# C support machinery. Also note that it means that autoscan, seeing -# CC etc. in the Makefile, will ask for an AC_PROG_CC use... - - - -# _AM_DEPENDENCIES(NAME) -# ---------------------- -# See how the compiler implements dependency checking. -# NAME is "CC", "CXX", "GCJ", or "OBJC". -# We try a few techniques and use that to set a single cache variable. -# -# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was -# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular -# dependency, and given that the user is not expected to run this macro, -# just rely on AC_PROG_CC. -AC_DEFUN([_AM_DEPENDENCIES], -[AC_REQUIRE([AM_SET_DEPDIR])dnl -AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl -AC_REQUIRE([AM_MAKE_INCLUDE])dnl -AC_REQUIRE([AM_DEP_TRACK])dnl - -ifelse([$1], CC, [depcc="$CC" am_compiler_list=], - [$1], CXX, [depcc="$CXX" am_compiler_list=], - [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], - [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], - [depcc="$$1" am_compiler_list=]) - -AC_CACHE_CHECK([dependency style of $depcc], - [am_cv_$1_dependencies_compiler_type], -[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named `D' -- because `-MD' means `put the output - # in D'. - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub - - am_cv_$1_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` - fi - for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with - # Solaris 8's {/usr,}/bin/sh. - touch sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - - case $depmode in - nosideeffect) - # after this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested - if test "x$enable_dependency_tracking" = xyes; then - continue - else - break - fi - ;; - none) break ;; - esac - # We check with `-c' and `-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle `-M -o', and we need to detect this. - if depmode=$depmode \ - source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && - ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_$1_dependencies_compiler_type=$depmode - break - fi - fi - done - - cd .. - rm -rf conftest.dir -else - am_cv_$1_dependencies_compiler_type=none -fi -]) -AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) -AM_CONDITIONAL([am__fastdep$1], [ - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) -]) - - -# AM_SET_DEPDIR -# ------------- -# Choose a directory name for dependency files. -# This macro is AC_REQUIREd in _AM_DEPENDENCIES -AC_DEFUN([AM_SET_DEPDIR], -[AC_REQUIRE([AM_SET_LEADING_DOT])dnl -AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl -]) - - -# AM_DEP_TRACK -# ------------ -AC_DEFUN([AM_DEP_TRACK], -[AC_ARG_ENABLE(dependency-tracking, -[ --disable-dependency-tracking speeds up one-time build - --enable-dependency-tracking do not reject slow dependency extractors]) -if test "x$enable_dependency_tracking" != xno; then - am_depcomp="$ac_aux_dir/depcomp" - AMDEPBACKSLASH='\' -fi -AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) -AC_SUBST([AMDEPBACKSLASH]) -]) - -# Generate code to set up dependency tracking. -*- Autoconf -*- - -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -#serial 2 - -# _AM_OUTPUT_DEPENDENCY_COMMANDS -# ------------------------------ -AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], -[for mf in $CONFIG_FILES; do - # Strip MF so we end up with the name of the file. - mf=`echo "$mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named `Makefile.in', but - # some people rename them; so instead we look at the file content. - # Grep'ing the first line is not enough: some people post-process - # each Makefile.in and add a new line on top of each file to say so. - # So let's grep whole file. - if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then - dirpart=`AS_DIRNAME("$mf")` - else - continue - fi - grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue - # Extract the definition of DEP_FILES from the Makefile without - # running `make'. - DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` - test -z "$DEPDIR" && continue - # When using ansi2knr, U may be empty or an underscore; expand it - U=`sed -n 's/^U = //p' < "$mf"` - test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" - # We invoke sed twice because it is the simplest approach to - # changing $(DEPDIR) to its actual value in the expansion. - for file in `sed -n ' - /^DEP_FILES = .*\\\\$/ { - s/^DEP_FILES = // - :loop - s/\\\\$// - p - n - /\\\\$/ b loop - p - } - /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do - # Make sure the directory exists. - test -f "$dirpart/$file" && continue - fdir=`AS_DIRNAME(["$file"])` - AS_MKDIR_P([$dirpart/$fdir]) - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" - done -done -])# _AM_OUTPUT_DEPENDENCY_COMMANDS - - -# AM_OUTPUT_DEPENDENCY_COMMANDS -# ----------------------------- -# This macro should only be invoked once -- use via AC_REQUIRE. -# -# This code is only required when automatic dependency tracking -# is enabled. FIXME. This creates each `.P' file that we will -# need in order to bootstrap the dependency handling code. -AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], -[AC_CONFIG_COMMANDS([depfiles], - [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], - [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) -]) - -# Do all the work for Automake. -*- Autoconf -*- - -# This macro actually does too much some checks are only needed if -# your package does certain things. But this isn't really a big deal. - -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 -# Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -# serial 11 - -# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) -# AM_INIT_AUTOMAKE([OPTIONS]) -# ----------------------------------------------- -# The call with PACKAGE and VERSION arguments is the old style -# call (pre autoconf-2.50), which is being phased out. PACKAGE -# and VERSION should now be passed to AC_INIT and removed from -# the call to AM_INIT_AUTOMAKE. -# We support both call styles for the transition. After -# the next Automake release, Autoconf can make the AC_INIT -# arguments mandatory, and then we can depend on a new Autoconf -# release and drop the old call support. -AC_DEFUN([AM_INIT_AUTOMAKE], -[AC_PREREQ([2.58])dnl -dnl Autoconf wants to disallow AM_ names. We explicitly allow -dnl the ones we care about. -m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl -AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl -AC_REQUIRE([AC_PROG_INSTALL])dnl -# test to see if srcdir already configured -if test "`cd $srcdir && pwd`" != "`pwd`" && - test -f $srcdir/config.status; then - AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) -fi - -# test whether we have cygpath -if test -z "$CYGPATH_W"; then - if (cygpath --version) >/dev/null 2>/dev/null; then - CYGPATH_W='cygpath -w' - else - CYGPATH_W=echo - fi -fi -AC_SUBST([CYGPATH_W]) - -# Define the identity of the package. -dnl Distinguish between old-style and new-style calls. -m4_ifval([$2], -[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl - AC_SUBST([PACKAGE], [$1])dnl - AC_SUBST([VERSION], [$2])], -[_AM_SET_OPTIONS([$1])dnl - AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl - AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl - -_AM_IF_OPTION([no-define],, -[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) - AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl - -# Some tools Automake needs. -AC_REQUIRE([AM_SANITY_CHECK])dnl -AC_REQUIRE([AC_ARG_PROGRAM])dnl -AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) -AM_MISSING_PROG(AUTOCONF, autoconf) -AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) -AM_MISSING_PROG(AUTOHEADER, autoheader) -AM_MISSING_PROG(MAKEINFO, makeinfo) -AM_MISSING_PROG(AMTAR, tar) -AM_PROG_INSTALL_SH -AM_PROG_INSTALL_STRIP -AC_REQUIRE([AM_PROG_MKDIR_P])dnl -# We need awk for the "check" target. The system "awk" is bad on -# some platforms. -AC_REQUIRE([AC_PROG_AWK])dnl -AC_REQUIRE([AC_PROG_MAKE_SET])dnl -AC_REQUIRE([AM_SET_LEADING_DOT])dnl - -_AM_IF_OPTION([no-dependencies],, -[AC_PROVIDE_IFELSE([AC_PROG_CC], - [_AM_DEPENDENCIES(CC)], - [define([AC_PROG_CC], - defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl -AC_PROVIDE_IFELSE([AC_PROG_CXX], - [_AM_DEPENDENCIES(CXX)], - [define([AC_PROG_CXX], - defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl -]) -]) - - -# When config.status generates a header, we must update the stamp-h file. -# This file resides in the same directory as the config header -# that is generated. The stamp files are numbered to have different names. - -# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the -# loop where config.status creates the headers, so we can generate -# our stamp files there. -AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], -[# Compute $1's index in $config_headers. -_am_stamp_count=1 -for _am_header in $config_headers :; do - case $_am_header in - $1 | $1:* ) - break ;; - * ) - _am_stamp_count=`expr $_am_stamp_count + 1` ;; - esac -done -echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) - -# AM_PROG_INSTALL_SH -# ------------------ -# Define $install_sh. - -# Copyright (C) 2001, 2003 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -AC_DEFUN([AM_PROG_INSTALL_SH], -[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -install_sh=${install_sh-"$am_aux_dir/install-sh"} -AC_SUBST(install_sh)]) - -# -*- Autoconf -*- -# Copyright (C) 2003 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -# serial 1 - -# Check whether the underlying file-system supports filenames -# with a leading dot. For instance MS-DOS doesn't. -AC_DEFUN([AM_SET_LEADING_DOT], -[rm -rf .tst 2>/dev/null -mkdir .tst 2>/dev/null -if test -d .tst; then - am__leading_dot=. -else - am__leading_dot=_ -fi -rmdir .tst 2>/dev/null -AC_SUBST([am__leading_dot])]) - -# Check to see how 'make' treats includes. -*- Autoconf -*- - -# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -# serial 2 - -# AM_MAKE_INCLUDE() -# ----------------- -# Check to see how make treats includes. -AC_DEFUN([AM_MAKE_INCLUDE], -[am_make=${MAKE-make} -cat > confinc << 'END' -am__doit: - @echo done -.PHONY: am__doit -END -# If we don't find an include directive, just comment out the code. -AC_MSG_CHECKING([for style of include used by $am_make]) -am__include="#" -am__quote= -_am_result=none -# First try GNU make style include. -echo "include confinc" > confmf -# We grep out `Entering directory' and `Leaving directory' -# messages which can occur if `w' ends up in MAKEFLAGS. -# In particular we don't look at `^make:' because GNU make might -# be invoked under some other name (usually "gmake"), in which -# case it prints its new name instead of `make'. -if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then - am__include=include - am__quote= - _am_result=GNU -fi -# Now try BSD make style include. -if test "$am__include" = "#"; then - echo '.include "confinc"' > confmf - if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then - am__include=.include - am__quote="\"" - _am_result=BSD - fi -fi -AC_SUBST([am__include]) -AC_SUBST([am__quote]) -AC_MSG_RESULT([$_am_result]) -rm -f confinc confmf -]) - -# -*- Autoconf -*- - - -# Copyright (C) 1997, 1999, 2000, 2001, 2003 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -# serial 3 - -# AM_MISSING_PROG(NAME, PROGRAM) -# ------------------------------ -AC_DEFUN([AM_MISSING_PROG], -[AC_REQUIRE([AM_MISSING_HAS_RUN]) -$1=${$1-"${am_missing_run}$2"} -AC_SUBST($1)]) - - -# AM_MISSING_HAS_RUN -# ------------------ -# Define MISSING if not defined so far and test if it supports --run. -# If it does, set am_missing_run to use it, otherwise, to nothing. -AC_DEFUN([AM_MISSING_HAS_RUN], -[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" -# Use eval to expand $SHELL -if eval "$MISSING --run true"; then - am_missing_run="$MISSING --run " -else - am_missing_run= - AC_MSG_WARN([`missing' script is too old or missing]) -fi -]) - -# AM_PROG_MKDIR_P -# --------------- -# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise. - -# Copyright (C) 2003, 2004 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories -# created by `make install' are always world readable, even if the -# installer happens to have an overly restrictive umask (e.g. 077). -# This was a mistake. There are at least two reasons why we must not -# use `-m 0755': -# - it causes special bits like SGID to be ignored, -# - it may be too restrictive (some setups expect 775 directories). -# -# Do not use -m 0755 and let people choose whatever they expect by -# setting umask. -# -# We cannot accept any implementation of `mkdir' that recognizes `-p'. -# Some implementations (such as Solaris 8's) are not thread-safe: if a -# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c' -# concurrently, both version can detect that a/ is missing, but only -# one can create it and the other will error out. Consequently we -# restrict ourselves to GNU make (using the --version option ensures -# this.) -AC_DEFUN([AM_PROG_MKDIR_P], -[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then - # Keeping the `.' argument allows $(mkdir_p) to be used without - # argument. Indeed, we sometimes output rules like - # $(mkdir_p) $(somedir) - # where $(somedir) is conditionally defined. - # (`test -n '$(somedir)' && $(mkdir_p) $(somedir)' is a more - # expensive solution, as it forces Make to start a sub-shell.) - mkdir_p='mkdir -p -- .' -else - # On NextStep and OpenStep, the `mkdir' command does not - # recognize any option. It will interpret all options as - # directories to create, and then abort because `.' already - # exists. - for d in ./-p ./--version; - do - test -d $d && rmdir $d - done - # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. - if test -f "$ac_aux_dir/mkinstalldirs"; then - mkdir_p='$(mkinstalldirs)' - else - mkdir_p='$(install_sh) -d' - fi -fi -AC_SUBST([mkdir_p])]) - -# Helper functions for option handling. -*- Autoconf -*- - -# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -# serial 2 - -# _AM_MANGLE_OPTION(NAME) -# ----------------------- -AC_DEFUN([_AM_MANGLE_OPTION], -[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) - -# _AM_SET_OPTION(NAME) -# ------------------------------ -# Set option NAME. Presently that only means defining a flag for this option. -AC_DEFUN([_AM_SET_OPTION], -[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) - -# _AM_SET_OPTIONS(OPTIONS) -# ---------------------------------- -# OPTIONS is a space-separated list of Automake options. -AC_DEFUN([_AM_SET_OPTIONS], -[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) - -# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) -# ------------------------------------------- -# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. -AC_DEFUN([_AM_IF_OPTION], -[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) - -# -# Check to make sure that the build environment is sane. -# - -# Copyright (C) 1996, 1997, 2000, 2001, 2003 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -# serial 3 - -# AM_SANITY_CHECK -# --------------- -AC_DEFUN([AM_SANITY_CHECK], -[AC_MSG_CHECKING([whether build environment is sane]) -# Just in case -sleep 1 -echo timestamp > conftest.file -# Do `set' in a subshell so we don't clobber the current shell's -# arguments. Must try -L first in case configure is actually a -# symlink; some systems play weird games with the mod time of symlinks -# (eg FreeBSD returns the mod time of the symlink's containing -# directory). -if ( - set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` - if test "$[*]" = "X"; then - # -L didn't work. - set X `ls -t $srcdir/configure conftest.file` - fi - rm -f conftest.file - if test "$[*]" != "X $srcdir/configure conftest.file" \ - && test "$[*]" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken -alias in your environment]) - fi - - test "$[2]" = conftest.file - ) -then - # Ok. - : -else - AC_MSG_ERROR([newly created file is older than distributed files! -Check your system clock]) -fi -AC_MSG_RESULT(yes)]) - -# AM_PROG_INSTALL_STRIP - -# Copyright (C) 2001, 2003 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -# One issue with vendor `install' (even GNU) is that you can't -# specify the program used to strip binaries. This is especially -# annoying in cross-compiling environments, where the build's strip -# is unlikely to handle the host's binaries. -# Fortunately install-sh will honor a STRIPPROG variable, so we -# always use install-sh in `make install-strip', and initialize -# STRIPPROG with the value of the STRIP variable (set by the user). -AC_DEFUN([AM_PROG_INSTALL_STRIP], -[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl -# Installed binaries are usually stripped using `strip' when the user -# run `make install-strip'. However `strip' might not be the right -# tool to use in cross-compilation environments, therefore Automake -# will honor the `STRIP' environment variable to overrule this program. -dnl Don't test for $cross_compiling = yes, because it might be `maybe'. -if test "$cross_compiling" != no; then - AC_CHECK_TOOL([STRIP], [strip], :) -fi -INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" -AC_SUBST([INSTALL_STRIP_PROGRAM])]) - diff --git a/autogen.sh b/autogen.sh deleted file mode 100755 index c0f5302..0000000 --- a/autogen.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -autoheader || exit 1 -aclocal-1.8 || exit 1 -libtoolize --automake -c -f || exit 1 -autoconf || exit 1 -automake-1.8 -a -c || exit 1 - -if [ -x ./test.sh ] ; then - exec ./test.sh "$@" -fi diff --git a/bin/Makefile.in b/bin/Makefile.in deleted file mode 100755 index f98bae3..0000000 --- a/bin/Makefile.in +++ /dev/null @@ -1,15 +0,0 @@ -PORTAGE_BASEDIR = @PORTAGE_BASE@ -INSTALL = @INSTALL@ -INSTALL_script = @INSTALL_PROGRAM@ -D -o 0 -g portage -m 755 - -all: -install: - $(INSTALL) -d -m 755 -o 0-g portage $(DESTDIR)/$(PORTAGE_BASEDIR)/bin || exit 1 - find . -type f -maxdepth 1 -exec $(INSTALL_script) {} $(DESTDIR)/$(PORTAGE_BASEDIR)/bin/{} \; || exit 1 - rm $(DESTDIR)/$(PORTAGE_BASEDIR)/bin/Makefile* || exit 1 - -distdir: - find . -type f -maxdepth 1 -exec $(INSTALL_script) {} $(distdir)/{} \; -clean: - -.PHONY: distdir install clean diff --git a/bin/affect-fakeroot-perms.sh b/bin/affect-fakeroot-perms.sh deleted file mode 100644 index af643dc..0000000 --- a/bin/affect-fakeroot-perms.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash -# affect-fakeroot-perms.sh; Make claimed fakeroot permissions, a reality. -# Copyright 2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -$Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/affect-fakeroot-perms.sh,v 1.4 2004/11/10 20:08:07 ferringb Exp $ - - -echo "adjusting $2 using $1" >&2 -fakeroot -i "$1" -- find "$2" -exec stat -c '%u:%g;%f=%n' {} \; | \ -while read l; do - o="${l/;*}" - r="${l/${o}}" - p="${r/=*}" - p="${p:1}" - p="$(printf %o 0x${p})" - p="${p:${#p}-4}" - f="${r/*=}" - chown "$o" "$f" - chmod "$p" "$f" - echo "tweaking $f" - done diff --git a/bin/archive-conf b/bin/archive-conf deleted file mode 100755 index e2cdfa1..0000000 --- a/bin/archive-conf +++ /dev/null @@ -1,101 +0,0 @@ -#!/usr/bin/python -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/archive-conf,v 1.7 2004/10/04 13:57:36 vapier Exp $ - -# -# archive-conf -- save off a config file in the dispatch-conf archive dir -# -# Written by Wayne Davison <gentoo@blorf.net> with code snagged from -# Jeremy Wohl's dispatch-conf script and the portage chkcontents script. -# - -import os, sys, string -sys.path = ["/usr/lib/portage/pym"]+sys.path - -import portage, dispatch_conf - -FIND_EXTANT_CONTENTS = "find %s -name CONTENTS" - -MANDATORY_OPTS = [ 'archive-dir' ] - -try: - import fchksum - def perform_checksum(filename): return fchksum.fmd5t(filename) -except ImportError: - import md5 - def md5_to_hex(md5sum): - hexform = "" - for ix in xrange(len(md5sum)): - hexform = hexform + "%02x" % ord(md5sum[ix]) - return string.lower(hexform) - - def perform_checksum(filename): - f = open(filename, 'rb') - blocksize=32768 - data = f.read(blocksize) - size = 0L - sum = md5.new() - while data: - sum.update(data) - size = size + len(data) - data = f.read(blocksize) - return (md5_to_hex(sum.digest()),size) - -def archive_conf(): - args = [] - content_files = [] - md5_match_hash = {} - - options = dispatch_conf.read_config(MANDATORY_OPTS) - - for conf in sys.argv[1:]: - if not os.path.isabs(conf): - conf = os.path.abspath(conf) - args += [ conf ] - md5_match_hash[conf] = '' - - # Find all the CONTENT files in VDB_PATH. - content_files += os.popen(FIND_EXTANT_CONTENTS % (portage.root+portage.VDB_PATH)).readlines() - - # Search for the saved md5 checksum of all the specified config files - # and see if the current file is unmodified or not. - try: - todo_cnt = len(args) - for file in content_files: - file = file.rstrip() - try: - contents = open(file, "r") - except IOError, e: - print >> sys.stderr, 'archive-conf: Unable to open %s: %s' % (file, e) - sys.exit(1) - lines = contents.readlines() - for line in lines: - items = string.split(line) - if items[0] == 'obj': - for conf in args: - if items[1] == conf: - stored = string.lower(items[2]) - real = string.lower(perform_checksum(conf)[0]) - if stored == real: - md5_match_hash[conf] = conf - todo_cnt -= 1 - if todo_cnt == 0: - raise "Break" - except "Break": - pass - - for conf in args: - archive = os.path.join(options['archive-dir'], conf.lstrip('/')) - if options['use-rcs'] == 'yes': - dispatch_conf.rcs_archive(archive, conf, md5_match_hash[conf], '') - dispatch_conf.rcs_archive_post_process(archive) - else: - dispatch_conf.file_archive(archive, conf, md5_match_hash[conf], '') - dispatch_conf.file_archive_post_process(archive) - -# run -if len(sys.argv) > 1: - archive_conf() -else: - print >> sys.stderr, 'Usage: archive-conf /CONFIG/FILE [/CONFIG/FILE...]' diff --git a/bin/chkcontents b/bin/chkcontents deleted file mode 100755 index 0b643cf..0000000 --- a/bin/chkcontents +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/python -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/chkcontents,v 1.11 2004/10/04 13:56:50 vapier Exp $ - -# Very simple program to compare the md5sums of a package as listed -# in VDB_PATH/category/package/CONTENTS with the md5sums of the -# actual programs on the system (and makes sure that symlinks point to -# the right files). - -import string, os.path, os, sys -sys.path = ["/usr/lib/portage/pym"]+sys.path -import portage - -def CONTENTScheck(path): - try: - contents = open(path, "r") - except IOError, e: - print "Unable to open %s: %s" % (path, e) - sys.exit(1) - lines = contents.readlines() - for line in lines: - items = string.split(line) - # items is a list w/ size depending on the type of item listed in item[0] - # if items[0] = 'dir' then items[1] is the path of a directory - # if items[0] = 'obj' then items[1] is the path of a file, - # items[2] is the file's md5sum, - # items[3] is the file's size - # if items[0] = 'sym' then items[1] is the path of a symbolic link, - # items[2] is '->' - # items[3] is the file the symlink should point to - # items[4] is the symlink mtime - if (items[0] == 'obj'): - md5stored = string.lower(items[2]) - # fchksum.fmdft(file) returns the file's md5sum and the file's size - md5real = string.lower(portage.perform_checksum(items[1])[0]) - if (md5stored != md5real): - if md5real: - print "%s has md5sum of %s instead of %s" % (items[1], md5real, md5stored) - else: - print "%s is missing!" % items[1] - elif (items[0] == 'sym'): - link = items[1] - target = items[3] - if (not os.path.islink(link)): - print "%s is not a symbolic link" % link - continue - actualtarget = os.readlink(link) - if (os.path.normpath(actualtarget) != os.path.normpath(target)): - print "%s points to %s, not %s" % (link, actualtarget, target) - - -if __name__ == '__main__': - import sys - if (len(sys.argv) != 2 or sys.argv[1] == "--help"): - print "This program compares md5sums in the file VDB_PATH/category/package/CONTENTS" - print "with the md5sums of the actual files on the filesystem" - print "(and makes sure that symlinks point to the right files)." - print "\nUsage: chkcontents path/to/CONTENTS" - sys.exit(1) - CONTENTScheck(sys.argv[1]) - diff --git a/bin/clean_locks b/bin/clean_locks deleted file mode 100755 index 7e47232..0000000 --- a/bin/clean_locks +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/python -O -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/clean_locks,v 1.1 2004/09/26 10:44:31 carpaski Exp $ - -import os,sys -sys.path = ["/usr/lib/portage/pym"]+sys.path - -import portage_locks - -if not sys.argv[1:] or "--help" in sys.argv or "-h" in sys.argv: - print - print "You must specify directories with hardlink-locks to clean." - print "You may optionally specify --force, which will remove all" - print "of the locks, even if we can't establish if they are in use." - print "Please attempt cleaning without force first." - print - print sys.argv[0]+" /usr/portage/distfiles/.locks" - print sys.argv[0]+" --force /usr/portage/distfiles/.locks" - print - sys.exit(1) - -force = False -if "--force" in sys.argv[1:]: - force=True - -for x in sys.argv[1:]: - if x == "--force": - continue - for y in portage_locks.hardlock_cleanup(x, remove_all_locks=force): - print y - print - - - -
\ No newline at end of file diff --git a/bin/db-update.py b/bin/db-update.py deleted file mode 100644 index a0d4a5e..0000000 --- a/bin/db-update.py +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/python -O -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/db-update.py,v 1.10 2004/11/10 03:10:56 genone Exp $ - -import os,sys,string -sys.path = ["/usr/lib/portage/pym"]+sys.path - -import portage - -os.chdir(portage.root+portage.VDB_PATH) -myvirts=portage.grabdict(portage.root+"var/cache/edb/virtuals") -mypvirts={} -if portage.profiledir: - mypvirts=portage.grabdict(portage.profiledir+"/virtuals") -mydict={} -myvalidargs=[] -origkey={} -for x in sys.argv[1:]: - myparts=string.split(x,"/") - x=myparts[1]+"/"+myparts[2] - try: - myfile=open(x+"/VIRTUAL","r") - except SystemExit, e: - raise # Needed else the app won't quit - except: - continue - myline=myfile.readline() - mykey=string.join(string.split(myline)) - if portage.isspecific(x): - mysplit=portage.portage_versions.catpkgsplit(x) - newkey=mysplit[0]+"/"+mysplit[1] - origkey[newkey]=x - x=newkey - else: - origkey[x]=x - if portage.isspecific(mykey): - mysplit=portage.portage_versions.catpkgsplit(mykey) - mykey=mysplit[0]+"/"+mysplit[1] - myvalidargs.append(x) - mydict[x]=mykey -for x in mydict.keys(): - if mypvirts.has_key(x) and len(mypvirts[x])>=1 and mypvirts[x][0]==mydict[x]: - #this is a default setting; don't record - continue - if myvirts.has_key(x): - if mydict[x] not in myvirts[x]: - myvirts[x][0:0]=[mydict[x]] - else: - myvirts[x]=[mydict[x]] -print ">>> Database upgrade..." -print ">>> Writing out new virtuals file..." -portage.writedict(myvirts,portage.root+"var/cache/edb/virtuals") -if not os.path.exists("/tmp/db-upgrade-bak"): - os.mkdir("/tmp/db-upgrade-bak") -print ">>> Backing up to /tmp/db-upgrade-bak..." -for myarg in myvalidargs: - print ">>> Backing up",portage.root+portage.VDB_PATH+"/"+origkey[myarg] - os.system("mv "+portage.root+portage.VDB_PATH+"/"+origkey[myarg]+" /tmp/db-upgrade-bak") -print ">>> Done." diff --git a/bin/dispatch-conf b/bin/dispatch-conf deleted file mode 100755 index 46b75a4..0000000 --- a/bin/dispatch-conf +++ /dev/null @@ -1,311 +0,0 @@ -#!/usr/bin/python -O -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/dispatch-conf,v 1.16 2005/06/04 11:15:12 jstubbs Exp $ - -# -# dispatch-conf -- Integrate modified configs, post-emerge -# -# Jeremy Wohl (http://igmus.org) -# -# TODO -# dialog menus -# - -from stat import * -from random import * -import os, shutil, sys, string, re, commands, atexit -sys.path = ["/usr/lib/portage/pym"]+sys.path - -import portage, dispatch_conf - -FIND_EXTANT_CONFIGS = "find %s/ -iname '._cfg????_*' | sed -e 's://:/:g'" -DIFF_CONTENTS = 'diff -Nu %s %s' -DIFF_CVS_INTERP = 'diff -Nu %s %s | grep "^[+-][^+-]" | grep -v "# .Header:.*"' -DIFF_WSCOMMENTS = 'diff -Nu %s %s | grep "^[+-][^+-]" | grep -v "^[-+]#" | grep -v "^[-+][:space:]*$"' - -# We need a secure scratch dir and python does silly verbose errors on the use of tempnam -oldmask = os.umask(0077) -SCRATCH_DIR = None -while SCRATCH_DIR is None: - try: - mydir = "/tmp/dispatch-conf." - for x in range(0,8): - if int(random() * 3) == 0: - mydir += chr(int(65+random()*26.0)) - elif int(random() * 2) == 0: - mydir += chr(int(97+random()*26.0)) - else: - mydir += chr(int(48+random()*10.0)) - if os.path.exists(mydir): - continue - os.mkdir(mydir) - SCRATCH_DIR = mydir - except OSError, e: - if e.errno != 17: - raise -os.umask(oldmask) - -# Ensure the scratch dir is deleted -def cleanup(mydir=SCRATCH_DIR): - shutil.rmtree(mydir) -atexit.register(cleanup) - -MANDATORY_OPTS = [ 'archive-dir', 'diff', 'replace-cvs', 'replace-wscomments', 'merge' ] - -class dispatch: - options = {} - - def grind (self, config_paths): - confs = [] - count = 0 - - - self.options = dispatch_conf.read_config(MANDATORY_OPTS) - - if self.options.has_key("log-file"): - if os.path.exists(self.options["log-file"]): - shutil.copyfile(self.options["log-file"], self.options["log-file"] + '.old') - os.remove(self.options["log-file"]) - else: - self.options["log-file"] = "/dev/null" - - # - # Build list of extant configs - # - - for path in config_paths.split (): - if not os.path.exists (path): - continue - - confs += self.massage (os.popen (FIND_EXTANT_CONFIGS % (path,)).readlines ()) - - if self.options['use-rcs'] == 'yes' and ((os.system( "which rcs >/dev/null 2>&1" ) == 256) - or (os.system( "which ci >/dev/null 2>&1" ) == 256) - or (os.system( "which co >/dev/null 2>&1" ) == 256) - or (os.system( "which rcsmerge >/dev/null 2>&1" ) == 256)): - print >> sys.stderr, 'dispatch-conf: Error finding all RCS utils and use-rcs=yes in config; fatal' - return False - - - # - # Remove new configs identical to current - # and - # Auto-replace configs a) whose differences are simply CVS interpolations, - # or b) whose differences are simply ws or comments, - # or c) in paths now unprotected by CONFIG_PROTECT_MASK, - # - - def f (conf): - mrgconf = re.sub(r'\._cfg', '._mrg', conf['new']) - archive = os.path.join(self.options['archive-dir'], conf['current'].lstrip('/')) - if self.options['use-rcs'] == 'yes': - mrgfail = dispatch_conf.rcs_archive(archive, conf['current'], conf['new'], mrgconf) - else: - mrgfail = dispatch_conf.file_archive(archive, conf['current'], conf['new'], mrgconf) - if os.path.exists(archive + '.dist'): - unmodified = len(commands.getoutput(DIFF_CONTENTS % (conf['current'], archive + '.dist'))) == 0 - else: - unmodified = 0 - if os.path.exists(mrgconf): - if mrgfail or len(commands.getoutput(DIFF_CONTENTS % (conf['new'], mrgconf))) == 0: - os.unlink(mrgconf) - newconf = conf['new'] - else: - newconf = mrgconf - else: - newconf = conf['new'] - - same_file = len(commands.getoutput (DIFF_CONTENTS % (conf ['current'], newconf))) == 0 - same_cvs = len(commands.getoutput (DIFF_CVS_INTERP % (conf ['current'], newconf))) == 0 - same_wsc = len(commands.getoutput (DIFF_WSCOMMENTS % (conf ['current'], newconf))) == 0 - - # Do options permit? - same_cvs = same_cvs and self.options['replace-cvs'] == 'yes' - same_wsc = same_wsc and self.options['replace-wscomments'] == 'yes' - unmodified = unmodified and self.options['replace-unmodified'] == 'yes' - - if same_file: - os.unlink (conf ['new']) - self.post_process(conf['current']) - if os.path.exists(mrgconf): - os.unlink(mrgconf) - return False - elif unmodified or same_cvs or same_wsc or conf ['dir'] in portage.settings ['CONFIG_PROTECT_MASK'].split (): - self.replace(newconf, conf['current']) - self.post_process(conf['current']) - if newconf == mrgconf: - os.unlink(conf['new']) - elif os.path.exists(mrgconf): - os.unlink(mrgconf) - return False - else: - return True - - confs = filter (f, confs) - - # - # Interactively process remaining - # - - for conf in confs: - count = count + 1 - - newconf = conf['new'] - mrgconf = re.sub(r'\._cfg', '._mrg', newconf) - if os.path.exists(mrgconf): - newconf = mrgconf - show_new_diff = 0 - - while 1: - if show_new_diff: - os.system((self.options['diff']) % (conf['new'], mrgconf)) - show_new_diff = 0 - else: - os.system((self.options['diff']) % (conf['current'], newconf)) - - print - print '>> (%i of %i) -- %s' % (count, len(confs), conf ['current']) - print '>> q quit, h help, n next, e edit-new, z zap-new, u use-new\n m merge, t toggle-merge, l look-merge: ', - - c = getch () - - if c == 'q': - sys.exit (0) - if c == 'h': - self.do_help () - continue - elif c == 't': - if newconf == mrgconf: - newconf = conf['new'] - elif os.path.exists(mrgconf): - newconf = mrgconf - continue - elif c == 'n': - break - elif c == 'm': - merged = SCRATCH_DIR+"/"+os.path.basename(conf['current']) - print - os.system (self.options['merge'] % (merged, conf ['current'], newconf)) - shutil.copyfile(merged, mrgconf) - os.remove(merged) - mystat = os.lstat(conf['new']) - os.chmod(mrgconf, mystat[ST_MODE]) - os.chown(mrgconf, mystat[ST_UID], mystat[ST_GID]) - newconf = mrgconf - continue - elif c == 'l': - show_new_diff = 1 - continue - elif c == 'e': - os.system(os.environ['EDITOR'] + ' ' + newconf) - continue - elif c == 'z': - os.unlink(conf['new']) - if os.path.exists(mrgconf): - os.unlink(mrgconf) - break - elif c == 'u': - self.replace(newconf, conf ['current']) - self.post_process(conf['current']) - if newconf == mrgconf: - os.unlink(conf['new']) - elif os.path.exists(mrgconf): - os.unlink(mrgconf) - break - else: - continue - - - def replace (self, newconf, curconf): - """Replace current config with the new/merged version. Also logs - the diff of what changed into the configured log file.""" - os.system((DIFF_CONTENTS % (curconf, newconf)) + '>>' + self.options["log-file"]) - try: - shutil.copyfile(newconf, curconf) - os.remove(newconf) - except (IOError, os.error), why: - print >> sys.stderr, 'dispatch-conf: Error renaming %s to %s: %s; fatal' % \ - (newconf, curconf, str(why)) - - - def post_process(self, curconf): - archive = os.path.join(self.options['archive-dir'], curconf.lstrip('/')) - if self.options['use-rcs'] == 'yes': - dispatch_conf.rcs_archive_post_process(archive) - else: - dispatch_conf.file_archive_post_process(archive) - - - def massage (self, newconfigs): - """Sort, rstrip, remove old versions, break into triad hash. - - Triad is dictionary of current (/etc/make.conf), new (/etc/._cfg0003_make.conf) - and dir (/etc). - - We keep ._cfg0002_conf over ._cfg0001_conf and ._cfg0000_conf. - """ - h = {} - - newconfigs.sort () - - for nconf in newconfigs: - nconf = nconf.rstrip () - conf = re.sub (r'\._cfg\d+_', '', nconf) - dir = re.match (r'^(.+)/', nconf).group (1) - - if h.has_key (conf): - mrgconf = re.sub(r'\._cfg', '._mrg', h[conf]['new']) - if os.path.exists(mrgconf): - os.unlink(mrgconf) - os.unlink(h[conf]['new']) - - h [conf] = { 'current' : conf, 'dir' : dir, 'new' : nconf } - - configs = h.values () - configs.sort (lambda a, b: cmp(a ['current'], b ['current'])) - - return configs - - - def do_help (self): - print; print - - print ' u -- update current config with new config and continue' - print ' z -- zap (delete) new config and continue' - print ' n -- skip to next config, leave all intact' - print ' e -- edit new config' - print ' m -- interactively merge current and new configs' - print ' l -- look at diff between pre-merged and merged configs' - print ' t -- toggle new config between merged and pre-merged state' - print ' h -- this screen' - print ' q -- quit' - - print; print 'press any key to return to diff...', - - getch () - - -def getch (): - # from ASPN - Danny Yoo - # - import sys, tty, termios - - fd = sys.stdin.fileno() - old_settings = termios.tcgetattr(fd) - try: - tty.setraw(sys.stdin.fileno()) - ch = sys.stdin.read(1) - finally: - termios.tcsetattr(fd, termios.TCSADRAIN, old_settings) - return ch - - -# run -d = dispatch () - -if len(sys.argv) > 1: - # for testing - d.grind (string.join (sys.argv [1:])) -else: - d.grind (portage.settings ['CONFIG_PROTECT']) diff --git a/bin/dispatch-conf-dialog b/bin/dispatch-conf-dialog deleted file mode 100755 index 2447e3a..0000000 --- a/bin/dispatch-conf-dialog +++ /dev/null @@ -1,287 +0,0 @@ -#!/usr/bin/python -O -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/dispatch-conf-dialog,v 1.3 2004/10/04 13:56:50 vapier Exp $ - -# -# dispatch-conf-dialog -- Integrate modified configs, post-emerge -# using a simple dialog interface... -# -# Jeremy Wohl (http://igmus.org) -# -# TODO -# dialog menus -# -import os, shutil, sys, string, re, commands -sys.path = ["/usr/lib/portage/pym"]+sys.path - -from stat import * -import portage, dispatch_conf - -from dcdialog import * - -from commands import * - -FIND_EXTANT_CONFIGS = "find %s -iname '._cfg????_*'" -DIFF_CONTENTS = 'diff -Nau %s %s' -DIFF_CVS_INTERP = 'diff -Nau %s %s | grep "^[+-][^+-]" | grep -v "# .Header:.*"' -DIFF_WSCOMMENTS = 'diff -Nau %s %s | grep "^[+-][^+-]" | grep -v "^[-+]#" | grep -v "^[-+][:space:]*$"' -MERGE = 'sdiff --suppress-common-lines --output=%s %s %s' - -LOG_CHANGES_TO = '/tmp/dispatch-conf.changes' - -MANDATORY_OPTS = [ 'archive-dir', 'diff', 'pager', 'replace-cvs', 'replace-wscomments' ] - -ITEMS = ['u','z','n','e', 'm','l','t','q'] -LONG_ITEMS = [ 'update current config with new config and continue', 'zap (delete) new config and continue', 'skip to next config, leave all intact','edit new config','interactively merge current and new configs','look at diff between pre-merged and merged configs','toggle new config between merged and pre-merged state','quit'] - - -class dispatch: - options = {} - - def grind (self, config_paths): - confs = [] - count = 0 - - if os.path.exists(LOG_CHANGES_TO): - shutil.move(LOG_CHANGES_TO, LOG_CHANGES_TO + '.old') - - self.options = dispatch_conf.read_config(MANDATORY_OPTS) - - # - # Build list of extant configs - # - - for path in config_paths.split (): - if not os.path.exists (path): - continue - - confs += self.massage (os.popen (FIND_EXTANT_CONFIGS % (path,)).readlines ()) - - # - # Remove new configs identical to current - # and - # Auto-replace configs a) whose differences are simply CVS interpolations, - # or b) whose differences are simply ws or comments, - # or c) in paths now unprotected by CONFIG_PROTECT_MASK, - # - - def f (conf): - mrgconf = re.sub(r'\._cfg', '._mrg', conf['new']) - archive = os.path.join(self.options['archive-dir'], conf['current'].lstrip('/')) - if self.options['use-rcs'] == 'yes': - dispatch_conf.rcs_archive(archive, conf['current'], conf['new'], mrgconf) - else: - dispatch_conf.file_archive(archive, conf['current'], conf['new'], mrgconf) - if os.path.exists(archive + '.dist'): - unmodified = len(commands.getoutput(DIFF_CONTENTS % (conf['current'], archive + '.dist'))) == 0 - else: - unmodified = 0 - if os.path.exists(mrgconf): - if len(commands.getoutput(DIFF_CONTENTS % (conf['new'], mrgconf))) == 0: - os.unlink(mrgconf) - newconf = conf['new'] - else: - newconf = mrgconf - else: - newconf = conf['new'] - - same_file = len(commands.getoutput (DIFF_CONTENTS % (conf ['current'], newconf))) == 0 - same_cvs = len(commands.getoutput (DIFF_CVS_INTERP % (conf ['current'], newconf))) == 0 - same_wsc = len(commands.getoutput (DIFF_WSCOMMENTS % (conf ['current'], newconf))) == 0 - - # Do options permit? - same_cvs = same_cvs and self.options['replace-cvs'] == 'yes' - same_wsc = same_wsc and self.options['replace-wscomments'] == 'yes' - unmodified = unmodified and self.options['replace-unmodified'] == 'yes' - - if same_file: - os.unlink (conf ['new']) - self.post_process(conf['current']) - if os.path.exists(mrgconf): - os.unlink(mrgconf) - return False - elif unmodified or same_cvs or same_wsc or conf ['dir'] in portage.settings ['CONFIG_PROTECT_MASK'].split (): - self.replace(newconf, conf['current']) - self.post_process(conf['current']) - if newconf == mrgconf: - os.unlink(conf['new']) - elif os.path.exists(mrgconf): - os.unlink(mrgconf) - return False - else: - return True - - confs = filter (f, confs) - - # - # Interactively process remaining - # - dialog = Dialog() - dialog.setBackgroundTitle('dispatch-conf Dialog Interface') - - for conf in confs: - count = count + 1 - - newconf = conf['new'] - mrgconf = re.sub(r'\._cfg', '._mrg', newconf) - if os.path.exists(mrgconf): - newconf = mrgconf - show_new_diff = 0 - - while 1: - if show_new_diff: -## os.system((self.options['diff'] + '| %s') % (conf['new'], mrgconf, self.options['pager'])) - (xx,yy) = getstatusoutput((self.options['diff']) % (conf['new'], mrgconf)) - dialog.scrollbox(yy,24,70) - show_new_diff = 0 - else: -## os.system((self.options['diff'] + '| %s') % (conf['current'], newconf, self.options['pager'])) - (xx,yy) = getstatusoutput((self.options['diff']) % (conf['current'], newconf)) - dialog.scrollbox(yy,24,70) - - - -## print -## print '>> (%i of %i) -- %s' % (count, len(confs), conf ['current']) -## print '>> q quit, h help, n next, e edit-new, z zap-new, u use-new\n m merge, t toggle-merge, l look-merge: ', - c = dialog.menu_ext('(%i of %i) -- %s' % (count, len(confs), conf ['current']),18,70,LONG_ITEMS,ITEMS) - #c = getch () - - if c == 'q' or c==None: - sys.exit (0) -## if c == 'h': -## self.do_help () -## continue - elif c == 't': - if newconf == mrgconf: - newconf = conf['new'] - elif os.path.exists(mrgconf): - newconf = mrgconf - continue - elif c == 'n': - break - elif c == 'm': - merged = '/tmp/dispatch-conf.merged.%i' % (os.getpid (),) -## print - os.system (MERGE % (merged, conf ['current'], newconf)) - shutil.move (merged, mrgconf) - mystat = os.lstat(conf['new']) - os.chmod(mrgconf, mystat[ST_MODE]) - os.chown(mrgconf, mystat[ST_UID], mystat[ST_GID]) - newconf = mrgconf - continue - elif c == 'l': - show_new_diff = 1 - continue - elif c == 'e': - os.system(os.environ['EDITOR'] + ' ' + newconf) - continue - elif c == 'z': - os.unlink(conf['new']) - if os.path.exists(mrgconf): - os.unlink(mrgconf) - break - elif c == 'u': - self.replace(newconf, conf ['current']) - self.post_process(conf['current']) - if newconf == mrgconf: - os.unlink(conf['new']) - elif os.path.exists(mrgconf): - os.unlink(mrgconf) - break - else: - continue - - - def replace (self, newconf, curconf): - """Replace current config with the new/merged version. Also logs - the diff of what changed into the LOG_CHANGES_TO file.""" - os.system((DIFF_CONTENTS % (curconf, newconf)) + '>>' + LOG_CHANGES_TO) - try: - shutil.move (newconf, curconf) - except (IOError, os.error), why: - print >> sys.stderr, 'dispatch-conf: Error renaming %s to %s: %s; fatal' % \ - (newconf, curconf, str(why)) - - - def post_process(self, curconf): - archive = os.path.join(self.options['archive-dir'], curconf.lstrip('/')) - if self.options['use-rcs'] == 'yes': - dispatch_conf.rcs_archive_post_process(archive) - else: - dispatch_conf.file_archive_post_process(archive) - - - def massage (self, newconfigs): - """Sort, rstrip, remove old versions, break into triad hash. - - Triad is dictionary of current (/etc/make.conf), new (/etc/._cfg0003_make.conf) - and dir (/etc). - - We keep ._cfg0002_conf over ._cfg0001_conf and ._cfg0000_conf. - """ - h = {} - - newconfigs.sort () - - for nconf in newconfigs: - nconf = nconf.rstrip () - conf = re.sub (r'\._cfg\d+_', '', nconf) - dir = re.match (r'^(.+)/', nconf).group (1) - - if h.has_key (conf): - mrgconf = re.sub(r'\._cfg', '._mrg', h[conf]['new']) - if os.path.exists(mrgconf): - os.unlink(mrgconf) - os.unlink(h[conf]['new']) - - h [conf] = { 'current' : conf, 'dir' : dir, 'new' : nconf } - - configs = h.values () - configs.sort (lambda a, b: cmp(a ['current'], b ['current'])) - - return configs - - -## def do_help (self): -## print; print - -## print ' u -- update current config with new config and continue' -## print ' z -- zap (delete) new config and continue' -## print ' n -- skip to next config, leave all intact' -## print ' e -- edit new config' -## print ' m -- interactively merge current and new configs' -## print ' l -- look at diff between pre-merged and merged configs' -## print ' t -- toggle new config between merged and pre-merged state' -## print ' h -- this screen' -## print ' q -- quit' - -## print; print 'press any key to return to diff...', - -## getch () - - -## def getch (): -## # from ASPN - Danny Yoo -## # -## import sys, tty, termios - -## fd = sys.stdin.fileno() -## old_settings = termios.tcgetattr(fd) -## try: -## tty.setraw(sys.stdin.fileno()) -## ch = sys.stdin.read(1) -## finally: -## termios.tcsetattr(fd, termios.TCSADRAIN, old_settings) -## return ch - - -# run -d = dispatch () - -if len(sys.argv) > 1: - # for testing - d.grind (string.join (sys.argv [1:])) -else: - d.grind (portage.settings ['CONFIG_PROTECT']) diff --git a/bin/dobin b/bin/dobin deleted file mode 100755 index 68fa6b7..0000000 --- a/bin/dobin +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/dobin,v 1.13 2004/10/04 13:56:50 vapier Exp $ - -if [ ${#} -lt 1 ] ; then - echo "${0}: at least one argument needed" - exit 1 -fi - -if [ ! -d "${D}${DESTTREE}/bin" ] ; then - install -d "${D}${DESTTREE}/bin" || exit 2 -fi - -for x in "$@" ; do - if [ -x "${x}" ] ; then - #if executable, use existing perms - install "${x}" "${D}${DESTTREE}/bin" || exit 3 - else - #otherwise, use reasonable defaults - echo ">>> dobin: making ${x} executable..." - if [ "$USERLAND" == "GNU" ]; then - install -m0755 -o root -g root "${x}" "${D}${DESTTREE}/bin" || exit 4 - else - install -m0755 -o root -g wheel "${x}" "${D}${DESTTREE}/bin" || exit 4 - fi - fi -done diff --git a/bin/doconfd b/bin/doconfd deleted file mode 100755 index 6204a3f..0000000 --- a/bin/doconfd +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -# Copyright 1999-2005 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/doconfd,v 1.4 2005/05/04 23:14:40 vapier Exp $ - -if [ $# -lt 1 ] ; then - echo "$0: at least one argument needed" 1>&2 - exit 1 -fi - -exec env INSDESTTREE=/etc/conf.d/ INSOPTIONS="-m0644" \ - doins "$@" diff --git a/bin/dodir b/bin/dodir deleted file mode 100755 index c07081c..0000000 --- a/bin/dodir +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/dodir,v 1.5 2004/10/04 13:56:50 vapier Exp $ - -for x in "$@" ; do - install -d ${DIROPTIONS} "${D}${x}" -done diff --git a/bin/dodoc b/bin/dodoc deleted file mode 100755 index 0c745b1..0000000 --- a/bin/dodoc +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash -# Copyright 1999-2005 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/dodoc,v 1.8 2005/05/04 23:50:33 vapier Exp $ - -if [ $# -lt 1 ] ; then - echo "$0: at least one argument needed" 1>&2 - exit 1 -fi - -dir="${D}usr/share/doc/${PF}/${DOCDESTTREE}" -if [ ! -d "${dir}" ] ; then - install -d "${dir}" -fi - -PORTAGE_COMPRESS=${PORTAGE_COMPRESS:-gzip} -PORTAGE_COMPRESS_FLAGS=${PORTAGE_COMPRESS_FLAGS:--9} - -for x in "$@" ; do - if [ -s "${x}" ] ; then - install -m0644 "${x}" "${dir}" - "${PORTAGE_COMPRESS}" ${PORTAGE_COMPRESS_FLAGS} -f "${dir}/${x##*/}" - elif [ ! -e "${x}" ] ; then - echo "dodoc: ${x} does not exist" 1>&2 - fi -done diff --git a/bin/doenvd b/bin/doenvd deleted file mode 100755 index 6c6500e..0000000 --- a/bin/doenvd +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -# Copyright 1999-2005 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/doenvd,v 1.4 2005/05/04 23:14:40 vapier Exp $ - -if [ $# -lt 1 ] ; then - echo "$0: at least one argument needed" 1>&2 - exit 1 -fi - -exec env INSDESTTREE=/etc/env.d/ INSOPTIONS="-m0644" \ - doins "$@" diff --git a/bin/doexe b/bin/doexe deleted file mode 100755 index 88a01a6..0000000 --- a/bin/doexe +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/doexe,v 1.11 2004/12/05 10:23:41 carpaski Exp $ - -mynum=${#} -if [ ${mynum} -lt 1 ] ; then - echo "doexe: at least one argument needed" - exit 1 -fi -if [ ! -d "${D}${EXEDESTTREE}" ] ; then - install -d "${D}${EXEDESTTREE}" -fi - -for x in "$@" ; do - if [ -L "${x}" ] ; then - cp "${x}" "${T}" - mysrc="${T}"/`/usr/bin/basename "${x}"` - elif [ -d "${x}" ] ; then - echo "doexe: warning, skipping directory ${x}" - continue - else - mysrc="${x}" - fi - install ${EXEOPTIONS} "${mysrc}" "${D}${EXEDESTTREE}" -done diff --git a/bin/dohard b/bin/dohard deleted file mode 100755 index 8f34968..0000000 --- a/bin/dohard +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/dohard,v 1.6 2004/10/04 13:56:50 vapier Exp $ - -if [ ${#} -ne 2 ] ; then - echo "${0}: two arguments needed" - exit 1 -fi - -mysrc="${1}" -mydest="${2}" -ln -f "${D}${mysrc}" "${D}${mydest}" diff --git a/bin/dohtml b/bin/dohtml deleted file mode 100755 index 64c0601..0000000 --- a/bin/dohtml +++ /dev/null @@ -1,159 +0,0 @@ -#!/usr/bin/python -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/dohtml,v 1.16 2004/10/23 09:13:13 jstubbs Exp $ - -# -# Typical usage: -# dohtml -r docs/* -# - put all files and directories in docs into /usr/share/doc/${PF}/html -# dohtml foo.html -# - put foo.html into /usr/share/doc/${PF}/html -# -# -# Detailed usage: -# dohtml <list-of-files> -# - will install the files in the list of files (space-separated list) into -# /usr/share/doc/${PF}/html, provided the file ends in .html, .png, .jpg -# or .css -# dohtml -r <list-of-files-and-directories> -# - will do as 'dohtml', but recurse into all directories, as long as the -# directory name is not CVS -# dohtml -A jpe,java [-r] <list-of-files[-and-directories]> -# - will do as 'dohtml' but add .jpe,.java (default filter list is -# added to your list) -# dohtml -a png,gif,html,htm [-r] <list-of-files[-and-directories]> -# - will do as 'dohtml' but filter on .png,.gif,.html,.htm (default filter -# list is ignored) -# dohtml -x CVS,SCCS,RCS -r <list-of-files-and-directories> -# - will do as 'dohtml -r', but ignore directories named CVS, SCCS, RCS -# - -import os -import string -import sys -import types - -def dodir(path): - os.system("install -d '%s'" % path) - -def dofile(src,dst): - - os.system("install -m0644 '%s' '%s'" % (src, dst)) - -def install(basename, dirname, options, prefix=""): - - fullpath = basename - if prefix: fullpath = prefix + "/" + fullpath - if dirname: fullpath = dirname + "/" + fullpath - - if options.DOCDESTTREE: - destdir = options.D + "usr/share/doc/" + options.PF + "/" + options.DOCDESTTREE + "/" + options.doc_prefix + "/" + prefix - else: - destdir = options.D + "usr/share/doc/" + options.PF + "/html/" + options.doc_prefix + "/" + prefix - - if os.path.isfile(fullpath): - ext = os.path.splitext(basename)[1] - if (len(ext) and ext[1:] in options.allowed_exts) or basename in options.allowed_files: - dodir(destdir) - dofile(fullpath, destdir + "/" + basename) - elif options.recurse and os.path.isdir(fullpath) and \ - basename not in options.disallowed_dirs: - for i in os.listdir(fullpath): - pfx = basename - if prefix: pfx = prefix + "/" + pfx - install(i, dirname, options, pfx) - -class OptionsClass: - def __init__(self): - self.PF = "" - self.D = "" - self.DOCDESTTREE = "" - - if os.environ.has_key("PF"): - self.PF = os.environ["PF"] - if os.environ.has_key("D"): - self.D = os.environ["D"] - if os.environ.has_key("DOCDESTTREE"): - self.DOCDESTTREE = os.environ["DOCDESTTREE"] - - self.allowed_exts = [ 'png', 'gif', 'html', 'htm', 'jpg', 'css', 'js' ] - self.allowed_files = [] - self.disallowed_dirs = [ 'CVS' ] - self.recurse = False - self.verbose = False - self.doc_prefix = "" - -def print_help(): - opts = OptionsClass() - - print "dohtml [-a .foo,.bar] [-A .foo,.bar] [-f foo,bar] [-x foo,bar]" - print " [-r] [-V] <file> [file ...]" - print - print " -a Set the list of allowed to those that are specified." - print " Default:", string.join(opts.allowed_exts, ",") - print " -A Extend the list of allowed file types." - print " -f Set list of allowed extensionless file names." - print " -x Set directories to be excluded from recursion." - print " Default:", string.join(opts.disallowed_dirs, ",") - print " -r Install files and directories recursively." - print " -V Be verbose." - print - -def parse_args(): - options = OptionsClass() - args = [] - - x = 1 - while x < len(sys.argv): - arg = sys.argv[x] - if arg in ["-h","-r","-V"]: - if arg == "-h": - print_help() - sys.exit(0) - elif arg == "-r": - options.recurse = True - elif arg == "-V": - options.verbose = True - elif sys.argv[x] in ["-A","-a","-f","-x","-p"]: - x += 1 - if x == len(sys.argv): - print_help() - sys.exit(0) - elif arg == "-p": - options.doc_prefix = sys.argv[x] - else: - values = string.split(sys.argv[x], ",") - if arg == "-A": - options.allowed_exts.extend(values) - elif arg == "-a": - options.allowed_exts = values - elif arg == "-f": - options.allowed_files = values - elif arg == "-x": - options.disallowed_dirs = values - else: - args.append(sys.argv[x]) - x += 1 - - return (options, args) - -def main(): - - (options, args) = parse_args() - - if type(options.allowed_exts) == types.StringType: - options.allowed_exts = options.allowed_exts.split(",") - - if options.verbose: - print "Allowed extensions:", options.allowed_exts - print "Document prefix : '" + options.doc_prefix + "'" - print "Allowed files :", options.allowed_files - - for x in args: - basename = os.path.basename(x) - dirname = os.path.dirname(x) - install(basename, dirname, options) - -if __name__ == "__main__": - main() diff --git a/bin/doinfo b/bin/doinfo deleted file mode 100755 index db86ac1..0000000 --- a/bin/doinfo +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash -# Copyright 1999-2005 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/doinfo,v 1.9 2005/05/04 23:50:33 vapier Exp $ - -if [ $# -lt 1 ] ; then - echo "$0: at least one argument needed" 1>&2 - exit 1 -fi - -dir="${D}usr/share/info" -if [ ! -d "${dir}" ] ; then - install -d "${dir}" -fi - -PORTAGE_COMPRESS=${PORTAGE_COMPRESS:-gzip} -PORTAGE_COMPRESS_FLAGS=${PORTAGE_COMPRESS_FLAGS:--9} - -for x in "$@" ; do - if [ -e "${x}" ] ; then - install -m0644 "${x}" "${dir}" - "${PORTAGE_COMPRESS}" ${PORTAGE_COMPRESS_FLAGS} -f \ - "${dir}/${x##*/}" - else - echo "doinfo: ${x} does not exist" 1>&2 - fi -done diff --git a/bin/doinitd b/bin/doinitd deleted file mode 100755 index 0471fbd..0000000 --- a/bin/doinitd +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -# Copyright 1999-2005 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/doinitd,v 1.4 2005/05/04 23:14:40 vapier Exp $ - -if [ $# -lt 1 ] ; then - echo "$0: at least one argument needed" 1>&2 - exit 1 -fi - -exec env EXEDESTTREE=/etc/init.d/ \ - doexe "$@" diff --git a/bin/doins b/bin/doins deleted file mode 100755 index b3df481..0000000 --- a/bin/doins +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/bash -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/doins,v 1.9 2005/05/24 04:12:29 vapier Exp $ - -if [ $# -lt 1 ] ; then - echo "${0}: at least one argument needed" - exit 1 -fi - -if [ "${1}" == "-r" ] ; then - DOINSRECUR=y - shift -else - DOINSRECUR=n -fi -[ -z "${INSDEPTH}" ] && declare -i INSDEPTH=0 -if [ ${INSDEPTH} -gt 30 ] ; then - echo "${0}: sanity check ... 30 directories is too much :(" - exit 1 -fi - -if [ "${INSDESTTREE%${D}*}" == "" ]; then - echo "-------------------------------------------------------" 1>&2 - echo "You should not use \${D} with helpers." 1>&2 - echo " --> ${INSDESTTREE}" 1>&2 - echo "-------------------------------------------------------" 1>&2 - #exit 1 -fi - -[ ! -d "${D}${INSDESTTREE}" ] && dodir "${INSDESTTREE}" - -for x in "$@" ; do - if [ -L "$x" ] ; then - cp "$x" "${T}" - mysrc="${T}/$(/usr/bin/basename "${x}")" - elif [ -d "$x" ] ; then - if [ "${DOINSRECUR}" == "n" ] ; then - continue - fi - - mydir="${INSDESTTREE}/$(basename "${x}")" - find "${x}" -mindepth 1 -maxdepth 1 -exec \ - env \ - INSDESTTREE="${mydir}" \ - INSDEPTH=$((INSDEPTH+1)) \ - doins -r {} \; - continue - else - mysrc="${x}" - fi - install ${INSOPTIONS} "${mysrc}" "${D}${INSDESTTREE}" -done diff --git a/bin/dojar b/bin/dojar deleted file mode 100755 index a47cb44..0000000 --- a/bin/dojar +++ /dev/null @@ -1,54 +0,0 @@ -#!/bin/sh -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/dojar,v 1.8 2004/10/04 13:56:50 vapier Exp $ -# Author Karl Trygve Kalleberg <karltk@gentoo.org> - -# -# Typical usage: -# dojar foo.jar bar.jar -# - installs foo.jar and bar.jar into /usr/share/${PN}/lib, and adds them -# both to /usr/share/${PN}/classpath.env -# -# Detailed usage -# dojar <list-of-jars> -# - installs <list-of-jars> into /usr/share/${PN}/lib and adds each to -# /usr/share/${PN}/classpath.env. -# -# The classpath.env file is currently merely a convenience for the user as -# it allows him to: -# export CLASSPATH=${CLASSPATH}:`cat /usr/share/foo/classpath.env` -# -# For many packages that set FOO_HOME, placing the jar files into -# lib will allow the user to set FOO_HOME=/usr/share/foo and have the -# scripts work as expected. -# -# Possibly a jarinto will be needed in the future. -# - -if [ -z "$JARDESTTREE" ] ; then - JARDESTTREE="lib" -fi - -jarroot="${DESTTREE}/share/${PN}/" -jardest="${DESTTREE}/share/${PN}/${JARDESTTREE}/" -pf="${D}${jarroot}/package.env" - -dodir "${jardest}" - -for i in $* ; do - bn="$(basename $i)" - - if [ -f "$pf" ] ; then - oldcp=`grep "CLASSPATH=" "$pf" | sed "s/CLASSPATH=//"` - grep -v "CLASSPATH=" "$pf" > "${pf}.new" - echo "CLASSPATH=${oldcp}:${jardest}${bn}" >> "${pf}.new" - mv "${pf}.new" "$pf" - else - echo "DESCRIPTION=\"${DESCRIPTION}\"" > "$pf" - echo "CLASSPATH=${jardest}${bn}" >> "$pf" - fi - - cp "$i" "${D}${jardest}/" - chmod 0444 "${D}${jardest}/${bn}" -done diff --git a/bin/dolib b/bin/dolib deleted file mode 100755 index 45f3931..0000000 --- a/bin/dolib +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/dolib,v 1.9 2005/02/26 04:14:19 jstubbs Exp $ - -LIBDIR_VAR="LIBDIR_${ABI}" -if [ -n "${ABI}" -a -n "${!LIBDIR_VAR}" ]; then - CONF_LIBDIR="${!LIBDIR_VAR}" -fi -unset LIBDIR_VAR - -if [ -z "${CONF_LIBDIR}" ]; then - # we need this to default to lib so that things dont break - CONF_LIBDIR="lib" -fi -libdir="${D}${DESTTREE}/${CONF_LIBDIR}" -for x in 1 2 3; do - # The escaping is weird. It will break if you escape the last one. - libdir="${libdir//\/\///}" -done - -if [ ${#} -lt 1 ] ; then - echo "${0}: at least one argument needed" - exit 1 -fi -if [ ! -d "${libdir}" ] ; then - install -d "${libdir}" -fi - -for x in "$@" ; do - if [ -e "${x}" ] ; then - if [ ! -L "${x}" ] ; then - install ${LIBOPTIONS} "${x}" "${libdir}" - else - ln -s "$(readlink "${x}")" "${libdir}/${x}" - fi - else - echo "${0}: ${x} does not exist" - fi -done diff --git a/bin/dolib.a b/bin/dolib.a deleted file mode 100755 index 1f8998c..0000000 --- a/bin/dolib.a +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/dolib.a,v 1.8 2004/10/10 10:07:20 carpaski Exp $ - -exec env LIBOPTIONS="-m0644" \ - dolib "$@" diff --git a/bin/dolib.so b/bin/dolib.so deleted file mode 100755 index 698d017..0000000 --- a/bin/dolib.so +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/dolib.so,v 1.12 2004/10/10 10:07:20 carpaski Exp $ - -exec env LIBOPTIONS="-m0755" \ - dolib "$@" diff --git a/bin/doman b/bin/doman deleted file mode 100755 index a53c0de..0000000 --- a/bin/doman +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/bash -# Copyright 1999-2005 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/doman,v 1.18 2005/05/04 23:50:33 vapier Exp $ - -if [ $# -lt 1 ] ; then - echo "$0: at least one argument needed" 1>&2 - exit 1 -fi - -PORTAGE_COMPRESS=${PORTAGE_COMPRESS:-gzip} -PORTAGE_COMPRESS_FLAGS=${PORTAGE_COMPRESS_FLAGS:--9} - -BASE="/usr/share" -i18n="" - -for x in "$@" ; do - if [ "${x:0:6}" == "-i18n=" ] ; then - i18n="${x:6}/" - fi - if [ "${x}" == ".keep" ] ; then - continue - fi - - suffix=${x##*.} - - case ${suffix} in - gz|bz2|Z) - compressed=${suffix} - realname=${x%.*} - suffix=${realname##*.} - ;; - *) - realname=${x} - compressed="" - ;; - esac - - mandir=${i18n}man${suffix:0:1} - - if echo ${mandir} | egrep -q 'man[0-9n](|f|p|pm)$' -; then - if [ -s "${x}" ] ; then - if [ ! -d "${D}${BASE}/man/${mandir}" ] ; then - install -d "${D}${BASE}/man/${mandir}" - fi - - install -m0644 "${x}" "${D}${BASE}/man/${mandir}" - - if [ -z "${compressed}" ] ; then - "${PORTAGE_COMPRESS}" ${PORTAGE_COMPRESS_FLAGS} -f \ - "${D}${BASE}/man/${mandir}/${x##*/}" - fi - else - echo "doman: ${x} does not exist" 1>&2 - fi - else - echo "doman: '${x}' is probably not a man page; skipping" 1>&2 - fi -done diff --git a/bin/domo b/bin/domo deleted file mode 100755 index 1ee8d7b..0000000 --- a/bin/domo +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/domo,v 1.6 2004/10/04 13:56:50 vapier Exp $ - -mynum=${#} -if [ ${mynum} -lt 1 ] ; then - echo "${0}: at least one argument needed" - exit 1 -fi -if [ ! -d "${D}${DESTTREE}/share/locale" ] ; then - install -d "${D}${DESTTREE}/share/locale/" -fi - -for x in "$@" ; do - if [ -e "${x}" ] ; then - mytiny="${x##*/}" - mydir="${D}${DESTTREE}/share/locale/${mytiny%.*}/LC_MESSAGES" - if [ ! -d "${mydir}" ] ; then - install -d "${mydir}" - fi - install -m0644 "${x}" "${mydir}/${MOPREFIX}.mo" - else - echo "${0}: ${x} does not exist" - fi -done diff --git a/bin/dopython b/bin/dopython deleted file mode 100755 index 2c7d387..0000000 --- a/bin/dopython +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/python -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/dopython,v 1.8 2004/10/04 13:56:50 vapier Exp $ - -import sys -sys.path = ["/usr/lib/portage/pym"]+sys.path - -from sys import * -import portage -import types -mycommand=argv[1]+"(" -x=2 -while (x<len(argv)): - if x==(len(argv)-1): - mycommand=mycommand+'"'+argv[x]+'"' - else: - mycommand=mycommand+'"'+argv[x]+'",' - x=x+1 -mycommand=mycommand+")" -exec("myresult="+mycommand) -if type(myresult)==types.IntType: - exit(myresult) diff --git a/bin/dosbin b/bin/dosbin deleted file mode 100755 index dcb5ee1..0000000 --- a/bin/dosbin +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/dosbin,v 1.11 2004/10/04 13:56:50 vapier Exp $ - -if [ ${#} -lt 1 ] ; then - echo "${0}: at least one argument needed" - exit 1 -fi -if [ ! -d "${D}${DESTTREE}/sbin" ] ; then - install -d "${D}${DESTTREE}/sbin" || exit 2 -fi - -for x in "$@" ; do - if [ -x "${x}" ] ; then - #if executable, use existing perms - install -m0755 "${x}" "${D}${DESTTREE}/sbin" || exit 3 - else - #otherwise, use reasonable defaults - echo ">>> dosbin: making ${x} executable..." - if [ "$USERLAND" == "GNU" ]; then - install -m0755 -o root -g root "${x}" "${D}${DESTTREE}/sbin" || exit 4 - else - install -m0755 -o root -g wheel "${x}" "${D}${DESTTREE}/sbin" || exit 4 - fi - fi -done diff --git a/bin/dosed b/bin/dosed deleted file mode 100755 index b0775de..0000000 --- a/bin/dosed +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/dosed,v 1.7 2004/10/04 13:56:50 vapier Exp $ - -mysed="s:${D}::g" - -for x in "$@" ; do - y="${D}${x}" - if [ -a "${y}" ] ; then - if [ -f "${y}" ] ; then - mysrc="${T}/${y##*/}" - cp "${y}" "${mysrc}" - sed -e "${mysed}" "${mysrc}" > "${y}" - else - echo "${y} is not a regular file!" - exit 1 - fi - else - mysed="${x}" - fi -done diff --git a/bin/dosym b/bin/dosym deleted file mode 100755 index 4031797..0000000 --- a/bin/dosym +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/dosym,v 1.7 2004/10/04 13:56:50 vapier Exp $ - -if [ ${#} -ne 2 ] ; then - echo "${0}: two arguments needed" - exit 1 -fi - -target="${1}" -linkname="${2}" -ln -snf "${target}" "${D}${linkname}" diff --git a/bin/ebuild b/bin/ebuild deleted file mode 100755 index a6a817b..0000000 --- a/bin/ebuild +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/python -O -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/ebuild,v 1.22 2005/05/07 04:46:49 ferringb Exp $ - -import os,sys -sys.path = ["/usr/lib/portage/pym"]+sys.path -import portage_util - -def getroot(): - try: - a=os.environ["ROOT"] - if a == '/': - return '/' - except SystemExit, e: - raise # Needed else we can't exit. - except: - return '/' - return os.path.normpath(a)+'/' - -os.environ["PORTAGE_CALLER"]="ebuild" - -if len(sys.argv)<=2: - print "expecting two arguments." - sys.exit(1) - -import getopt - -debug=0 - -opts,pargs=getopt.getopt(sys.argv[1:],'',['debug']) -for opt in opts: - if opt[0]=='--debug': - debug=1 - -if "merge" in pargs: - print "Disabling noauto in features... merge disables it. (qmerge doesn't)" - os.environ["FEATURES"] = os.environ.get("FEATURES", "") + " -noauto" - -import portage, portage_util - -for x in pargs[1:]: - try: - tmpsettings = portage.config(clone=portage.settings) - - if x in ['clean','config']: - cleanup=1 - else: - cleanup=0 - a=portage.doebuild(pargs[0],x,getroot(),tmpsettings,debug=debug,cleanup=cleanup) - except KeyboardInterrupt: - print "(interrupted by user -- ctrl-C?)" - a=1 - except IOError: - a=1 - print "ebuild: this ebuild generated output during the depend phase (bad)" - if a == None: - portage_util.writemsg("Could not run the required binary?\n") - sys.exit(127) - if a: - sys.exit(a) diff --git a/bin/ebuild-daemon.lib b/bin/ebuild-daemon.lib deleted file mode 100755 index 7781b42..0000000 --- a/bin/ebuild-daemon.lib +++ /dev/null @@ -1,126 +0,0 @@ -#!/bin/bash -# ebuild-daemon.lib; daemon lib code. -# Copyright 2005 Gentoo Foundation -# Author(s): Brian Harring (ferringb@gentoo.org) -# License: GPL2 -$Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/ebuild-daemon.lib,v 1.1 2005/07/20 14:22:48 ferringb Exp $ - -alias die='diefunc "$FUNCNAME" "$LINENO" "$?"' -#alias listen='read -u 3 -t 10' -alias assert='_pipestatus="${PIPESTATUS[*]}"; [[ "${_pipestatus// /}" -eq 0 ]] || diefunc "$FUNCNAME" "$LINENO" "$_pipestatus"' - - -# portageq hijack- redirects all requests back through the pipes and has the python side execute it. -# much faster, also avoids the gpg/sandbox being active issues. -portageq() { - local line e alive - if [ "${EBUILD_PHASE}" == "depend" ]; then - echo "QA Notice: portageq() in global scope for ${CATEGORY}/${PF}" >&2 - fi - speak "portageq $*" - listen line - declare -i e - e=$(( ${line/return_code=} + 0 )) - alive=1 - while [ $alive == 1 ]; do - listen line - if [ "$line" == "stop_text" ]; then - alive=0 - else - echo "portageq: $line" - fi - done - return $e -} - -# ask the python side to display sandbox complaints. -request_sandbox_summary() { - local line - speak "request_sandbox_summary ${SANDBOX_LOG}" - listen line - while [ "$line" != "end_sandbox_summary" ]; do - echo "$line" - listen line - done -} - -# request the global confcache be transferred to $1 for usage. -# flips the sandbox vars as needed. -request_confcache() { - if ! hasq confcache $FEATURES || ! hasq sandbox $FEATURES || hasq confcache $RESTRICT; then - return 1 - fi - local line - speak "request_confcache $1" - listen line s - while [ "${line#request}" != "${line}" ]; do - # var requests for updating the cache's ac_cv_env - # send set, then val - line="$(echo ${line#request})" - if [ "${!line:+set}" == "set" ]; then - speak set - speak "${!line}" - else - speak unset - fi - listen line - done - if [ "${line:0:9}" == "location:" ]; then - cp -v "${line:10}" $1 - elif [ "${line}" == "empty" ]; then - echo ">>> Confcache is empty, starting anew" - fi - if hasq "${line/: *}" location empty; then - echo ">>> Temporary configure cache file is $1" - export PORTAGE_CONFCACHE_STATE=1 - export SANDBOX_DEBUG_LOG="${T}/debug_log" - export SANDBOX_DEBUG=1 - return 0 - fi - return 1 -} - -# notify python side configure calls are finished. -update_confcache() { - local line - if [ "$PORTAGE_CONFCACHE_STATE" != "1" ]; then - return 0 - fi - unset SANDBOX_DEBUG - unset PORTAGE_CONFCACHE_STATE - if ! hasq sandbox $FEATURES; then - echo "not updating confcache, sandbox isn't set in features" >&2 - return 1 - fi - speak "update_confcache $SANDBOX_DEBUG_LOG $1" - unset SANDBOX_DEBUG_LOG - listen line - if [ "$line" == "updated" ]; then - return 0 - fi - return 1 -} - -internal_inherit() { - local line x - if [ "$#" != "1" ]; then - die "internal_inherit accepts one arg, requested eclass location. $* is a bit much" - fi - speak "request_inherit $1" - listen line - if [ $line == "path" ]; then - listen line; - source "${line}" || die "failed sources inherit: ${line}" - elif [ $line == "transfer" ]; then - listen line; - eval "$line" || die "failed evaluating eclass $x on an inherit transfer" - else - speak "failed" - die "unknown inherit command from pythonic side, '$line' for eclass $x" - fi -} - -DONT_EXPORT_FUNCS="${DONT_EXPORT_FUNCS} $(declare -F | cut -s -d ' ' -f 3)" -DONT_EXPORT_VARS="${DONT_EXPORT_VARS} ${DONT_EXPORT_VARS}" - -: diff --git a/bin/emake b/bin/emake deleted file mode 100755 index 7a25df8..0000000 --- a/bin/emake +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -# Copyright 1999-2005 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/emake,v 1.10 2005/05/04 23:17:54 vapier Exp $ -# -# emake: Supplies some default parameters to GNU make. At the moment the -# only parameter supplied is -jN, where N is a number of -# parallel processes that should be ideal for the running host -# (e.g. on a single-CPU machine, N=2). The MAKEOPTS variable -# is set in /etc/make.globals. We don't source -# /etc/make.globals here because emake is only called from an -# ebuild. - -exec make ${MAKEOPTS} ${EXTRA_EMAKE} "$@" diff --git a/bin/emerge b/bin/emerge deleted file mode 100755 index f3d1341..0000000 --- a/bin/emerge +++ /dev/null @@ -1,3512 +0,0 @@ -#!/usr/bin/python -O -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/emerge,v 1.379 2005/04/24 12:49:01 jstubbs Exp $ - -import os,sys -os.environ["PORTAGE_CALLER"]="emerge" -sys.path = ["/usr/lib/portage/pym"]+sys.path - -import portage -import random - -import emergehelp,xpak,string,re,commands,time,shutil,traceback,atexit,signal,socket,types -from stat import * -from output import * - -import portage_util -import portage_locks -import portage_exception -import portage_exec, sync -from portage_dep import DependencyGraph -import portage_dep, portage_versions - - -spinner_msgs = ["Gentoo Rocks ("+os.uname()[0]+")", - "Thank you for using Gentoo. :)", - "Are you actually trying to read this?", - "How many times have you stared at this?", - "We are generating the cache right now", - "You are paying too much attention.", - "A theory is better than its explanation.", - "Phasers locked on target, Captain.", - "Thrashing is just virtual crashing.", - "To be is to program.", - "Real Users hate Real Programmers.", - "When all else fails, read the instructions.", - "Functionality breeds Contempt.", - "The future lies ahead.", - "3.1415926535897932384626433832795028841971694", - "Sometimes insanity is the only alternative.", - "Inaccuracy saves a world of explanation.", - ] - - -def update_basic_spinner(): - global spinner, spinpos - spinpos = (spinpos+1) % 500 - if (spinpos % 100) == 0: - if spinpos == 0: - sys.stdout.write(". ") - else: - sys.stdout.write(".") - sys.stdout.flush() - -def update_scroll_spinner(): - global spinner, spinpos - if(spinpos >= len(spinner)): - sys.stdout.write(darkgreen(" \b\b\b"+spinner[len(spinner)-1-(spinpos%len(spinner))])) - else: - sys.stdout.write(green("\b "+spinner[spinpos])) - sys.stdout.flush() - spinpos = (spinpos+1) % (2*len(spinner)) - -def update_twirl_spinner(): - global spinner, spinpos - spinpos = (spinpos+1) % len(spinner) - sys.stdout.write("\b\b "+spinner[spinpos]) - sys.stdout.flush() - -spinpos = 0 -spinner = "/-\\|/-\\|/-\\|/-\\|\\-/|\\-/|\\-/|\\-/|" -update_spinner = update_twirl_spinner -if "candy" in portage.settings.features: - spinner = spinner_msgs[int(time.time()*100)%len(spinner_msgs)] - update_spinner = update_scroll_spinner -if not sys.stdout.isatty() or ("--nospinner" in sys.argv): - update_spinner = update_basic_spinner - - -if (not sys.stdout.isatty()) or (portage.settings["NOCOLOR"] in ["yes","true"]): - nocolor() - -def normpath(mystr): - if mystr and (mystr[0]=='/'): - return os.path.normpath("///"+mystr) - else: - return os.path.normpath(mystr) - -def userquery(prompt, responses=None, colours=None): - """Displays a prompt and a set of responses, then waits for a response - which is checked against the responses and the first to match is - returned. - - prompt: a String. - responses: a List of Strings. - colours: a List of Functions taking and returning a String, used to - process the responses for display. Typically these will be functions - like red() but could be e.g. lambda x: "DisplayString". - If responses is omitted, defaults to ["Yes", "No"], [green, red]. - If only colours is omitted, defaults to [bold, ...]. - - Returns a member of the List responses. (If called without optional - arguments, returns "Yes" or "No".) - KeyboardInterrupt is converted to SystemExit to avoid tracebacks being - printed.""" - if responses is None: - responses, colours = ["Yes", "No"], [green, red] - elif colours is None: - colours=[bold] - colours=(colours*len(responses))[:len(responses)] - print bold(prompt), - try: - while True: - response=raw_input("["+"/".join([colour(response) for colour,response in zip(colours,responses)])+"] ") - for key in responses: - if response.upper()==key[:len(response)].upper(): - return key - print "Sorry, response '%s' not understood." % response, - except (EOFError, KeyboardInterrupt): - print "Interrupted." - sys.exit(1) - -if portage.settings.has_key("PORTAGE_NICENESS"): - try: - os.nice(int(portage.settings["PORTAGE_NICENESS"])) - except SystemExit, e: - raise # Needed else can't exit - except Exception,e: - print "!!! Failed to change nice value to '"+str(portage.settings["PORTAGE_NICENESS"])+"'" - print "!!!",e - -#Freeze the portdbapi for enhanced performance: -portage.portdb.freeze() - -# Kill noauto as it will break merges otherwise. -while 'noauto' in portage.features: - portage.features.remove('noauto') - -#number of ebuilds merged -merged=0 -params=["selective", "deep", "self", "recurse", "empty"] -actions=[ -"clean", "config", "depclean", -"info", "inject", "metadata", -"prune", "regen", "rsync", "search", -"sync", "system", "unmerge", "world", -] -options=[ -"--ask", -"--buildpkg", "--buildpkgonly", -"--changelog", "--columns", -"--debug", "--deep", -"--digest", -"--emptytree", -"--fetchonly", "--fetch-all-uri", -"--getbinpkg", "--getbinpkgonly", -"--help", "--noconfmem", -"--newuse", -"--nodeps", "--noreplace", -"--nospinner", "--oneshot", -"--onlydeps", "--pretend", -"--quiet", "--resume", -"--searchdesc", "--selective", -"--skipfirst", -"--tree", -"--update", -"--usepkg", "--usepkgonly", -"--verbose", "--version" -] - -shortmapping={ -"1":"--oneshot", -"a":"--ask", -"b":"--buildpkg", "B":"--buildpkgonly", -"c":"--clean", "C":"--unmerge", -"d":"--debug", "D":"--deep", -"e":"--emptytree", -"f":"--fetchonly", "F":"--fetch-all-uri", -"g":"--getbinpkg", "G":"--getbinpkgonly", -"h":"--help", -"k":"--usepkg", "K":"--usepkgonly", -"l":"--changelog", -"n":"--noreplace", "N":"--newuse", -"o":"--onlydeps", "O":"--nodeps", -"p":"--pretend", "P":"--prune", -"q":"--quiet", -"s":"--search", "S":"--searchdesc", -'t':"--tree", -"u":"--update", -"v":"--verbose", "V":"--version" -} - -myaction=None -myopts=[] -myfiles=[] -edebug=0 -verbosity=0 - -# process short actions -tmpcmdline=sys.argv[1:] -#tmpcmdline.extend(portage.settings["EMERGE_OPTS"].split()) -cmdline=[] -for x in tmpcmdline: - if x[0:1]=="-" and x[1:2]!="-": - for y in x[1:]: - if shortmapping.has_key(y): - if shortmapping[y]=="--verbose": - verbosity += 1 - elif shortmapping[y] in cmdline: - print - print "*** Warning: Redundant use of",shortmapping[y] - else: - cmdline.append(shortmapping[y]) - else: - print "!!! Error: -"+y+" is an invalid short action or option." - sys.exit(1) - else: - cmdline.append(x) - -# process the options and command arguments -for x in cmdline: - if not x: - continue - if len(x)>=2 and x[0:2]=="--": - if x in options: - myopts.append(x) - elif x[2:] in actions: - if x[2:]=="rsync" or x=="rsync": - # "emerge --rsync" - print - print red("*** '--rsync' has been deprecated.") - print red("*** Please use '--sync' instead.") - print - x="--sync" - if myaction: - if myaction not in ["system", "world"]: - myaction="--"+myaction - print - print red("!!!")+green(" Multiple actions requested... Please choose one only.") - print red("!!!")+" '"+darkgreen(myaction)+"' "+red("or")+" '"+darkgreen(x)+"'" - print - sys.exit(1) - myaction=x[2:] - else: - print "!!! Error:",x,"is an invalid option." - sys.exit(1) - elif (not myaction) and (x in actions): - if x not in ["system", "world"]: - #print red("*** Deprecated use of action '"+x+"'") - if x=="rsync": - # "emerge rsync" - print - print red("*** 'rsync' will now install the package rsync.") - print red("*** To sync the tree, please use '--sync' instead.") - print - myfiles.append(x) - continue - if myaction: - print - print red("!!!")+green(" Multiple actions requested... Please choose one only.") - print red("!!! '")+darkgreen(myaction)+"' "+red("or")+" '"+darkgreen(x)+"'" - print - sys.exit(1) - myaction=x - elif x[-1]=="/": - # this little conditional helps tab completion - myfiles.append(x[:-1]) - else: - myfiles.append(x) - -if verbosity: - import portage_metadata - -if "moo" in myfiles: - print """ - - Gentoo (""" + os.uname()[0] + """) - - _______________________ -< Have you mooed today? > - ----------------------- - \ ^__^ - \ (oo)\_______ - (__)\ )\/\ - ||----w | - || || - -""" - -if (myaction in ["world", "system"]) and myfiles: - print "emerge: please specify a package class (\"world\" or \"system\") or individual packages, but not both." - sys.exit(1) - -for x in myfiles: - if (x.endswith(".ebuild") or x.endswith(".tbz2")) and os.path.exists(os.path.abspath(x)): - print "emerging by path implies --oneshot... adding --oneshot to options." - print red("\n*** emerging by path is broken and may not always work!!!\n") - break - -if ("--tree" in myopts) and ("--columns" in myopts): - print "emerge: can't specify both of \"--tree\" and \"--columns\"." - sys.exit(1) - -# Always create packages if FEATURES=buildpkg -# Imply --buildpkg if --buildpkgonly -if ("buildpkg" in portage.features) or ("--buildpkgonly" in myopts): - if "--buildpkg" not in myopts: - myopts.append("--buildpkg") - -# --tree only makes sense with --pretend -if "--tree" in myopts and not (("--pretend" in myopts) or ("--ask" in myopts)): - print ">>> --tree implies --pretend... adding --pretend to options." - myopts.append("--pretend") - -# Also allow -S to invoke search action (-sS) -if ("--searchdesc" in myopts): - if myaction and myaction != "search": - myfiles.append(myaction) - if "--search" not in myopts: - myopts.append("--search") - myaction = "search" - -# Always try and fetch binary packages if FEATURES=getbinpkg -if ("getbinpkg" in portage.features): - myopts.append("--getbinpkg") - -if ("--getbinpkgonly" in myopts) and not ("--usepkgonly" in myopts): - myopts.append("--usepkgonly") - -if ("--getbinpkgonly" in myopts) and not ("--getbinpkg" in myopts): - myopts.append("--getbinpkg") - -if ("--getbinpkg" in myopts) and not ("--usepkg" in myopts): - myopts.append("--usepkg") - -# Also allow -K to apply --usepkg/-k -if ("--usepkgonly" in myopts) and not ("--usepkg" in myopts): - myopts.append("--usepkg") - -# Also allow -l to apply --pretend/-p, but if already in --ask mode -if ("--changelog" in myopts) and not (("--pretend" in myopts) or ("--ask" in myopts)): - print ">>> --changelog implies --pretend... adding --pretend to options." - myopts.append("--pretend") - -# Allow -p to remove --ask -if ("--pretend" in myopts) and ("--ask" in myopts): - print ">>> --pretend disables --ask... removing --ask from options." - myopts.remove("--ask") - -# forbid --ask when not in a terminal -# note: this breaks `emerge --ask | tee logfile`, but that doesn't work anyway. -if ("--ask" in myopts) and (not sys.stdout.isatty()): - portage.writemsg("!!! \"--ask\" should only be used in a terminal. Exiting.\n") - sys.exit(1) - -# Set so that configs will be merged regardless of remembered status -if ("--noconfmem" in myopts): - portage.settings.unlock() - portage.settings["NOCONFMEM"]="1" - portage.settings.backup_changes("NOCONFMEM") - portage.settings.lock() - -# Set various debug markers... They should be merged somehow. -if ("--debug" in myopts): - portage.settings.unlock() - portage.settings["PORTAGE_DEBUG"]="1" - portage.settings.backup_changes("PORTAGE_DEBUG") - portage.debug=1 - portage.settings.lock() - -CLEAN_DELAY = 5 -EMERGE_WARNING_DELAY = 10 -if portage.settings["CLEAN_DELAY"]: - CLEAN_DELAY = int("0"+portage.settings["CLEAN_DELAY"]) -if portage.settings["EMERGE_WARNING_DELAY"]: - EMERGE_WARNING_DELAY = int("0"+portage.settings["EMERGE_WARNING_DELAY"]) - - -def emergelog(mystr,short_msg=None): - if "notitles" not in portage.features: - if short_msg: - xtermTitle(short_msg) - else: - xtermTitle(mystr) - try: - #seems odd opening a file each write... - if not os.path.exists("/var/log/emerge.log"): - mylogfile=open("/var/log/emerge.log", "w") - os.chmod("/var/log/emerge.log", S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP) - os.chown("/var/log/emerge.log", portage.portage_uid, portage.portage_gid) - else: - mylogfile=open("/var/log/emerge.log", "a") - - l=portage_locks.lockfile(mylogfile) - # seek because we may have gotten held up by the lock. - # if so, we may not be positioned at the end of the file. - mylogfile.seek(0,2) - mylogfile.write(str(time.time())[:10]+": "+mystr+"\n") - mylogfile.flush() - portage_locks.unlockfile(l) - mylogfile.close() - except SystemExit, e: - raise # Needed else can't exit - except Exception, e: - if edebug: - print "emergelog():",e - pass - -def emergeexit(): - """This gets out final log message in before we quit.""" - if "--pretend" not in myopts: - emergelog(" *** terminating.") - if "notitles" not in portage.features: - xtermTitleReset() -atexit.register(emergeexit) - -def emergeexitsig(signum, frame): - signal.signal(signal.SIGINT, signal.SIG_IGN) - portage.portageexit() - portage_util.writemsg("\n\nExiting on signal %(signal)s\n" % {"signal":signum}) - sys.exit(100+signum) -signal.signal(signal.SIGINT, emergeexitsig) - -def countdown(secs=5, doing="Starting"): - if secs: - print ">>> Waiting",secs,"seconds before starting..." - print ">>> (Control-C to abort)...\n"+doing+" in: ", - ticks=range(secs) - ticks.reverse() - for sec in ticks: - sys.stdout.write(red(str(sec+1)+" ")) - sys.stdout.flush() - time.sleep(1) - print - -# formats a size given in bytes nicely -def format_size(mysize): - if type(mysize) not in [types.IntType,types.LongType]: - return str(mysize) - mystr=str(mysize/1024) - mycount=len(mystr) - while (mycount > 3): - mycount-=3 - mystr=mystr[:mycount]+","+mystr[mycount:] - return mystr+" kB" - - -def getgccversion(): - """ - rtype: C{str} - return: the current in-use gcc version - """ - - gcc_env_dir = os.path.join('/', 'etc', 'env.d', 'gcc') - gcc_config_config = os.path.join(gcc_env_dir, 'config') - gcc_ver_command = 'gcc -dumpversion' - gcc_ver_prefix = 'gcc-' - - gcc_not_found_error = red( - "!!! No gcc found. You probably need to 'source /etc/profile'\n" + - "!!! to update the environment of this terminal and possibly\n" + - "!!! other terminals also." - ) - - gcc_distcc_broken_error = green( - '!!! Relying on the shell to locate gcc, this may break\n' + - '!!! DISTCC, installing gcc-config and setting your current gcc\n' + - '!!! profile will fix this' - ) - - def fallback(): - - print >>sys.stderr, gcc_distcc_broken_error - - gccout = portage_exec.spawn_get_output(gcc_ver_command) - - if gccout[0] != 0: - print >>sys.stderr, gcc_not_found_error - gccver = "[unavailable]" - else: - gccver = gcc_ver_prefix + gccout[1] - - return gccver - - if os.path.isfile(gcc_config_config): - try: - gccver_str = open(gcc_config_config).read().strip() - gccver = gcc_ver_prefix + string.join(gccver_str.split('-')[4:], '-') - except IndexError: - gccver = fallback() - - else: - import glob - dir_l = glob.glob(os.path.join(gcc_env_dir, '*-*')) - - if len(dir_l) == 1: - try: - gccver = gcc_ver_prefix + dir_l[0].split('-')[-1] - except IndexError: - gccver = fallback() - - else: - # There was no "config" file in /etc/env.d/gcc and there was more - # than one profile in /etc/env.d/gcc so we can't actively - # determine what version of gcc we are using so we fall back on the - # old way that breaks distcc - - gccver = fallback() - - return gccver - -def getportageversion(): - try: - import re - profilever = os.path.normpath("///"+os.readlink("/etc/make.profile")) - basepath = os.path.normpath("///"+portage.settings["PORTDIR"]+"/profiles") - if re.match(basepath,profilever): - profilever = profilever[len(basepath)+1:] - else: - profilever = "!"+profilever - del basepath - except SystemExit, e: - raise # Needed else can't exit - except: - profilever="unavailable" - libcver=[] - libclist = portage.vardbapi(portage.root).match("virtual/libc") - libclist += portage.vardbapi(portage.root).match("virtual/glibc") - libclist = portage_util.unique_array(libclist) - for x in libclist: - xs=portage_versions.catpkgsplit(x) - if libcver: - libcver+=","+"-".join(xs[1:]) - else: - libcver="-".join(xs[1:]) - if libcver==[]: - libcver="unavailable" - - gccver = getgccversion() - unameout=os.uname()[2]+" "+os.uname()[4] - - return "Portage " + portage.VERSION +" ("+profilever+", "+gccver+", "+libcver+", "+unameout+")" - -def help(): - # Move all the help stuff out of this file. - emergehelp.help(myaction,myopts,havecolor) - -# check if root user is the current user for the actions where emerge needs this -if ("--pretend" in myopts) or ("--fetchonly" in myopts or "--fetch-all-uri" in myopts) or (myaction=="search"): - if not portage.secpass: - if portage.wheelgid==portage.portage_gid: - print "emerge: wheel group membership required for \"--pretend\" and search." - print "emerge: wheel group use is being deprecated. Please update group and passwd to" - print " include the portage user as noted above, and then use group portage." - else: - print "emerge: portage group membership required for \"--pretend\" and search." - sys.exit(1) -elif "--version" in myopts: - print getportageversion() - sys.exit(0) -elif "--help" in myopts: - help() - sys.exit(0) -elif portage.secpass!=2: - if myaction in ["search", "info", "regen", "metadata"]: - pass - elif (not myaction) and (not myfiles): - pass - elif ("--pretend" in myopts) and (myaction in ["world","system","clean","prune","unmerge"]): - pass - else: - if "--debug" in myopts: - print "myaction",myaction - print "myopts",myopts - print "emerge: root access required." - sys.exit(1) - -if not "--pretend" in myopts: - emergelog("Started emerge on: "+time.strftime("%b %d, %Y %H:%M:%S", time.localtime())) - myelogstr="" - if myopts: - myelogstr=" ".join(myopts) - if myaction: - myelogstr+=" "+myaction - if myfiles: - myelogstr+=" "+" ".join(myfiles) - emergelog(" *** emerge "+myelogstr) - -#configure emerge engine parameters -# -# self: include _this_ package regardless of if it is merged. -# selective: exclude the package if it is merged -# recurse: go into the dependencies -# empty: pretend nothing is merged -myparams=["self","recurse"] -add=[] -sub=[] -if "--update" in myopts: - add.extend(["selective","empty"]) -if "--emptytree" in myopts: - add.extend(["empty"]) - sub.extend(["selective"]) -if "--nodeps" in myopts: - sub.extend(["recurse"]) -if "--noreplace" in myopts: - add.extend(["selective"]) -if "--deep" in myopts: - add.extend(["deep"]) -if "--selective" in myopts: - add.extend(["selective"]) -if myaction in ["world","system"]: - add.extend(["selective"]) -elif myaction in ["depclean"]: - add.extend(["empty"]) - sub.extend(["selective"]) -for x in add: - if (x not in myparams) and (x not in sub): - myparams.append(x) -for x in sub: - if x in myparams: - myparams.remove(x) - -# search functionality -class search: - - # - # class constants - # - VERSION_SHORT=1 - VERSION_RELEASE=2 - - # - # public interface - # - def __init__(self): - """Searches the available and installed packages for the supplied search key. - The list of available and installed packages is created at object instantiation. - This makes successive searches faster.""" - self.installcache = portage.db["/"]["vartree"] - - def execute(self,searchkey): - """Performs the search for the supplied search key""" - global myopts - match_category = 0 - self.searchkey=searchkey - self.packagematches = [] - if "--searchdesc" in myopts: - self.searchdesc=1 - self.matches = {"pkg":[], "desc":[]} - else: - self.searchdesc=0 - self.matches = {"pkg":[]} - print "Searching... ", - - if self.searchkey[0] == '@': - match_category = 1 - self.searchkey = self.searchkey[1:] - if self.searchkey=="*": - #hack for people who aren't regular expression gurus - self.searchkey==".*" - if re.search("\+\+", self.searchkey): - #hack for people who aren't regular expression gurus - self.searchkey=re.sub("\+\+","\+\+",self.searchkey) - self.searchre=re.compile(self.searchkey.lower(),re.I) - for package in portage.portdb.cp_all(): - update_spinner() - - if match_category: - match_string = package[:] - else: - match_string = package.split("/")[-1] - - masked=0 - if self.searchre.search(match_string): - if not portage.portdb.xmatch("match-visible",package): - masked=1 - self.matches["pkg"].append([package,masked]) - elif self.searchdesc: # DESCRIPTION searching - full_package = portage.portdb.xmatch("bestmatch-visible",package) - if not full_package: - #no match found; we don't want to query description - full_package=portage.best(portage.portdb.xmatch("match-all",package)) - if not full_package: - continue - else: - masked=1 - try: - full_desc = portage.portdb.aux_get(full_package,["DESCRIPTION"])[0] - except KeyError: - print "emerge: search: aux_get() failed, skipping" - continue - if self.searchre.search(full_desc): - self.matches["desc"].append([full_package,masked]) - self.mlen=0 - for mtype in self.matches.keys(): - self.matches[mtype].sort() - self.mlen += len(self.matches[mtype]) - - def output(self): - """Outputs the results of the search.""" - print "\b\b \n[ Results for search key : "+white(self.searchkey)+" ]" - print "[ Applications found : "+white(str(self.mlen))+" ]" - print " " - for mtype in self.matches.keys(): - for match,masked in self.matches[mtype]: - if mtype=="pkg": - catpack=match - full_package = portage.portdb.xmatch("bestmatch-visible",match) - if not full_package: - #no match found; we don't want to query description - masked=1 - full_package=portage.best(portage.portdb.xmatch("match-all",match)) - else: - full_package = match - match = portage_versions.pkgsplit(match)[0] - - if full_package: - try: - desc, homepage, license = portage.portdb.aux_get(full_package,["DESCRIPTION","HOMEPAGE","LICENSE"]) - except KeyError: - print "emerge: search: aux_get() failed, skipping" - continue - if masked: - print green("*")+" "+white(match)+" "+red("[ Masked ]") - else: - print green("*")+" "+white(match) - myversion = self.getVersion(full_package, search.VERSION_RELEASE) - - mysum = [0,0] - mycat = match.split("/")[0] - mypkg = match.split("/")[1] - - mydigest = portage.db["/"]["porttree"].dbapi.finddigest(mycat+"/"+mypkg + "-" + myversion) - - try: - myfile = open(mydigest,"r") - for line in myfile.readlines(): - mysum[0] += int(line.split(" ")[3]) - myfile.close() - mystr = str(mysum[0]/1024) - mycount=len(mystr) - while (mycount > 3): - mycount-=3 - mystr=mystr[:mycount]+","+mystr[mycount:] - mysum[0]=mystr+" kB" - except SystemExit, e: - raise # Needed else can't exit - except Exception, e: - if edebug: - print "!!! Exception:",e - mysum[0]=" [no/bad digest]" - - if "--quiet" not in myopts: - print " ", darkgreen("Latest version available:"),myversion - print " ", self.getInstallationStatus(mycat+'/'+mypkg) - print " ", darkgreen("Size of downloaded files:"),mysum[0] - print " ", darkgreen("Homepage:")+" ",homepage - print " ", darkgreen("Description:"),desc - print " ", darkgreen("License:")+" ",license - if (verbosity): - # show herd/maintainers if verbosity>=1 (ie: -vv) - metadata_file=portage.settings["PORTDIR"] + "/" + match + "/metadata.xml" - if not os.path.exists(metadata_file): - print " " + darkgreen("Metadata: ") + red("(Missing "+metadata_file+")") - else: - parser = portage_metadata.make_parser() - handler = portage_metadata.Metadata_XML() - handler._maintainers = [] - handler._herds = [] - parser.setContentHandler(handler) - parser.parse( metadata_file ) - if len(handler._herds) > 0: - print " " + darkgreen("Herd: ") + ", ".join(handler._herds) - if len(handler._maintainers): - print " " + darkgreen("Maintainers: ") + ", ".join(handler._maintainers) - print - print - # - # private interface - # - def getInstallationStatus(self,package): - installed_package = self.installcache.dep_bestmatch(package) - result = "" - version = self.getVersion(installed_package,search.VERSION_RELEASE) - if len(version) > 0: - result = darkgreen("Latest version installed:")+" "+version - else: - result = darkgreen("Latest version installed:")+" [ Not Installed ]" - return result - - def getVersion(self,full_package,detail): - if len(full_package) > 1: - package_parts = portage_versions.catpkgsplit(full_package) - if detail == search.VERSION_RELEASE and package_parts[3] != 'r0': - result = package_parts[2]+ "-" + package_parts[3] - else: - result = package_parts[2] - else: - result = "" - return result - - -#build our package digraph -def getlist(mode): - if mode=="system": - mylines=portage.settings.packages - elif mode=="world": - try: - myfile=open(portage.root+portage.WORLD_FILE,"r") - mylines=myfile.readlines() - myfile.close() - except OSError: - print "!!! Couldn't open "+pfile+"; exiting." - sys.exit(1) - except IOError: - #world file doesn't exist - mylines=[] - mynewlines=[] - for x in mylines: - myline=" ".join( x.split() ) - if not len(myline): - continue - elif myline[0]=="#": - continue - elif mode=="system": - if myline[0]!="*": - continue - myline=myline[1:] - mynewlines.append(myline.strip()) - return mynewlines - -def genericdict(mylist): - mynewdict={} - for x in mylist: - mynewdict[portage.portage_dep.dep_getkey(x)]=x - return mynewdict - -olddbapi=None -class depgraph: - - def __init__(self,myaction,myopts): - global olddbapi - self.pkgsettings = portage.config(clone=portage.settings) - if not self.pkgsettings["ARCH"]: - portage.writemsg(red("\a!!! ARCH is not set... Are you missing the /etc/make.profile symlink?\n")) - portage.writemsg(red("\a!!! Is the symlink correct? Is your portage tree complete?\n\n")) - sys.exit(9) - self.applied_useflags = {} - - self.missingbins=[] - self.myaction=myaction - self.mynewgraph = DependencyGraph() - self.orderedkeys=[] - self.outdatedpackages=[] - self.mydbapi={} - self.mydbapi["/"] = portage.fakedbapi() - if "empty" not in myparams: - for pkg in portage.db["/"]["vartree"].getallcpv(): - self.mydbapi["/"].cpv_inject(pkg) - if portage.root != "/": - self.mydbapi[portage.root] = portage.fakedbapi() - if "empty" not in myparams: - for pkg in portage.db[portage.root]["vartree"].getallcpv(): - self.mydbapi[portage.root].cpv_inject(pkg) - - if "--usepkg" in myopts: - portage.db["/"]["bintree"].populate(("--getbinpkg" in myopts), ("--getbinpkgonly" in myopts)) - - def create(self,mybigkey,myparent=None,addme=1,myuse=None): - """creates the actual digraph of packages to merge. return 1 on success, 0 on failure - mybigkey = specification of package to merge; myparent = parent package (one depending on me); - addme = should I be added to the tree? (for the --onlydeps mode)""" - #stuff to add: - #SLOT-aware emerge - #IUSE-aware emerge - #"no downgrade" emerge - #print "mybigkey:",mybigkey - - jbigkey=" ".join(mybigkey) - if self.mynewgraph.has_node(jbigkey+" merge") or self.mynewgraph.has_node(jbigkey+" nomerge"): - if myparent: - if self.mynewgraph.has_node(jbigkey+" merge"): - child = jbigkey+" merge" - else: - child = jbigkey+" nomerge" - self.mynewgraph.add_relationship(myparent, child) - #this conditional is needed to prevent infinite recursion on already-processed deps - return 1 - - update_spinner() - - mytype,myroot,mykey=mybigkey - # select the correct /var database that we'll be checking against - vardbapi=portage.db[myroot]["vartree"].dbapi - - if addme: - if mytype=="blocks": - # we've encountered a "blocks" node. We will totally ignore this - # node and not add it to our digraph if it doesn't apply to us. - if myparent and (self.mydbapi[myroot].match(mykey) or vardbapi.match(mykey)): - mybigkey.append(myparent.split()[2]) - self.mynewgraph.add_node(" ".join(mybigkey)) - self.mynewgraph.add_relationship(myparent, " ".join(mybigkey)) - return 1 - - if myuse == None: - self.pkgsettings.setcpv(mykey) - myuse=self.pkgsettings["USE"].split() - - self.applied_useflags[mykey] = myuse - - merging=1 - if addme: - # this is where we add the node to the list of packages to merge - if not myparent: - # command-line specified or part of a world list... - if ("self" not in myparams) or (("selective" in myparams) and vardbapi.cpv_exists(mykey)): - # the package is on the system, so don't merge it. - merging=0 - elif ("selective" in myparams) and vardbapi.cpv_exists(mykey): - merging=0 - - if (merging==0 and "--newuse" in myopts and vardbapi.cpv_exists(mykey)): - iuses=portage.portdb.aux_get(mykey, ["IUSE"])[0].split() - old_use=vardbapi.aux_get(mykey, ["USE"])[0].split() - now_use=self.pkgsettings["USE"].split() - for x in iuses: - if (old_use.count(x) and not now_use.count(x)) or (not old_use.count(x) and now_use.count(x)): - merging=1 - break - else: - #onlydeps mode; don't merge - merging=2 - - # if the package is already on the system, we add a "nomerge" - # directive, otherwise we add a "merge" directive. - if merging==1: - mybigkey.append("merge") - else: - mybigkey.append("nomerge") - - # whatever the case, we need to add the node to our digraph so - # that children can depend upon it. - self.mynewgraph.add_node(" ".join(mybigkey)) - if myparent: - self.mynewgraph.add_relationship(myparent, " ".join(mybigkey)) - if ("deep" not in myparams) and (not merging): - return 1 - elif "recurse" not in myparams: - return 1 - - edepend={} - if mytype=="binary": - mypkgparts=portage_versions.catpkgsplit(mykey) - tbz2name = mykey.split("/")[1]+".tbz2" - if tbz2name in portage.db[portage.root]["bintree"].invalids: - sys.stderr.write("\nINVALID PACKAGE (is required to continue): "+str(mykey)+"\n") - sys.exit(1) - if portage.db[portage.root]["bintree"].isremote(mykey): - edepend = portage.db[portage.root]["bintree"].remotepkgs[tbz2name] - edepend["DEPEND"] ="" - edepend["RDEPEND"]=" ".join(edepend["RDEPEND"].split()) - edepend["PDEPEND"]=" ".join(edepend["PDEPEND"].split()) - edepend["CDEPEND"]=" ".join(edepend["CDEPEND"].split()) - edepend["SLOT"] =edepend["SLOT"].strip() - #portage.db[portage.root]["bintree"].gettbz2(mykey) - else: # It's local. - mytbz2=xpak.tbz2(portage.db[portage.root]["bintree"].getname(mykey)) - edepend["DEPEND"] ="" - edepend["RDEPEND"]=" ".join(mytbz2.getelements("RDEPEND")) - edepend["PDEPEND"]=" ".join(mytbz2.getelements("PDEPEND")) - edepend["CDEPEND"]=" ".join(mytbz2.getelements("CDEPEND")) - edepend["SLOT"] =mytbz2.getfile("SLOT",mypkgparts[2]) - elif mytype=="ebuild": - try: - mymeta = ["DEPEND","RDEPEND","PDEPEND","CDEPEND"] - myfoo = portage.portdb.aux_get(mykey, mymeta) - for index in range(0,len(mymeta)): - edepend[mymeta[index]] = myfoo[index] - except (KeyError,IOError): - print "emerge: create(): aux_get() error on",mykey+"; aborting..." - sys.exit(1) - mydep={} - mp=" ".join(mybigkey) - - if myroot=="/": - mydep["/"]=edepend["DEPEND"]+" "+edepend["RDEPEND"] - if not self.select_dep("/",mydep["/"],myparent=mp,myuse=myuse): - return 0 - else: - mydep["/"]=edepend["DEPEND"] - mydep[myroot]=edepend["RDEPEND"] - if not self.select_dep("/",mydep["/"],myparent=mp,myuse=myuse): - return 0 - if not self.select_dep(myroot,mydep[myroot],myparent=mp,myuse=myuse): - return 0 - - if edepend.has_key("PDEPEND") and edepend["PDEPEND"]: - # Post Depend -- Add to the list without a parent, as it depends - # on a package being present AND must be built after that package. - if not self.select_dep(myroot,edepend["PDEPEND"],myuse=myuse): - return 0 - - return 1 - - def select_files(self,myfiles): - "given a list of .tbz2s, .ebuilds and deps, create the appropriate depgraph and return a favorite list" - myfavorites=[] - for x in myfiles: - if x[-5:]==".tbz2": - if not os.path.exists(x): - if os.path.exists(self.pkgsettings["PKGDIR"]+"/All/"+x): - x=self.pkgsettings["PKGDIR"]+"/All/"+x - elif os.path.exists(self.pkgsettings["PKGDIR"]+"/"+x): - x=self.pkgsettings["PKGDIR"]+"/"+x - else: - print "\n\n!!! Binary package '"+str(x)+"' does not exist." - print "!!! Please ensure the tbz2 exists as specified.\n" - sys.exit(1) - mytbz2=xpak.tbz2(x) - mykey=mytbz2.getelements("CATEGORY")[0]+"/"+os.path.basename(x)[:-5] - if os.path.realpath(portage.db["/"]["bintree"].getname(mykey)) != os.path.realpath(x): - print red("\n*** You need to adjust PKGDIR to emerge this package.\n") - sys.exit(1) - if not self.create(["binary",portage.root,mykey],None,"--onlydeps" not in myopts): - return (0,myfavorites) - elif not "--oneshot" in myopts: - myfavorites.append(mykey) - elif x[-7:]==".ebuild": - x = os.path.realpath(x) - mykey=os.path.basename(os.path.normpath(x+"/../.."))+"/"+os.path.basename(x)[:-7] - ebuild_path = portage.db["/"]["porttree"].dbapi.findname(mykey) - if ebuild_path: - if os.path.realpath(ebuild_path) != x: - print red("\n*** You need to adjust PORTDIR or PORTDIR_OVERLAY to emerge this package.\n") - sys.exit(1) - if mykey not in portage.db["/"]["porttree"].dbapi.xmatch("match-visible", portage.portage_dep.dep_getkey(mykey)): - print red("\n*** You are emerging a masked package. It is MUCH better to use") - print red("*** /etc/portage/package.* to accomplish this. See portage(5) man") - print red("*** page for details.") - countdown(EMERGE_WARNING_DELAY, "Continuing...") - else: - print red("\n*** "+x+" does not exist") - sys.exit(1) - if not self.create(["ebuild",portage.root,mykey],None,"--onlydeps" not in myopts): - return (0,myfavorites) - elif not "--oneshot" in myopts: - myfavorites.append(mykey) - else: - try: - mykey=portage.dep_expand(x,portage.portdb) - except ValueError, errpkgs: - print "\n\n!!! The short ebuild name \"" + x + "\" is ambiguous. Please specify" - print "!!! one of the following fully-qualified ebuild names instead:\n" - for i in errpkgs[0]: - print " " + green(i) - print - sys.exit(1) - - # select needs to return 0 on dep_check failure - - sys.stdout.flush() - sys.stderr.flush() - - try: - self.mysd = self.select_dep(portage.root,mykey,arg=x) - except portage_exception.MissingSignature, e: - portage.writemsg("\n\n!!! A missing gpg signature is preventing portage from calculating the\n") - portage.writemsg("!!! required dependencies. This is a security feature enabled by the admin\n") - portage.writemsg("!!! to aid in the detection of malicious intent.\n\n") - portage.writemsg("!!! THIS IS A POSSIBLE INDICATION OF A TAMPERED FILES -- CHECK CAREFULLY.\n") - portage.writemsg("!!! Affected file: %s\n" % (e)) - sys.exit(1) - except portage_exception.InvalidSignature, e: - portage.writemsg("\n\n!!! An invalid gpg signature is preventing portage from calculating the\n") - portage.writemsg("!!! required dependencies. This is a security feature enabled by the admin\n") - portage.writemsg("!!! to aid in the detection of malicious intent.\n\n") - portage.writemsg("!!! THIS IS A POSSIBLE INDICATION OF A TAMPERED FILES -- CHECK CAREFULLY.\n") - portage.writemsg("!!! Affected file: %s\n" % (e)) - sys.exit(1) - except SystemExit, e: - raise # Needed else can't exit - except Exception, e: - if "--debug" in myopts: - raise - print "\n\n!!! Problem in",mykey,"dependencies." - print "!!!",str(e),e.__module__ - sys.exit(1) - - if not self.mysd: - return (0,myfavorites) - elif not "--oneshot" in myopts: - myfavorites.append(mykey) - - missing=0 - if "--usepkgonly" in myopts: - for x in self.mynewgraph.get_all_nodes(): - xs=x.split(" ") - if (xs[0] != "binary") and (xs[3]=="merge"): - if missing == 0: - print - missing += 1 - print "Missing binary for:",xs[2] - - # We're true here unless we are missing binaries. - return (not missing,myfavorites) - - def select_dep(self,myroot,depstring,myparent=None,arg=None,myuse=None): - "given a dependency string, create the appropriate depgraph and return 1 on success and 0 on failure" - if "--debug" in myopts: - print - print "Parent: ",myparent - print "Depstring:",depstring - if not arg: - #processing dependencies - mycheck=portage.dep_check(depstring,self.mydbapi[myroot],self.pkgsettings,myuse=myuse,use_binaries=("--usepkg" in myopts)) - #mycheck=portage.dep_check(depstring,self.mydbapi[myroot],self.pkgsettings,myuse=myuse) - - if not mycheck[0]: - mymerge=[] - else: - mymerge=mycheck[1] - - else: - #we're processing a command-line argument; unconditionally merge it even if it's already merged - mymerge=[depstring] - - # dep_check has been run so we can now add our parent to our - # build state to update virtuals and other settings. This - # happens after the package is added to the tree so that a - # package can depend on a virtual which it satisfies. - if myparent: - myp = myparent.split() - if myp[3]=="merge": - self.mydbapi[myroot].cpv_inject(myp[2]) - if myp[0]=="binary": - self.pkgsettings.setinst(myp[2],portage.db["/"]["bintree"].dbapi) - else: - self.pkgsettings.setinst(myp[2],portage.db[myroot]["porttree"].dbapi) - - if not mymerge: - return 1 - - if "--debug" in myopts: - print "Candidates:",mymerge - for x in mymerge: - myk=None - binpkguseflags=None - if x[0]=="!": - # if this package is myself, don't append it to block list. - if "--debug" in myopts: - print "Myparent",myparent - if (myparent): - if myparent.split()[2] in portage.portdb.xmatch("match-all", x[1:]): - # myself, so exit. - continue - # adding block - myk=["blocks",myroot,x[1:]] - else: - #We are not processing a blocker but a normal dependency - myeb=None - myeb_matches = portage.portdb.xmatch("match-visible",x) - if ("--usepkgonly" not in myopts): - myeb=portage.best(myeb_matches) - - myeb_pkg=None - if ("--usepkg" in myopts): - # The next line assumes the binarytree has been populated. - # XXX: Need to work out how we use the binary tree with roots. - myeb_pkg_matches=portage.db["/"]["bintree"].dbapi.match(x) - if ("--usepkgonly" not in myopts): - # Remove any binary package entries that are masked in the portage tree (#55871) - for idx in range(len(myeb_pkg_matches)-1,-1,-1): - if myeb_pkg_matches[idx] not in myeb_matches: - del myeb_pkg_matches[idx] - myeb_pkg = portage.best(myeb_pkg_matches) - if myeb_pkg == '': - myeb_pkg = None - - if (not myeb) and (not myeb_pkg): - if not arg: - xinfo='"'+x+'"' - else: - xinfo='"'+arg+'"' - if myparent: - xfrom = '(dependency required by '+green('"'+myparent.split()[2]+'"')+red(' ['+myparent.split()[0]+"])") - alleb=portage.portdb.xmatch("match-all",x) - if alleb: - if "--usepkgonly" not in myopts: - print "\n!!! "+red("All ebuilds that could satisfy ")+green(xinfo)+red(" have been masked.") - print "!!! One of the following masked packages is required to complete your request:" - oldcomment = "" - for p in alleb: - mreasons = portage.portdb.getmaskingstatus(p) - print "- "+p+" (masked by: "+", ".join(mreasons)+")" - comment = portage.portdb.getmaskingreason(p) - if comment and comment != oldcomment: - print comment - oldcomment = comment - print - print "For more information, see MASKED PACKAGES section in the emerge man page or " - print "section 2.2 \"Software Availability\" in the Gentoo Handbook." - if myparent: - print "!!! "+red(xfrom) - print - else: - print "\n!!! "+red("There are no packages available to satisfy: ")+green(xinfo) - print "!!! Either add a suitable binary package or compile from an ebuild." - else: - print "\nemerge: there are no ebuilds to satisfy "+xinfo+"." - print - return 0 - - if "--debug" in myopts: - print "ebuild:",myeb - print "binpkg:",myeb_pkg - - if myeb and myeb_pkg: - myeb_s = portage_versions.catpkgsplit(myeb) - myeb_s = [myeb_s[0]+"/"+myeb_s[1], myeb_s[2], myeb_s[3]] - myeb_pkg_s = portage_versions.catpkgsplit(myeb_pkg) - myeb_pkg_s = [myeb_pkg_s[0]+"/"+myeb_pkg_s[1], myeb_pkg_s[2], myeb_pkg_s[3]] - - if portage_versions.pkgcmp(myeb_s, myeb_pkg_s) == 0: - # pkg is same version as ebuild - myeb = None - else: - myeb_pkg = None - - if myeb: - myk=["ebuild",myroot,myeb] - elif myeb_pkg: - binpkguseflags=portage.db[portage.root]["bintree"].get_use(myeb_pkg) - myk=["binary",myroot,myeb_pkg] - else: - sys.stderr.write("!!! Confused... Don't know what I'm using for dependency info. :(\n") - sys.exit(1) - - #if "--usepkg" in myopts: - # #If we want to use packages, see if we have a pre-built one... - # mypk=portage.db["/"]["bintree"].dbapi.match(x) - # if myeb in mypk: - # #Use it only if it's exactly the version we want. - # myk=["binary",myroot,myeb] - # else: - # myk=["ebuild",myroot,myeb] - #else: - # myk=["ebuild",myroot,myeb] - if myparent: - #we are a dependency, so we want to be unconditionally added - if not self.create(myk,myparent,myuse=binpkguseflags): - return 0 - else: - #if mysource is not set, then we are a command-line dependency and should not be added - #if --onlydeps is specified. - if not self.create(myk,myparent,"--onlydeps" not in myopts,myuse=binpkguseflags): - return 0 - - if "--debug" in myopts: - print "Exiting...",myparent - return 1 - - - def altlist(self): - mygraph=self.mynewgraph.clone() - dolist=["/"] - retlist=[] - for x in portage.db: - portage.db[x]["merge"]=[] - if x not in dolist: - dolist.append(x) - while mygraph.get_all_nodes(): - mycurkey=mygraph.get_leaf_nodes()[0] - splitski=mycurkey.split() - portage.db[splitski[1]]["merge"].append(splitski) - mygraph.remove_node(mycurkey) - for x in dolist: - for y in portage.db[x]["merge"]: - retlist.append(y) - return retlist - - def xcreate(self,mode="system"): - global syslist - if mode=="system": - mylist=syslist - else: - #world mode - worldlist=getlist("world") - sysdict=genericdict(syslist) - worlddict=genericdict(worldlist) - #we're effectively upgrading sysdict to contain all new deps from worlddict - for x in worlddict.keys(): - #only add the world node if the package is: - #actually installed -- this prevents the remerging of already unmerged packages when we do a world --update; - #actually available -- this prevents emerge from bombing out due to no match being found (we want a silent ignore) - if "empty" in myparams: - if portage.db["/"]["vartree"].dbapi.match(x): - sysdict[x]=worlddict[x] - elif portage.db[portage.root]["vartree"].dbapi.match(x): - #package is installed - sysdict[x]=worlddict[x] - else: - print "\n*** Package in world file is not installed: "+x - mylist = sysdict.values() - - for mydep in mylist: - myeb=portage.portdb.xmatch("bestmatch-visible",mydep) - if not myeb: - #this is an unavailable world entry; just continue - continue - - #THIS NEXT BUNCH OF CODE NEEDS TO BE REPLACED TO SUPPORT WORLD ANTI-DEPS - #if mydep2[0]=="!":, etc. - binpkguseflags = None - if "--usepkg" in myopts: - mypk=portage.db[portage.root]["bintree"].dep_bestmatch(mydep) - if myeb==mypk: - myk=["binary",portage.root,mypk] - binpkguseflags=portage.db[portage.root]["bintree"].get_use(mypk) - elif "--usepkgonly" in myopts: - if not mypk: - self.missingbins += [myeb] - myk=["binary",portage.root,myeb] - else: - myk=["binary",portage.root,mypk] - else: - myk=["ebuild",portage.root,myeb] - else: - myk=["ebuild",portage.root,myeb] - - if not self.create(myk,myuse=binpkguseflags): - print - print "!!! Problem with",myk[0],myk[2] - print "!!! Possibly a DEPEND/*DEPEND problem." - print - return 0 - return 1 - - def match(self,mydep,myroot=portage.root,mykey=None): - # support mutual exclusive deps - if mydep[0]=="!": - #add our blocker; it will be ignored later if necessary (if we are remerging the same pkg, for example) - myk="blocks "+myroot+" "+mydep[1:] - else: - myeb=portage.db[portage.root]["porttree"].dep_bestmatch(mydep) - if not myeb: - if not mykey: - print "\n!!! Error: couldn't find match for",mydep - else: - print "\n!!! Error: couldn't find match for",mydep,"in",mykey - print - sys.exit(1) - - if "--usepkg" in myopts: - mypk=portage.db[portage.root]["bintree"].dep_bestmatch(mydep) - if myeb==mypk: - myk="binary "+portage.root+" "+mypk - else: - myk="ebuild "+myroot+" "+myeb - else: - myk="ebuild "+myroot+" "+myeb - - return myk - - def display(self,mylist): - changelogs=[] - p=[] - totalsize=0 - - if verbosity: - overlays = portage.settings['PORTDIR_OVERLAY'].split() - - i = 0 - while i < len(mylist): - if mylist[i][-1]=="nomerge": - # we don't care about this elements - mylist.pop(i) - continue - # the branch continues, or we've found a good element. - # -> let's see what's next, if anything - i += 1 - - display_overlays=False - # files to fetch list - avoids counting a same file twice - # in size display (verbose mode) - myfetchlist=[] - for x in mylist: - fetch=" " - - if x[0]=="blocks": - addl=""+red("B")+" "+fetch+" " - resolved=portage.db[x[1]]["vartree"].resolve_key(x[2]) - print "["+x[0]+" "+addl+"]",red(resolved), - if resolved!=x[2]: - if x[3]: - print red("(\""+x[2]+"\" is blocking "+x[3]+")") - else: - print red("(\""+x[2]+"\")") - else: - if x[3]: - print red("(is blocking "+x[3]+")") - else: - print - else: - if (x[0]!="binary") and ("fetch" in portage.portdb.aux_get(x[2],["RESTRICT"])[0].split()): - fetch = red("F") - if portage.portdb.fetch_check(x[2], portage.settings): - fetch = green("f") - - #we need to use "--emptrytree" testing here rather than "empty" param testing because "empty" - #param is used for -u, where you still *do* want to see when something is being upgraded. - myoldbest="" - if (not "--emptytree" in myopts) and portage.db[x[1]]["vartree"].exists_specific(x[2]): - addl=" "+yellow("R")+fetch+" " - elif (not "--emptytree" in myopts) and portage.db[x[1]]["vartree"].exists_specific_cat(x[2]): - if x[0] == "binary": - mynewslot=portage.db["/"]["bintree"].getslot(x[2]) - elif x[0] == "ebuild": - mynewslot=portage.db["/"]["porttree"].getslot(x[2]) - myoldlist=portage.db[x[1]]["vartree"].dbapi.match(portage_versions.pkgsplit(x[2])[0]) - myinslotlist=filter((lambda p: portage.db[portage.root]["vartree"].getslot(p)==mynewslot),myoldlist) - if myinslotlist: - myoldbest=portage.best(myinslotlist) - addl=" "+fetch - if portage_versions.pkgcmp(portage_versions.pkgsplit(x[2]), portage_versions.pkgsplit(myoldbest)) < 0: - # Downgrade in slot - addl+=turquoise("U")+blue("D") - else: - # Update in slot - addl+=turquoise("U")+" " - else: - # New slot, mark it new. - addl=" "+green("NS")+fetch+" " - - if "--changelog" in myopts: - changelogs.extend(self.calc_changelog( - portage.portdb.findname(x[2]), - portage.db["/"]["vartree"].dep_bestmatch('/'.join(portage_versions.catpkgsplit(x[2])[:2])), - x[2] - )) - else: - addl=" "+green("N")+" "+fetch+" " - - verboseadd="" - if verbosity > 0: - # iuse verbose - try: - if x[0] == "binary": - iuse_split = portage.db["/"]["bintree"].dbapi.aux_get(x[2],["IUSE"])[0].split() - elif x[0] == "ebuild": - iuse_split = portage.portdb.aux_get(x[2],["IUSE"])[0].split() - else: - iuse_split = [] - except SystemExit, e: - raise # Needed else can't exit - except: - portage.writemsg("!!! Error getting IUSE (report this to bugs.gentoo.org)\n") - portage.writemsg("!!! %s\n" % x) - iuse_split = [] - iuse_split.sort() - old_use=None - if myoldbest: - pkg=myoldbest - else: - pkg=x[2] - if portage.db["/"]["vartree"].dbapi.cpv_exists(pkg): - try: - old_use=portage.db["/"]["vartree"].dbapi.aux_get(pkg, ["USE"])[0].split() - except SystemExit, e: - raise # Needed else can't exit - except: - pass - iuse="" - now_use=self.applied_useflags[x[2]] - for ebuild_iuse in portage_util.unique_array(iuse_split): - usechange="" - if old_use: - if (old_use.count(ebuild_iuse) and not now_use.count(ebuild_iuse)) or (not old_use.count(ebuild_iuse) and now_use.count(ebuild_iuse)): - usechange="*" - - if ebuild_iuse in self.applied_useflags[x[2]]: - if usechange == "*": - iuse=green("+"+ebuild_iuse) - else: - iuse=red("+"+ebuild_iuse) - elif ebuild_iuse in portage.settings.usemask: - iuse=blue("(-"+ebuild_iuse+")") - else: - iuse=blue("-"+ebuild_iuse) - verboseadd+=iuse+usechange+" " - if (verbosity and "--pretend" not in myopts) or \ - (verbosity > 1 and "--pretend" in myopts): - # show herd/maintainers. - metadata_file=portage.settings["PORTDIR"] + "/" + portage.portage_versions.pkgsplit(x[2])[0] + "/metadata.xml" - if not os.path.exists(metadata_file): - verboseadd += red("(Missing metadata.xml) ") - else: - parser = portage_metadata.make_parser() - handler = portage_metadata.Metadata_XML() - handler._maintainers = [] - handler._herds = [] - parser.setContentHandler(handler) - parser.parse( metadata_file ) - - if len(handler._herds) > 0: - verboseadd += "("+ teal("H:" + ", ".join(handler._herds) ) + ")" - if len(handler._maintainers) < 1: - verboseadd += " (" + teal("M:" + ", ".join(handler._herds) ) + ") " - else: - verboseadd += " (" + teal("M:" + ", ".join(handler._maintainers) ) + ") " - - - # size verbose - mysize=0 - if x[0] == "ebuild" and x[-1]!="nomerge": - myfilesdict=portage.portdb.getfetchsizes(x[2], useflags=self.applied_useflags[x[2]], debug=edebug) - if myfilesdict==None: - myfilesdict="[empty/missing/bad digest]" - else: - for myfetchfile in myfilesdict.keys(): - if myfetchfile not in myfetchlist: - mysize+=myfilesdict[myfetchfile] - myfetchlist.append(myfetchfile) - totalsize+=mysize - verboseadd+=format_size(mysize)+" " - - # overlay verbose - # XXX: Invalid binaries have caused tracebacks here. 'if file_name' - # x = ['binary', '/', 'sys-apps/pcmcia-cs-3.2.7.2.6', 'merge'] - file_name=portage.portdb.findname(x[2]) - if file_name: # It might not exist in the tree - dir_name=os.path.abspath(os.path.dirname(file_name)+"/../..") - if (overlays.count(dir_name)>0): - verboseadd+=teal("["+str(overlays.index(os.path.normpath(dir_name))+1)+"]")+" " - display_overlays=True - else: - verboseadd += "[No ebuild?]" - - xs=portage.portage_versions.pkgsplit(x[2]) - if xs[2]=="r0": - xs=(xs[0],xs[1],"") - else: - xs=(xs[0],xs[1],"-"+xs[2]) - - if self.pkgsettings.has_key("COLUMNWIDTH"): - mywidth=int(self.pkgsettings["COLUMNWIDTH"]) - else: - mywidth=130 - oldlp=mywidth-30 - newlp=oldlp-30 - - indent="" - - if myoldbest: - myoldbest=portage_versions.pkgsplit(myoldbest)[1]+"-"+portage.portage_versions.pkgsplit(myoldbest)[2] - if myoldbest[-3:]=="-r0": - myoldbest=myoldbest[:-3] - myoldbest=blue("["+myoldbest+"]") - - if x[1]!="/": - if "--columns" in myopts: - myprint="["+x[0]+" "+addl+"] "+indent+darkgreen(xs[0]) - if (newlp-nc_len(myprint)) > 0: - myprint=myprint+(" "*(newlp-nc_len(myprint))) - myprint=myprint+"["+darkblue(xs[1]+xs[2])+"] " - if (oldlp-nc_len(myprint)) > 0: - myprint=myprint+" "*(oldlp-nc_len(myprint)) - myprint=myprint+myoldbest - myprint=myprint+darkgreen(" to "+x[1])+" "+verboseadd - else: - myprint="["+x[0]+" "+addl+"] "+darkgreen(x[2])+" "+myoldbest+" "+darkgreen("to "+x[1])+" "+verboseadd - else: - if "--columns" in myopts: - myprint="["+x[0]+" "+addl+"] "+indent+darkgreen(xs[0]) - if (newlp-nc_len(myprint)) > 0: - myprint=myprint+(" "*(newlp-nc_len(myprint))) - myprint=myprint+green(" ["+xs[1]+xs[2]+"] ") - if (oldlp-nc_len(myprint)) > 0: - myprint=myprint+(" "*(oldlp-nc_len(myprint))) - myprint=myprint+myoldbest+" "+verboseadd - else: - if x[3]=="nomerge": - myprint=darkblue("[nomerge ] "+indent+x[2]+" "+myoldbest+" ")+verboseadd - else: - myprint="["+x[0]+" "+addl+"] "+indent+darkgreen(x[2])+" "+myoldbest+" "+verboseadd - p.append(myprint) - - if ("--tree" not in myopts): - mysplit=portage_versions.pkgsplit(x[2]) - - # XXX mysplit _can_ be None.... Why? - if mysplit and (len(mysplit)==3): - if "--emptytree" not in myopts: - if mysplit[0]=="sys-apps/portage": - if (mysplit[1]+mysplit[2]!=portage.VERSION and - "livecvsportage" not in portage.settings.features): - if mylist.index(x)<len(mylist)-1: - p.append(red("*** Portage will stop merging at this point and reload itself,")) - p.append(red(" recalculate dependencies, and complete the merge.")) - if "--update" not in myopts: - p.append(darkgreen(" You may avoid the remerging of packages by updating portage on its own.")) - print - else: - if mysplit[0]=="sys-apps/portage" and ("--emptytree" in myopts): - if mysplit[1]+mysplit[2]!=portage.VERSION: - p.append(red("***")+" Please update portage to the above version before proceeding.") - p.append(" Failure to do so may result in failed or improper merges.") - p.append(" A simple '"+green("emerge -u portage")+"' is sufficient.") - p.append("") - del mysplit - - for x in p: - print x - - if verbosity: - print - print "Total size of downloads: "+format_size(totalsize) - if overlays and display_overlays: - print "Portage overlays:" - y=0 - for x in overlays: - y=y+1 - print " "+teal("["+str(y)+"]"),x - - if "--changelog" in myopts: - print - for revision,text in changelogs: - print bold('*'+revision) - sys.stdout.write(text) - - def calc_changelog(self,ebuildpath,current,next): - current = '-'.join(portage_versions.catpkgsplit(current)[1:]) - if current.endswith('-r0'): current = current[:-3] - next = '-'.join(portage_versions.catpkgsplit(next)[1:]) - if next.endswith('-r0'): next = next[:-3] - changelogpath = os.path.join(os.path.split(ebuildpath)[0],'ChangeLog') - try: - changelog = open(changelogpath).read() - except SystemExit, e: - raise # Needed else can't exit - except: - return [] - divisions = self.find_changelog_tags(changelog) - #print 'XX from',current,'to',next - #for div,text in divisions: print 'XX',div - # skip entries for all revisions above the one we are about to emerge - for i in range(len(divisions)): - if divisions[i][0]==next: - divisions = divisions[i:] - break - # find out how many entries we are going to display - for i in range(len(divisions)): - if divisions[i][0]==current: - divisions = divisions[:i] - break - else: - # couldnt find the current revision in the list. display nothing - return [] - return divisions - - def find_changelog_tags(self,changelog): - divs = [] - release = None - while 1: - match = re.search(r'^\*\ ?([-a-zA-Z0-9_.]*)(?:\ .*)?\n',changelog,re.M) - if match is None: - if release is not None: - divs.append((release,changelog)) - return divs - if release is not None: - divs.append((release,changelog[:match.start()])) - changelog = changelog[match.end():] - release = match.group(1) - if release.endswith('.ebuild'): - release = release[:-7] - if release.endswith('-r0'): - release = release[:-3] - - def outdated(self): - return self.outdatedpackages - -#retval=portage.doebuild(y,"fetch",myroot,self.pkgsettings,edebug,("--pretend" in myopts),fetchonly=1,fetchall=1) - def __fetch(self, pkg_list,fd_pipes={1:1,2:2},fetchall=False,verbosity=0): - mysettings = portage.config(clone=self.pkgsettings) -# print "passed pkg_list",pkg_list - print "kiddie pid is %i" % os.getpid() - for x in ('autoaddcvs','cvs'): - try: portage.features.remove(x) - except ValueError: pass - for x in pkg_list: - y=portage.portdb.findname(x[2]) - print "fetching",y - try: - ret = portage.doebuild(y,"fetch", x[1], mysettings,False, False, fetchonly=True, fetchall=fetchall,verbosity=verbosity) - except Exception,e: - ret=1 - if ret: - return False - - def merge(self,mylist): - returnme=0 - mymergelist=[] - - #check for blocking dependencies - if ("--fetchonly" not in myopts) and ("--buildpkgonly" not in myopts): - for x in mylist: - if x[0]=="blocks": - print "\n!!! Error: the "+x[2]+" package conflicts with another package." - print "!!! both can't be installed on the same system together." - print "!!! Please use 'emerge --pretend' to determine blockers." - print - if ("--pretend" not in myopts): - sys.exit(1) - - #buildsyspkg: I need mysysdict also on resume (moved from the else block) - mysysdict=genericdict(syslist) - if ("--resume" in myopts): - # We're resuming. - print green("*** Resuming merge...") - emergelog(" *** Resuming merge...") - mymergelist=portage.mtimedb["resume"]["mergelist"][:] - if ("--skipfirst" in myopts) and mymergelist: - del portage.mtimedb["resume"]["mergelist"][0] - del mymergelist[0] - else: - myfavs=portage.grabfile(portage.root+portage.WORLD_FILE) - myfavdict=genericdict(myfavs) - for x in range(len(mylist)): - if mylist[x][3]!="nomerge": - # Add to the mergelist - mymergelist.append(mylist[x]) - else: - myfavkey=portage.cpv_getkey(mylist[x][2]) - if "--onlydeps" in myopts: - continue - # Add to the world file. Since we won't be able to later. - if (not "--fetchonly" in myopts) and (myfavkey in favorites): - #don't record if already in system profile or already recorded - if (not mysysdict.has_key(myfavkey)) and (not myfavdict.has_key(myfavkey)): - #we don't have a favorites entry for this package yet; add one - myfavdict[myfavkey]=myfavkey - print ">>> Recording",myfavkey,"in \"world\" favorites file..." - if not "--fetchonly" in myopts: - portage.writedict(myfavdict,portage.root+portage.WORLD_FILE,writekey=0) - - portage.mtimedb["resume"]["mergelist"]=mymergelist[:] - - # We need to yank the harmful-to-new-builds settings from features. - myorigfeat=self.pkgsettings["FEATURES"] - myfeat=myorigfeat.split() - while "keeptemp" in myfeat: - myfeat.remove("keeptemp") - while "keepwork" in myfeat: - myfeat.remove("keepwork") - - self.pkgsettings["FEATURES"]=" ".join(myfeat) - self.thread = None - - # parallel-fetch should only kick in when not pretending, emerge isn't just fetching, - # and there is more then one node being processed. - if "parallel-fetch" in self.pkgsettings["FEATURES"] and not \ - ("--ask" in myopts or "--pretend" in myopts or "--fetchonly" in myopts) and \ - len(mymergelist) > 1: - if "distlocks" not in self.pkgsettings["FEATURES"]: - print red("!!!") - print red("!!!")+" parallel-fetching would've been enabled, but you lack distlocks" - print red("!!!")+" in your features. so yeah, no go." - print red("!!!")+" enable distlocks to use parallel fetching" - print red("!!!") - import time - time.sleep(5) - else: -# print "mergelist=",mymergelist -# -# self.thread = threading.Thread(target=self.__fetch,args=[mymergelist], \ -# kwargs={"verbosity":1, "fetchall":("--fetchalluri" in myopts)}) -# self.thread.setDaemon(False) -# portage.exit_callbacks.append(self.thread.join) -# self.thread.start() - print ">>> parallel fetching is in the house, hizzay" - print ">>> represent." - portage_exec.spawn_func(self.__fetch,[mymergelist],{"verbosity":1,\ - "fetchall":("--fetchalluri" in myopts)},returnpid=True,fd_pipes={1:1,2:2}) -# time.sleep(2) - - mergecount=0 - for x in mymergelist: - mergecount+=1 - myroot=x[1] - pkgindex=2 - if x[0]=="blocks": - pkgindex=3 - y=portage.portdb.findname(x[pkgindex]) - if not "--pretend" in myopts: - print ">>> emerge ("+str(mergecount)+" of "+str(len(mymergelist))+")",x[pkgindex],"to",x[1] - emergelog(" >>> emerge ("+str(mergecount)+" of "+str(len(mymergelist))+") "+x[pkgindex]+" to "+x[1]) - - self.pkgsettings["EMERGE_FROM"] = x[0][:] - self.pkgsettings.backup_changes("EMERGE_FROM") - - #buildsyspkg: Check if we need to _force_ binary package creation - issyspkg = ("buildsyspkg" in myfeat) \ - and x[0] != "blocks" \ - and mysysdict.has_key(portage.cpv_getkey(x[2])) \ - and not ("--buildpkg" in myopts) - if x[0] in ["ebuild","blocks"]: - if (x[0]=="blocks") and ("--fetchonly" not in myopts): - raise Exception, "Merging a blocker" - elif ("--fetchonly" in myopts) or ("--fetch-all-uri" in myopts): - if ("--fetch-all-uri" in myopts): - retval=portage.doebuild(y,"fetch",myroot,self.pkgsettings,edebug,("--pretend" in myopts),fetchonly=1,fetchall=1) - else: - retval=portage.doebuild(y,"fetch",myroot,self.pkgsettings,edebug,("--pretend" in myopts),fetchonly=1) - if retval: - print - print "!!! Fetch for",y,"failed, continuing..." - print - returnme=1 - continue - elif "--buildpkg" in myopts or issyspkg: - #buildsyspkg: Sounds useful to display something, but I don't know if we should also log it - if issyspkg: - print ">>> This is a system package, let's pack a rescue tarball." - #emergelog(">>> This is a system package, let's pack a rescue tarball.") - #create pkg, then merge pkg - short_msg = "emerge: ("+str(mergecount)+" of "+str(len(mymergelist))+") "+x[pkgindex]+" Clean" - emergelog(" === ("+str(mergecount)+" of "+str(len(mymergelist))+") Cleaning ("+x[pkgindex]+"::"+y+")", short_msg=short_msg) - retval=portage.doebuild(y,"clean",myroot,self.pkgsettings,edebug,cleanup=1) - if retval: - sys.exit(1) - short_msg = "emerge: ("+str(mergecount)+" of "+str(len(mymergelist))+") "+x[pkgindex]+" Compile" - emergelog(" === ("+str(mergecount)+" of "+str(len(mymergelist))+") Compiling/Packaging ("+x[pkgindex]+"::"+y+")", short_msg=short_msg) - retval=portage.doebuild(y,"package",myroot,self.pkgsettings,edebug) - if retval: - sys.exit(1) - #dynamically update our database - if "--buildpkgonly" not in myopts: - portage.db[portage.root]["bintree"].inject(x[2]) - mytbz2=portage.db[portage.root]["bintree"].getname(x[2]) - short_msg = "emerge: ("+str(mergecount)+" of "+str(len(mymergelist))+") "+x[pkgindex]+" Merge" - emergelog(" === ("+str(mergecount)+" of "+str(len(mymergelist))+") Merging ("+x[pkgindex]+"::"+y+")", short_msg=short_msg) - - self.pkgsettings["EMERGE_FROM"] = "binary" - self.pkgsettings.backup_changes("EMERGE_FROM") - - retval=portage.pkgmerge(mytbz2,myroot,self.pkgsettings) - if retval==None: - sys.exit(1) - else: - short_msg = "emerge: ("+str(mergecount)+" of "+str(len(mymergelist))+") "+x[pkgindex]+" Clean" - emergelog(" === ("+str(mergecount)+" of "+str(len(mymergelist))+") Cleaning ("+x[pkgindex]+"::"+y+")", short_msg=short_msg) - retval=portage.doebuild(y,"clean",myroot,self.pkgsettings,edebug,cleanup=1) - if retval: - sys.exit(1) - short_msg = "emerge: ("+str(mergecount)+" of "+str(len(mymergelist))+") "+x[pkgindex]+" Compile" - emergelog(" === ("+str(mergecount)+" of "+str(len(mymergelist))+") Compiling/Merging ("+x[pkgindex]+"::"+y+")", short_msg=short_msg) - retval=portage.doebuild(y,"merge",myroot,self.pkgsettings,edebug) - if retval: - sys.exit(1) - #dynamically update our database - elif x[0]=="binary": - #merge the tbz2 - mytbz2=portage.db[portage.root]["bintree"].getname(x[2]) - if portage.db[portage.root]["bintree"].isremote(x[2]): - short_msg = "emerge: ("+str(mergecount)+" of "+str(len(mymergelist))+") "+x[pkgindex]+" Fetch" - emergelog(" --- ("+str(mergecount)+" of "+str(len(mymergelist))+") Fetching Binary ("+x[pkgindex]+"::"+mytbz2+")", short_msg=short_msg) - portage.db[portage.root]["bintree"].gettbz2(x[2]) - - if ("--fetchonly" in myopts) or ("--fetch-all-uri" in myopts): - continue - - short_msg = "emerge: ("+str(mergecount)+" of "+str(len(mymergelist))+") "+x[pkgindex]+" Merge Binary" - emergelog(" === ("+str(mergecount)+" of "+str(len(mymergelist))+") Merging Binary ("+x[pkgindex]+"::"+mytbz2+")", short_msg=short_msg) - retval=portage.pkgmerge(mytbz2,x[1],self.pkgsettings) - if retval==None: - sys.exit(1) - #need to check for errors - if "--buildpkgonly" not in myopts: - portage.db[x[1]]["vartree"].inject(x[2]) - myfavkey=portage.cpv_getkey(x[2]) - if (not "--fetchonly" in myopts) and (not "--fetch-all-uri" in myopts) and (myfavkey in favorites): - myfavs=portage.grabfile(myroot+portage.WORLD_FILE) - myfavdict=genericdict(myfavs) - mysysdict=genericdict(syslist) - #don't record if already in system profile or already recorded - if ("--update" not in myopts or not portage.db[portage.root]["vartree"].dbapi.match(myfavkey)) and \ - (not mysysdict.has_key(myfavkey)) and (not myfavdict.has_key(myfavkey)): - #we don't have a favorites entry for this package yet; add one - myfavdict[myfavkey]=myfavkey - print ">>> Recording",myfavkey,"in \"world\" favorites file..." - emergelog(" === ("+str(mergecount)+" of "+str(len(mymergelist))+") Updating world file ("+x[pkgindex]+")") - portage.writedict(myfavdict,myroot+portage.WORLD_FILE,writekey=0) - - if ("noclean" not in portage.features) and (x[0] != "binary"): - short_msg = "emerge: ("+str(mergecount)+" of "+str(len(mymergelist))+") "+x[pkgindex]+" Clean Post" - emergelog(" === ("+str(mergecount)+" of "+str(len(mymergelist))+") Post-Build Cleaning ("+x[pkgindex]+"::"+y+")", short_msg=short_msg) - retval=portage.doebuild(y,"clean",myroot,self.pkgsettings,edebug,cleanup=1) - if retval: - sys.exit(1) - - if ("--pretend" not in myopts) and ("--fetchonly" not in myopts) and ("--fetch-all-uri" not in myopts): - # Clean the old package that we have merged over top of it. - xsplit=portage.portage_versions.pkgsplit(x[2]) - emergelog(" >>> AUTOCLEAN: "+xsplit[0]) - retval=unmerge("clean", [xsplit[0]]) - if not retval: - emergelog(" --- AUTOCLEAN: Nothing unmerged.") - - # Figure out if we need a restart. - mysplit=portage.portage_versions.pkgsplit(x[2]) - if mysplit[0]=="sys-apps/portage": - myver=mysplit[1]+"-"+mysplit[2] - if myver[-3:]=='-r0': - myver=myver[:-3] - if (myver!=portage.VERSION and - "livecvsportage" not in portage.settings.features): - if len(mymergelist) > mergecount: - myargv=sys.argv - myr=0 - for myra in range(len(myargv)): - if myargv[myr][0:len("portage")]=="portage": - del myargv[myr] - myr-=1 - if myargv[myr][0:len("sys-apps/portage")]=="sys-apps/portage": - del myargv[myr] - myr-=1 - myr+=1 - emergelog(" *** RESTARTING emerge via exec() after change of portage version.") - portage.portageexit() - badlongopts = ["--ask","--tree","--changelog"] - badshortopts = ["a","t","l"] - mynewargv=[] - for arg in myargv: - if arg[0:2] == "--": - if arg in badlongopts: - continue - mynewargv += [arg] - elif arg[0] == "-": - myarg = "-" - for ch in arg[1:]: - if ch in badshortopts: - continue - myarg += ch - mynewargv += [myarg] - else: - mynewargv += [arg] - os.execv("/usr/lib/portage/bin/emerge", mynewargv) - - if ("--pretend" not in myopts) and ("--fetchonly" not in myopts) and ("--fetch-all-uri" not in myopts): - emergelog(" ::: completed emerge ("+str(mergecount)+" of "+str(len(mymergelist))+") "+x[2]+" to "+x[1]) - - # Unsafe for parallel merges - del portage.mtimedb["resume"]["mergelist"][0] - - if self.thread: - self.thread.join() - self.thread=None - - emergelog(" *** Finished. Cleaning up...") - - # We're out of the loop... We're done. Delete the resume data. - if portage.mtimedb.has_key("resume"): - del portage.mtimedb["resume"] - - if ("--pretend" not in myopts): - if ("--fetchonly" not in myopts) and ("--fetch-all-uri" not in myopts): - if (mergecount>0): - if retval: - portage.env_update(portage.root) - - #by doing an exit this way, --fetchonly can continue to try to - #fetch everything even if a particular download fails. - if "--fetchonly" in myopts or "--fetch-all-uri" in myopts: - if returnme: - print "\n\n!!! Some fetch errors were encountered. Please see above for details.\n\n" - sys.exit(returnme) - else: - sys.exit(0) - -class graph_display: - - def __init__(self, mygraph): - self.graph = mygraph.clone() - - merge_nodes = self.graph.get_all_nodes() - for x in range(len(merge_nodes)-1,-1,-1): - if merge_nodes[x].split()[3] == "nomerge": - del merge_nodes[x] - - relevant = merge_nodes[:] - for x in range(len(merge_nodes)): - parents = self.graph.get_parent_nodes(merge_nodes[x], depth=0) - for node in parents: - if node not in relevant: - relevant.append(node) - - for node in self.graph.get_all_nodes(): - if node not in relevant: - self.graph.remove_node(node) - - self.fetchsizes = {} - self.overlays = [] - self.changelogs = [] - - def old_version(self, mydep): - dep_type = mydep[0] - dep_root = mydep[1] - dep_pkg = mydep[2] - - if not portage.db[dep_root]["vartree"].exists_specific_cat(dep_pkg): - return None - - if dep_type == "binary": - mynewslot=portage.db["/"]["bintree"].getslot(dep_pkg) - else: - mynewslot=portage.db["/"]["porttree"].getslot(dep_pkg) - - mycurpkgs = portage.db[dep_root]["vartree"].dbapi.match(portage.portage_versions.pkgsplit(dep_pkg)[0]) - for x in range(len(mycurpkgs)-1, -1, -1): - if portage.db[dep_root]["vartree"].getslot(mycurpkgs[x]) != mynewslot: - del mycurpkgs[x] - - if not mycurpkgs: - return None - - return portage.best(mycurpkgs) - - def use_flags(self, mydep): - portage.settings.unlock() - portage.settings.setcpv(mydep[2]) - myflags = portage.settings["USE"].split() - portage.settings.reset() - portage.settings.lock() - return myflags - - def format_summary(self, mydep): - dep_type = mydep[0] - dep_root = mydep[1] - dep_pkg = mydep[2] - dep_extra = mydep[3] - - problem_status = " " - new_status = " " - slot_status = " " - update_status = " " - downgrade_status = " " - - if dep_extra == "nomerge": - dep_type = darkblue("merged") - - elif dep_type == "blocks": - problem_status = red("B") - - else: - if dep_type != "binary": - restrictions = portage.db["/"]["porttree"].dbapi.aux_get(dep_pkg, ["RESTRICT"])[0].split() - if "fetch" in restrictions: - if portage.db["/"]["porttree"].dbapi.fetch_check(dep_pkg, portage.settings): - problem_status = green("f") - else: - problem_status = red("F") - - if portage.db[dep_root]["vartree"].exists_specific(dep_pkg): - new_status = yellow("R") - - else: - prevpkg = self.old_version(mydep) - if prevpkg: - update_status = turquoise("U") - myoldpkg = portage.portage_versions.pkgsplit(prevpkg) - mynewpkg = portage.portage_versions.pkgsplit(dep_pkg) - if portage.portage_versions.pkgcmp(mynewpkg, myoldpkg) < 0: - downgrade_status = blue("D") - else: - new_status = green("N") - if portage.db[dep_root]["vartree"].exists_specific_cat(dep_pkg): - slot_status = green("S") - - summary = "["+dep_type+" " - summary += problem_status - summary += new_status - summary += slot_status - summary += update_status - summary += downgrade_status+"]" - - return summary - - def format_cpv(self, mydep): - if mydep[0] == "blocks": - return red(mydep[2]) - elif mydep[3] == "nomerge": - return darkblue(mydep[2]) - return darkgreen(mydep[2]) - - def format_name(self, mydep): - mysplit = portage.portage_versions.pkgsplit(mydep[2]) - if mysplit: - name = mysplit[0] - else: - name = mydep[2] - - if mydep[0] == "blocks": - return red(name) - elif mydep[3] == "nomerge": - return darkblue(name) - return darkgreen(name) - - def format_new_version(self, mydep): - mysplit = portage.portage_versions.pkgsplit(mydep[2]) - if not mysplit: - return "" - version = mysplit[1] - if mysplit[2] != "r0": - version += "-"+mysplit[2] - - if mydep[0] == "blocks": - return red("["+version+"]") - elif mydep[3] == "nomerge": - return darkblue("["+version+"]") - return darkgreen("["+version+"]") - - def format_old_version(self, mydep): - dep_type = mydep[0] - dep_root = mydep[1] - dep_pkg = mydep[2] - dep_extra = mydep[3] - - if dep_extra == "nomerge": - return "" - - if dep_type == "blocks": - return red("("+dep_extra+")") - - prevpkg = self.old_version(mydep) - - if not prevpkg or prevpkg == dep_pkg: - return "" - - myoldsplit = portage.portage_versions.pkgsplit(prevpkg) - version = myoldsplit[1] - if myoldsplit[2] != "r0": - version += "-"+myoldsplit[2] - return blue("["+version+"]") - - def format_flags(self, mydep): - dep_type = mydep[0] - dep_root = mydep[1] - dep_pkg = mydep[2] - dep_extra = mydep[3] - - if dep_type == "blocks" or dep_extra == "nomerge": - return "" - - if dep_type == "binary": - iuse = portage.db["/"]["bintree"].dbapi.aux_get(dep_pkg,["IUSE"])[0].split() - elif dep_type == "ebuild": - iuse = portage.db["/"]["porttree"].dbapi.aux_get(dep_pkg,["IUSE"])[0].split() - else: - iuse = [] - iuse.sort() - iuse = portage_util.unique_array(iuse) - - cur_use = self.use_flags(mydep) - bad_use = portage.settings.usemask - - prevpkg = self.old_version(mydep) - if prevpkg: - old_use = portage.db[dep_root]["vartree"].dbapi.aux_get(prevpkg, ["USE"])[0].split() - else: - old_use = cur_use - - uselist = [] - for use in iuse: - if use in cur_use: - myuse = red("+"+use) - elif use in bad_use: - myuse = blue("(-"+use+")") - else: - myuse = blue("-"+use) - if (use in old_use and use not in cur_use) or \ - (use not in old_use and use in cur_use): - myuse += "*" - uselist.append(myuse) - - return " ".join(uselist) - - def format_metadata(self, mydep): - catpkg = portage.portage_versions.pkgsplit(mydep[2])[0] - metadata_file = portage.settings["PORTDIR"] + "/" + catpkg + "/metadata.xml" - if not os.path.exists(metadata_file): - return "" - - parser = portage_metadata.make_parser() - handler = portage_metadata.Metadata_XML() - handler._maintainers = [] - handler._herds = [] - parser.setContentHandler(handler) - parser.parse(metadata_file) - - metadata = [] - if handler._herds: - metadata += ["(" + teal("H:" + ", ".join(handler._herds) ) + ")"] - if handler._maintainers: - metadata += ["(" + teal("M:" + ", ".join(handler._maintainers) ) + ")"] - - return " ".join(metadata) - - def format_size(self, mydep): - mysize = 0 - if mydep[0] == "ebuild" and mydep[3] != "nomerge": - myfilesdict=portage.portdb.getfetchsizes(mydep[2], useflags=self.use_flags(mydep), debug=edebug) - if myfilesdict: - for myfetchfile in myfilesdict.keys(): - mysize += myfilesdict[myfetchfile] - self.fetchsizes[myfetchfile] = myfilesdict[myfetchfile] - if mysize: - return format_size(mysize) - return "" - - def post_size_msg(self): - mysize = 0 - for myfetchfile in self.fetchsizes.keys(): - mysize += self.fetchsizes[myfetchfile] - return "Total size of downloads: "+format_size(mysize) - - def format_overlay(self, mydep): - if mydep[0] != "ebuild" or mydep[3] == "nomerge": - return "" - filename = portage.db["/"]["porttree"].dbapi.findname(mydep[2]) - dirname = os.path.abspath(os.path.dirname(filename)+"/../..") - if dirname in portage.settings['PORTDIR_OVERLAY'].split(): - if dirname not in self.overlays: - self.overlays.append(dirname) - return teal("["+str(self.overlays.index(dirname)+1)+"]") - return "" - - def post_overlay_msg(self): - if self.overlays: - msg = "Portage overlays:\n" - for x in range(0, len(self.overlays)): - msg += " "+teal("["+str(x+1)+"]")+" "+self.overlays[x]+"\n" - return msg - return "" - - def find_changelog_tags(self,changelog): - divs = [] - release = None - while 1: - match = re.search(r'^\*\ ?([-a-zA-Z0-9_.]*)(?:\ .*)?\n',changelog,re.M) - if match is None: - if release is not None: - divs.append((release,changelog)) - return divs - if release is not None: - divs.append((release,changelog[:match.start()])) - changelog = changelog[match.end():] - release = match.group(1) - if release.endswith('.ebuild'): - release = release[:-7] - if release.endswith('-r0'): - release = release[:-3] - - def calc_changelog(self,ebuildpath,current,next): - current = '-'.join(portage.portage_versions.catpkgsplit(current)[1:]) - if current.endswith('-r0'): current = current[:-3] - next = '-'.join(portage.portage_versions.catpkgsplit(next)[1:]) - if next.endswith('-r0'): next = next[:-3] - - changelogpath = os.path.join(os.path.split(ebuildpath)[0],'ChangeLog') - if os.path.exists(changelogpath): - changelog = open(changelogpath).read() - else: - return [] - - divisions = self.find_changelog_tags(changelog) - - for i in range(len(divisions)): - if divisions[i][0]==next: - divisions = divisions[i:] - break - - for i in range(len(divisions)): - if divisions[i][0]==current: - divisions = divisions[:i] - break - - return divisions - - def format_changelog(self, mydep): - thispkg = mydep[2] - ebuild_path = portage.db["/"]["porttree"].dbapi.findname(thispkg) - if ebuild_path: - prevpkg = self.old_version(mydep) - if prevpkg: - self.changelogs.extend(self.calc_changelog(ebuild_path, prevpkg, thispkg)) - - def post_changelog_msg(self): - msg = "" - for (revision,text) in self.changelogs: - msg += bold("*"+revision)+"\n" - msg += text - if msg: - return "\n"+msg - return "" - - def display_flat(self): - mygraph = self.graph.clone() - - funclist = [self.format_summary, self.format_cpv, self.format_old_version] - postfuncs = [] - if verbosity: - funclist += [self.format_flags] - if verbosity >= 2: - funclist += [self.format_metadata] - funclist += [self.format_size, self.format_overlay] - postfuncs += [self.post_size_msg, self.post_overlay_msg] - if "--changelog" in myopts: - funclist += [self.format_changelog] - postfuncs += [self.post_changelog_msg] - - print - while mygraph.get_all_nodes(): - nextpkg = mygraph.get_leaf_nodes()[0] - mygraph.remove_node(nextpkg) - nextpkg = nextpkg.split() - if nextpkg[3] == "nomerge": - continue - - for func in funclist: - txt = func(nextpkg) - if txt: - print txt, - print - - print - for func in postfuncs: - msg = func() - if msg: - print msg - - def display_columns(self): - mygraph = self.graph.clone() - - funclist = [self.format_summary, self.format_name, - self.format_new_version, self.format_old_version] - postfuncs = [] - if verbosity: - funclist += [self.format_flags] - if verbosity >= 2: - funclist += [self.format_metadata] - funclist += [self.format_size, self.format_overlay] - postfuncs += [self.post_size_msg, self.post_overlay_msg] - if "--changelog" in myopts: - funclist += [self.format_changelog] - postfuncs += [self.post_changelog_msg] - - myoutput = [] - mywidths = [] - for x in range(len(funclist)): - mywidths.append(0) - - while mygraph.get_all_nodes(): - nextpkg = mygraph.get_leaf_nodes()[0] - mygraph.remove_node(nextpkg) - nextpkg = nextpkg.split() - if nextpkg[3] == "nomerge": - continue - - thisoutput = [] - for x in range(len(funclist)): - func = funclist[x] - txt = func(nextpkg) - txtw = nc_len(txt) - if txt and txtw > mywidths[x]: - mywidths[x] = txtw - thisoutput.append(txt) - myoutput.append(thisoutput) - - print - for output in myoutput: - for x in range(len(output)): - txt = output[x] - print txt,((mywidths[x]-nc_len(txt))*" "), - print - - print - for func in postfuncs: - msg = func() - if msg: - print msg - - def display_tree(self): - mygraph = self.graph.clone() - - funclist = [self.format_cpv, self.format_old_version] - postfuncs = [] - if verbosity: - funclist += [self.format_flags] - if verbosity >= 2: - funclist += [self.format_metadata] - funclist += [self.format_size, self.format_overlay] - postfuncs += [self.post_size_msg, self.post_overlay_msg] - if "--changelog" in myopts: - funclist += [self.format_changelog] - postfuncs += [self.post_changelog_msg] - - all = [] - - stack = [] - depth = 0 - parents = [] - curlist = mygraph.get_root_nodes() - index = 0 - - print - while stack or index != len(curlist): - if index == len(curlist): - (depth, parents, curlist, index) = stack.pop() - else: - nextpkg = curlist[index].split() - if curlist[index] in all: - nextpkg[3] = "nomerge" - print self.format_summary(nextpkg), - if depth: - print (depth-1)*" ", - for func in funclist: - txt = func(nextpkg) - if txt: - print txt, - print - if curlist[index] not in parents and curlist[index] not in all: - children = mygraph.get_child_nodes(curlist[index]) - stack += [(depth, parents, curlist, index)] - depth += 1 - parents = parents + [curlist[index]] - curlist = children - index = 0 - continue - if curlist[index] not in all: - all.append(curlist[index]) - index += 1 - - print - for func in postfuncs: - msg = func() - if msg: - print msg - - - - -def unmerge(unmerge_action, unmerge_files): - candidate_catpkgs=[] - global_unmerge=0 - - realsyslist = getlist("system") - syslist = [] - for x in realsyslist: - mycp = portage.portage_dep.dep_getkey(x) - if mycp in portage.settings.virtuals: - syslist.extend(portage.settings.virtuals[mycp]) - syslist.append(mycp) - - global myopts - mysettings = portage.config(clone=portage.settings) - - if not unmerge_files or "world" in unmerge_files or "system" in unmerge_files: - if "unmerge"==unmerge_action: - print - print bold("emerge unmerge")+" can only be used with specific package names, not with "+bold("world")+" or" - print bold("system")+" targets." - print - return 0 - else: - global_unmerge=1 - - localtree=portage.db[portage.root]["vartree"] - # process all arguments and add all valid db entries to candidate_catpkgs - if global_unmerge: - if not unmerge_files or "world" in unmerge_files: - candidate_catpkgs.extend(localtree.getallnodes()) - elif "system" in unmerge_files: - candidate_catpkgs.extend(getlist("system")) - else: - #we've got command-line arguments - if not unmerge_files: - print "\nNo packages to unmerge have been provided.\n" - return 0 - for x in unmerge_files: - arg_parts=x.split('/') - if (x[0] not in [".","/"]) and (arg_parts[-1][-7:] != ".ebuild"): - #possible cat/pkg or dep; treat as such - candidate_catpkgs.append(x) - elif unmerge_action in ["prune","clean"]: - print "\n!!! Prune and clean do not accept individual ebuilds as arguments;\n skipping.\n" - continue - else: - # it appears that the user is specifying an installed ebuild and we're in "unmerge" mode, so it's - # ok. - if not os.path.exists(x): - print "\n!!! The path '"+x+"' doesn't exist.\n" - return 0 - - absx = os.path.abspath(x) - sp_absx = absx.split("/") - if sp_absx[-1][-7:] == ".ebuild": - del sp_absx[-1] - absx = "/".join(sp_absx) - - sp_absx_len = len(sp_absx) - - vdb_path = portage.root+portage.VDB_PATH - vdb_len = len(vdb_path) - - sp_vdb = vdb_path.split("/") - sp_vdb_len = len(sp_vdb) - - if not os.path.exists(absx+"/CONTENTS"): - print "!!! Not a valid db dir: "+str(absx) - return 0 - - if sp_absx_len <= sp_vdb_len: - # The Path is shorter... so it can't be inside the vdb. - print spabsx - print absx - print "\n!!!",x,"cannot be inside "+(portage.root+portage.VDB_PATH)+"; aborting.\n" - return 0 - - for idx in range(0,sp_vdb_len): - if (idx >= sp_absx_len) or (sp_vdb[idx] != sp_absx[idx]): - print sp_absx - print absx - print "\n!!!",x,"is not inside "+(portage.root+portage.VDB_PATH)+"; aborting.\n" - return 0 - - print "="+"/".join(sp_absx[sp_vdb_len:]) - candidate_catpkgs.append("="+"/".join(sp_absx[sp_vdb_len:])) - - if ("--pretend" in myopts) or ("--ask" in myopts): - print darkgreen("\n>>> These are the packages that I would unmerge:") - - pkgmap={} - numselected=0 - for x in candidate_catpkgs: - #cycle through all our candidate deps and determine what will and will not get unmerged - try: - mymatch=localtree.dep_match(x) - except KeyError: - mymatch=None - except ValueError, errpkgs: - print "\n\n!!! The short ebuild name \"" + x + "\" is ambiguous. Please specify" - print "!!! one of the following fully-qualified ebuild names instead:\n" - for i in errpkgs[0]: - print " " + green(i) - print - sys.exit(1) - - if not mymatch and x[0] not in "<>=~": - #add a "=" if missing - mymatch=localtree.dep_match("="+x) - if not mymatch: - print "\n--- Couldn't find " + white(x) + " to "+unmerge_action+"." - continue - mykey=portage.key_expand(portage.portage_dep.dep_getkey(mymatch[0]),portage.db["/"]["vartree"].dbapi) - if not pkgmap.has_key(mykey): - pkgmap[mykey]={"protected":[], "selected":[], "omitted":[] } - if unmerge_action=="unmerge": - for y in mymatch: - if y not in pkgmap[mykey]["selected"]: - pkgmap[mykey]["selected"].append(y) - numselected=numselected+len(mymatch) - if not (pkgmap[mykey]["protected"] or pkgmap[mykey]["omitted"]) and \ - (mykey in syslist+["sys-apps/portage"]): - print red("\a\n\n!!! Trying to unmerge package(s) in system profile. '%s'" % (mykey)) - print yellow("\a!!! This could be damaging to your system.\n") - if "--pretend" not in myopts: - global EMERGE_WARNING_DELAY - countdown(EMERGE_WARNING_DELAY,red("Press Ctrl-C to Stop")) - - else: - #unmerge_action in ["prune", clean"] - slotmap={} - for mypkg in mymatch: - if unmerge_action=="clean": - myslot=localtree.getslot(mypkg) - else: - #since we're pruning, we don't care about slots and put all the pkgs in together - myslot=0 - if not slotmap.has_key(myslot): - slotmap[myslot]={} - slotmap[myslot][localtree.dbapi.cpv_counter(mypkg)]=mypkg - for myslot in slotmap.keys(): - counterkeys=slotmap[myslot].keys() - counterkeys.sort() - if not counterkeys: - continue - counterkeys.sort() - pkgmap[mykey]["protected"].append(slotmap[myslot][counterkeys[-1]]) - del counterkeys[-1] - #be pretty and get them in order of merge: - for ckey in counterkeys: - pkgmap[mykey]["selected"].append(slotmap[myslot][ckey]) - numselected=numselected+1 - #ok, now the last-merged package is protected, and the rest are selected - if global_unmerge and not numselected: - print "\n>>> No outdated packages were found on your system.\n" - return 0 - - if not numselected: - print "\n>>>",unmerge_action+": No packages selected for removal.\n" - return 0 - - keys = pkgmap.keys() - keys.sort() - for x in keys: - for y in localtree.dep_match(x): - if y not in pkgmap[x]["omitted"] and \ - y not in pkgmap[x]["selected"] and \ - y not in pkgmap[x]["protected"]: - pkgmap[x]["omitted"].append(y) - if global_unmerge and not pkgmap[x]["selected"]: - #avoid cluttering the preview printout with stuff that isn't getting unmerged - continue - print "\n "+white(x) - for mytype in ["selected","protected","omitted"]: - print mytype.rjust(12)+":", - if pkgmap[x][mytype]: - for mypkg in pkgmap[x][mytype]: - mysplit=portage_versions.catpkgsplit(mypkg) - if mysplit[3]=="r0": - myversion=mysplit[2] - else: - myversion=mysplit[2]+"-"+mysplit[3] - if mytype=="selected": - print red(myversion), - else: - print green(myversion), - else: - print "none", - print - - print "\n>>>",red("'Selected'"),"packages are slated for removal." - print ">>>",green("'Protected'"),"and",green("'omitted'"),"packages will not be removed.\n" - - if "--pretend" in myopts: - #we're done... return - return 0 - if "--ask" in myopts: - if userquery("Do you want me to unmerge these packages?")=="No": - # enter pretend mode for correct formatting of results - myopts+=["--pretend"] - print - print "Quitting." - print - return 0 - #the real unmerging begins, after a short delay.... - - global CLEAN_DELAY - countdown(CLEAN_DELAY, ">>> Unmerging") - - for x in pkgmap.keys(): - for y in pkgmap[x]["selected"]: - print ">>> Unmerging "+y+"..." - emergelog("=== Unmerging... ("+y+")") - mysplit=y.split("/") - #unmerge... - retval=portage.unmerge(mysplit[0],mysplit[1],portage.root,mysettings,unmerge_action not in ["clean","prune"]) - if retval: - emergelog(" !!! unmerge FAILURE: "+y) - else: - emergelog(" >>> unmerge success: "+y) - #run ldconfig, etc... - portage.env_update(portage.root) - if not numselected: - return 0 - else: - return 1 - - -def chk_updated_info_files(): - root=portage.root - - infodirs =portage.settings["INFOPATH"].split(":") - infodirs+=portage.settings["INFODIR"].split(":") - - print - if os.path.exists("/usr/bin/install-info"): - regen_infodirs=[] - for z in infodirs: - if z=='': - continue - inforoot=normpath(root+z) - if os.path.isdir(inforoot): - try: - infomtime=os.stat(inforoot)[ST_MTIME] - except SystemExit, e: - raise # Needed else can't exit - except: - infomtime=0 - - if not portage.mtimedb.has_key("info"): - portage.mtimedb["info"]={} - if portage.mtimedb["info"].has_key(inforoot): - if portage.mtimedb["info"][inforoot]==infomtime: - pass - else: - portage.mtimedb["info"][inforoot]=infomtime - regen_infodirs.append(inforoot) - else: - regen_infodirs.append(inforoot) - - if not regen_infodirs: - print " "+green("*")+" GNU info directory index is up-to-date." - else: - print " "+green("*")+" Regenerating GNU info directory index..." - - icount=0 - badcount=0 - for inforoot in regen_infodirs: - if inforoot=='': - continue - try: - os.rename(inforoot+"/dir",inforoot+"/dir.old") - except SystemExit, e: - raise # Needed else can't exit - except: - pass - - if not os.path.isdir(inforoot): - continue - errmsg = "" - for x in os.listdir(inforoot): - if (x[0] == ".") or (x in ["dir","dir.old"]) or (os.path.isdir(inforoot+"/"+x)): - continue -# myso=commands.getstatusoutput("LANG=C LANGUAGE=C /usr/bin/install-info --dir-file="+inforoot+"/dir "+inforoot+"/"+x)[1] - mycmd = "LANG=C LANGUAGE=C /usr/bin/install-info --dir-file="+inforoot+"/dir "+inforoot+"/"+x - myso=portage_exec.spawn_get_output(mycmd,spawn_type=portage_exec.spawn_bash)[1] - existsstr="already exists, for file `" - if myso!="": - if re.search(existsstr,myso): - # Already exists... Don't increment the count for this. - pass - elif myso[:44]=="install-info: warning: no info dir entry in ": - # This info file doesn't contain a DIR-header: install-info produces this - # (harmless) warning (the --quiet switch doesn't seem to work). - # Don't increment the count for this. - pass - else: - badcount=badcount+1 - errmsg += myso + "\n" - icount=icount+1 - - #update mtime so we can potentially avoid regenerating. - portage.mtimedb["info"][inforoot]=os.stat(inforoot)[ST_MTIME] - - if badcount: - print " "+yellow("*")+" Processed",icount,"info files;",badcount,"errors." - print errmsg - else: - print " "+green("*")+" Processed",icount,"info files." - - -def post_emerge(retval=0): - global myopts - os.chdir("/") - if "--pretend" in myopts: - sys.exit(retval) - - emergelog(" *** exiting successfully.") - - if "noinfo" not in portage.settings.features: - chk_updated_info_files() - - chk_updated_cfg_files() - - sys.exit(retval) - -def chk_updated_cfg_files(): - if portage.settings["CONFIG_PROTECT"]: - #number of directories with some protect files in them - procount=0 - for x in portage.settings["CONFIG_PROTECT"].split(): - if os.path.isdir(x): - a=portage_exec.spawn_get_output("cd "+x+"; find . -iname '._cfg????_*'",spawn_type=portage_exec.spawn_bash) - if a[0]!=0: - print " "+red("*")+" error scanning",x - else: - files=a[1].split() - if files: - procount=procount+1 - print " "+yellow("* IMPORTANT:")+"",len(files),"config files in",x,"need updating." - if procount: - #print " "+yellow("*")+" Type "+green("emerge --help config")+" to learn how to update config files." - print " "+yellow("*")+" Type "+green("emerge --help config")+" to learn how to update config files." - print - -# general options that should be taken into account before any action -if "--debug" in myopts: - edebug=1 - -if myaction in ["sync","rsync","metadata"] and (not "--help" in myopts): - if "--pretend" in myopts: - print "emerge: \"sync\" actions do not support \"--pretend.\"" - sys.exit(1) - - emergelog(" === "+str(myaction)) - myportdir=portage.settings["PORTDIR"] - if myportdir[-1]=="/": - myportdir=myportdir[:-1] - if not os.path.exists(myportdir): - print ">>>",myportdir,"not found, creating it." - os.makedirs(myportdir,0755) - syncuri=portage.settings["SYNC"].rstrip() - os.umask(0022) - - sync_verbosity=0 - if "--quiet" in myopts: - sync_verbosity = 1 - elif "--verbose" in myopts: - sync_verbosity = 3 - else: - sync_verbosity = 2 - - print "sync_verbosity=",sync_verbosity - tmpservertimestampfile = None - - protocol,host_uri = sync.parseSyncUri(syncuri) - print "host_uri=",host_uri - - if myaction == "metadata": - if "--ask" in myopts: - if userquery("Are you sure?") == "No": - #userquery("Are you sure you should be using *NIX?",["Definately Not"]) - sys.exit(1) - print "skipping sync" - updatecache_flg = True - tmpservertimestampfile = None - elif protocol == "rsync": - mytimeout=180 - if portage.settings.has_key("RSYNC_TIMEOUT"): - try: - mytimeout=int(portage.settings["RSYNC_TIMEOUT"]) - except SystemExit, e: - raise # Needed else can't exit - except: - pass - - syncer=sync.rsync.RsyncHost(host_uri) - - servertimestampdir = portage.settings.depcachedir+"/" - servertimestampfile = portage.settings.depcachedir+"/timestamp.chk" - tmpservertimestampdir = portage.settings["PORTAGE_TMPDIR"]+"/" - tmpservertimestampfile = portage.settings["PORTAGE_TMPDIR"]+"/timestamp.chk" - - # We only use the backup if a timestamp exists in the portdir. - - content=None - if os.path.exists(myportdir+"/metadata/timestamp.chk"): - content=portage.grabfile(servertimestampfile) - if (not content): - content=portage.grabfile(myportdir+"/metadata/timestamp.chk") - - if (content): - try: - mytimestamp=time.mktime(time.strptime(content[0], "%a, %d %b %Y %H:%M:%S +0000")) - except ValueError: - mytimestamp=0 - else: - mytimestamp=0 - - if not os.path.exists(servertimestampdir): - os.mkdir(servertimestampdir) - os.chown(servertimestampdir, os.getuid(), portage.portage_gid) - os.chmod(servertimestampdir, 0775) - - #exitcode=0 - try: - maxretries=int(portage.settings["RSYNC_RETRIES"]) - except SystemExit, e: - raise # Needed else can't exit - except: - maxretries=3 #default number of retries - - retries=0 - updatecache_flg=True - - ips=syncer.get_ips() - if ips == None: - ips=[None] - while (1): - if (retries==0): - if "--ask" in myopts: - if userquery("Do you want to sync your Portage tree with the mirror %s at %s\n" \ - % (host_uri, blue(str(ips[0])))+bold("?"))=="No": - print - print "Quitting." - print - sys.exit(0) - emergelog(">>> starting rsync with "+host_uri) - if "--quiet" not in myopts: - print ">>> starting rsync with %s, ip %s..." % (host_uri,ips[0]) - else: - emergelog(">>> Starting retry %d of %d with %s ip %s" % \ - (retries,maxretries,host_uri,ips[0])) - print "\n\n>>> Starting retry %d of %d with %s" % (retries,maxretries,host_uri) - - try: - if "--quiet" not in myopts: - print ">>> syncing..." - exitcode=syncer.sync(portage.settings,tmpservertimestampdir, \ - remote_path=syncer.get_remote_path()+"/metadata/timestamp.chk", - verbosity=0, cleanup=False, ip=ips[0]) - if exitcode==True: - exitcode=0 - except (sync.rsync.RSyncSyntaxError,IOError),e: - print e - exitcode=1 - - if exitcode==0: - try: - servertimestamp = time.mktime(time.strptime(portage.grabfile(tmpservertimestampfile)[0], "%a, %d %b %Y %H:%M:%S +0000")) - except SystemExit, e: - raise # Needed else can't exit - except: - servertimestamp = 0 - - if (servertimestamp != 0) and (servertimestamp == mytimestamp): - emergelog(">>> Cancelling sync -- Already current.") - print - print ">>>" - print ">>> Timestamps on the server and in the local repository are the same." - print ">>> Cancelling all further sync action. You are already up to date." - print ">>>" - print - sys.exit(0) - elif (servertimestamp != 0) and (servertimestamp < mytimestamp): - emergelog(">>> Server out of date: %s" % dosyncuri) - print - print ">>>" - print ">>> SERVER OUT OF DATE: %s" % dosyncuri - print ">>>" - print - elif (servertimestamp == 0) or (servertimestamp > mytimestamp): - # actual sync - try: - exitcode=syncer.sync(portage.settings,portage.settings["PORTDIR"], - verbosity=sync_verbosity, - excludes=('/distfiles','/local','/packages'),ip=ips[0]) - if exitcode==True: - exitcode=0 - except (sync.rsync.RSyncSyntaxError,IOError),e: - print e - exitcode=21 - if exitcode in [0,1,2,3,4,11,14,20,21]: - break - elif exitcode in [0,1,2,3,4,11,14,20,21]: - break - - retries=retries+1 - - if retries<=maxretries: - print ">>> retry ..." - time.sleep(11) - else: - # over retries - # exit loop - updatecache_flg=False - break - - if (exitcode==0): - emergelog("=== Sync completed with %s: %s" % (host_uri,ips[0])) - elif (exitcode>0): - print - try: - exitcode=syncer.sync(portage.settings,portage.settings["PORTDIR"], - excludes=("/distfiles","/local","/packages"),verbosity=sync_verbosity,ip=ips[0]) - if exitcode == True: - exitcode=0 - except sync.rsync.RSyncSyntaxError, rsse: - print darkred("!!!")+green(" Rsync has reported that there is a syntax error. Please ensure") - print darkred("!!!")+green(" that your SYNC statement is proper.") - print darkred("!!!")+green(" SYNC="+rsse.value) - except IOError, ie: - print darkred("!!!")+green(" Rsync has reported that there is a File IO error. Normally") - print darkred("!!!")+green(" this means your disk is full, but can be caused by corruption") - print darkred("!!!")+green(" on the filesystem that contains PORTDIR. Please investigate") - print darkred("!!!")+green(" and try again after the problem has been fixed.") - print darkred("!!!")+green(" PORTDIR="+portage.settings["PORTDIR"]) - if exitcode==20: - print darkred("!!!")+green(" Rsync was killed before it finished.") - elif exitcode > 0: - print darkred("!!!")+green(" Rsync has not successfully finished. It is recommended that you keep") - print darkred("!!!")+green(" trying or that you use the 'emerge-webrsync' option if you are unable") - print darkred("!!!")+green(" to use rsync due to firewall or other restrictions. This should be a") - print darkred("!!!")+green(" temporary problem unless complications exist with your network") - print darkred("!!!")+green(" (and possibly your system's filesystem) configuration.") - if exitcode: - print "bailing",exitcode - sys.exit(exitcode) - else: - updatecache_flg=True - elif protocol == "cvs": - syncer=sync.cvs.CvsHost(host_uri) - try: - print ">>> starting cvs update with "+syncuri+"..." - syncer.sync(portage.settings["PORTDIR"],compress=False) - print ">>> finished" - except sync.cvs.CVSIOError, ce: - print red("!!!")+"cvs operation failed-" - print str(ce) - sys.exit(1) - elif protocol == "snapshot": - fetcher=portage.get_preferred_fetcher() - print 'host_uri=',host_uri - if host_uri == None: - print ">>> choosing a random mirror from the mirror list" - host_uri = portage.thirdpartymirrors["gentoo"][:] - random.shuffle(host_uri) - host_uri=host_uri[0].replace("distfiles","snapshots") - print ">>> using %s" % host_uri - if not os.path.exists(portage.settings["PORTAGE_TMPDIR"]+"/snapshots"): - os.mkdir(portage.settings["PORTAGE_TMPDIR"]+"/snapshots") - syncer=sync.snapshot.SnapshotHost(host_uri,portage.settings["DISTDIR"], \ - portage.settings["PORTAGE_TMPDIR"]+"/snapshots", fetcher=fetcher) - if not syncer.sync(portage.settings["PORTDIR"],verbosity=sync_verbosity): - print "!!! snapshot failed" - sys.exit(1) - if os.path.exists("%s/metadata/timestamp.chk" % portage.settings["PORTAGE_PORTDIR"]): - tmpservertimestampfile = "%s/metadata.timestamp.chk" % portage.settings["PORTAGE_PORTDIR"] - - updatecache_flg = True - else: - print "!!! rsync setting: ",syncuri,"not recognized; exiting." - sys.exit(1) - - - if os.path.exists(myportdir+"/metadata/cache") and updatecache_flg: - if "--quiet" not in myopts: - print "\n>>> Updating Portage cache: ", - os.umask(0002) - cachedir = os.path.normpath(portage.settings.depcachedir) - if cachedir in ["/", "/bin", "/dev", "/etc", "/home", - "/lib", "/opt", "/proc", "/root", "/sbin", - "/sys", "/tmp", "/usr", "/var"]: - print "!!! PORTAGE_CACHEDIR IS SET TO A PRIMARY ROOT DIRECTORY ON YOUR SYSTEM." - print "!!! This is ALMOST CERTAINLY NOT what you want: "+str(cachedir) - sys.exit(73) - if not os.path.exists(cachedir): - os.mkdir(cachedir) - - if (os.path.exists(cachedir) and os.path.exists(cachedir+"/app-portage")): - # removed old style cache. - # XXX: Compat Code, and Potentially bad. - portage.spawn("rm -Rf "+cachedir+"/*",portage.settings,free=1) - - # save timestamp.chk for next timestamp check. - try: - if tmpservertimestampfile != None: - portage.movefile(tmpservertimestampfile, servertimestampfile) - except SystemExit, e: - raise # Needed else can't exit - except Exception, e: - print "!!! Failed to save current timestamp." - print "!!!",e - - portage.portdb.flush_cache() - - try: - os.umask(002) - os.chown(cachedir, os.getuid(), portage.portage_gid) - os.chmod(cachedir, 00775) - except SystemExit, e: - raise # Needed else can't exit - except: - pass - # we don't make overlay trees cache here. - #grab our own eclass_cache. - ec = portage.eclass_cache.cache(portage.portdb.porttree_root) - # kinda ugly. - cm = portage.settings.load_best_module("portdbapi.metadbmodule") - cmi = cm("metadata/cache", cm.auxdbkey_order, basepath=myportdir) - - def quicky_cpv_generator(dbapi): - for x in dbapi.cp_all(): - for y in dbapi.cp_list(x): - yield y - - import cache.util - # mangle the settings var. - config=portage.config(clone=portage.settings) - config["PORTDIR_OVERLAY"] = '' - config["PORTDIR"] = myportdir - pdb=portage.portdbapi(myportdir, config) - cache.util.mirror_cache(quicky_cpv_generator(pdb), cmi, - pdb.auxdb[myportdir], eclass_cache=ec, - verbose_instance=cache.util.non_quiet_mirroring()) - del ec - del cmi - del cm - del pdb -# mynodes=portage.portdb.cp_all() -# mynodes.sort() -# pcnt=0 -# pcntstr="" -# pcntcount=len(mynodes)/100.0 -# nextupdate=pcntcount -# current=0 -# # need to add a callback option to regen_keys to take advantage of the happy spinny eye-candy stuff. -# portage.portdb.regen_keys(src_cache=myportdir+"/metadata/cache",debug=("cachedebug" in portage.features), -# verbose=False) -# portage.portdb.porttrees=backup_porttrees - sys.stdout.write("\n\n") - sys.stdout.flush() - - portage.portageexit() - reload(portage) - mybestpv=portage.portdb.xmatch("bestmatch-visible","sys-apps/portage") - mypvs=portage.best(portage.db[portage.root]["vartree"].dbapi.match("sys-apps/portage")) - - chk_updated_cfg_files() - - if(mybestpv != mypvs): - print - print red(" * ")+bold("An update to portage is available.")+" It is _highly_ recommended" - print red(" * ")+"that you update portage now, before any other packages are updated." - print red(" * ")+"Please do so and then update "+bold("ALL")+" of your configuration files." - print -elif myaction=="regen": - emergelog(" === regen") - #regenerate cache entries - print "Regenerating cache entries... " - portage.portdb.regen_keys() - print "done!" -# HELP action -elif "config"==myaction: - emergelog(" === config") - print - print "Currently, \'config\' is a help option only." - print -# INFO action -elif "info"==myaction: - unameout=portage_exec.spawn_get_output("uname -mrp")[1] - print getportageversion() - print "=================================================================" - print "System uname: "+unameout - if os.path.exists("/etc/gentoo-release"): - portage_exec.spawn("cat /etc/gentoo-release") - else: - print "Unknown Host Operating System" - - py_vers = string.join(portage.db["/"]["vartree"].dbapi.match("dev-lang/python"), ",") - py_this = string.strip(string.split(sys.version,"\n")[0]) - print "%-20s %s [%s]" % ("Python:",py_vers,py_this) - - output=portage_exec.spawn_get_output("distcc --version") - if not output[0]: - print output[1].split("\n",1)[0], - if "distcc" in portage.features: - print "[enabled]" - else: - print "[disabled]" - - output=portage_exec.spawn_get_output("ccache -V") - if not output[0]: - print output[1].split("\n",1)[0], - if "ccache" in portage.features: - print "[enabled]" - else: - print "[disabled]" - - myvars = ["sys-devel/autoconf", "sys-devel/automake", "virtual/os-headers", - "sys-devel/binutils", "sys-devel/libtool", "dev-lang/python"] - myvars += portage_util.grabfile(portage.settings["PORTDIR"]+"/profiles/info_pkgs") - myvars = portage_util.unique_array(myvars) - myvars.sort() - - for x in myvars: - if portage.portage_dep.isvalidatom(x): - pkg_matches = portage.db["/"]["vartree"].dbapi.match(x) - pkgs = "" - for y in pkg_matches: - mycpv = portage.catpkgsplit(y) - if pkgs: - pkgs += ", " - pkgs += str(mycpv[2]) - if(mycpv[3] != "r0"): - pkgs += "-" + str(mycpv[3]) - if not pkgs: - pkgs = "[Not Present]" - print "%-20s %s" % (x+":", pkgs) - else: - print "%-20s %s" % (x+":", "[NOT VALID]") - - libtool_vers = string.join(portage.db["/"]["vartree"].dbapi.match("sys-devel/libtool"), ",") - - if "--verbose" in myopts: - myvars=portage.settings.keys() - else: - myvars = ['GENTOO_MIRRORS', 'CONFIG_PROTECT', 'CONFIG_PROTECT_MASK', - 'PORTDIR', 'DISTDIR', 'PKGDIR', 'PORTAGE_TMPDIR', - 'PORTDIR_OVERLAY', 'USE', 'CHOST', 'CFLAGS', 'CXXFLAGS', - 'ACCEPT_KEYWORDS', 'SYNC', 'FEATURES'] - - myvars.extend(portage_util.grabfile(portage.settings["PORTDIR"]+"/profiles/info_vars")) - - myvars = portage_util.unique_array(myvars) - unset_vars = [] - myvars.sort() - for x in myvars: - if portage.settings.has_key(x): - print x+'="'+portage.settings[x]+'"' - else: - unset_vars.append(x) - if unset_vars: - print "Unset: "+", ".join(unset_vars) - print - - config_files = [portage.MAKE_CONF_FILE, - portage.MODULES_FILE_PATH, - portage.USER_VIRTUALS_FILE, - portage.EBUILD_SH_ENV_FILE, - portage.CUSTOM_MIRRORS_FILE] - config_files += [portage.USER_CONFIG_PATH+"/package."+x for x in ["mask","unmask","keywords","env"]] - config_files += [portage.CUSTOM_PROFILE_PATH+"/"+x for x in ["make.defaults","packages","use.mask","virtuals","profile.bashrc","use.defaults"]] - print "Config files: "+(", ".join([x for x in config_files if os.path.exists(x)])) - - if "--debug" in myopts: - for x in dir(portage): - module = getattr(portage, x) - if "cvs_id_string" in dir(module): - print "%s: %s" % (str(x), str(module.cvs_id_string)) - -# SEARCH action -elif "search"==myaction: - if not myfiles: - print "emerge: no search terms provided." - else: - searchinstance = search() - for mysearch in myfiles: - try: - searchinstance.execute(mysearch) - except re.error, comment: - print "\n!!! Regular expression error in \"%s\": %s" % ( mysearch, comment ) - sys.exit(1) - searchinstance.output() -elif "unmerge"==myaction or "prune"==myaction or "clean"==myaction: - if 1==unmerge(myaction, myfiles): - post_emerge() - -elif "depclean"==myaction: - # Kill packages that aren't explicitly merged or are required as a - # dependency of another package. World file is explicit. - - print - print red("*** WARNING ***")+" : DEPCLEAN CAN SERIOUSLY IMPAIR YOUR SYSTEM. USE CAUTION." - print red("*** WARNING ***")+" : (Cancel: CONTROL-C) -- ALWAYS VERIFY ALL PACKAGES IN THE" - print red("*** WARNING ***")+" : CANDIDATE LIST FOR SANITY BEFORE ALLOWING DEPCLEAN TO" - print red("*** WARNING ***")+" : UNMERGE ANY PACKAGES." - print red("*** WARNING ***")+" :" - print red("*** WARNING ***")+" : USE FLAGS MAY HAVE AN EXTREME EFFECT ON THE OUTPUT." - print red("*** WARNING ***")+" : SOME LIBRARIES MAY BE USED BY PACKAGES BUT ARE NOT" - print red("*** WARNING ***")+" : CONSIDERED TO BE A DEPEND DUE TO USE FLAG SETTINGS." - print red("*** WARNING ***")+" : emerge --update --deep --newuse world TO VERIFY" - print red("*** WARNING ***")+" : SANITY IN THIS REGARD." - print red("*** WARNING ***")+" :" - print red("*** WARNING ***")+" : Packages in the list that are desired may be added" - print red("*** WARNING ***")+" : directly to the world file to cause them to be ignored" - print red("*** WARNING ***")+" : by depclean and maintained in the future. BREAKAGES DUE" - print red("*** WARNING ***")+" : TO UNMERGING AN ==IN-USE LIBRARY== MAY BE REPAIRED BY" - print red("*** WARNING ***")+" : MERGING *** THE PACKAGE THAT COMPLAINS *** ABOUT THE" - print red("*** WARNING ***")+" : MISSING LIBRARY." - print - if ("--pretend" not in myopts) and ("--ask" not in myopts): - countdown(EMERGE_WARNING_DELAY, ">>> Depclean") - emergelog(" >>> depclean") - - mydepgraph=depgraph(myaction,myopts) - syslist=getlist("system") - worldlist=getlist("world") - - print "Calculating",myaction,"dependencies ", - if not mydepgraph.xcreate("world"): - print "\n!!! Failed to create deptree." - sys.exit(1) - print "\b\b ... done!" - - if ("--usepkgonly" in myopts) and mydepgraph.missingbins: - sys.stderr.write(red("The following binaries are not available for merging...\n")) - for x in mydepgraph.missingbins: - sys.stderr.write(" "+str(x)+"\n") - sys.stderr.write("\nThese are required by '--usepkgonly' -- Terminating.\n\n") - sys.exit(1) - - alldeps=mydepgraph.mynewgraph.get_all_nodes() - myvarlist=portage.vardbapi(portage.root).cp_all() - - if not syslist: - print "!!! You have no system list. Cannot determine system from world." - if not worldlist: - print "!!! You have no world file. Cannot determine explicit merges." - if not myvarlist: - print "!!! You have no installed package tree (%s). This is a problem." % portage.VDB_PATH - if not alldeps: - print "!!! You have no dependencies. Impossible. Bug." - - if not (syslist and worldlist and myvarlist and alldeps): - print - sys.exit(1) - - reallist=[] - for x in alldeps: - myparts=portage_versions.catpkgsplit(x.split()[2]) - if not myparts: - sys.stderr.write( - red("!!! There appears to be a problem with the following package:\n")+ - red("!!! "+str(x.split()[2])+"\n\n")+ - "!!! Please ensure that blocking/conflicting packages are not merged."+ - "!!! 'emerge -p "+str(x.split()[2])+"\n\n") - if ("--pretend" not in myopts) and ("--ask" not in myopts): - countdown(EMERGE_WARNING_DELAY, "*** Continuing") - continue - - catpack=myparts[0]+"/"+myparts[1] - if catpack not in reallist: - reallist.append(catpack) - - cleanlist=[] - for x in myvarlist: - if x not in reallist: - if x not in cleanlist: - cleanlist.append(x) - - for x in syslist+worldlist: - myparts = portage_versions.catpkgsplit(x) - if myparts: - mycat = "" - myparts = list(myparts) - if myparts[0][0] in ('<','>','='): - mycat = myparts[0][1:] - elif myparts[0][:2] in ('<=','>='): - mycat = myparts[0][2:] - catpack=mycat+"/"+myparts[1] - else: - catpack=x - if catpack in cleanlist: - cleanlist.remove(catpack) - - #print "\n\n\nCleaning: " - #for x in cleanlist: - # print x - #print - - if len(cleanlist): - unmerge("unmerge", cleanlist) - - print - print "Packages installed: "+str(len(myvarlist)) - print "Packages in world: "+str(len(worldlist)) - print "Packages in system: "+str(len(syslist)) - print "Unique package names: "+str(len(reallist)) - print "Required packages: "+str(len(alldeps)) - if "--pretend" in myopts: - print "Number to remove: "+str(len(cleanlist)) - else: - print "Number removed: "+str(len(cleanlist)) - post_emerge() - -# "update", "system", or just process files: -else: - favorites=[] - syslist=getlist("system") - if (("--pretend" in myopts) and not ("--fetchonly" in myopts or "--fetch-all-uri" in myopts)) or ("--ask" in myopts): - if "--tree" in myopts: - print - print darkgreen("These are the packages that I would merge, in reverse order:") - print - else: - print - print darkgreen("These are the packages that I would merge, in order:") - print - - if ("--resume" in myopts) and portage.mtimedb.has_key("resume"): - myresumeopts=portage.mtimedb["resume"]["myopts"][:] - - while "--skipfirst" in myresumeopts: - myresumeopts.remove("--skipfirst") - while "--ask" in myresumeopts: - myresumeopts.remove("--ask") - - for myopt in myopts: - if myopt not in myresumeopts: - myresumeopts.append(myopt) - myopts=myresumeopts - mydepgraph=depgraph("resume",myopts) - if "--resume" not in myopts: - myopts+=["--resume"] - else: - if ("--resume" in myopts): - del myopts[myopts.index("--resume")] - print darkgreen("emerge: It seems we have nothing to resume...") - sys.exit(0) - - mydepgraph=depgraph(myaction,myopts) - if myaction in ["system","world"]: - print "Calculating",myaction,"dependencies ", - sys.stdout.flush() - if not mydepgraph.xcreate(myaction): - print "!!! Depgraph creation failed." - sys.exit(1) - print "\b\b ...done!" - else: - if not myfiles: - print "emerge: please tell me what to do." - help() - sys.exit(1) - #we don't have any files to process; skip this step and exit - print "Calculating dependencies ", - sys.stdout.flush() - retval,favorites=mydepgraph.select_files(myfiles) - if not retval: - sys.exit(1) - print "\b\b ...done!" - - if ("--usepkgonly" in myopts) and mydepgraph.missingbins: - sys.stderr.write(red("The following binaries are not available for merging...\n")) - - if mydepgraph.missingbins: - for x in mydepgraph.missingbins: - sys.stderr.write(" "+str(x)+"\n") - sys.stderr.write("\nThese are required by '--usepkgonly' -- Terminating.\n\n") - sys.exit(1) - - if "--ask" in myopts: - if "--resume" in myopts: - mydepgraph.display(portage.mtimedb["resume"]["mergelist"]) - prompt="Do you want me to resume merging these packages?" - else: - graphdisp = graph_display(mydepgraph.mynewgraph) - if "--tree" in myopts: - graphdisp.display_tree() - elif "--columns" in myopts: - graphdisp.display_columns() - else: - graphdisp.display_flat() - mergecount=0 - for x in mydepgraph.altlist(): - if x[3]!="nomerge": - mergecount+=1 - #check for blocking dependencies - if x[0]=="blocks": - print "\n!!! Error: The above package list contains packages which cannot be installed" - print "!!! on the same system." - print - sys.exit(1) - if mergecount==0: - prompt="Nothing to merge; do you want me to auto-clean packages?" - elif "--fetchonly" in myopts or "--fetch-all-uri" in myopts: - prompt="Do you want me to fetch the source files for these packages?" - else: - prompt="Do you want me to merge these packages?" - print - if userquery(prompt)=="No": - print - print "Quitting." - print - sys.exit(0) - # Don't ask again (e.g. when auto-cleaning packages after merge) - myopts.remove("--ask") - - if ("--pretend" in myopts) and not ("--fetchonly" in myopts or "--fetch-all-uri" in myopts): - if ("--resume" in myopts): - mydepgraph.display(portage.mtimedb["resume"]["mergelist"]) - else: - graphdisp = graph_display(mydepgraph.mynewgraph) - if "--tree" in myopts: - graphdisp.display_tree() - elif "--columns" in myopts: - graphdisp.display_columns() - else: - graphdisp.display_flat() - else: - if ("--buildpkgonly" in myopts): - has_deps = False - for node in mydepgraph.mynewgraph.get_all_nodes(): - if mydepgraph.mynewgraph.get_relationships(node)[0]: - has_deps = True - if has_deps: - print "\n!!! --buildpkgonly requires all dependencies to be merged." - print "!!! Cannot merge requested packages. Merge deps and try again.\n" - sys.exit(1) - - if ("--resume" in myopts): - favorites=portage.mtimedb["resume"]["favorites"] - mydepgraph.merge(portage.mtimedb["resume"]["mergelist"]) - else: - portage.mtimedb["resume"]={} - portage.mtimedb["resume"]["myopts"]=myopts - portage.mtimedb["resume"]["favorites"]=favorites - if ("--digest" in myopts) and not ("--fetchonly" in myopts or "--fetch-all-uri" in myopts): - for pkgline in mydepgraph.altlist(): - if pkgline[0]=="ebuild" and pkgline[3]=="merge": - y=portage.portdb.findname(pkgline[2]) - tmpsettings = portage.config(clone=portage.settings) - retval=portage.doebuild(y,"digest",portage.root,tmpsettings,edebug,("--pretend" in myopts)) - mydepgraph.merge(mydepgraph.altlist()) - - if portage.mtimedb.has_key("resume"): - del portage.mtimedb["resume"] - print ">>> Auto-cleaning packages ..." - unmerge("clean", ["world"]) - post_emerge() - diff --git a/bin/env-update b/bin/env-update deleted file mode 100755 index 2c41752..0000000 --- a/bin/env-update +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/python -O -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/env-update,v 1.10 2004/11/07 13:15:28 ferringb Exp $ - -import os,sys -os.environ["PORTAGE_CALLER"] = "env-update" -sys.path = ["/usr/lib/portage/pym"]+sys.path - -import portage -portage.env_update(portage.root) diff --git a/bin/env-update.sh b/bin/env-update.sh deleted file mode 100755 index 2d09252..0000000 --- a/bin/env-update.sh +++ /dev/null @@ -1,219 +0,0 @@ -#!/bin/bash -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/env-update.sh,v 1.3 2005/04/29 04:43:19 vapier Exp $ - -############################################ -############################################ -# ENVIRONMENT SETUP -############################################ - -if [[ ${EUID} -ne 0 ]] ; then - echo "$0: must be root." - exit 1 -fi - -# Make sure our environment is sane -if [[ ! -z "${MAKELINKS}" ]] ; then - export MAKELINKS=0 -else - export MAKELINKS=1 -fi -export ROOT="${ROOT:=/}" -[[ ${ROOT} == */ ]] || export ROOT="${ROOT}/" - -export ENVDIR="${ROOT}etc/env.d" -mkdir -p ${ENVDIR} -chmod 755 ${ENVDIR} -specials=" - KDEDIRS PATH CLASSPATH LDPATH MANPATH INFODIR INFOPATH ROOTPATH - CONFIG_PROTECT CONFIG_PROTECT_MASK PRELINK_PATH PYTHONPATH - PRELINK_PATH_MASK ADA_INCLUDE_PATH ADA_OBJECTS_PATH" -colon_separated=" - ADA_INCLUDE_PATH ADA_OBJECTS_PATH LDPATH PATH MANPATH ROOTPATH - PRELINK_PATH PRELINK_PATH_MASK PYTHON_PATH" - -export LDSOCONF="${ROOT}etc/ld.so.conf" - -export PRELINKCONF="${ROOT}etc/prelink.conf" -defaultprelinkpaths=":/bin:/sbin:/usr/bin:/usr/sbin:/lib:/usr/lib" - -export PROFILEENV="${ROOT}etc/profile.env" -export CSHENV="${ROOT}etc/csh.env" - -# make sure we aren't tricked with previous 'my_envd_' variables -unset $(set | grep '^my_envd_' | cut -d= -f1) - -############################################ -############################################ -# ENV.D PARSING -############################################ - -do_has() { - local x - local me="$1" - shift - - for x in "$@" ; do - [[ ${x} == ${me} ]] && return 0 - done - return 1 -} -has() { - local ret - local ifs="${IFS}" - unset IFS - do_has $1 ${!2} - ret=$? - export IFS="${ifs}" - return ${ret} -} -is_special() { - has $1 specials -} -is_colon_separated() { - has $1 colon_separated -} - -for envd in $(ls ${ENVDIR} | sort) ; do - # make sure file is a vaild env'd entry and not a backup file - num="${envd:0:2}" - if [[ ! -z ${num//[0-9]} ]] ; then - continue - elif [[ ${envd} == *~ || ${envd} == *.bak ]] ; then - continue - fi - - # use bash to make sure the file is valid - envd="${ENVDIR}/${envd}" - if ! (source "${envd}") ; then - echo "!!! Error parsing ${envd}!" - exit 1 - fi - - # parse env.d entries - cnfvars="$(grep '^[[:alpha:]_][[:alnum:]_]*=' "${envd}")" - export IFS=$'\n' - for cnfv in ${cnfvars} ; do - var="${cnfv/=*}" - val="${cnfv:${#var}+1}" - if [ "${val:0:1}" == "\"" ] ; then - val="${val:1:${#val}-2}" - fi - myvar="my_envd_${var}" - if is_special ${var} ; then - if [[ ! -z "${!myvar}" ]] ; then - if is_colon_separated ${var} ; then - sep=":" - else - sep=" " - fi - else - sep="" - fi - export ${myvar}="${!myvar}${sep}${val}" - else - export ${myvar}="${val}" - fi - done - unset IFS -done - -############################################ -############################################ -# LD.SO.CONF HANDLING -############################################ - -# create a : sep list from ld.so.conf -export OLD_LDPATH="" -if [ -s "${LDSOCONF}" ] ; then - while read line ; do - if [[ "${line:0:1}" == "#" ]] ; then - continue - fi - export OLD_LDPATH="${OLD_LDPATH}:${line}" - done < ${LDSOCONF} - export OLD_LDPATH="${OLD_LDPATH:1}" -fi - -# has the ldpath changed ? if so, recreate -if [[ "${OLD_LDPATH}" != "${my_envd_LDPATH}" ]] ; then - cat << EOF > ${LDSOCONF} -# ld.so.conf autogenerated by env-update; make all changes to -# contents of /etc/env.d directory -${my_envd_LDPATH//:/ -} -EOF -fi - -############################################ -############################################ -# HANDLE PRELINK PATHS -############################################ - -if prelink --version >& /dev/null ; then - # we assume LDPATH and PATH aren't empty ... if they were, we got other problems - envdprelinkcheckpaths="${my_envd_LDPATH}:${my_envd_PATH}" - if [[ ! -z "${my_envd_PRELINK_PATH}" ]] ; then - envdprelinkcheckpaths="${envdprelinkcheckpaths}:${my_envd_PRELINK_PATH}" - fi - - if [[ ! -z "${my_envd_PRELINK_PATH_MASK}" ]] ; then - export prelink_mask=":${PRELINK_PATH_MASK}:" - envdprelinkpaths="" - export IFS=":" - for dir in ${envdprelinkcheckpaths} ; do - if [[ ${dir:0-1} == / ]] ; then - noslashdir="${dir:0:${#dir}-1}" - else - dir="${dir}/" - noslashdir="${dir}" - fi - if [[ ${prelink_mask/:${dir}:/} == ${prelink_mask} \ - && ${prelink_mask/:${noslashdir}:/} == ${prelink_mask} ]] ; then - envdprelinkpaths="${envdprelinkpaths}:${dir}" - fi - done - unset IFS - else - envdprelinkpaths=":${envdprelinkcheckpaths}" - fi - - cat << EOF > ${PRELINKCONF} -# prelink.conf autogenerated by env-update; make all changes to -# contents of /etc/env.d directory -${defaultprelinkpaths//:/ --l } -${envdprelinkpaths//:/ --h } -EOF -fi -unset my_envd_LDPATH - -############################################ -############################################ -# RUN EXTERNAL PROGRAMS NOW -############################################ - -echo ">>> Regenerating ${ROOT}etc/ld.so.cache..." -if [[ ${MAKELINKS} -eq 0 ]] ; then - (cd / ; /sbin/ldconfig -X -r ${ROOT} >& /dev/null) -else - (cd / ; /sbin/ldconfig -r ${ROOT} >& /dev/null) -fi - -cat << EOF > ${PROFILEENV} -# THIS FILE IS AUTOMATICALLY GENERATED BY env-update. -# DO NOT EDIT THIS FILE. CHANGES TO STARTUP PROFILES -# GO INTO /etc/profile NOT /etc/profile.env - -$(set | grep '^my_envd_' | sed -e 's:^my_envd_:export :') -EOF - -cat << EOF > ${CSHENV} -# THIS FILE IS AUTOMATICALLY GENERATED BY env-update. -# DO NOT EDIT THIS FILE. CHANGES TO STARTUP PROFILES -# GO INTO /etc/csh.cshrc NOT /etc/csh.env - -$(set | grep '^my_envd_' | sed -e 's:^my_envd_\([[:alpha:]_][[:alnum:]_]*\)=:setenv \1 :') -EOF diff --git a/bin/etc-update b/bin/etc-update deleted file mode 100755 index 5dd5a13..0000000 --- a/bin/etc-update +++ /dev/null @@ -1,413 +0,0 @@ -#!/bin/bash -# Copyright 1999-2005 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/etc-update,v 1.27 2005/04/19 22:05:48 vapier Exp $ - -# Author Brandon Low <lostlogic@gentoo.org> -# -# Previous version (from which I've borrowed a few bits) by: -# Jochem Kossen <j.kossen@home.nl> -# Leo Lipelis <aeoo@gentoo.org> -# Karl Trygve Kalleberg <karltk@gentoo.org> - -export PORTAGE_CALLER="etc-update" - -if [ $(/usr/lib/portage/bin/portageq envvar USERLAND) = BSD ] ; then - function sed() { gsed "$@"; } -fi - -function get_config() { - item=$1 - - # First strip off comment lines, then grab the configuration - # item. If there's more than one of the same configuration item, - # then allow the last setting to take precedence. - cut -d'#' -f1-1 /etc/etc-update.conf | \ - sed -ne "s/^ *$item *= *\([\"']\{0,1\}\)\(.*\)\1/\2/p" |sed -e '$p;d' -} - -function scan() { - - echo "Scanning Configuration files..." - rm -rf ${TMP}/files > /dev/null 2>&1 - mkdir ${TMP}/files || die "Failed mkdir command!" 1 - count=0 - input=0 - - for path in ${CONFIG_PROTECT}; do if [ -d ${path} ]; then - ofile="" - for file in `find ${path}/ -iname "._cfg????_*" | - sed -e "s:\(^.*/\)\(._cfg*_\)\(/.*$\):\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 - MATCHES=0 - if [[ "${EU_AUTOMERGE}" == "yes" ]]; then - if [ ! -e "${rpath}/${rfile}" ] || [ ! -e "${rpath}/${rfile:10}" ]; then - MATCHES=0 - else - diff -Bbua ${rpath}/${rfile} ${rpath}/${rfile:10} | egrep '^[+-]' | egrep -v '^[+-][\t ]*#|^--- |^\+\+\+ ' | egrep -qv '^[-+][\t ]*$' - MATCHES=$? - fi - elif [[ -z `diff -Nua ${rpath}/${rfile} ${rpath}/${rfile:10}| - grep "^[+-][^+-]"|grep -v '# .Header:.*'` ]]; then - MATCHES=1 - fi - if [[ "${MATCHES}" == "1" ]]; then - echo "Automerging trivial changes in: ${rfile:10}" - mv ${rpath}/${rfile} ${rpath}/${rfile:10} - continue - else - count=${count}+1 - echo "${rpath}/${rfile:10}" > ${TMP}/files/${count} - echo "${rpath}/${rfile}" >> ${TMP}/files/${count} - ofile="${rfile}" - opath="${rpath}" - continue - fi - fi - - if [[ -z `diff -Nua ${rpath}/${rfile} ${rpath}/${ofile}| - grep "^[+-][^+-]"|grep -v '# .Header:.*'` ]]; then - mv ${rpath}/${rfile} ${rpath}/${ofile} - continue - else - echo "${rpath}/${rfile}" >> ${TMP}/files/${count} - ofile="${rfile}" - opath="${rpath}" - fi - done - fi; done - -} - -function sel_file() { - local -i isfirst=0 - until [ -f ${TMP}/files/${input} ] || [ ${input} == -1 ] || [ ${input} == -3 ]; do - local numfiles=$(ls ${TMP}/files|wc -l) - local numwidth=${#numfiles} - for file in $(ls ${TMP}/files|sort -n); do - if (( ${isfirst} == 0 )); then - isfirst=${file} - fi - numshow=$(printf "%${numwidth}i${PAR} " ${file}) - spacer=${numshow//?/ } - echo -n "${numshow}" - if (( ${mode} == 0 )); then - spacedit=0 - for word in $(<${TMP}/files/${file}); do - if (( ${spacedit} == 1 )); then - echo -n "${spacer}" - else - spacedit=1 - fi - echo ${word} - done - else - head -n1 ${TMP}/files/${file} - fi - done > ${TMP}/menuitems - - if [ "${OVERWRITE_ALL}" == "yes" ]; then - input=0 - else - if (( ${mode} == 0 )); then - echo "The following is the list of files which need updating, each -configuration file is followed by a list of possible replacement files." - else - local my_title="Please select a file to update" - fi - - if (( ${mode} == 0 )); then - cat ${TMP}/menuitems - echo "Please select a file to edit by entering the corresponding number." - echo " (don't use -3 or -5 if you're unsure what to do)" - echo " (-1 to exit) (-3 to auto merge all remaining files)" - echo -n " (-5 to auto-merge AND not use 'mv -i'): " - read input - else - dialog --title "${title}" --menu "${my_title}" \ - 0 0 0 $(echo -e "-1 Exit\n$(<${TMP}/menuitems)") \ - 2> ${TMP}/input - input=$(<${TMP}/input) - fi - if (( ${input} == -5 )); then - input=-3 - export mv_opts="" - fi - if (( ${input} == -3 )); then - input=0 - export OVERWRITE_ALL="yes" - fi - fi # -3 automerge - if (( ${input} == 0 )); then - input=${isfirst} - fi - done -} - -function do_file() { - echo - local -i my_input - local -i fcount=0 - until (( $(wc -l < ${TMP}/files/${input}) < 2 )); do - my_input=0 - if (( $(wc -l < ${TMP}/files/${input}) == 2 )); then - my_input=1 - fi - until (( ${my_input} > 0 )) && (( ${my_input} < $(wc -l < ${TMP}/files/${input}) )); do - fcount=0 - - if [ "${OVERWRITE_ALL}" == "yes" ]; then - my_input=0 - else - for line in $(<${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 `echo -e "$(<${TMP}/menuitems)\n${fcount} Exit"` \ - 2> ${TMP}/input - my_input=$(<${TMP}/input) - fi - fi # OVERWRITE_ALL - - if (( ${my_input} == 0 )); then - my_input=1 - elif (( ${my_input} == -1 )); then - input=0 - return - elif (( ${my_input} == ${fcount} )); then - break - fi - done - if (( ${my_input} == ${fcount} )); then - break - fi - - fcount=${my_input}+1 - - file=$(sed -e "${fcount}p;d" ${TMP}/files/${input}) - ofile=$(head -n1 ${TMP}/files/${input}) - - do_cfg "${file}" "${ofile}" - - sed -e "${fcount}!p;d" ${TMP}/files/${input} > ${TMP}/files/sed - mv ${TMP}/files/sed ${TMP}/files/${input} - - if (( ${my_input} == -1 )); then - break - fi - done - echo - rm ${TMP}/files/${input} - count=${count}-1 -} - -function do_cfg() { - - local file="${1}" - local ofile="${2}" - local -i my_input=0 - - until (( ${my_input} == -1 )) || [ ! -f ${file} ]; do - if [ "${OVERWRITE_ALL}" == "yes" ]; then - my_input=1 - else - showdiffcmd=$(echo "${diff_command}" | - sed -e "s:%file1:${ofile}:" -e "s:%file2:${file}:") - - if [ "${using_editor}" == 0 ]; then - ( - echo "Showing differences between ${ofile} and ${file}" - ${showdiffcmd} - ) | ${pager} - else - echo "Beginning of differences between ${ofile} and ${file}" - ${showdiffcmd} - echo "End of differences between ${ofile} and ${file}" - fi - if [ -L "${file}" ]; then - echo - echo "-------------------------------------------------------------" - echo "NOTE: File is a symlink to another file. REPLACE recommended." - echo " The original file may simply have moved. Please review." - echo "-------------------------------------------------------------" - echo - fi - echo -n "1) Replace original with update -2) Delete update, keeping original as is -3) Interactively merge original with update -4) Show differences again -Please select from the menu above (-1 to ignore this update): " - read my_input - fi - - case ${my_input} in - 1) echo "Replacing ${ofile} with ${file}" - mv ${mv_opts} ${file} ${ofile} - my_input=-1 - continue - ;; - 2) echo "Deleting ${file}" - rm ${rm_opts} ${file} - continue - ;; - 3) do_merge "${file}" "${ofile}" - my_input=${?} -# [ ${my_input} == 255 ] && my_input=-1 - continue - ;; - 4) continue - ;; - *) continue - ;; - esac - done -} - -function do_merge() { - - local file="${1}" - local ofile="${2}" - local mfile="${2}.merged" - local -i my_input=0 - echo "${file} ${ofile} ${mfile}" - - if [ -e ${mfile} ] ; then - echo "A previous version of the merged file exists, cleaning..." - rm ${rm_opts} ${mfile} - fi - - until (( ${my_input} == -1 )); do - echo "Merging ${file} and ${ofile}" - `echo "${merge_command}" | - sed -e "s:%merged:${mfile}:g" \ - -e "s:%orig:${ofile}:g" \ - -e "s:%new:${file}:g"` - until (( ${my_input} == -1 )); do - echo -n "1) Replace ${ofile} with merged file -2) Show differences between merged file and original -3) Remerge original with update -4) Edit merged file -5) Return to the previous menu -Please select from the menu above (-1 to exit, losing this merge): " - read my_input - case ${my_input} in - 1) echo "Replacing ${ofile} with ${mfile}" - chmod --reference=${ofile} ${mfile} - mv ${mv_opts} ${mfile} ${ofile} - rm ${rm_opts} ${file} - return 255 - ;; - 2) ( echo "Showing differences between ${ofile} and ${mfile}" - `echo "${diff_command}" | \ - sed -e "s:%file1:${ofile}:" \ - -e "s:%file2:${mfile}:"` ) | ${pager} - continue - ;; - 3) break - ;; - 4) ${EDITOR:-nano -w} "${mfile}" - continue - ;; - 5) rm ${rm_opts} ${mfile} - return 0 - ;; - *) continue - ;; - esac - done - done - rm ${rm_opts} ${mfile} - return 255 -} - -function die() { - trap "" term - trap "" kill - echo "Exiting: ${1}" - rm -rf ${TMP} - exit ${2} -} - -# -# Run the script -# -scriptname=`basename $0` - -trap die term - -TMP=/tmp/$$ -rm -rf ${TMP} 2> /dev/null -mkdir ${TMP} || die "failed mkdir command!" 1 - -# I need the CONFIG_PROTECT value -CONFIG_PROTECT=$(/usr/lib/portage/bin/portageq envvar CONFIG_PROTECT) -CONFIG_PROTECT_MASK=$(/usr/lib/portage/bin/portageq envvar CONFIG_PROTECT_MASK) - -# load etc-config's configuration -EU_AUTOMERGE=`get_config eu_automerge` -rm_opts=`get_config rm_opts` -mv_opts=`get_config mv_opts` -cp_opts=`get_config cp_opts` -pager=`get_config pager` -diff_command=`get_config diff_command` -using_editor=`get_config using_editor` -merge_command=`get_config merge_command` -declare -i mode=`get_config mode` -[ -z ${mode} ] && mode=0 -[ -z "${pager}" ] && pager="cat" - -#echo "rm_opts: $rm_opts, mv_opts: $mv_opts, cp_opts: $cp_opts" -#echo "pager: $pager, diff_command: $diff_command, merge_command: $merge_command" - -if (( ${mode} == 0 )); then - PAR=")" -else - PAR="" -fi - -declare -i count=0 -declare -i input=0 -declare title="Gentoolkit's etc-update tool!" - -scan - -until (( ${input} == -1 )); do - if (( ${count} == 0 )); then - die "Nothing left to do; exiting. :)" 0 - fi - sel_file - if (( ${input} != -1 )); then - do_file - fi -done - -die "User termination!" 0 diff --git a/bin/find-requires b/bin/find-requires deleted file mode 100755 index 9746159..0000000 --- a/bin/find-requires +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/sh -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/find-requires,v 1.5 2004/10/04 13:56:50 vapier Exp $ - -# note this works for both a.out and ELF executables -# it also auto-generates requirment lines for shell scripts - -ulimit -c 0 - -filelist=`sed "s/['\"]/\\\&/g"` -exelist=`echo $filelist | $XARGS file | grep ":.*executable" | cut -d: -f1 ` -scriptlist=`echo $filelist | $XARGS file | egrep ":.* (commands|script) " | cut -d: -f1 ` -liblist=`echo $filelist | $XARGS file | grep ":.*shared object" | cut -d : -f1 ` - -for f in $exelist; do - if [ -x $f ]; then - ldd $f | awk '/=>/ { print $1 }' - fi -done | sort -u | sed "s/['\"]/\\\&/g" | $XARGS -n 1 basename | grep -v 'libNoVersion.so' | sort -u - -for f in $liblist; do - ldd $f | awk '/=>/ { print $1 }' -done | sort -u | sed "s/['\"]/\\\&/g" | $XARGS -n 1 basename | grep -v 'libNoVersion.so' | sort -u - -for f in $scriptlist; do - if [ -x $f ]; then - head -1 $f | sed -e 's/^\#\![ ]*//' | cut -d" " -f1 - fi -done | sort -u - -#for f in $liblist $exelist ; do -# objdump -p $f | awk ' -# BEGIN { START=0; LIBNAME=""; } -# /Version References:/ { START=1; } -# /required from/ && (START==1) { -# sub(/:/, "", $3); -# LIBNAME=$3; -# } -# (START==1) && (LIBNAME!="") && ($4~/^GLIBC_*/) { print LIBNAME "(" $4 ")"; } -# /^$/ { START=0; } -# ' -#done | sort -u - diff --git a/bin/fix-db.py b/bin/fix-db.py deleted file mode 100755 index 11afbf7..0000000 --- a/bin/fix-db.py +++ /dev/null @@ -1,175 +0,0 @@ -#!/usr/bin/python -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/fix-db.py,v 1.8 2004/10/11 04:01:00 jstubbs Exp $ - -import os,sys,re -sys.path = ["/usr/lib/portage/pym"]+sys.path - -from stat import * -from output import * -from portage import lockfile,unlockfile,VDB_PATH,root - - -mylog = open("/var/log/emerge_fix-db.log", "a") -def writemsg(msg): - if msg[-1] != '\n': - msg += "\n" - sys.stderr.write(msg) - sys.stderr.flush() - mylog.write(msg) - mylog.flush() - -def fix_global_counter(value): - myf = open("/var/cache/edb/counter") - newvalue = value+1000 - myf.write(str(newvalue)) - myf.flush() - myf.close() - return newvalue - -bad = {} -counters = {} -times = {} - -try: - real_counter = long(open("/var/cache/edb/counter").read()) -except SystemExit, e: - raise # This needs to be propogated -except: - writemsg("ERROR: Real counter is invalid.\n") - real_counter = 0 - -vardbdir = root+VDB_PATH+"/" -for cat in os.listdir(vardbdir): - catdir = vardbdir+cat+"/" - if not os.path.isdir(catdir): - writemsg("Invalid file: '%s'\n" % catdir[:-1]) - continue - for pkg in os.listdir(catdir): - pkgdir = catdir+pkg+"/" - catpkg = cat+"/"+pkg - - if not os.path.isdir(catdir): - writemsg("Invalid file: '%s'\n" % pkgdir) - continue - - bad[catpkg] = [] - - pkgdirlist = os.listdir(pkgdir) - if not pkgdirlist: - writemsg("ERROR: Package directory is empty for '%s'\n" % catpkg) - writemsg(" Deleting this directory. Remerge if you want it back.\n") - os.rmdir(pkgdir) - del bad[catpkg] - continue - - if "CONTENTS" not in pkgdirlist: - bad[catpkg] += ["CONTENTS is missing"] - times[catpkg] = -1 - writemsg("ERROR: Contents file is missing from the package directory.\n") - writemsg(" '%s' is corrupt and should be deleted.\n" % catpkg) - else: - times[catpkg] = None - for line in open(pkgdir+"CONTENTS").readlines(): - mysplit = line.split() - if mysplit[0] == "obj": - try: - times[catpkg] = long(mysplit[-1]) - except SystemExit, e: - raise # This needs to be propogated - except: - times[catpkg] = -1 - bad[catpkg] += ["CONTENTS is corrupt"] - writemsg("ERROR: Corrupt CONTENTS file in '%s'\n" % catpkg) - writemsg(" This package should be deleted.\n") - break - if times[catpkg] == None: - times[catpkg] = os.stat(pkgdir+"CONTENTS")[ST_MTIME] - - if "COUNTER" not in pkgdirlist: - bad[catpkg] += ["COUNTER is missing"] - writemsg("ERROR: COUNTER file missing from '%s'.\n" % catpkg) - counters[catpkg] = -1 - else: - try: - counters[catpkg] = long(open(pkgdir+"COUNTER").read().strip()) - if counters[catpkg] > real_counter: - writemsg("ERROR: Global counter is lower than the '%s' COUNTER." % catpkg) - real_counter = fix_global_counter(counters[catpkg]) - except SystemExit, e: - raise # This needs to be propogated - except: - bad[catpkg] += ["COUNTER is corrupt"] - counters[catpkg] = -1 - - if "SLOT" not in pkgdirlist: - writemsg("ERROR: SLOT file missing from '%s'.\n" % catpkg) - writemsg(" RE-MERGE this exact package version or unmerge and remerge.\n") - bad[catpkg] += ["SLOT is missing"] - else: - myslot = open(pkgdir+"SLOT").read() - if myslot and myslot[-1]=="\n": - #writemsg("WARN: SLOT file has a newline. '%s'\n" % catpkg) - myslot = myslot[:-1] - if not myslot: - bad[catpkg] += ["SLOT is empty"] - writemsg("ERROR: SLOT file is empty for '%s'.\n" % catpkg) - writemsg(" RE-MERGE this exact package version or unmerge and remerge it.\n") - elif re.search("[^-a-zA-Z0-9\._]", myslot): - bad[catpkg] += ["SLOT is corrupt"] - writemsg("ERROR: SLOT file is corrupt for '%s'.\n" % catpkg) - writemsg(" RE-MERGE this exact package version or unmerge and remerge it.\n") - elif myslot.strip() != myslot: - writemsg("WARN: SLOT file has invalid characters. '%s'\n" % catpkg) - bad[catpkg] += ["SLOT is invalid"] - - if not bad[catpkg]: - del bad[catpkg] - - -actions = {} -writemsg("\n\n") -for catpkg in bad.keys(): - bad[catpkg].sort() - - mystr = "" - for x in bad[catpkg]: - mystr += " "+str(x)+"\n" - - if bad[catpkg] == ["CONTENTS is missing", "SLOT is missing"]: - writemsg("%s: (possibly injected)\n%s\n" % (green(catpkg), mystr)) - actions[catpkg] = ["ignore"] - elif bad[catpkg] == ["SLOT is empty"]: - writemsg("%s: (old package) []\n%s\n" % (yellow(catpkg), mystr)) - actions[catpkg] = ["remerge"] - else: - writemsg("%s: (damaged/invalid) []\n%s\n" % (red(catpkg), mystr)) - actions[catpkg] = ["merge exact"] - -if (len(sys.argv) > 1) and (sys.argv[1] == "--fix"): - writemsg("These are only directions, at the moment.") - for catpkg in actions.keys(): - action = actions[catpkg] - writemsg("We will now '%s' '%s'..." % (action, catpkg)) - #if action == -else: - #writemsg("Run with '--fix' to attempt automatic correction.") - pass - - - - - - - - - - - - - - - - - diff --git a/bin/fixdbentries b/bin/fixdbentries deleted file mode 100755 index 2da87ec..0000000 --- a/bin/fixdbentries +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/fixdbentries,v 1.3 2004/10/04 13:56:50 vapier Exp $ - -# Script to adjust the contents of the DB entries after a package move. -# Fairly straight forward... ./movedbentry 'from/here' 'to/here' /over/here - -VAR=$1 -NEW=$2 -SPATH=$3 - -grep -FrZl "${VAR}" "${SPATH}" | -sed "s#${SPATH}[^\d000]\+/CONTENTS\d000##g" | -$XARGS -0 sed -i -e " -s#${VAR}\$#${NEW}#g; -s#${VAR}\([[:space:]]\)#${NEW}\1#g; -s#${VAR}\(-[^a-zA-Z]\)#${NEW}\1#g; -s#${VAR}\([^a-zA-Z0-9-]\)#${NEW}\1#g -" diff --git a/bin/fixpackages b/bin/fixpackages deleted file mode 100755 index 0a6104d..0000000 --- a/bin/fixpackages +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/python -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/fixpackages,v 1.6 2004/10/04 13:56:50 vapier Exp $ - -import os,sys -os.environ["PORTAGE_CALLER"]="fixpackages" -sys.path = ["/usr/lib/portage/pym"]+sys.path - -import portage - -print -print "Done." -print diff --git a/bin/fixvardbentries b/bin/fixvardbentries deleted file mode 100755 index 7fa76ee..0000000 --- a/bin/fixvardbentries +++ /dev/null @@ -1,167 +0,0 @@ -#!/usr/bin/python -O -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/fixvardbentries,v 1.4 2004/10/11 04:01:00 jstubbs Exp $ - -import os -import sys - -def fix_entries(path): - path += "/" - - # Find the ebuild - contents = os.listdir(path) - ebuild = None - for fn in contents: - if fn[-7:] == ".ebuild": - ebuild = fn - break - if ebuild is None: - print "missing ebuild in",path - return - - # Read it - ebuildfile = open(path+ebuild) - orig = ebuildfile.readlines() - ebuildfile.close() - - # Quickly check it - if "\1" not in " ".join(orig): - return False - - # Read the original environment - if "environment.bz2" in contents: - os.system("bzip2 -dk "+path+"environment.bz2") - elif "environment" in contents: - os.system("bzip2 -zk "+path+"environment") - else: - print "environement.bz2 missing!" - print "Please find and remove ^A occurences manually" - print "or replace the ebuild with one from your portage" - print "tree as a last resort." - return False - try: - envfile = open(path+"environment") - except SystemExit, e: - raise # this needs to be propogated - except: - print "environment.bz2 corrupt!" - print "There is no way to fix this ebuild automatically." - print "Try editing the ebuild to remove any ^A occurrences," - print 'possible replacing them with `"`, or copy an ebuild' - print "of the same version (if possible) from the portage tree." - print - return False - lines = envfile.readlines() - envfile.close() - os.remove(path+"environment") - - # Parse it - env = {} - for line in lines: - line = " ".join(line.split()) - values = line.split("=") - if len(values) == 1: - break - key = values[0] - value = "=".join(values[1:]) - if value and value[0] == "$": - value = value[1:] - if value and value[0] == "'": - value = value[1:-1] - value = value.replace("\\n","\n") - value = value.replace("\\t","\t") - env[key] = value - - # Revert the *DEPEND files to their originals - for key in ["DEPEND","RDEPEND","PDEPEND"]: - if not env.has_key(key): - env[key] = "" - f = open(path+key, "w") - f.write(env[key]) - f.close() - - # Check and fix unbalanced quotes - quotecount = 0 - for l in orig: - quotecount += l.count('"') - if (quotecount % 2): - for x in range(len(orig)-1,-1,-1): - if "\1" in orig[x]: - for y in range(len(orig[x])-1,-1,-1): - if orig[x][y]=="\1": - orig[x] = orig[x][:y] + '"' + orig[x][y+1:] - break - break - - # Replace *DEPEND in the ebuild with their originals - fixed = [] - x=0 - while x != len(orig): - for key in ["DEPEND","RDEPEND","PDEPEND"]: - if orig[x].startswith(key): - quotes = 0 - while quotes != 2: - if x >= len(orig): - print "Definate bug" - print "Please attach ebuild",ebuild,"to bug 46096" - print - return False - if not orig[x]: - print "Possible bug - if the original ebuild you see both DEPEND and RDEPEND" - print "in the following but the 'fixed' ebuild doesn't have both then please" - print "attach",ebuild,"to bug 46096 with the following output:" - print orig - print - continue - quotes += orig[x].count('"') - if quotes == 2: - break - if quotes > 2: - print "Unfixable ebuild",ebuild - print "Please attach it to bug 46906" - print - return False - x += 1 - fixed += [key+'="'+env[key]+'"\n'] - x += 1 - break - if x != len(orig): - fixed += orig[x] - x += 1 - ebuildfile = open(path+ebuild,"w") - ebuildfile.writelines(fixed) - ebuildfile.close() - - if "\1" in " ".join(fixed): - print "Partially Fixed... see below" - else: - print "Fixed" - - return True - - -vardb = "/var/db/pkg/" -changed = False -for cat in os.listdir(vardb): - if os.path.isdir(vardb+cat): - for pkg in os.listdir(vardb+cat): - if pkg[0] != "-" and os.path.isdir(vardb+cat+"/"+pkg): - changed = (changed or fix_entries(vardb+cat+"/"+pkg)) - -if changed: - - print "Any ebuilds that were partially fixed can not be fixed any further" - print "by this script or possible any other. Unmerging the package will" - print "more than likely work. If it doesn't, however, try editing the" - print "ebuild to leave only the pkg_prerm and pkg_postrm functions (if" - print "they exist) or copying an ebuild - even of a different version -" - print "from the main portage tree." - - import portage - if portage.mtimedb.has_key("updates"): - del portage.mtimedb["updates"] - -else: - print "No corruption found!" - diff --git a/bin/fixvirtuals b/bin/fixvirtuals deleted file mode 100755 index 975823a..0000000 --- a/bin/fixvirtuals +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/python -O -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/fixvirtuals,v 1.4 2004/11/10 03:10:56 genone Exp $ - -import os,sys -sys.path = ["/usr/lib/portage/pym"]+sys.path - -import portage - -if portage.secpass!=2: - print "fixvirtuals: root access required." - sys.exit(1) - -newvirts={} -myvirts=portage.grabdict("/var/cache/edb/virtuals") -myprovides=portage.db["/"]["vartree"].get_all_provides() - -for myvirt in myprovides.keys(): - newvirts[myvirt]=[] - for mycatpkg in myprovides[myvirt]: - mysplit=portage.portage_versions.catpkgsplit(mycatpkg) - pkg=mysplit[0]+"/"+mysplit[1] - - try: - if (newvirts[myvirt].index(pkg)): - pass - except SystemExit, e: - raise # This needs to be propogated - except: - newvirts[myvirt].append(pkg) - -portage.writedict(newvirts,"/var/cache/edb/virtuals") diff --git a/bin/fowners b/bin/fowners deleted file mode 100755 index 1d20940..0000000 --- a/bin/fowners +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash -# Copyright 1999-2005 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/fowners,v 1.7 2005/05/04 22:49:14 vapier Exp $ - -if [ $# -lt 2 ] ; then - echo "${0}: at least two arguments needed" 1>&2 - exit 1 -fi - -OPTS="" -while [ "${1:0:1}" = "-" ] ; do - OPTS="${OPTS} $1" - shift -done - -OWNER="${1}" -shift - -for FILE in "$@" ; do - chown ${OPTS} "${OWNER}" "${D}${FILE}" -done diff --git a/bin/fperms b/bin/fperms deleted file mode 100755 index 131f6a0..0000000 --- a/bin/fperms +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash -# Copyright 1999-2005 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/fperms,v 1.7 2005/05/04 22:49:14 vapier Exp $ - -if [ $# -lt 2 ] ; then - echo "${0}: at least two arguments needed" 1>&2 - exit 1 -fi - -OPTS="" -while [ "${1:0:1}" = "-" ] ; do - OPTS="${OPTS} $1" - shift -done - -PERM=$1 -shift - -for FILE in "$@" ; do - chmod ${OPTS} "${PERM}" "${D}${FILE}" -done diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh deleted file mode 100644 index 6eb5d98..0000000 --- a/bin/isolated-functions.sh +++ /dev/null @@ -1,204 +0,0 @@ -# Copyright 1999-2004 Gentoo Technologies, Inc. -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/isolated-functions.sh,v 1.2 2005/02/21 12:45:49 genone Exp $ - -# Internal logging function, don't use this in ebuilds -elog_base() { - local messagetype - [ -z "${1}" -o -z "${T}" -o ! -d "${T}/logging" ] && return 1 - case "${1}" in - INFO|WARN|ERROR|LOG) - messagetype="${1}" - shift - ;; - *) - echo -e " ${BAD}*${NORMAL} Invalid use of internal function elog_base(), next message will not be logged" - return 1 - ;; - esac - echo ${*} >> ${T}/logging/${EBUILD_PHASE}.${messagetype} - return 0 -} - -elog() { - elog_base LOG ${*} - echo -e " ${GOOD}*${NORMAL} ${*}" - return 0 -} - -esyslog() { - local pri= - local tag= - - if [ -x /usr/bin/logger ] - then - pri="$1" - tag="$2" - - shift 2 - [ -z "$*" ] && return 0 - - /usr/bin/logger -p "${pri}" -t "${tag}" -- "$*" - fi - - return 0 -} - -einfo() { - einfon ${*} - echo - return 0 -} - -einfon() { - elog_base INFO ${*} - echo -ne " ${GOOD}*${NORMAL} ${*}" - return 0 -} - -ewarn() { - elog_base WARN ${*} - echo -e " ${WARN}*${NORMAL} ${*}" - return 0 -} - -eerror() { - elog_base ERROR ${*} - echo -e " ${BAD}*${NORMAL} ${*}" - return 0 -} - -ebegin() { - if [ -z "${NOCOLOR}" ]; then - echo -ne " ${GOOD}*${NORMAL} ${*}..." - else - echo -e " ${GOOD}*${NORMAL} ${*}..." - fi - return 0 -} - -eend() { - local retval= - if [ "$#" -eq 0 ] || [ "${1:-1}" -eq 0 ]; then - echo -e "${ENDCOL} ${BRACKET}[ ${GOOD}ok${BRACKET} ]${NORMAL}" - else - retval="$1" - - if [ "$#" -ge 2 ] - then - shift - eerror "${*}" - fi - echo -e "${ENDCOL} ${BRACKET}[ ${BAD}!!${BRACKET} ]${NORMAL}" - # extra spacing makes it easier to read - echo - return ${retval} - fi - return 0 -} - -KV_major() { - local KV= - - [ -z "$1" ] && return 1 - - KV="$(echo "$1" | \ - awk '{ tmp = $0; gsub(/^[0-9\.]*/, "", tmp); sub(tmp, ""); print }')" - echo "${KV}" | awk -- 'BEGIN { FS = "." } { print $1 }' - - return 0 -} - -KV_minor() { - local KV= - - [ -z "$1" ] && return 1 - - KV="$(echo "$1" | \ - awk '{ tmp = $0; gsub(/^[0-9\.]*/, "", tmp); sub(tmp, ""); print }')" - echo "${KV}" | awk -- 'BEGIN { FS = "." } { print $2 }' - - return 0 -} - -KV_micro() { - local KV= - - [ -z "$1" ] && return 1 - - KV="$(echo "$1" | \ - awk '{ tmp = $0; gsub(/^[0-9\.]*/, "", tmp); sub(tmp, ""); print }')" - echo "${KV}" | awk -- 'BEGIN { FS = "." } { print $3 }' - - return 0 -} - -KV_to_int() { - local KV_MAJOR= - local KV_MINOR= - local KV_MICRO= - local KV_int= - - [ -z "$1" ] && return 1 - - KV_MAJOR="$(KV_major "$1")" - KV_MINOR="$(KV_minor "$1")" - KV_MICRO="$(KV_micro "$1")" - KV_int="$((KV_MAJOR * 65536 + KV_MINOR * 256 + KV_MICRO))" - - # We make version 2.2.0 the minimum version we will handle as - # a sanity check ... if its less, we fail ... - if [ "${KV_int}" -ge 131584 ] - then - echo "${KV_int}" - - return 0 - fi - - return 1 -} - -get_KV() { - local KV="$(uname -r)" - - echo "$(KV_to_int "${KV}")" - - return $? -} - -getcols() { - echo "$2" -} - -unset_colors() { - COLS="25 80" - ENDCOL= - - GOOD= - WARN= - BAD= - NORMAL= - HILITE= - BRACKET= - - if [ -n "${EBUILD}" ] && [ "${*/depend}" = "$*" ]; then - stty cols 80 &>/dev/null - stty rows 25 &>/dev/null - fi -} - -set_colors() { - COLS="`stty size 2> /dev/null`" - COLS="`getcols ${COLS}`" - COLS=$((${COLS} - 7)) - ENDCOL=$'\e[A\e['${COLS}'G' # Now, ${ENDCOL} will move us to the end of the - # column; irregardless of character width - - GOOD=$'\e[32;01m' - WARN=$'\e[33;01m' - BAD=$'\e[31;01m' - NORMAL=$'\e[0m' - HILITE=$'\e[36;01m' - BRACKET=$'\e[34;01m' -} -true diff --git a/bin/md5check.py b/bin/md5check.py deleted file mode 100755 index 77c6ab8..0000000 --- a/bin/md5check.py +++ /dev/null @@ -1,102 +0,0 @@ -#!/usr/bin/python -O -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/md5check.py,v 1.4 2004/10/10 10:07:20 carpaski Exp $ - -import os,sys,string -os.environ["PORTAGE_CALLER"]="mirror" -os.environ["FEATURES"]="mirror cvs" -sys.path = ["/usr/lib/portage/pym"]+sys.path - -import portage -from threading import * -from output import red,green,blue,bold -from random import shuffle -from time import sleep - - -def cstrip(mystr,mychars): - newstr = "" - for x in mystr: - if x not in mychars: - newstr += x - return newstr - -md5_list = {} -bn_list = [] -col_list = [] - -hugelist = [] -for mycp in portage.db["/"]["porttree"].dbapi.cp_all(): - hugelist += portage.db["/"]["porttree"].dbapi.cp_list(mycp) -hugelist.sort() - -for mycpv in hugelist: - pv = string.split(mycpv, "/")[-1] - - newuri = portage.db["/"]["porttree"].dbapi.aux_get(mycpv,["SRC_URI"])[0] - newuri = string.split(newuri) - - digestpath = portage.db["/"]["porttree"].dbapi.findname(mycpv) - digestpath = os.path.dirname(digestpath)+"/files/digest-"+pv - md5sums = portage.digestParseFile(digestpath) - - if md5sums == None: - portage.writemsg("Missing digest: %s\n" % mycpv) - md5sums = {} - - for x in md5sums.keys(): - if x[0] == '/': - del md5sums[x] - - #portage.writemsg("\n\ndigestpath: %s\n" % digestpath) - #portage.writemsg("md5sums: %s\n" % md5sums) - #portage.writemsg("newuri: %s\n" % newuri) - - bn_list = [] - for x in newuri: - if not x: - continue - if (x in [")","(",":","||"]) or (x[-1] == "?"): - # ignore it. :) - continue - x = cstrip(x,"()|?") - if not x: - continue - - mybn = os.path.basename(x) - if mybn not in bn_list: - bn_list += [mybn] - else: - continue - - if mybn not in md5sums.keys(): - portage_util.writemsg("Missing md5sum: %s in %s\n" % (mybn, mycpv)) - else: - if mybn in md5_list.keys(): - if (md5_list[mybn]["MD5"] != md5sums[mybn]["MD5"]) or \ - (md5_list[mybn]["size"] != md5sums[mybn]["size"]): - - # This associates teh md5 with each file. [md5/size] - md5joins = string.split(md5_list[mybn][2],",") - md5joins = string.join(md5joins," ["+md5_list[mybn][0]+"/"+md5_list[mybn][1]+"],") - md5joins += " ["+md5_list[mybn][0]+"/"+md5_list[mybn][1]+"]" - - portage.writemsg("Colliding md5: %s of %s [%s/%s] and %s\n" % (mybn,mycpv,md5sums[mybn][0],md5sums[mybn][1],md5joins)) - col_list += [mybn] - else: - md5_list[mybn][2] += ","+mycpv - else: - md5_list[mybn] = md5sums[mybn]+[mycpv] - del md5sums[mybn] - - #portage.writemsg(str(bn_list)+"\n") - for x in md5sums.keys(): - if x not in bn_list: - portage.writemsg("Extra md5sum: %s in %s\n" % (x, mycpv)) - - -print col_list -print -print str(len(md5_list.keys()))+" unique distfile md5s." -print str(len(bn_list))+" unique distfile names." diff --git a/bin/md5check.sh b/bin/md5check.sh deleted file mode 100755 index ddb242b..0000000 --- a/bin/md5check.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/md5check.sh,v 1.2 2004/10/04 13:56:50 vapier Exp $ - -# pipe in the data. - -sort -u - > md5check.tmp -grep '^Extra' md5check.tmp > md5check.tmp.extra -grep '^Missing' md5check.tmp > md5check.tmp.missing -grep '^Coll' md5check.tmp > md5check.tmp.colliding - -sed -i " -s:^Col:\nCol: -s:,:\n :g -s: of :\n :g -s: and :\n :g" md5check.tmp.colliding -sed -i "s/^[^ ]\+ md5sum: \(.*\) in \(.*\)$/ \2: \1/g" md5check.tmp.missing -sed -i "s/^[^ ]\+ md5sum: \(.*\) in \(.*\)$/ \2: \1/g" md5check.tmp.extra - -#echo "Colliding files:" > md5check.colliding -#sort -u md5check.tmp.colliding >> md5check.colliding -cp md5check.tmp.colliding md5check.colliding - -echo "Missing from digest:" > md5check.missing -sort -u md5check.tmp.missing >> md5check.missing - -echo "Extra files in digest:" > md5check.extra -sort -u md5check.tmp.extra >> md5check.extra - -rm md5check.tmp* diff --git a/bin/mirror.py b/bin/mirror.py deleted file mode 100755 index ba85f0f..0000000 --- a/bin/mirror.py +++ /dev/null @@ -1,167 +0,0 @@ -#!/usr/bin/python -O -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/mirror.py,v 1.3 2004/10/10 10:07:20 carpaski Exp $ - -# Defines the number of threads carrying out the downloading. -maxsems=5 - -import os,sys,string -os.environ["PORTAGE_CALLER"]="mirror" -os.environ["FEATURES"]="mirror cvs" -sys.path = ["/usr/lib/portage/pym"]+sys.path - -import portage -from threading import * -from output import red,green,blue,bold -from random import shuffle -from time import sleep - - -def cstrip(mystr,mychars): - newstr = "" - for x in mystr: - if x not in mychars: - newstr += x - return newstr - -class fetcher(Thread): - def __init__(self, filename, urilist, dest, md5sum): - self.filename = filename - self.myurilist = urilist - self.myuri = None - self.mydest = dest - self.destpath = self.mydest+"/"+self.filename - self.md5sum = md5sum - self.result = None - Thread.__init__(self) - - def fetch(self): - #print "Started",self.filename - sys.stderr.write(".") - sys.stderr.flush() - portage.spawn("wget -q -P "+str(self.mydest)+" "+self.myuri, free=1) - - def finished(self): - if os.path.exists(self.destpath) and self.md5sum: - ok,reason = portage_checksum.verify_all(self.destpath, md5sum) - if not ok: - portage_util.writemsg("Failed verification:" + reason + "\n") - return 1 - return 0 - - def delete(self): - if os.path.exists(self.destpath): - #print "Unlink:",self.destpath - os.unlink(self.destpath) - - def run(self): - if not self.finished(): - self.delete() - - while not self.finished(): - if self.myurilist: - self.myuri = self.myurilist.pop(0)+"/"+self.filename - self.fetch() - else: - self.delete() - self.result = 0 - #print "Failed:",self.filename - return 1 - - #print "Finished:",self.filename - self.result = 1 - return 0 - - -uri_list = {} -fetchers = [] -fetcher_sem = BoundedSemaphore(value=maxsems) -failures = 0 -successes = 0 - -def clean_fetchers(): - global fetcher_sem,fetchers,uri_list,failures,successes,maxsems - while len(fetchers) == maxsems: - for x in fetchers: - if not x.isAlive(): - failures += (x.result == 0) - successes += (x.result == 1) - if x.filename in uri_list.keys(): - del uri_list[x.filename] - del fetchers[fetchers.index(x)] - fetcher_sem.release() - if len(fetchers) == maxsems: - sleep(1) - - -def start_fetcher(fname, urilist, dest, md5sum): - global fetcher_sem,fetchers,uri_list,failures,successes - fetcher_sem.acquire() - fetchers.append(fetcher(fname, urilist, dest, md5sum)) - fetchers[-1].start() - - -tpm = portage.thirdpartymirrors -destdir = portage.settings["DISTDIR"][:] - -hugelist = [] -for mycp in portage.db["/"]["porttree"].dbapi.cp_all(): - hugelist += portage.db["/"]["porttree"].dbapi.cp_list(mycp) -shuffle(hugelist) - -mycount = -1 -for mycpv in hugelist: - pv = string.split(mycpv, "/")[-1] - - clean_fetchers() - - mycount += 1 - if ((mycount % 20) == 0): - sys.stdout.write("\nCompleted: %s\n" % mycount) - sys.stdout.flush() - newuri = portage.db["/"]["porttree"].dbapi.aux_get(mycpv,["SRC_URI"])[0] - newuri = string.split(newuri) - - digestpath = portage.db["/"]["porttree"].dbapi.findname(mycpv) - digestpath = os.path.dirname(digestpath)+"/files/digest-"+pv - md5sums = portage.digestParseFile(digestpath) - - for x in newuri: - clean_fetchers() - if not x: - continue - if (x in [")","(",":","||"]) or (x[-1] == "?"): - # ignore it. :) - continue - x = cstrip(x,"()|?") - if not x: - continue - mybn = os.path.basename(x) - mydn = os.path.dirname(x) - if mybn not in uri_list.keys(): - if (len(mybn) > len("mirror://")) and (mybn[:len("mirror://")] == "mirror://"): - mysite = string.split(x[len("mirror://"):], "/")[0] - shuffle(tpm[mysite]) - uri_list[mybn] = tpm[mysite][:] - else: - uri_list[mybn] = [os.path.dirname(x)] - clean_fetchers() - if (not md5sums) or (mybn not in md5sums.keys()): - start_fetcher(mybn, uri_list[mybn], destdir, None) - else: - start_fetcher(mybn, uri_list[mybn], destdir, md5sums[mybn]) - else: - break - -sys.stderr.write("\n\nWaiting last set\n") -sys.stderr.flush() -while fetchers: - if fetchers[0].isAlive(): - fetchers[0].join() - clean_fetchers() - -print -print -print "Successes:",successes -print "Failures: ",failures diff --git a/bin/newbin b/bin/newbin deleted file mode 100755 index dc503e8..0000000 --- a/bin/newbin +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/newbin,v 1.7 2004/10/04 13:56:50 vapier Exp $ - -if [ -z "${T}" ] || [ -z "${2}" ] ; then - echo "Nothing defined to do." - exit 1 -fi - -rm -rf "${T}/${2}" -cp "${1}" "${T}/${2}" -dobin "${T}/${2}" diff --git a/bin/newconfd b/bin/newconfd deleted file mode 100755 index b9042c9..0000000 --- a/bin/newconfd +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -# Copyright 1999-2005 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/newconfd,v 1.3 2005/05/04 23:14:40 vapier Exp $ - -if [ -z "${T}" ] || [ -z "${2}" ] ; then - echo "$0: nothing defined to do" 1>&2 - exit 1 -fi - -rm -rf "${T}/${2}" -cp "${1}" "${T}/${2}" -exec doconfd "${T}/${2}" diff --git a/bin/newdoc b/bin/newdoc deleted file mode 100755 index b4a0d49..0000000 --- a/bin/newdoc +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -# Copyright 1999-2005 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/newdoc,v 1.8 2005/05/04 00:52:42 vapier Exp $ - -if [ -z "${T}" ] || [ -z "${2}" ] ; then - echo "newdoc: Nothing defined to do" 1>&2 - exit 1 -fi - -rm -rf "${T}/${2}" -cp "${1}" "${T}/${2}" -exec dodoc "${T}/${2}" diff --git a/bin/newenvd b/bin/newenvd deleted file mode 100755 index 3acb06e..0000000 --- a/bin/newenvd +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -# Copyright 1999-2005 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/newenvd,v 1.3 2005/05/04 23:14:40 vapier Exp $ - -if [ -z "${T}" ] || [ -z "${2}" ] ; then - echo "$0: nothing defined to do" 1>&2 - exit 1 -fi - -rm -rf "${T}/${2}" -cp "${1}" "${T}/${2}" -exec doenvd "${T}/${2}" diff --git a/bin/newexe b/bin/newexe deleted file mode 100755 index f42deeb..0000000 --- a/bin/newexe +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/newexe,v 1.7 2004/10/04 13:56:50 vapier Exp $ - -if [ -z "${T}" ] || [ -z "${2}" ] ; then - echo "Nothing defined to do." - exit 1 -fi - -rm -rf "${T}/${2}" -cp "${1}" "${T}/${2}" -doexe "${T}/${2}" diff --git a/bin/newinitd b/bin/newinitd deleted file mode 100755 index 3544057..0000000 --- a/bin/newinitd +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -# Copyright 1999-2005 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/newinitd,v 1.3 2005/05/04 23:14:40 vapier Exp $ - -if [ -z "${T}" ] || [ -z "${2}" ] ; then - echo "$0: nothing defined to do" 1>&2 - exit 1 -fi - -rm -rf "${T}/${2}" -cp "${1}" "${T}/${2}" -exec doinitd "${T}/${2}" diff --git a/bin/newins b/bin/newins deleted file mode 100755 index 3652ea7..0000000 --- a/bin/newins +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/newins,v 1.7 2004/10/04 13:56:50 vapier Exp $ - -if [ -z "${T}" ] || [ -z "${2}" ] ; then - echo "Error: Nothing defined to do." - exit 1 -fi - -rm -rf "${T}/${2}" -cp "${1}" "${T}/${2}" -doins "${T}/${2}" diff --git a/bin/newlib.a b/bin/newlib.a deleted file mode 100755 index 6e5a2f7..0000000 --- a/bin/newlib.a +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/newlib.a,v 1.7 2004/10/04 13:56:50 vapier Exp $ - -if [ -z "${T}" ] || [ -z "${2}" ] ; then - echo "Error: Nothing defined to do." - exit 1 -fi - -rm -rf "${T}/${2}" -cp "${1}" "${T}/${2}" -dolib.a "${T}/${2}" diff --git a/bin/newlib.so b/bin/newlib.so deleted file mode 100755 index f183d89..0000000 --- a/bin/newlib.so +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/newlib.so,v 1.7 2004/10/04 13:56:50 vapier Exp $ - -if [ -z "${T}" ] || [ -z "${2}" ] ; then - echo "Error: Nothing defined to do." - exit 1 -fi - -rm -rf "${T}/${2}" -cp "${1}" "${T}/${2}" -dolib.so "${T}/${2}" diff --git a/bin/newman b/bin/newman deleted file mode 100755 index a20f031..0000000 --- a/bin/newman +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/newman,v 1.8 2005/05/04 00:52:42 vapier Exp $ - -if [ -z "${T}" ] || [ -z "${2}" ] ; then - echo "newman: Nothing defined to do" 1>&2 - exit 1 -fi - -rm -rf "${T}/${2}" -cp "${1}" "${T}/${2}" -exec doman "${T}/${2}" diff --git a/bin/newsbin b/bin/newsbin deleted file mode 100755 index 5c35ea4..0000000 --- a/bin/newsbin +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/newsbin,v 1.7 2004/10/04 13:56:50 vapier Exp $ - -if [ -z "${T}" ] || [ -z "${2}" ] ; then - echo "Nothing defined to do." - exit 1 -fi - -rm -rf "${T}/${2}" -cp "${1}" "${T}/${2}" -dosbin "${T}/${2}" diff --git a/bin/pkgmerge b/bin/pkgmerge deleted file mode 100755 index 1628d39..0000000 --- a/bin/pkgmerge +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/python -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/pkgmerge,v 1.8 2004/10/04 13:56:50 vapier Exp $ - -import sys,os,string -sys.path = ["/usr/lib/portage/pym"]+sys.path - -import portage,xpak - -#build our package digraph - -def digraph_create(digraph,mykey,myprovides=None): - mytbz2=xpak.tbz2(bintree.getname(mykey)) - mydep=mytbz2.getelements("RDEPEND") - digraph.addnode(mykey,myprovides) - mycheck=roottree.depcheck(string.join(mydep," ")) - if mycheck[0]==0: - print "!!! Error: RDEPEND string formatted incorrectly:",mydep - return None - for x in mycheck[1]: - mymatch=bintree.dep_bestmatch(x) - if mymatch=="": - print "!!! Error: can't resolve dependency --",x - return None - if not digraph_create(digraph,mymatch,mykey): - return None - return 1 - -#main program loop -myvirtuals=portage.getvirtuals(portage.root) -roottree=portage.vartree(portage.root,myvirtuals) -bintree=portage.binarytree("/",myvirtuals) -pretend=0 -if len(sys.argv)>=2: - if sys.argv[1]=="--pretend": - print "These are the packages that I would merge, in order:" - pretend=1 - del sys.argv[1] - elif sys.argv[1]=="--help": - print "Usage: pkgmerge [--pretend] pkg1.tbz2 [pkg2.tbz2]..." - sys.exit(1) -for mypkg in sys.argv[1:]: - digraph=portage.digraph() - mytbz2=xpak.tbz2(mypkg) - mykey=mytbz2.getelements("CATEGORY")[0]+"/"+os.path.basename(mypkg)[:-5] - digraph_create(digraph,mykey) - while not digraph.empty(): - mykey=digraph.firstzero() - if not mykey: - print "!!! Error: circular dependencies" - sys.exit(1) - mytbz2=bintree.getname(mykey) - if pretend: - print mytbz2 - else: - portage.pkgmerge(mytbz2,portage.settings["ROOT"]) - digraph.delnode(mykey) - diff --git a/bin/pkgmerge.new b/bin/pkgmerge.new deleted file mode 100755 index 40ab737..0000000 --- a/bin/pkgmerge.new +++ /dev/null @@ -1,84 +0,0 @@ -#!/usr/bin/python -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/pkgmerge.new,v 1.7 2004/10/04 13:56:50 vapier Exp $ - -import os,string,sys -sys.path = ["/usr/lib/portage/pym"]+sys.path - -import portage,xpak - -#beautiful directed graph functions - -def dig_addnode(digraph,mykey,myprovides): - if not digraph.has_key(mykey): - if myprovides==None: - digraph[mykey]=[0,[]] - else: - digraph[mykey]=[0,[myprovides]] - digraph[myprovides][0]=digraph[myprovides][0]+1 - return - digraph[mykey]=[digraph[mykey][0],digraph[mykey][1].append(myprovides)] - -def dig_delnode(digraph,mykey): - if not digraph.has_key(mykey): - return - for x in digraph[mykey][1]: - digraph[x][0]=digraph[x][0]-1 - del digraph[mykey] - -def dig_firstzero(digraph): - for x in digraph.keys(): - if digraph[x][0]==0: - return x - return None - -#build our package digraph - -def digraph_create(digraph,mykey,myprovides=None): - mytbz2=xpak.tbz2(bintree.getname(mykey)) - mydep=mytbz2.getelements("RDEPEND") - dig_addnode(digraph,mykey,myprovides) - mycheck=roottree.depcheck(string.join(mydep," ")) - if mycheck[0]==0: - print "!!! Error: RDEPEND string formatted incorrectly:",mydep - return None - for x in mycheck[1]: - mymatch=bintree.dep_bestmatch(x) - if mymatch=="": - print "!!! Error: can't resolve dependency --",x - return None - if not digraph_create(digraph,mymatch,mykey): - return None - return 1 - -#main program loop -myvirtuals=portage.getvirtual(portage.root) -roottree=portage.vartree(portage.root,myvirtuals) -bintree=portage.binarytree("/",myvirtuals) -pretend=0 -if len(sys.argv)>=2: - if sys.argv[1]=="--pretend": - print "These are the packages that I would merge, in order:" - pretend=1 - del sys.argv[1] - elif sys.argv[1]=="--help": - print "Usage: pkgmerge [--pretend] pkg1.tbz2 [pkg2.tbz2]..." - sys.exit(1) -for mypkg in sys.argv[1:]: - digraph={} - mytbz2=xpak.tbz2(mypkg) - mykey=mytbz2.getelements("CATEGORY")[0]+"/"+mypkg[:-5] - digraph_create(digraph,mykey) - while (len(digraph)): - mykey=dig_firstzero(digraph) - if not mykey: - print "!!! Error: circular dependencies" - sys.exit(1) - mytbz2=bintree.getname(mykey) - if pretend: - print mytbz2 - else: - portage.pkgmerge(mytbz2) - dig_delnode(digraph,mykey) - diff --git a/bin/pkgname b/bin/pkgname deleted file mode 100755 index ef0e193..0000000 --- a/bin/pkgname +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/python -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/pkgname,v 1.9 2004/11/10 03:10:56 genone Exp $ - -import sys -sys.path = ["/usr/lib/portage/pym"]+sys.path - -import portage - -a=portage.portage_versions.pkgsplit(sys.argv[1]) -if a: - print a[0],a[1],a[2][1:] - sys.exit(0) -else: - print '!!! Error: package name is invalid.' - sys.exit(1) diff --git a/bin/portage_gpg_update.sh b/bin/portage_gpg_update.sh deleted file mode 100755 index fc31ae7..0000000 --- a/bin/portage_gpg_update.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/portage_gpg_update.sh,v 1.2 2004/10/04 13:56:50 vapier Exp $ - -wget -O - http://www.gentoo.org/proj/en/devrel/roll-call/userinfo.xml | sed 's:.*\(0x[0-9a-fA-F]\+\)[^0-9a-fA-F].*:\1:gp;d' | xargs gpg -vvv --no-default-keyring --no-permission-warning --homedir /usr/portage/metadata --keyring "gentoo.gpg" --keyserver subkeys.pgp.net --recv-keys &> gpg.log diff --git a/bin/portageq b/bin/portageq deleted file mode 100755 index d749318..0000000 --- a/bin/portageq +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/python -O -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/portageq,v 1.15 2004/12/07 15:06:41 jstubbs Exp $ - -import sys -sys.path = ["/usr/lib/portage/pym"]+sys.path - -import portage,types, portageq - - -#----------------------------------------------------------------------------- -# -# DO NOT CHANGE CODE BEYOND THIS POINT - IT'S NOT NEEDED! -# - -def usage(): - rev="$Revision: 1.15 $" - ver=rev.split(' ')[1] - print ">>> Portage information query tool -- version "+ver - print ">>> Usage: portageq <command> [<option> ...]" - print "" - print "Available commands:" - - # - # Show our commands -- we do this by scanning the functions in this - # file, and formatting each functions documentation. - # - for name in dir(portageq): - # Drop python stuff, modules, and our own support functions. - if (name in ("usage", "__doc__", "__name__", "main", "os", "portage", "sys", "__builtins__", "types", "string")): - continue - - # Drop non-functions - obj = getattr(portageq,name) - if (type(obj) != types.FunctionType): - continue - - doc = obj.__doc__ - if (doc == None): - print " "+name - print " MISSING DOCUMENTATION!" - print "" - continue - - lines = doc.split('\n') - print " "+name+" "+lines[0].strip() - for line in lines[1:]: - print " "+line.strip() - - -def main(): - if (len(sys.argv) < 2): - usage() - sys.exit() - - cmd = sys.argv[1] - try: - function = getattr(portageq,cmd) - e,s = function(sys.argv[2:]) - print s - sys.exit(e) - except KeyError: - usage() - sys.exit() - except SystemExit: - raise - except Exception,e: - sys.exit(1) - -main() - - -#----------------------------------------------------------------------------- diff --git a/bin/prepall b/bin/prepall deleted file mode 100755 index a2c9570..0000000 --- a/bin/prepall +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash -# Copyright 1999-2005 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/prepall,v 1.14 2005/05/29 05:33:08 vapier Exp $ - -prepallman -prepallinfo -prepallstrip - -#this should help to ensure that all (most?) shared libraries are executable -for i in "${D}"opt/*/lib{,32,64} \ - "${D}"lib{,32,64} \ - "${D}"usr/lib{,32,64} \ - "${D}"usr/X11R6/lib{,32,64} ; do - [ ! -d "${i}" ] && continue - - for j in "${i}"/*.so.* "${i}"/*.so ; do - [ ! -e "${j}" ] && continue - [ -L "${j}" ] && continue - [ -x "${j}" ] && continue - echo "making executable: /${j/${D}/}" - chmod +x "${j}" - done -done - -# When installing static libraries into /usr/lib and shared libraries into -# /lib, we have to make sure we have a linker script in /usr/lib along side -# the static library, or gcc will utilize the static lib when linking :(. -# http://bugs.gentoo.org/show_bug.cgi?id=4411 -for a in "${D}"/usr/lib/*.a ; do - s=${a%.a}.so - if [ ! -e "${s}" ] ; then - s=${s##*/} - if [ -e "${D}/lib/${s}" ] ; then - echo -e "\aQA Notice: missing gen_usr_ldscript for ${s}\a" - sleep 1 - fi - fi -done - -# Verify that the libtool files don't contain bogus $D entries. -for a in "${D}"/usr/lib/*.la ; do - s=${a##*/} - if grep -qs "${PORTAGE_TMPDIR}" "${a}" ; then - echo -e "\aQA Notice: ${s} appears to contain PORTAGE_TMPDIR paths\a" - sleep 1 - fi -done diff --git a/bin/prepalldocs b/bin/prepalldocs deleted file mode 100755 index 682b075..0000000 --- a/bin/prepalldocs +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/bash -# Copyright 1999-2005 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/prepalldocs,v 1.7 2005/05/04 23:50:33 vapier Exp $ - -dir="${D}usr/share/doc" - -[ ! -d "${dir}" ] && exit 0 - -z=$(find "${dir}" \ - '(' -type f -or -type l ')' \ - -not -name '*.gz' \ - -not -name '*.bz2' \ - -not -name '*.Z' \ - -not -name '*.js' \ - 2>/dev/null) - -[ -z "${z}" ] && exit 0 - -PORTAGE_COMPRESS=${PORTAGE_COMPRESS:-gzip} -PORTAGE_COMPRESS_FLAGS=${PORTAGE_COMPRESS_FLAGS:--9} -if [ -z "${PORTAGE_COMPRESS_SUFFIX}" ] ; then - case ${PORTAGE_COMPRESS} in - gzip) suffix="gz";; - bzip2) suffix="bz2";; - *) echo "prepalldocs error: please set PORTAGE_COMPRESS_SUFFIX in make.conf" 1>&2 - exit 1;; - esac -fi - -echo "doc: ${PORTAGE_COMPRESS} ${PORTAGE_COMPRESS_FLAGS}" -for y in ${z} ; do - if [ -L "${y}" ] ; then - # Symlink ... - mylink=${y} - linkto=$(readlink "${y}") - - if [ "${linkto##*.}" != "${suffix}" ] ; then - linkto="${linkto}.${suffix}" - fi - if [ "${mylink##*.}" != "${suffix}" ] ; then - mylink="${mylink}.${suffix}" - fi - - echo " link fixed ${mylink##*/}" - ln -snf "${linkto}" "${mylink}" - if [ "${y}" != "${mylink}" ] ; then - echo " link removed ${y##*/}" - rm -f "${y}" - fi - else - if [ "${y##*.}" != "${suffix}" ] ; then - echo " compressing ${y##*/}" - "${PORTAGE_COMPRESS}" ${PORTAGE_COMPRESS_FLAGS} -f "${y}" - fi - fi -done diff --git a/bin/prepallinfo b/bin/prepallinfo deleted file mode 100755 index b0fd644..0000000 --- a/bin/prepallinfo +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -# Copyright 1999-2005 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/prepallinfo,v 1.8 2005/05/04 23:50:33 vapier Exp $ - -[ ! -d "${D}usr/share/info" ] && exit 0 - -exec prepinfo diff --git a/bin/prepallman b/bin/prepallman deleted file mode 100755 index 02d7733..0000000 --- a/bin/prepallman +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -# Copyright 1999-2005 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/prepallman,v 1.12 2005/05/04 23:50:33 vapier Exp $ - -for x in "${D}"opt/*/man "${D}"usr/share/man "${D}"usr/local/man "${D}"usr/X11R6/man ; do - if [ -d "${x}" ] ; then - prepman "`echo "${x}" | sed -e "s:${D}::" -e "s:/man[/]*$::"`" - export prepallman_banner=no - fi -done diff --git a/bin/prepallstrip b/bin/prepallstrip deleted file mode 100755 index b200baf..0000000 --- a/bin/prepallstrip +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -# Copyright 1999-2005 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/prepallstrip,v 1.13 2005/05/04 23:39:40 vapier Exp $ - -if [ "${FEATURES//*nostrip*/true}" == "true" ] || [ "${RESTRICT//*nostrip*/true}" == "true" ] ; then - exit 0 -fi - -exec prepstrip "${D}" diff --git a/bin/prepinfo b/bin/prepinfo deleted file mode 100755 index e80028c..0000000 --- a/bin/prepinfo +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/bash -# Copyright 1999-2005 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/prepinfo,v 1.7 2005/05/04 23:50:33 vapier Exp $ - -if [ -z "$1" ] ; then - z="${D}usr/share/info" -else - if [ -d "${D}$1/share/info" ] ; then - z="${D}$1/share/info" - else - z="${D}$1/info" - fi -fi - -[ ! -d "${z}" ] && exit 0 - -rm -f "${z}"/dir{,.old}{,.info{,.gz,.bz2,.Z}} - -PORTAGE_COMPRESS=${PORTAGE_COMPRESS:-gzip} -PORTAGE_COMPRESS_FLAGS=${PORTAGE_COMPRESS_FLAGS:--9} -if [ -z "${PORTAGE_COMPRESS_SUFFIX}" ] ; then - case ${PORTAGE_COMPRESS} in - gzip) suffix="gz";; - bzip2) suffix="bz2";; - *) echo "prepinfo: error fixing links: please set PORTAGE_COMPRESS_SUFFIX in make.conf" 1>&2 - exit 1;; - esac -fi - -echo "info: ${PORTAGE_COMPRESS} ${PORTAGE_COMPRESS_FLAGS}" - -for x in `find "${z}"/ \( -type f -or -type l \) -maxdepth 1 -mindepth 1 2>/dev/null` ; do - if [ -L "${x}" ] ; then - # Symlink ... - mylink=${x} - linkto=$(readlink "${x}") - - if [ "${linkto##*.}" != "${suffix}" ] ; then - linkto="${linkto}.${suffix}" - fi - if [ "${mylink##*.}" != "${suffix}" ] ; then - mylink="${mylink}.${suffix}" - fi - - echo "fixing GNU info symlink: ${mylink##*/}" - ln -snf "${linkto}" "${mylink}" - if [ "${x}" != "${mylink}" ] ; then - echo "removing old symlink: ${x##*/}" - rm -f "${x}" - fi - else - if [ "${x##*.}" != "${suffix}" ] ; then - echo "compressing GNU info page: ${x##*/}" - "${PORTAGE_COMPRESS}" ${PORTAGE_COMPRESS_FLAGS} -f "${x}" - fi - fi -done diff --git a/bin/preplib b/bin/preplib deleted file mode 100755 index f93bdc1..0000000 --- a/bin/preplib +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/preplib,v 1.8 2005/02/26 04:14:19 jstubbs Exp $ - -LIBDIR_VAR="LIBDIR_${ABI}" -if [ -n "${ABI}" -a -n "${!LIBDIR_VAR}" ]; then - CONF_LIBDIR="${!LIBDIR_VAR}" -fi -unset LIBDIR_VAR - -if [ -z "${CONF_LIBDIR}" ]; then - # we need this to default to lib so that things dont break - CONF_LIBDIR="lib" -fi - -if [ -z "$1" ] ; then - z="${D}usr/${CONF_LIBDIR}" -else - z="${D}$1/${CONF_LIBDIR}" -fi - -if [ -d "${z}" ] ; then - ldconfig -n -N "${z}" -fi diff --git a/bin/preplib.so b/bin/preplib.so deleted file mode 100755 index ea4e084..0000000 --- a/bin/preplib.so +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/preplib.so,v 1.11 2004/12/05 10:23:41 carpaski Exp $ - -for x in "$@" ; do - if [ -d "${D}${x}" ] ; then - ldconfig -n -N "${D}${x}" - fi -done diff --git a/bin/prepman b/bin/prepman deleted file mode 100755 index 405b344..0000000 --- a/bin/prepman +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/bash -# Copyright 1999-2005 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/prepman,v 1.12 2005/05/04 23:50:33 vapier Exp $ - -if [ -z "$1" ] ; then - z="${D}usr/share/man" -else - z="${D}$1/man" -fi - -[ ! -d "${z}" ] && exit 0 - -PORTAGE_COMPRESS=${PORTAGE_COMPRESS:-gzip} -PORTAGE_COMPRESS_FLAGS=${PORTAGE_COMPRESS_FLAGS:--9} -if [ -z "${PORTAGE_COMPRESS_SUFFIX}" ] ; then - case ${PORTAGE_COMPRESS} in - gzip) suffix="gz";; - bzip2) suffix="bz2";; - *) echo "prepman error: please set PORTAGE_COMPRESS_SUFFIX in make.conf" 1>&2 - exit 1;; - esac -fi - -if [ -z "${prepallman_banner}" ] ; then - echo "man: ${PORTAGE_COMPRESS} ${PORTAGE_COMPRESS_FLAGS}" -fi - -for x in `find "${z}"/ -type d 2>/dev/null` ; do - for y in `find "${x}"/ \( -type f -or -type l \) ! -name '.keep' -maxdepth 1 -mindepth 1 2>/dev/null` ; do - if [ -L "${y}" ] ; then - # Symlink ... - mylink=${y} - linkto=$(readlink "${y}") - - # Do NOT change links to directories - if [ -d "${z}/${linkto}" ] ; then - continue - fi - - if [ "${linkto##*.}" != "${suffix}" ] ; then - linkto="${linkto}.${suffix}" - fi - if [ "${mylink##*.}" != "${suffix}" ] ; then - mylink="${mylink}.${suffix}" - fi - - echo " link fixed ${mylink##*/}" - ln -snf "${linkto}" "${mylink}" - if [ "${y}" != "${mylink}" ] ; then - echo " link removed ${y##*/}" - rm -f "${y}" - fi - else - if [ "${y##*.}" != "${suffix}" ] && [ ! -d "${y}" ] ; then - echo " compressing ${y##*/}" - "${PORTAGE_COMPRESS}" ${PORTAGE_COMPRESS_FLAGS} -f "${y}" - fi - fi - done -done diff --git a/bin/prepstrip b/bin/prepstrip deleted file mode 100755 index c9c281d..0000000 --- a/bin/prepstrip +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/bash -# Copyright 1999-2005 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/prepstrip,v 1.28 2005/05/29 05:43:49 vapier Exp $ - -if [ "${FEATURES//*nostrip*/true}" == "true" ] || [ "${RESTRICT//*nostrip*/true}" == "true" ] ; then - echo "nostrip" - STRIP="/bin/false" - PORTAGE_STRIP_FLAGS="" -else - STRIP="${STRIP:-${CHOST}-strip}" - type -p ${STRIP} > /dev/null || STRIP=strip - PORTAGE_STRIP_FLAGS=${PORTAGE_STRIP_FLAGS:---strip-unneeded} -fi - -banner=1 -retval=0 - -for x in "$@" ; do - if [ -d "${x}" ]; then - # We only want files. So make a pass for each directory and call again. - find "${x}" -type f \( -perm -0100 -or -perm -0010 -or -perm -0001 -or -name '*.so' -or -name '*.so.*' \) -print0 | - $XARGS -0 -n500 prepstrip - else - if [ ${banner} -eq 1 ] ; then - echo "strip: ${STRIP} ${PORTAGE_STRIP_FLAGS}" - banner=0 - fi - - f=$(file "${x}") - if [ -z "${f/*current ar archive*/}" ]; then - echo " ${x:${#D}:${#x}}" - ${STRIP} -g "${x}" - fi - if [ -z "${f/*SB executable*/}" ]; then - echo " ${x:${#D}:${#x}}" - ${STRIP} "${x}" - fi - if [ -z "${f/*SB shared object*/}" ]; then - echo " ${x:${#D}:${#x}}" - ${STRIP} ${PORTAGE_STRIP_FLAGS} "${x}" - fi - fi -done - -exit ${retval} diff --git a/bin/queryhost.sh b/bin/queryhost.sh deleted file mode 100755 index d1ff1c7..0000000 --- a/bin/queryhost.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/queryhost.sh,v 1.6 2004/10/04 13:56:50 vapier Exp $ - -# Ping a single host and collect the round-trip time. Unfortunately -# this measures latency, not bandwidth, but it's better than nothing. -pinghost() { - local host result - - # Extract the hostname from the URL - host="${1#*://}"; host="${host%%/*}" - - # Attempt to ping the host three times, with an overall timeout of - # 10 seconds. - result=`ping -q -c3 -w10 ${host} 2>/dev/null` - - # Extract average ping time, truncated to integer - result="${result%.?/*}" - result="${result##*/}" - - # Test for sensible $result and return. If zero packets were - # received, then $result will not be sensible since the above - # extraction would have failed. - if [ "$result" -gt 0 ] 2>/dev/null; then - return $result - else - return 9999 - fi -} - -# Ping all of the hosts in parallel, collate the output. -pingall() { - local i output - - for i in $* - do - # Do this as a single echo so it happens as a single - # "write". This is so that the writes coming from the - # multiple processes aren't mixed within a line. It should - # usually work. :-) - ( pinghost $i; echo "$? $i" ) & - done - wait -} - -pingall $1 | sort -n | awk '{print $NF}' diff --git a/bin/quickpkg b/bin/quickpkg deleted file mode 100755 index 9cb5c73..0000000 --- a/bin/quickpkg +++ /dev/null @@ -1,146 +0,0 @@ -#!/bin/bash -# Copyright 1999-2005 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/quickpkg,v 1.16 2005/04/12 22:37:12 vapier Exp $ - -# This script tries to quickly create a Gentoo binary package using the -# VDB_PATH/category/pkg/* files -# -# Resulting tbz2 file will be created in ${PKGDIR} ... -# default is /usr/portage/packages/All/ - -if [ "`whoami`" != "root" ] ; then - echo "You must run this as root" - exit 1 -fi - -export PORTAGE_DB="$(portageq vdb_path)" -if [ -z $1 ] || [ $1 == "-h" ] || [ $1 == "--help" ] ; then - echo "QUICKPKG ver 1.2" - echo "USAGE: quickpkg <list of pkgs>" - echo " a pkg can be of the form:" - echo " - ${PORTAGE_DB}/<CATEGORY>/<PKG-VERSION>/" - echo " - single depend-type atom ..." - echo " if portage can emerge it, quickpkg can make a package" - echo " for exact definitions of depend atoms, see ebuild(5)" - echo - echo "EXAMPLE:" - echo " quickpkg ${PORTAGE_DB}/net-www/apache-1.3.27-r1" - echo " package up apache, just version 1.3.27-r1" - echo " quickpkg apache" - echo " package up apache, all versions of apache installed" - echo " quickpkg =apache-1.3.27-r1" - echo " package up apache, just version 1.3.27-r1" - exit 1 -fi - -export PKGDIR="`portageq envvar PKGDIR`" -export PORTAGE_TMPDIR="`portageq envvar PORTAGE_TMPDIR`" - -source /sbin/functions.sh - -# here we make a package given a little info -# $1 = package-name w/version -# $2 = category -do_pkg() { - mkdir -p "${PORTAGE_TMPDIR}/binpkgs" || exit 1 - chmod 0750 "${PORTAGE_TMPDIR}/binpkgs" - MYDIR="${PORTAGE_TMPDIR}/binpkgs/$1" - SRCDIR="${PORTAGE_DB}/$2/$1" - LOG="${PORTAGE_TMPDIR}/binpkgs/$1-quickpkglog" - - ebegin "Building package for $1" - ( - # clean up temp directory - rm -rf ${MYDIR} - - # get pkg info files - mkdir -p ${MYDIR}/temp - cp ${SRCDIR}/* ${MYDIR}/temp/ - - # create filelist and a basic tbz2 - awk '{ - if ($1 != "dir") { - if ($1 == "obj") - NF=NF-2 - else if ($1 == "sym") - NF=NF-3 - print - } - }' ${SRCDIR}/CONTENTS | cut -f2- -d" " - > ${MYDIR}/filelist - tar -vjcf ${MYDIR}/bin.tar.bz2 --files-from=${MYDIR}/filelist --no-recursion - - # join together the basic tbz2 and the pkg info files - xpak ${MYDIR}/temp ${MYDIR}/inf.xpak - tbz2tool join ${MYDIR}/bin.tar.bz2 ${MYDIR}/inf.xpak ${MYDIR}/$1.tbz2 - - # move the final binary package to PKGDIR - [ -d ${PKGDIR}/All ] || mkdir -p ${PKGDIR}/All - [ -d ${PKGDIR}/$2 ] || mkdir -p ${PKGDIR}/$2 - mv ${MYDIR}/$1.tbz2 ${PKGDIR}/All - ( cd ${PKGDIR}/$2 && ln -s ../All/$1.tbz2 ) - - # cleanup again - rm -rf ${MYDIR} - ) >& ${LOG} - - if [ -e ${PKGDIR}/All/$1.tbz2 ] ; then - rm -f ${LOG} - PKGSTATS="${PKGSTATS}"$'\n'"$(einfo $1: `ls -alh ${PKGDIR}/All/$1.tbz2 | awk '{print $5}'`)" - eend 0 - else - cat ${LOG} - PKGSTATS="${PKGSTATS}"$'\n'"$(ewarn $1: not created)" - eend 1 - fi -} - -# here we parse the parameters given to use on the cmdline -export PKGERROR="" -export PKGSTATS="" -for x in "$@" ; do - - # they gave us full path - if [ -e ${x}/CONTENTS ] ; then - x="`readlink -f $x`" - pkg="`echo ${x} | cut -d/ -f6`" - cat="`echo ${x} | cut -d/ -f5`" - do_pkg ${pkg} ${cat} - - # lets figure out what they want - else - DIRLIST="`portageq match / ${x}`" - if [ -z "${DIRLIST}" ] ; then - eerror "Could not find anything to match '${x}'; skipping" - export PKGERROR="${PKGERROR} ${x}" - continue - fi - - for d in ${DIRLIST} ; do - pkg="`echo ${d} | cut -d/ -f2`" - cat="`echo ${d} | cut -d/ -f1`" - if [ -f "${PORTAGE_DB}/${cat}/${pkg}/CONTENTS" ] ; then - do_pkg ${pkg} ${cat} - elif [ -d "${PORTAGE_DB}/${cat}/${pkg}" ] ; then - ewarn "Package '${cat}/${pkg}' was injected; skipping" - else - eerror "Unhandled case (${cat}/${pkg}) !" - eerror "Please file a bug at http://bugs.gentoo.org/" - exit 10 - fi - done - fi - -done - -if [ -z "${PKGSTATS}" ] ; then - eerror "No packages found" - exit 1 -else - echo $'\n'"$(einfo Packages now in ${PKGDIR}:)${PKGSTATS}" -fi -if [ ! -z "${PKGERROR}" ] ; then - ewarn "The following packages could not be found:" - ewarn "${PKGERROR}" - exit 2 -fi diff --git a/bin/regenworld b/bin/regenworld deleted file mode 100755 index e526683..0000000 --- a/bin/regenworld +++ /dev/null @@ -1,93 +0,0 @@ -#!/usr/bin/python -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/regenworld,v 1.11 2005/02/26 04:14:19 jstubbs Exp $ - -import sys -sys.path.insert(0, "/usr/lib/portage/pym") - -import portage, string, re - -__candidatematcher__ = re.compile("^[0-9]+: \\*\\*\\* emerge ") -__noncandidatematcher__ = re.compile(" sync( |$)| clean( |$)| search( |$)|--oneshot| unmerge( |$)") - -def issyspkg(pkgline): - return (pkgline[0] == "*") - -def iscandidate(logline): - return (__candidatematcher__.match(logline) \ - and not __noncandidatematcher__.search(logline)) - -def getpkginfo(logline): - logline = re.sub("^[0-9]+: \\*\\*\\* emerge ", "", logline) - logline = logline.strip() - logline = re.sub("(\\S+\\.(ebuild|tbz2))|(--\\S+)|inject ", "", logline) - return logline.strip() - -__uniqlist__ = [] -def isunwanted(pkgline): - if pkgline in ["world", "system", "depclean", "info", "regen", ""]: - return False - elif pkgline in __uniqlist__: - return False - elif not re.search("^[a-zA-Z<>=~]", pkgline): - return False - else: - __uniqlist__.append(pkgline) - return True - -# show a little description if we have arguments -if len(sys.argv) >= 2 and sys.argv[1] in ["-h", "--help"]: - print "This script regenerates the portage world file by checking the portage" - print "logfile for all actions that you've done in the past. It ignores any" - print "arguments except --help. It is recommended that you make a backup of" - print "your existing world file (%s) before using this tool." % portage.WORLD_FILE - sys.exit(0) - -worldlist = portage.grabfile(portage.WORLD_FILE) -syslist = portage.settings.packages -syslist = filter(issyspkg, syslist) - -logfile = portage.grabfile("/var/log/emerge.log") -biglist = filter(iscandidate, logfile) -biglist = map(getpkginfo, biglist) -tmplist = [] -for l in biglist: - tmplist += l.split() -biglist = filter(isunwanted, tmplist) -#for p in biglist: -# print p -#sys.exit(0) - -# resolving virtuals -realsyslist = [] -for mykey in syslist: - # drop the asterix - mykey = mykey[1:] - #print "candidate:",mykey - mylist=portage.db["/"]["vartree"].dbapi.match(mykey) - if mylist: - mykey=portage.cpv_getkey(mylist[0]) - if mykey not in realsyslist: - realsyslist.append(mykey) - -for mykey in biglist: - #print "checking:",mykey - try: - mylist=portage.db["/"]["vartree"].dbapi.match(mykey) - except KeyError: - if "--debug" in sys.argv: - print "* ignoring broken log entry for %s (likely injected)" % mykey - except ValueError, e: - print "* %s is an ambigous package name, candidates are:\n%s" % (mykey, e) - continue - if mylist: - #print "mylist:",mylist - myfavkey=portage.cpv_getkey(mylist[0]) - if (myfavkey not in realsyslist) and (myfavkey not in worldlist): - print "add to world:",myfavkey - worldlist.append(myfavkey) - -myfile=open(portage.WORLD_FILE, "w") -myfile.write(string.join(worldlist, '\n')+'\n') -myfile.close() diff --git a/bin/repoman b/bin/repoman deleted file mode 100755 index d9f0023..0000000 --- a/bin/repoman +++ /dev/null @@ -1,1475 +0,0 @@ -#!/usr/bin/python -O -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/repoman,v 1.112 2005/06/18 01:01:35 vapier Exp $ - -# Next to do: dep syntax checking in mask files -# Then, check to make sure deps are satisfiable (to avoid "can't find match for" problems) -# that last one is tricky because multiple profiles need to be checked. - -import os,sys,shutil -exename=os.path.basename(sys.argv[0]) -os.environ["PORTAGE_CALLER"]="repoman" -sys.path = ["/usr/lib/portage/pym"]+sys.path -version="1.2" - -import string,signal,re,pickle,tempfile - -import portage -import portage_checksum -import portage_const -import portage_dep -import cvstree -import time -from output import * -#bold, darkgreen, darkred, green, red, turquoise, yellow - -from commands import getstatusoutput -from fileinput import input -from grp import getgrnam -from stat import * -from datetime import datetime - - -def err(txt): - print exename+": "+txt - sys.exit(1) - -def exithandler(signum=None,frame=None): - sys.stderr.write("\n"+exename+": Interrupted; exiting...\n") - sys.exit(1) - os.kill(0,signal.SIGKILL) -signal.signal(signal.SIGINT,exithandler) - -REPOROOTS=["gentoo-x86"] -modes=["scan","fix","full","help","commit","last","lfull"] -shortmodes={"ci":"commit"} -modeshelp={ -"scan" :"Scan current directory tree for QA issues (default)", -"fix" :"Fix those issues that can be fixed (stray digests, missing digests)", -"full" :"Scan current directory tree for QA issues (full listing)", -"help" :"Show this screen", -"commit":"Scan current directory tree for QA issues; if OK, commit via cvs", -"last" :"Remember report from last run", -"lfull" :"Remember report from last run (full listing)" -} -options=["--pretend","--help","--commitmsg","--commitmsgfile","--verbose","--xmlparse","--ignore-other-arches"] -shortoptions={"-m":"--commitmsg","-M":"--commitmsgfile","-p":"--pretend","-v":"--verbose","-x":"--xmlparse","-I":"--ignore-other-arches"} -optionshelp={ -"--pretend":"Don't actually perform commit or fix steps; just show what would be done (always enabled when not started in a CVS tree).", -"--help" :"Show this screen", -"--commitmsg" :"Adds a commit message via the command line.", -"--commitmsgfile":"Adds a commit message from a file given on the command line.", -"--ignore-other-arches": "Instructs repoman to ignore arches that are not relevent to the committing arch. REPORT/FIX issues you work around.", -"--verbose":"Displays every package name while checking", -"--xmlparse":"Forces the metadata.xml parse check to be carried out" -} - -qahelp={ - "CVS/Entries.IO_error":"Attempting to commit, and an IO error was encountered access the Entries file", - "digest.partial":"Digest files do not contain all corresponding URI elements", - "digest.assumed":"Existing digest must be assumed correct", - "digest.unused":"Digest entry has no matching SRC_URI entry", - "digest.fail":"Digest does not match the specified local file", - "digest.stray":"Digest files that do not have a corresponding ebuild", - "digest.missing":"Digest files that are missing (ebuild exists, digest doesn't)", - "digest.disjointed":"Digests not added to cvs when the matching ebuild has been added", - "digest.notadded":"Digests that exist but have not been added to cvs", - "digest.unmatch":"Digests which are incomplete (please check if your USE/ARCH includes all files)", - "ebuild.invalidname":"Ebuild files with a non-parseable or syntactically incorrect name", - "ebuild.namenomatch":"Ebuild files that do not have the same name as their parent directory", - "changelog.missing":"Missing ChangeLog files", - "ebuild.disjointed":"Ebuilds not added to cvs when the matching digest has been added", - "ebuild.notadded":"Ebuilds that exist but have not been added to cvs", - "changelog.notadded":"ChangeLogs that exist but have not been added to cvs", - "filedir.missing":"Package lacks a files directory", - "file.executable":"Ebuilds, digests, metadata.xml, Manifest, and ChangeLog do note need the executable bit", - "file.size":"Files in the files directory must be under 20k", - "KEYWORDS.missing":"Ebuilds that have a missing KEYWORDS variable", - "LICENSE.missing":"Ebuilds that have a missing LICENSE variable", - "IUSE.missing":"Ebuilds that have a missing IUSE variable", - "DESCRIPTION.missing":"Ebuilds that have a missing DESCRIPTION variable", - "SLOT.missing":"Ebuilds that have a missing SLOT variable", - "DEPEND.bad":"User-visible ebuilds with bad DEPEND settings (matched against *visible* ebuilds)", - "RDEPEND.bad":"User-visible ebuilds with bad RDEPEND settings (matched against *visible* ebuilds)", - "PDEPEND.bad":"User-visible ebuilds with bad PDEPEND settings (matched against *visible* ebuilds)", - "DEPEND.badmasked":"Masked ebuilds with bad DEPEND settings (matched against *all* ebuilds)", - "RDEPEND.badmasked":"Masked ebuilds with RDEPEND settings (matched against *all* ebuilds)", - "PDEPEND.badmasked":"Masked ebuilds with PDEPEND settings (matched against *all* ebuilds)", - "DEPEND.badindev":"User-visible ebuilds with bad DEPEND settings (matched against *visible* ebuilds) in developing arch", - "RDEPEND.badindev":"User-visible ebuilds with bad RDEPEND settings (matched against *visible* ebuilds) in developing arch", - "PDEPEND.badindev":"User-visible ebuilds with bad PDEPEND settings (matched against *visible* ebuilds) in developing arch", - "DEPEND.badmaskedindev":"Masked ebuilds with bad DEPEND settings (matched against *all* ebuilds) in developing arch", - "RDEPEND.badmaskedindev":"Masked ebuilds with RDEPEND settings (matched against *all* ebuilds) in developing arch", - "PDEPEND.badmaskedindev":"Masked ebuilds with PDEPEND settings (matched against *all* ebuilds) in developing arch", - "DEPEND.syntax":"Syntax error in DEPEND (usually an extra/missing space/parenthesis)", - "RDEPEND.syntax":"Syntax error in RDEPEND (usually an extra/missing space/parenthesis)", - "PDEPEND.syntax":"Syntax error in PDEPEND (usually an extra/missing space/parenthesis)", - "LICENSE.syntax":"Syntax error in LICENSE (usually an extra/missing space/parenthesis)", - "ebuild.syntax":"Error generating cache entry for ebuild; typically caused by ebuild syntax error", - "ebuild.output":"A simple sourcing of the ebuild produces output; this breaks ebuild policy.", - "ebuild.nesteddie":"Placing 'die' inside ( ) prints an error, but doesn't stop the ebuild.", - "variable.readonly":"Assigning a readonly variable", - "IUSE.invalid":"This build has a variable in IUSE that is not in the use.desc or use.local.desc file", - "LICENSE.invalid":"This ebuild is listing a license that doesnt exist in portages license/ dir.", - "KEYWORDS.invalid":"This ebuild contains KEYWORDS that are not listed in profiles/arch.list or for which no valid profile was found", - "ebuild.nostable":"There are no ebuilds that are marked as stable for your ARCH", - "ebuild.allmasked":"All ebuilds are masked for this package", - "ebuild.majorsyn":"This ebuild has a major syntax error that may cause the ebuild to fail partially or fully", - "ebuild.minorsyn":"This ebuild has a minor syntax error that contravenes gentoo coding style", - "ebuild.badheader":"This ebuild has a malformed header", - "metadata.missing":"Missing metadata.xml files", - "metadata.bad":"Bad metadata.xml files" -} - -qacats = qahelp.keys() -qacats.sort() - -qawarnings=[ -"changelog.missing", -"changelog.notadded", -"ebuild.notadded", -"ebuild.nostable", -"ebuild.allmasked", -"digest.assumed", -"digest.notadded", -"digest.disjointed", -"digest.missing", -"digest.unused", -"DEPEND.badmasked","RDEPEND.badmasked","PDEPEND.badmasked", -"DEPEND.badindev","RDEPEND.badindev","PDEPEND.badindev", -"DEPEND.badmaskedindev","RDEPEND.badmaskedindev","PDEPEND.badmaskedindev", -"IUSE.invalid", -"ebuild.minorsyn", -"ebuild.badheader", -"file.size", -"metadata.missing", -"metadata.bad" -] - -missingvars=["KEYWORDS","LICENSE","DESCRIPTION","SLOT","IUSE"] -allvars=portage.auxdbkeys -commitmessage=None -commitmessagefile=None -for x in missingvars: - qacats.append(x+".missing") - qawarnings.append(x+".missing") - - -def err(txt): - print exename+": "+txt - sys.exit(1) - -ven_cat = r'[\w0-9-]+' # Category -ven_nam = r'([+a-z0-9-]+(?:[+_a-z0-9-]*[+a-z0-9-]+)*)' # Name -ven_ver = r'((?:\d+\.)*\d+[a-z]?)' # Version -ven_suf = r'(_(alpha\d*|beta\d*|pre\d*|rc\d*|p\d+))?' # Suffix -ven_rev = r'(-r\d+)?' # Revision - -ven_string=ven_cat+'/'+ven_nam+'-'+ven_ver+ven_suf+ven_rev -valid_ebuild_name_re=re.compile(ven_string+'$', re.I) -valid_ebuild_filename_re=re.compile(ven_string+'\.ebuild$', re.I) - -repoman_settings = portage.config(clone=portage.settings) - -def valid_ebuild_name(name): - """(name) --- Checks to ensure that the package name meets portage specs. - Return 1 if valid, 0 if not.""" - # Handle either a path to the ebuild, or cat/pkg-ver string - if (len(name) > 7) and (name[-7:] == ".ebuild"): - if valid_ebuild_filename_re.match(name): - return 1 - else: - if valid_ebuild_name_re.match(name): - return 1 - return 0 - - -def help(): - print - print green(exename+" "+version) - print " \"Quality is job zero.\"" - print " Copyright 1999-2005 Gentoo Foundation" - print " Distributed under the terms of the GNU General Public License v2" - print - print bold(" Usage:"),turquoise(exename),"[",green("option"),"] [",green("mode"),"]" - print bold(" Modes:"),turquoise("scan (default)"), - for x in modes[1:]: - print "|",turquoise(x), - print "\n" - print " "+green(string.ljust("Option",20)+" Description") - for x in options: - print " "+string.ljust(x,20),optionshelp[x] - print - print " "+green(string.ljust("Mode",20)+" Description") - for x in modes: - print " "+string.ljust(x,20),modeshelp[x] - print - print " "+green(string.ljust("QA keyword",20)+" Description") - for x in qacats: - print " "+string.ljust(x,20),qahelp[x] - print - sys.exit(1) - -def last(): - try: - #Retrieve and unpickle stats and fails from saved files - savedf=open('/var/cache/edb/repo.stats','r') - stats = pickle.load(savedf) - savedf.close() - savedf=open('/var/cache/edb/repo.fails','r') - fails = pickle.load(savedf) - savedf.close() - except SystemExit, e: - raise # Need to propogate this - except: - err("Error retrieving last repoman run data; exiting.") - - #dofail will be set to 1 if we have failed in at least one non-warning category - dofail=0 - #dowarn will be set to 1 if we tripped any warnings - dowarn=0 - #dofull will be set if we should print a "repoman full" informational message - dofull=0 - - print - print green("RepoMan remembers...") - print - for x in qacats: - if stats[x]: - dowarn=1 - if x not in qawarnings: - dofail=1 - else: - if mymode!="lfull": - continue - print " "+string.ljust(x,20), - if stats[x]==0: - print green(`stats[x]`) - continue - elif x in qawarnings: - print yellow(`stats[x]`) - else: - print red(`stats[x]`) - if mymode!="lfull": - if stats[x]<12: - for y in fails[x]: - print " "+y - else: - dofull=1 - else: - for y in fails[x]: - print " "+y - print - if dofull: - print bold("Note: type \"repoman lfull\" for a complete listing of repomans last run.") - print - if dowarn and not dofail: - print green("RepoMan sez:"),"\"You only gave me a partial QA payment last time?\nI took it, but I wasn't happy.\"" - elif not dofail: - print green("RepoMan sez:"),"\"If everyone were like you, I'd be out of business!\"" - print - sys.exit(1) - -mymode=None -myoptions=[] -if len(sys.argv)>1: - x=1 - while x < len(sys.argv): - if sys.argv[x] in shortmodes.keys(): - sys.argv[x]=shortmodes[sys.argv[x]] - if sys.argv[x] in modes: - if mymode==None: - mymode=sys.argv[x] - else: - err("Please specify either \""+mymode+"\" or \""+sys.argv[x]+"\", but not both.") - elif sys.argv[x] in options+shortoptions.keys(): - optionx=sys.argv[x] - if optionx in shortoptions.keys(): - optionx = shortoptions[optionx] - if (optionx=="--commitmsg") and (len(sys.argv)>=(x+1)): - commitmessage=sys.argv[x+1] - x=x+1 - elif (optionx=="--commitmsgfile") and (len(sys.argv)>=(x+1)): - commitmessagefile=sys.argv[x+1] - x=x+1 - elif optionx not in myoptions: - myoptions.append(optionx) - else: - err("\""+sys.argv[x]+"\" is not a valid mode or option.") - x=x+1 -if mymode==None: - mymode="scan" -if mymode=="help" or ("--help" in myoptions): - help() -if mymode=="last" or (mymode=="lfull"): - last() - - -isCvs=False -myreporoot=None -if os.path.isdir("CVS"): - repoman_settings["PORTDIR_OVERLAY"]="" - if "cvs" not in portage.features: - print - print - print red('!!! You do not have ')+bold('FEATURES="cvs" ')+red("enabled...") - print red("!!! ")+bold("Adding \"cvs\" to FEATURES") - print - os.environ["FEATURES"]=repoman_settings["FEATURES"]+" cvs" - - try: - isCvs=True - myrepofile=open("CVS/Repository") - myreporoot=myrepofile.readline()[:-1] - myrepofile.close() - myrepofile=open("CVS/Root") - myreporootpath=string.split(myrepofile.readline()[:-1], ":")[-1] - myrepofile.close() - if myreporootpath == myreporoot[:len(myreporootpath)]: - # goofy os x cvs co. - myreporoot = myreporoot[len(myreporootpath):] - while myreporoot and myreporoot[0] == '/': - myreporoot = myreporoot[1:] - except SystemExit, e: - raise # Need to propogate this - except: - err("Error grabbing repository information; exiting.") - myreporootpath=os.path.normpath(myreporootpath) - if myreporootpath=="/space/cvsroot": - print - print - print red("You're using the wrong cvsroot. For Manifests to be correct, you must") - print red("use the same base cvsroot path that the servers use. Please try the") - print red("following script to remedy this:") - print - print "cd my_cvs_tree" - print - print "rm -Rf [a-z]*" - print "cvs up" - print - if portage.userland=="BSD": - print "find ./ -type f -regex '.*/CVS/Root$' -print0 | xargs -0 sed \\" - else: - print "find ./ -type f -regex '.*/CVS/Root$' -print0 | xargs -0r sed \\" - fi - print " -i 's:/space/cvsroot$:/home/cvsroot:'" - print - print red("You must clear and re-update your tree as all header tags will cause") - print red("problems in manifests for all rsync and /home/cvsroot users.") - print - print "You should do this to any other gentoo trees your have as well," - print "excluding the deletions. 'gentoo-src' should be /home/cvsroot." - print - sys.exit(123) - -if not "--pretend" in myoptions and not isCvs: - print - print darkgreen("Not in a CVS repository; enabling pretend mode.") - myoptions.append("--pretend"); - - -def have_profile_dir(path, maxdepth=3): - while path != "/" and maxdepth: - if os.path.exists(path + "/profiles/package.mask"): - return path - path = os.path.normpath(path + "/..") - maxdepth -= 1 - -portdir=None -portdir_overlay=None -mydir=os.getcwd() -if mydir[-1] != "/": - mydir += "/" - -for overlay in repoman_settings["PORTDIR_OVERLAY"].split(): - if overlay[-1] != "/": - overlay += "/" - if mydir[:len(overlay)] == overlay: - portdir_overlay = overlay - subdir = mydir[len(overlay):] - if subdir and subdir[-1] != "/": - subdir += "/" - if have_profile_dir(mydir, subdir.count("/")): - portdir = portdir_overlay - break - -if not portdir_overlay: - if (repoman_settings["PORTDIR"]+"/")[:len(mydir)] == mydir: - portdir_overlay = repoman_settings["PORTDIR"] - else: - portdir_overlay = have_profile_dir(mydir) - portdir = portdir_overlay - -if not portdir_overlay: - print darkred("Unable to determine PORTDIR.") - sys.exit(1) - -if not portdir: - portdir = repoman_settings["PORTDIR"] - -if portdir[-1] == "/": - portdir = portdir[:-1] -if portdir_overlay[-1] == "/": - portdir_overlay = portdir_overlay[:-1] - -os.environ["PORTDIR"] = portdir -if portdir_overlay != portdir: - os.environ["PORTDIR_OVERLAY"] = portdir_overlay -else: - os.environ["PORTDIR_OVERLAY"] = "" - -print "\nSetting paths:" -print "PORTDIR = \""+os.environ["PORTDIR"]+"\"" -print "PORTDIR_OVERLAY = \""+os.environ["PORTDIR_OVERLAY"]+"\"" - - -reload(portage) -repoman_settings = portage.config(clone=portage.settings) - -if not myreporoot: - myreporoot = os.path.basename(portdir_overlay) - myreporoot += mydir[len(portdir_overlay):-1] - -if isCvs: - reporoot=None - for x in REPOROOTS: - if myreporoot[0:len(x)]==x: - reporoot=myreporoot - if not reporoot: - err("Couldn't recognize repository type. Supported repositories:\n"+repr(REPOROOTS)) -reposplit=string.split(myreporoot,"/") -repolevel=len(reposplit) - -# check if it's in $PORTDIR/$CATEGORY/$PN , otherwise bail if commiting. -# Reason for this is if they're trying to commit in just $FILESDIR/*, the Manifest needs updating. -# this check ensure that repoman knows where it is, and the manifest recommit is at least possible. -if mymode == "commit" and repolevel not in [1,2,3]: - print red("***")+" Commit attempts *must* be from within a cvs co, category, or package directory." - print red("***")+" Attempting to commit from a packages files directory will be blocked for instance." - print red("***")+" This is intended behaviour, to ensure the manifest is recommited for a package." - print red("***") - err("Unable to identify level we're commiting from for %s" % string.join(reposplit,'/')) - -startdir=os.getcwd() - -for x in range(0,repolevel-1): - os.chdir("..") -repodir=os.getcwd() -os.chdir(startdir) - -def caterror(mycat): - err(mycat+" is not an official category. Skipping QA checks in this directory.\nPlease ensure that you add "+catdir+" to "+repodir+"/profiles/categories\nif it is a new category.") -print -if "--pretend" in myoptions: - print green("RepoMan does a once-over of the neighborhood...") -else: - print green("RepoMan scours the neighborhood...") - -# retreive local USE list -luselist={} -try: - mylist=portage.grabfile(portdir+"/profiles/use.local.desc") - for mypos in range(0,len(mylist)): - mysplit=mylist[mypos].split()[0] - myuse=string.split(mysplit,":") - if len(myuse)==2: - if not luselist.has_key(myuse[0]): - luselist[myuse[0]] = [] - luselist[myuse[0]].append(myuse[1]) -except SystemExit, e: - raise # Need to propogate this -except: - err("Couldn't read from use.local.desc") - -# setup a uselist from portage -uselist=[] -try: - uselist=portage.grabfile(portdir+"/profiles/use.desc") - for l in range(0,len(uselist)): - uselist[l]=string.split(uselist[l])[0] -except SystemExit, e: - raise # Need to propogate this -except: - err("Couldn't read USE flags from use.desc") - -# retrieve a list of current licenses in portage -liclist=portage.listdir(portdir+"/licenses") -if not liclist: - err("Couldn't find licenses?") - -# retrieve list of offical keywords -try: - kwlist=portage.grabfile(portdir+"/profiles/arch.list") -except SystemExit, e: - raise # Need to propogate this -except: - err("Couldn't read KEYWORDS from arch.list") -if not kwlist: - kwlist=["alpha","arm","hppa","mips","ppc","sparc","x86"] - -scanlist=[] -if repolevel==2: - #we are inside a category directory - catdir=reposplit[-1] - if catdir not in repoman_settings.categories: - caterror(catdir) - mydirlist=os.listdir(startdir) - for x in mydirlist: - if x=="CVS": - continue - if os.path.isdir(startdir+"/"+x): - scanlist.append(catdir+"/"+x) -elif repolevel==1: - for x in repoman_settings.categories: - if not os.path.isdir(startdir+"/"+x): - continue - for y in os.listdir(startdir+"/"+x): - if y=="CVS": - continue - if os.path.isdir(startdir+"/"+x+"/"+y): - scanlist.append(x+"/"+y) -elif repolevel==3: - catdir = reposplit[-2] - if catdir not in repoman_settings.categories: - caterror(catdir) - scanlist.append(catdir+"/"+reposplit[-1]) - -profiles={} -descfile=portdir+"/profiles/profiles.desc" -if os.path.exists(descfile): - badarchs=[] - for x in portage.grabfile(descfile): - if x[0]=="#": - continue - arch=string.split(x) - if len(arch)!=3: - print "wrong format: \""+red(x)+"\" in "+descfile - continue - if not os.path.isdir(portdir+"/profiles/"+arch[1]): - print "Invalid "+arch[2]+" profile ("+arch[1]+") for arch "+arch[0] - continue - if profiles.has_key(arch[0]): - print "Ignoring "+profiles[arch[0]][1]+" profile ("+profiles[arch[0]][0]+") for arch "+arch[0] - profiles[arch[0]]=[arch[1],arch[2]] - - for x in portage.archlist: - if x[0]=="~": - continue - if not profiles.has_key(x): - print yellow("\""+x+"\" doesn't have a valid profile listed in profiles.desc.") - print yellow("You need to either \"cvs update\" your profiles dir or follow this") - print yellow("up with the "+x+" team.") - print -else: - print yellow("profiles.desc does not exist: "+descfile) - print yellow("You need to do \"cvs update\" in profiles dir.") - print - sys.exit(1) - - -stats={} -fails={} -#objsadded records all object being added to cvs -objsadded=[] -for x in qacats: - stats[x]=0 - fails[x]=[] -xmllint_capable = False -if getstatusoutput('which xmllint')[0] != 0: - print red("!!! xmllint not found. Can't check metadata.xml.\n") - if "--xmlparse" in myoptions or repolevel==3: - print red("!!!")+" sorry, xmllint is needed. failing\n" - sys.exit(1) -else: - #hardcoded paths/urls suck. :-/ - must_fetch=1 - backup_exists=0 - try: - # if it's been over a week since fetching (or the system clock is fscked), grab an updated copy of metadata.dtd - # clock is fscked or it's been a week. time to grab a new one. - ct=os.stat(portage.CACHE_PATH + '/metadata.dtd')[ST_CTIME] - if abs(time.time() - ct) > (60*60*24*7): - # don't trap the exception, we're watching for errno 2 (file not found), anything else is a bug. - backup_exists=1 - os.rename(portage.CACHE_PATH+'/metadata.dtd',portage.CACHE_PATH+'/metadata.dtd.backup') - else: - must_fetch=0 - - except (OSError,IOError), e: - if e.errno != 2: - print red("!!!")+" caught exception '%s' for %s/metadata.dtd, bailing" % (str(e), portage.CACHE_PATH) - sys.exit(1) - - if must_fetch: - print - print green("***")+" the local copy of metadata.dtd needs to be refetched, doing that now" - print - try: - fetcher=portage.get_preferred_fetcher() - - val=fetcher.fetch("http://www.gentoo.org/dtd/metadata.dtd",file_name="%s/metadata.dtd" % - portage.CACHE_PATH) - del fetcher - if not val: - print "fetched." - if backup_exists: - os.remove(portage.CACHE_PATH+'/metadata.dtd.backup') - os.chown(portage.CACHE_PATH+'/metadata.dtd',os.getuid(),portage.portage_gid) - os.chmod(portage.CACHE_PATH+'/metadata.dtd',0664) - - except SystemExit, e: - raise # Need to propogate this - except Exception,e: - print - print red("!!!")+" attempting to fetch 'http://www.gentoo.org/dtd/metadata.dtd', caught" - print red("!!!")+" exception '%s' though." % str(e) - val=0 - if val: - if backup_exists: - os.rename(portage.CACHE_PATH+'/metadata.dtd.backup',portage.CACHE_PATH+'/metadata.dtd') - print red("!!!")+" fetching new metadata.dtd failed, aborting" - sys.exit(1) - #this can be problematic if xmllint changes their output - xmllint_capable=True - - -arch_caches={} -for x in scanlist: - #ebuilds and digests added to cvs respectively. - if "--verbose" in myoptions: - print "checking package " + x - eadded=[] - dadded=[] - cladded=0 - catdir,pkgdir=x.split("/") - checkdir=repodir+"/"+x - checkdirlist=os.listdir(checkdir) - ebuildlist=[] - for y in checkdirlist: - if y[-7:]==".ebuild": - ebuildlist.append(y[:-7]) - if y in ["Manifest","ChangeLog","metadata.xml"]: - if os.stat(checkdir+"/"+y)[0] & 0x0248: - stats["file.executable"] += 1 - fails["file.executable"].append(checkdir+"/"+y) - digestlist=[] - if isCvs: - try: - mystat=os.stat(checkdir+"/files")[0] - if len(ebuildlist) and not S_ISDIR(mystat): - raise Exception - except SystemExit, e: - raise # Need to propogate this - except: - stats["filedir.missing"] += 1 - fails["filedir.missing"].append(checkdir) - continue - try: - myf=open(checkdir+"/CVS/Entries","r") - myl=myf.readlines() - for l in myl: - if l[0]!="/": - continue - splitl=l[1:].split("/") - if not len(splitl): - continue - objsadded.append(splitl[0]) - if splitl[0][-7:]==".ebuild": - eadded.append(splitl[0][:-7]) - if splitl[0]=="ChangeLog": - cladded=1 - except IOError: - if mymode=="commit": - stats["CVS/Entries.IO_error"] += 1 - fails["CVS/Entries.IO_error"].append(checkdir+"/CVS/Entries") - continue - - try: - myf=open(checkdir+"/files/CVS/Entries","r") - myl=myf.readlines() - for l in myl: - if l[0]!="/": - continue - splitl=l[1:].split("/") - if not len(splitl): - continue - objsadded.append(splitl[0]) - if splitl[0][:7]=="digest-": - dadded.append(splitl[0][7:]) - except IOError: - if mymode=="commit": - stats["CVS/Entries.IO_error"] += 1 - fails["CVS/Entries.IO_error"].append(checkdir+"/files/CVS/Entries") - continue - - if os.path.exists(checkdir+"/files"): - filesdirlist=os.listdir(checkdir+"/files") - for y in filesdirlist: - if y[:7]=="digest-": - if y[7:] not in dadded: - #digest not added to cvs - stats["digest.notadded"]=stats["digest.notadded"]+1 - fails["digest.notadded"].append(x+"/files/"+y) - if y[7:] in eadded: - stats["digest.disjointed"]=stats["digest.disjointed"]+1 - fails["digest.disjointed"].append(x+"/files/"+y) - - if os.stat(checkdir+"/files/"+y)[0] & 0x0248: - stats["file.executable"] += 1 - fails["file.executable"].append(x+"/files/"+y) - - mydigests=portage.digestParseFile(checkdir+"/files/"+y) - - mykey = catdir + "/" + y[7:] - if y[7:] not in ebuildlist: - #stray digest - if mymode=="fix": - if "--pretend" in myoptions: - print "(cd "+repodir+"/"+x+"/files; cvs rm -f "+y+")" - else: - os.system("(cd "+repodir+"/"+x+"/files; cvs rm -f "+y+")") - else: - stats["digest.stray"]=stats["digest.stray"]+1 - fails["digest.stray"].append(x+"/files/"+y) - else: - # We have an ebuild - myuris,myfiles = portage.db["/"]["porttree"].dbapi.getfetchlist(mykey,all=True) - for entry in mydigests.keys(): - if entry not in myfiles: - stats["digest.unused"] += 1 - fails["digest.unused"].append(y+"::"+entry) - uri_dict = {} - for myu in myuris: - myubn = os.path.basename(myu) - if myubn not in uri_dict: - uri_dict[myubn] = [myu] - else: - uri_dict[myubn] += [myu] - - for myf in uri_dict: - myff = repoman_settings["DISTDIR"] + "/" + myf - if not mydigests.has_key(myf): - uri_settings = portage.config(clone=repoman_settings) - if mymode == "fix": - if not portage.fetch(uri_dict[myf], uri_settings): - stats["digest.unmatch"] += 1 - fails["digest.unmatch"].append(y+"::"+myf) - else: - eb_name,eb_location = portage.db["/"]["porttree"].dbapi.findname2(mykey) - portage.doebuild(eb_name, "digest", "/", uri_settings) - else: - if os.path.exists(myff): - if not portage_checksum.verify_all(myff, mydigests[myf]): - stats["digest.fail"] += 1 - fails["digest.fail"].append(y+"::"+myf) - else: - stats["digest.assumed"] += 1 - fails["digest.assumed"].append(y+"::"+myf) - - # recurse through files directory - # use filesdirlist as a stack, appending directories as needed so people can't hide > 20k files in a subdirectory. - while filesdirlist: - y = filesdirlist.pop(0) - try: - mystat = os.stat(checkdir+"/files/"+y) - except OSError, oe: - if oe.errno == 2: - # don't worry about it. it likely was removed via fix above. - continue - else: - raise oe - if S_ISDIR(mystat.st_mode): - for z in os.listdir(checkdir+"/files/"+y): - filesdirlist.append(y+"/"+z) - # current policy is no files over 20k, this is the check. - elif mystat.st_size > 20000: - stats["file.size"] += 1 - fails["file.size"].append("("+ str(mystat.st_size/1000) + "K) "+x+"/files/"+y) - - if "ChangeLog" not in checkdirlist: - stats["changelog.missing"]+=1 - fails["changelog.missing"].append(x+"/ChangeLog") - - #metadata.xml file check - if "metadata.xml" not in checkdirlist: - stats["metadata.missing"]+=1 - fails["metadata.missing"].append(x+"/metadata.xml") - #metadata.xml parse check - else: - #Only carry out if in package directory or check forced - if xmllint_capable: - st=getstatusoutput("xmllint --noout --valid --dtdvalid %s/metadata.dtd %s/metadata.xml" % (portage.CACHE_PATH, checkdir)) - if st[0] != 0: - for z in st[1].split("\n"): - print red("!!! ")+z - stats["metadata.bad"]+=1 - fails["metadata.bad"].append(x+"/metadata.xml") - - for y in ebuildlist: - if os.stat(checkdir+"/"+y+".ebuild")[0] & 0x0248: - stats["file.executable"] += 1 - fails["file.executable"].append(x+"/"+y+".ebuild") - if y not in eadded: - #ebuild not added to cvs - stats["ebuild.notadded"]=stats["ebuild.notadded"]+1 - fails["ebuild.notadded"].append(x+"/"+y+".ebuild") - if y in dadded: - stats["ebuild.disjointed"]=stats["ebuild.disjointed"]+1 - fails["ebuild.disjointed"].append(x+"/"+y+".ebuild") - if not os.path.exists(checkdir+"/files/digest-"+y): - if mymode=="fix": - if "--pretend" in myoptions: - print "You will need to run:" - print " /usr/sbin/ebuild "+repodir+"/"+x+"/"+y+".ebuild digest" - else: - retval=os.system("/usr/sbin/ebuild "+repodir+"/"+x+"/"+y+".ebuild digest") - if retval: - print "!!! Exiting on ebuild digest (shell) error code:",retval - sys.exit(retval) - else: - stats["digest.missing"]=stats["digest.missing"]+1 - fails["digest.missing"].append(x+"/files/digest-"+y) - myesplit=portage.portage_versions.pkgsplit(y) - if myesplit==None or not valid_ebuild_name(x.split("/")[0]+"/"+y): - stats["ebuild.invalidname"]=stats["ebuild.invalidname"]+1 - fails["ebuild.invalidname"].append(x+"/"+y+".ebuild") - continue - elif myesplit[0]!=pkgdir: - print pkgdir,myesplit[0] - stats["ebuild.namenomatch"]=stats["ebuild.namenomatch"]+1 - fails["ebuild.namenomatch"].append(x+"/"+y+".ebuild") - continue - try: - myaux=portage.db["/"]["porttree"].dbapi.aux_get(catdir+"/"+y,allvars,strict=1) - except KeyError: - stats["ebuild.syntax"]=stats["ebuild.syntax"]+1 - fails["ebuild.syntax"].append(x+"/"+y+".ebuild") - continue - except IOError: - stats["ebuild.output"]=stats["ebuild.output"]+1 - fails["ebuild.output"].append(x+"/"+y+".ebuild") - continue - - # Test for negative logic and bad words in the RESTRICT var. - #for x in myaux[allvars.index("RESTRICT")].split(): - # if x.startswith("no"): - # print "Bad RESTRICT value: %s" % x - - for pos in range(0,len(missingvars)): - if portage.db["/"]["porttree"].dbapi.aux_get(catdir+"/"+y, [ missingvars[pos] ] )[0]=="": - if missingvars[pos]=="IUSE": - # We should rewrite here later. See #21544 - if not os.system("egrep '^IUSE=' "+repodir+"/"+x+"/"+y+".ebuild > /dev/null 2>&1"): - continue - myqakey=missingvars[pos]+".missing" - stats[myqakey]=stats[myqakey]+1 - fails[myqakey].append(x+"/"+y+".ebuild") - - if "--ignore-other-arches" in myoptions: - arches=[[repoman_settings["ARCH"], repoman_settings["ARCH"], portage.groups]] - else: - arches=[] - for keyword in string.split(portage.db["/"]["porttree"].dbapi.aux_get(catdir+"/"+y,["KEYWORDS"])[0]): - if (keyword[0]=="-"): - continue - elif (keyword[0]=="~"): - arches.append([keyword, keyword[1:], [keyword[1:], keyword]]) - else: - arches.append([keyword, keyword, [keyword]]) - - baddepsyntax = False - badlicsyntax = False - catpkg = catdir+"/"+y - for mytype in ["DEPEND","RDEPEND","PDEPEND","LICENSE"]: - mydepstr = string.join(portage.db["/"]["porttree"].dbapi.aux_get(catpkg, [mytype])) - if (string.find(mydepstr, " ?") != -1): - stats[mytype+".syntax"] += 1 - fails[mytype+".syntax"].append(catpkg+".ebuild "+mytype+": '?' preceded by space") - if mytype != "LICENSE": - baddepsyntax = True - else: - badlicsyntax = True - try: - # Missing closing parenthesis will result in a ValueError - mydeplist=portage_dep.paren_reduce(mydepstr) - # Missing opening parenthesis will result in a final "" element - if "" in mydeplist or "(" in mydeplist: - raise ValueError - except ValueError: - stats[mytype+".syntax"] += 1 - fails[mytype+".syntax"].append(catpkg+".ebuild "+mytype+": Mismatched parenthesis") - if mytype != "LICENSE": - baddepsyntax = True - else: - badlicsyntax = True - - if not baddepsyntax: - for keyword,arch,groups in arches: - portage.groups=groups - - if (profiles.has_key(arch)): - profdir=portdir+"/profiles/"+profiles[arch][0] - else: - # A missing profile will create an error further down - # during the KEYWORDS verification. - continue - - portage.profiledir=profdir - os.environ["ACCEPT_KEYWORDS"]="-~"+arch - - if arch_caches.has_key(arch): - dep_settings, portage.portdb = arch_caches[arch] - portage.do_vartree(dep_settings) - dep_settings.regenerate() - else: - dep_settings=portage.config(config_profile_path=profdir, config_incrementals=portage_const.INCREMENTALS) - if isCvs: - dep_settings["PORTDIR_OVERLAY"]="" - dep_settings["ARCH"]=arch - portage.do_vartree(dep_settings) - dep_settings.regenerate() - portage.portdb=portage.portdbapi(portdir, dep_settings) - arch_caches[arch]=[dep_settings, portage.portdb] - - portage.db["/"]["porttree"]=portage.portagetree("/",dep_settings.getvirtuals("/")) - - for mytype,mypos in [["DEPEND",len(missingvars)],["RDEPEND",len(missingvars)+1],["PDEPEND",len(missingvars)+2]]: - if not catdir+"/"+y in portage.db["/"]["porttree"].dbapi.xmatch("list-visible",x): - #we are testing deps for a masked package; give it some lee-way - suffix="masked" - matchmode="match-all" - else: - suffix="" - matchmode="match-visible" - - if profiles.has_key(arch) and profiles[arch][1]=="dev": - suffix=suffix+"indev" - - mykey=mytype+".bad"+suffix - myvalue=string.join(portage.db["/"]["porttree"].dbapi.aux_get(catdir+"/"+y,[ mytype ])) - if not myvalue: - continue - try: - mydep=portage.dep_check(myvalue,portage.db["/"]["porttree"].dbapi,dep_settings,use="all",mode=matchmode) - except KeyError, e: - stats[mykey]=stats[mykey]+1 - fails[mykey].append(x+"/"+y+".ebuild: "+keyword+" "+repr(e[0])) - continue - - if mydep[0]==1: - if mydep[1]!=[]: - #we have some unsolvable deps - #remove ! deps, which always show up as unsatisfiable - d=0 - while d<len(mydep[1]): - if mydep[1][d][0]=="!": - del mydep[1][d] - else: - d += 1 - #if we emptied out our list, continue: - if not mydep[1]: - continue - stats[mykey]=stats[mykey]+1 - fails[mykey].append(x+"/"+y+".ebuild: "+keyword+" "+repr(mydep[1])) - else: - stats[mykey]=stats[mykey]+1 - fails[mykey].append(x+"/"+y+".ebuild: "+keyword+" "+repr(mydep[1])) - - # this check needs work, it won't catch (\ndie) - if not os.system("egrep '^[^#]*\([^)]*\<die\>' "+checkdir+"/"+y+".ebuild >/dev/null 2>&1"): - stats["ebuild.nesteddie"]=stats["ebuild.nesteddie"]+1 - fails["ebuild.nesteddie"].append(x+"/"+y+".ebuild") - # uselist checks - global - myuse=string.split(portage.db["/"]["porttree"].dbapi.aux_get(catdir+"/"+y,["IUSE"])[0]) - for mypos in range(len(myuse)-1,-1,-1): - if myuse[mypos] and (myuse[mypos] in uselist): - del myuse[mypos] - # uselist checks - local - mykey = portage.portage_dep.dep_getkey(catpkg) - if luselist.has_key(mykey): - for mypos in range(len(myuse)-1,-1,-1): - if myuse[mypos] and (myuse[mypos] in luselist[mykey]): - del myuse[mypos] - for mypos in range(len(myuse)): - stats["IUSE.invalid"]=stats["IUSE.invalid"]+1 - fails["IUSE.invalid"].append(x+"/"+y+".ebuild: %s" % myuse[mypos]) - - # license checks - if not badlicsyntax: - myuse=portage.db["/"]["porttree"].dbapi.aux_get(catdir+"/"+y,["LICENSE"])[0] - # Parse the LICENSE variable, remove USE conditions and - # flatten it. - myuse=portage_dep.use_reduce(portage_dep.paren_reduce(myuse), matchall=1) - myuse=portage.flatten(myuse) - # Check each entry to ensure that it exists in PORTDIR's - # license directory. - for mypos in range(0,len(myuse)): - # Need to check for "||" manually as no portage - # function will remove it without removing values. - if myuse[mypos] not in liclist and myuse[mypos] != "||": - stats["LICENSE.invalid"]=stats["LICENSE.invalid"]+1 - fails["LICENSE.invalid"].append(x+"/"+y+".ebuild: %s" % myuse[mypos]) - - #keyword checks - myuse=string.split(portage.db["/"]["porttree"].dbapi.aux_get(catdir+"/"+y,["KEYWORDS"])[0]) - for mykey in myuse: - myskey=mykey[:] - if myskey[0]=="-": - myskey=myskey[1:] - if myskey[0]=="~": - myskey=myskey[1:] - if mykey!="-*": - if myskey not in kwlist: - stats["KEYWORDS.invalid"] += 1 - fails["KEYWORDS.invalid"].append(x+"/"+y+".ebuild: %s" % mykey) - elif not profiles.has_key(myskey): - stats["KEYWORDS.invalid"] += 1 - fails["KEYWORDS.invalid"].append(x+"/"+y+".ebuild: %s (profile invalid)" % mykey) - - #syntax checks - myear = time.gmtime(os.stat(checkdir+"/"+y+".ebuild")[ST_MTIME])[0] - gentoo_copyright = re.compile(r'^# Copyright 1999-' + str(myear) + r' Gentoo Foundation') - gentoo_license = re.compile(r'^# Distributed under the terms of the GNU General Public License v2$') - cvs_header = re.compile(r'^#\s*\$Header.*\$$') - ignore_line = re.compile(r'(^$)|(^(\t)*#)') - leading_spaces = re.compile(r'^[\S\t]') - trailing_whitespace = re.compile(r'.*([\S]$)') - readonly_assignment = re.compile(r'^\s*(export\s+)?(A|P|PV|PN|PR|PVR|PF|D|WORKDIR|FILESDIR|FEATURES|USE)=') - continuation_symbol = re.compile(r'(.*[ ]+[\\][ ].*)') - line_continuation_quoted = re.compile(r'(\"|\')(([\w ,:;#\[\]\.`=/|\$\^\*{}()\'-])|(\\.))*\1') - line_continuation = re.compile(r'([^#]*\S)(\s+|\t)\\$') - linenum=0 - for line in input(checkdir+"/"+y+".ebuild"): - linenum += 1 - # Gentoo copyright check - if linenum == 1: - match = gentoo_copyright.match(line) - if not match: - myerrormsg = "Copyright header Error. Possibly date related." - stats["ebuild.badheader"] +=1 - fails["ebuild.badheader"].append(x+"/"+y+".ebuild: %s" % myerrormsg) - # Gentoo license check - elif linenum == 2: - match = gentoo_license.match(line) - if not match: - myerrormsg = "Gentoo License Error." - stats["ebuild.badheader"] +=1 - fails["ebuild.badheader"].append(x+"/"+y+".ebuild: %s" % myerrormsg) - # CVS Header check - elif linenum == 3: - match = cvs_header.match(line) - if not match: - myerrormsg = "CVS Header Error." - stats["ebuild.badheader"] +=1 - fails["ebuild.badheader"].append(x+"/"+y+".ebuild: %s" % myerrormsg) - else: - match = ignore_line.match(line) - if not match: - # Excluded Blank lines and full line comments. Good! - # Leading Spaces Check - match = leading_spaces.match(line) - if not match: - #Line has got leading spaces. Bad! - myerrormsg = "Leading Space Syntax Error. Line %d" % linenum - stats["ebuild.minorsyn"] +=1 - fails["ebuild.minorsyn"].append(x+"/"+y+".ebuild: %s" % myerrormsg) - # Trailing whitespace check - match = trailing_whitespace.match(line) - if not match: - #Line has got trailing whitespace. Bad! - myerrormsg = "Trailing whitespace Syntax Error. Line %d" % linenum - stats["ebuild.minorsyn"] +=1 - fails["ebuild.minorsyn"].append(x+"/"+y+".ebuild: %s" % myerrormsg) - # Readonly variable assignment check - match = readonly_assignment.match(line) - if match: - # invalid assignment, very bad! - myerrormsg = "Readonly variable assignment to %s on line %d" % (match.group(2), linenum) - stats["variable.readonly"] += 1 - fails["variable.readonly"].append(x+"/"+y+".ebuild: %s" % myerrormsg) - # Line continuation check - match = continuation_symbol.match(line) - if match: - #Excluded lines not even containing a " \" match. Good! - line = re.sub(line_continuation_quoted,"\"\"",line) - #line has been edited to collapsed "" and '' quotes to "". Good! - match = continuation_symbol.match(line) - if match: - #Again exclude lines not even containing a " \" match. Good! - #This repetition is done for a slight performance increase - match = line_continuation.match(line) - if not match: - #Line has a line continuation error. Bad! - myerrormsg = "Line continuation (\"\\\") Syntax Error. Line %d" % linenum - stats["ebuild.majorsyn"] +=1 - fails["ebuild.majorsyn"].append(x+"/"+y+".ebuild: %s" % myerrormsg) - - # Check for 'all unstable' or 'all masked' -- ACCEPT_KEYWORDS is stripped - # XXX -- Needs to be implemented in dep code. Can't determine ~arch nicely. - #if not portage.portdb.xmatch("bestmatch-visible",x): - # stats["ebuild.nostable"]+=1 - # fails["ebuild.nostable"].append(x) - portage.groups=["*"] - if not portage.portdb.xmatch("list-visible",x): - stats["ebuild.allmasked"]+=1 - fails["ebuild.allmasked"].append(x) - -#Pickle and save results for instant reuse in last and lfull -savef=open('/var/cache/edb/repo.stats','w') -pickle.dump(stats,savef) -savef.close() -savef=open('/var/cache/edb/repo.fails','w') -pickle.dump(fails,savef) -savef.close() -if not (os.stat('/var/cache/edb/repo.stats')[ST_GID] == getgrnam('portage')[2]): - os.chown('/var/cache/edb/repo.stats',os.geteuid(),getgrnam('portage')[2]) - os.chmod('/var/cache/edb/repo.stats',0664) -if not (os.stat('/var/cache/edb/repo.fails')[ST_GID] == getgrnam('portage')[2]): - os.chown('/var/cache/edb/repo.fails',os.geteuid(),getgrnam('portage')[2]) - os.chmod('/var/cache/edb/repo.fails',0664) -print -#dofail will be set to 1 if we have failed in at least one non-warning category -dofail=0 -#dowarn will be set to 1 if we tripped any warnings -dowarn=0 -#dofull will be set if we should print a "repoman full" informational message -dofull=0 -for x in qacats: - if not isCvs and (string.find(x, "notadded") != -1): - stats[x] = 0 - if stats[x]: - dowarn=1 - if x not in qawarnings: - dofail=1 - else: - if mymode!="full": - continue - print " "+string.ljust(x,30), - if stats[x]==0: - print green(`stats[x]`) - continue - elif x in qawarnings: - print yellow(`stats[x]`) - else: - print red(`stats[x]`) - if mymode!="full": - if stats[x]<12: - for y in fails[x]: - print " "+y - else: - dofull=1 - else: - for y in fails[x]: - print " "+y -print - -def grouplist(mylist,seperator="/"): - """(list,seperator="/") -- Takes a list of elements; groups them into - same initial element categories. Returns a dict of {base:[sublist]} - From: ["blah/foo","spork/spatula","blah/weee/splat"] - To: {"blah":["foo","weee/splat"], "spork":["spatula"]}""" - mygroups={} - for x in mylist: - xs=string.split(x,seperator) - if xs[0]==".": - xs=xs[1:] - if xs[0] not in mygroups.keys(): - mygroups[xs[0]]=[string.join(xs[1:],seperator)] - else: - mygroups[xs[0]]+=[string.join(xs[1:],seperator)] - return mygroups - -if mymode!="commit": - if dofull: - print bold("Note: type \"repoman full\" for a complete listing.") - print - if dowarn and not dofail: - print green("RepoMan sez:"),"\"You're only giving me a partial QA payment?\nI'll take it this time, but I'm not happy.\"" - elif not dofail: - print green("RepoMan sez:"),"\"If everyone were like you, I'd be out of business!\"" - print -else: - if dofail: - print turquoise("Please fix these important QA issues first.") - print green("RepoMan sez:"),"\"Make your QA payment on time and you'll never see the likes of me.\"\n" - sys.exit(1) - - if "--pretend" in myoptions: - print green("RepoMan sez:"), "\"So, you want to play it safe. Good call.\"\n" - - if fails["digest.missing"]: - print green("Creating missing digests...") - for x in fails["digest.missing"]: - xs=string.split(x,"/") - del xs[-2] - myeb=string.join(xs[:-1],"/")+"/"+xs[-1][7:] - if "--pretend" in myoptions: - print "(ebuild "+portdir+"/"+myeb+".ebuild digest)" - else: - retval=os.system("ebuild "+portdir+"/"+myeb+".ebuild digest") - if retval: - print "!!! Exiting on ebuild digest (shell) error code:",retval - sys.exit(retval) - - mycvstree=cvstree.getentries("./",recursive=1) - if isCvs and not mycvstree: - print "!!! It seems we don't have a cvs tree?" - sys.exit(3) - - myunadded=cvstree.findunadded(mycvstree,recursive=1,basedir="./") - myautoadd=[] - if myunadded: - for x in range(len(myunadded)-1,-1,-1): - xs=string.split(myunadded[x],"/") - if xs[-1]=="files": - print "!!! files dir is not added! Please correct this." - sys.exit(-1) - elif xs[-1]=="Manifest": - # It's a manifest... auto add - myautoadd+=[myunadded[x]] - del myunadded[x] - elif len(xs[-1])>=7: - if xs[-1][:7]=="digest-": - del xs[-2] - myeb=string.join(xs[:-1]+[xs[-1][7:]],"/")+".ebuild" - if os.path.exists(myeb): - # Ebuild exists for digest... So autoadd it. - myautoadd+=[myunadded[x]] - del myunadded[x] - - if myautoadd: - print ">>> Auto-Adding missing digests..." - if "--pretend" in myoptions: - print "(/usr/bin/cvs add "+string.join(myautoadd)+")" - retval=0 - else: - retval=os.system("/usr/bin/cvs add "+string.join(myautoadd)) - if retval: - print "!!! Exiting on cvs (shell) error code:",retval - sys.exit(retval) - - if myunadded: - print red("!!! The following files are in your cvs tree but are not added to the master") - print red("!!! tree. Please remove them from the cvs tree or add them to the master tree.") - for x in myunadded: - print " ",x - print - print - sys.exit(1) - - mymissing=None - if mymissing: - print "The following files are obviously missing from your cvs tree" - print "and are being fetched so we can continue:" - for x in mymissing: - print " ",x - if "--pretend" in myoptions: - print "(/usr/bin/cvs -q up "+string.join(mymissing)+")" - retval=0 - else: - retval=os.system("/usr/bin/cvs -q up "+string.join(mymissing)) - if retval: - print "!!! Exiting on cvs (shell) error code:",retval - sys.exit(retval) - del mymissing - - retval=["",""] - if isCvs: - print "Performing a "+green("cvs -n up")+" with a little magic grep to check for updates." - retval=getstatusoutput("/usr/bin/cvs -n up 2>&1 | egrep '^[^\?] .*' | egrep -v '^. .*/digest-[^/]+|^cvs server: .* -- ignored$'") - - mylines=string.split(retval[1], "\n") - myupdates=[] - for x in mylines: - if not x: - continue - if x[0] not in "UPMAR": # Updates,Patches,Modified,Added,Removed - print red("!!! Please fix the following issues reported from cvs: ")+green("(U,P,M,A,R are ok)") - print red("!!! Note: This is a pretend/no-modify pass...") - print retval[1] - print - sys.exit(1) - elif x[0] in ["U","P"]: - myupdates+=[x[2:]] - - if myupdates: - print green("Fetching trivial updates...") - if "--pretend" in myoptions: - print "(/usr/bin/cvs up "+string.join(myupdates)+")" - retval=0 - else: - retval=os.system("/usr/bin/cvs up "+string.join(myupdates)) - if retval!=0: - print "!!! cvs exited with an error. Terminating." - sys.exit(retval) - - if isCvs: - mycvstree=cvstree.getentries("./",recursive=1) - mychanged=cvstree.findchanged(mycvstree,recursive=1,basedir="./") - mynew=cvstree.findnew(mycvstree,recursive=1,basedir="./") - myremoved=cvstree.findremoved(mycvstree,recursive=1,basedir="./") - if not (mychanged or mynew or myremoved): - print - print green("RepoMan sez:"), "\"Doing nothing is not always good for QA.\"\n" - print - print "(Didn't find any changed files...)" - print - sys.exit(0) - - myupdates=mychanged+mynew - myheaders=[] - mydirty=[] - headerstring="'\$(Header|Id)" - headerstring+=".*\$'" - for myfile in myupdates: - myout=getstatusoutput("egrep -q "+headerstring+" "+myfile) - if myout[0]==0: - myheaders.append(myfile) - - print "*",green(str(len(myupdates))),"files being committed...",green(str(len(myheaders))),"have headers that will change." - print "*","Files with headers will cause the manifests to be made and recommited." - print "myupdates:",myupdates - print "myheaders:",myheaders - print - unlinkfile=0 - if not (commitmessage or commitmessagefile): - print "Please enter a CVS commit message at the prompt:" - try: - commitmessage=raw_input(green("> ")) - except KeyboardInterrupt: - exithandler() - if not commitmessagefile: - unlinkfile=1 - commitmessagefile=tempfile.mktemp(".repoman.msg") - if os.path.exists(commitmessagefile): - os.unlink(commitmessagefile) - mymsg=open(commitmessagefile,"w") - mymsg.write(commitmessage) - try: - mymsg.write("\n(Portage version: "+str(portage.VERSION)+")") - except: - print "Failed to insert portage version in message!" - mymsg.write("\n(Portage version: Unknown)") - mymsg.close() - - try: - mymsg=open(commitmessagefile,"r") - commitmessage=mymsg.read() - mymsg.close() - except SystemExit, e: - raise # Need to propogate this - except Exception,e: - print "!!! Failed to open commit message file." - print "!!!",e - sys.exit(1) - print - print green("Using commit message:") - print green("------------------------------------------------------------------------------") - print commitmessage - print green("------------------------------------------------------------------------------") - print - - if "--pretend" in myoptions: - print "(/usr/bin/cvs -q commit -F "+commitmessagefile+")" - retval=0 - else: - retval=os.system("/usr/bin/cvs -q commit -F "+commitmessagefile) - if retval: - print "!!! Exiting on cvs (shell) error code:",retval - sys.exit(retval) - - # Setup the GPG commands - def gpgsign(filename): - gpgcmd = "gpg --sign --clearsign --yes " - gpgcmd+= "--default-key "+repoman_settings["PORTAGE_GPG_KEY"] - if repoman_settings.has_key("PORTAGE_GPG_DIR"): - gpgcmd += " --homedir "+repoman_settings["PORTAGE_GPG_DIR"] - rValue = os.system(gpgcmd+" "+filename) - if rValue == 0: - os.rename(filename+".asc", filename) - else: - print "!!! gpg exited with '" + str(rValue) + "' status" - return rValue - - mychanges=[] - mysigs=[] - if myheaders or myupdates or myremoved or mynew: - myfiles=myheaders+myupdates+myremoved+mynew - mydone=[] - if repolevel==3: # In a package dir - repoman_settings["O"]="./" - portage.digestgen([],repoman_settings,manifestonly=1) - failure_count=0 - if "sign" in portage.features: - while(failure_count < 5 and gpgsign(repoman_settings["O"]+"/Manifest")): - portage.writemsg("!!! YOU MUST sign the Manifest.\n") - portage.writemsg("!!! You can also disable this for the time being by removing FEATURES='sign'") - #mysigs+=[sigfile] - if failure_count >= 5: - portage.writemsg("!!! WARNING\n") - portage.writemsg("!!! You've had gpg signing fail %i times, disabling it to ensure the manifest is commited\n") - portage.writemsg("!!!\n\n!!! IN OTHER WORDS, THE MANIFEST WASN'T SIGNED!\n") - portage.writemsg("!!! Please fix your installation, or contact devs in portage-dev so this can be resolved\n") - portage.writemsg("!!!\n") - elif repolevel==2: # In a category dir - for x in myfiles: - xs=string.split(x,"/") - if xs[0]==".": - xs=xs[1:] - if xs[0] in mydone: - continue - mydone.append(xs[0]) - repoman_settings["O"]="./"+xs[0] - portage.digestgen([],repoman_settings,manifestonly=1) - if "sign" in portage.features: - while(gpgsign(repoman_settings["O"]+"/Manifest")): - portage.writemsg("!!! YOU MUST sign the Manifest.\n") - portage.writemsg("!!! You can also disable this for the time being by removing FEATURES='sign'") - #mysigs+=[sigfile] - elif repolevel==1: # repo-cvsroot - print green("RepoMan sez:"), "\"You're rather crazy... doing the entire repository.\"\n" - for x in myfiles: - xs=string.split(x,"/") - if xs[0]==".": - xs=xs[1:] - if string.join(xs[:2],"/") in mydone: - continue - mydone.append(string.join(xs[:2],"/")) - repoman_settings["O"]="./"+string.join(xs[:2],"/") - portage.digestgen([],repoman_settings,manifestonly=1) - if "sign" in portage.features: - while(gpgsign(repoman_settings["O"]+"/Manifest")): - portage.writemsg("!!! YOU MUST sign the Manifest.\n") - portage.writemsg("!!! You can also disable this for the time being by removing FEATURES='sign'") - #mysigs+=[sigfile] - else: - print red("I'm confused... I don't know where I am!") - sys.exit(1) - - if "--pretend" in myoptions: - print "(/usr/bin/cvs -q commit -F "+commitmessagefile+")" - else: - mymsg=open(commitmessagefile,"a") - mymsg.write(" (Manifest recommit)") - try: - mymsg.write("\n(Portage version: "+str(portage.VERSION)+")") - except: - print "Failed to insert portage version in message!" - mymsg.write("\n(Portage version: Unknown)") - mymsg.close() - retval=os.system("/usr/bin/cvs -q commit -F "+commitmessagefile) - if retval: - print "!!! Exiting on cvs (shell) error code:",retval - sys.exit(retval) - - if unlinkfile: - os.unlink(commitmessagefile) - print - if isCvs: - print "CVS commit complete." - else: - print "repoman was too scared by not seeing any familiar cvs file that he forgot to commit anything" - print green("RepoMan sez:"), "\"If everyone were like you, I'd be out of business!\"\n" -sys.exit(0) - diff --git a/bin/test_target_graph.py b/bin/test_target_graph.py deleted file mode 100755 index 4c0fe66..0000000 --- a/bin/test_target_graph.py +++ /dev/null @@ -1,95 +0,0 @@ -#!/usr/bin/python - -import portage -from portage_dep import * -from portage_syntax import * - -vdb = portage.db["/"]["vartree"].dbapi - -preferred = [] -allcp = vdb.cp_all() -for cp in allcp: - preferred.append(Atom(cp)) - -preferred = prepare_prefdict(preferred) - -tgraph = StateGraph() - -allatoms = [] -for atomstr in portage.settings.packages: - if atomstr[0] == "*": - allatoms.append(Atom(atomstr[1:])) - -for atomstr in portage.grabfile("/var/lib/portage/world"): - allatoms.append(Atom(atomstr)) - -rdeps = DependSpec(element_class=Atom) -rdeps.elements = allatoms -dummypkg = GluePkg("sets/world-1.0", "set", "0", [], DependSpec(), rdeps) -rdeps = transform_virtuals(dummypkg, rdeps, portage.settings.virtuals) -rdeps = transform_dependspec(rdeps, preferred) -rdeps.compact() -dummypkg = GluePkg("sets/world-1.0", "set", "0", [], DependSpec(), rdeps) -tgraph.add_package(dummypkg, True) - -def create_pkg(cpv): - aux = vdb.aux_get(cpv, ["SLOT","USE","RDEPEND","PDEPEND"]) - slot = aux[0] - use = aux[1].split() - rdeps = DependSpec(aux[2] + " " + aux[3], Atom) - rdeps.resolve_conditions(use) - pkg = GluePkg(cpv, "installed", slot, use, DependSpec(), rdeps) - rdeps = transform_virtuals(pkg, rdeps, portage.settings.virtuals) - rdeps = transform_dependspec(rdeps, preferred) - pkg = GluePkg(cpv, "installed", slot, use, DependSpec(), rdeps) - return pkg - -while True: - changed = False - for atom in tgraph.get_unmatched_atoms(): - matches = vdb.match(str(atom)) - if matches: - tgraph.add_package(create_pkg(portage.best(matches))) - changed = True - if changed: - continue - for atom in tgraph.get_unmatched_preferentials(): - matches = vdb.match(str(atom)) - if matches: - tgraph.add_package(create_pkg(portage.best(matches))) - changed = True - break - if changed: - continue - if tgraph.get_conflicts(): - conflict = pkg.get_conflicts()[0] - print "Conflict:",conflict - cpvs = [] - for pkg in conflict: - cpvs.append(str(pkg)) - cpvs.remove(portage.best(cpvs)) - for pkg in conflict: - if str(pkg) in cpvs: - tgraph.remove(pkg) - changed = True - if changed: - continue - if tgraph.get_unneeded_packages(): - pkg = tgraph.get_unneeded_packages()[0] - print "Unneeded:",pkg - tgraph.remove_package(pkg) - changed = True - if not changed: - break - -allcpv = [] -for cp in allcpv: - allcpv.extend(vdb.match(cp)) - -neededcpv = [] -for pkg in tgraph.get_needed_packages(): - neededcpv.append(str(pkg)) - -for cpv in allcpv: - if cpv not in neededcpv: - print "No runtime deps on",cpv diff --git a/bin/xpak b/bin/xpak deleted file mode 100755 index fc6b467..0000000 --- a/bin/xpak +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/python -O -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/xpak,v 1.10 2004/10/04 13:56:50 vapier Exp $ - -import sys -if len(sys.argv)!=3: - print "xpak: expecting three arguments." - sys.exit(1) - -sys.path = ["/usr/lib/portage/pym"]+sys.path - -import xpak -xpak.xpak(sys.argv[1],sys.argv[2]) diff --git a/cnf/dispatch-conf.conf b/cnf/dispatch-conf.conf deleted file mode 100644 index 8e88936..0000000 --- a/cnf/dispatch-conf.conf +++ /dev/null @@ -1,31 +0,0 @@ -# -# dispatch-conf.conf -# - -# Directory to archive replaced configs -archive-dir=/etc/config-archive - -# Use rcs for storing files in the archive directory? -# (yes or no) -use-rcs=no - -# Diff for display -diff="diff -Nu %s %s" - -# Pager for diff display -pager="less --no-init --QUIT-AT-EOF" - -# Automerge files comprising only CVS interpolations (e.g. Header or Id) -# (yes or no) -replace-cvs=yes - -# Automerge files comprising only whitespace and/or comments -# (yes or no) -replace-wscomments=no - -# Automerge files that the user hasn't modified -# (yes or no) -replace-unmodified=no - -# Per-session log file of changes made to configuration files -#log-file=/var/log/dispatch-conf.log diff --git a/cnf/etc-update.conf b/cnf/etc-update.conf deleted file mode 100644 index bbdbd82..0000000 --- a/cnf/etc-update.conf +++ /dev/null @@ -1,71 +0,0 @@ -# edit the lines below to your liking -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/cnf/etc-update.conf,v 1.5 2003/04/28 10:19:46 carpaski Exp $ - -# mode - 0 for text, 1 for menu (support incomplete) -# note that you need dev-util/dialog installed -mode="0" - -# Whether trivial/comment changes should be automerged -eu_automerge="yes" - -# 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" -using_editor=0 -#diff_command="vim -d %file1 %file2" -#using_editor=1 - - -# 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! - diff --git a/cnf/make.conf b/cnf/make.conf deleted file mode 100644 index 69702be..0000000 --- a/cnf/make.conf +++ /dev/null @@ -1,401 +0,0 @@ -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/cnf/make.conf,v 1.89 2005/02/26 07:21:14 jstubbs Exp $ -# Contains local system settings for Portage system - -# Please review 'man make.conf' for more information. - -# Build-time functionality -# ======================== -# -# The USE variable is used to enable optional build-time functionality. For -# example, quite a few packages have optional X, gtk or GNOME functionality -# that can only be enabled or disabled at compile-time. Gentoo Linux has a -# very extensive set of USE variables described in our USE variable HOWTO at -# http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&chap=1 -# -# The available list of use flags with descriptions is in your portage tree. -# Use 'less' to view them: --> less /usr/portage/profiles/use.desc <-- -# -# 'ufed' is an ncurses/dialog interface available in portage to make handling -# useflags for you. 'emerge app-portage/ufed' -# -# Example: -#USE="X gtk gnome -alsa" - -# Host Setting -# ============ -# -# DO NOT CHANGE THIS SETTING UNLESS YOU ARE USING STAGE1! -# Change this line as appropriate (i686, i586, i486 or i386). -# All modern systems (even Athlons) should use "i686-pc-linux-gnu". -# All K6's are i586. -CHOST="i686-pc-linux-gnu" - -# Host and optimization settings -# ============================== -# -# For optimal performance, enable a CFLAGS setting appropriate for your CPU. -# -# Please note that if you experience strange issues with a package, it may be -# due to gcc's optimizations interacting in a strange way. Please test the -# package (and in some cases the libraries it uses) at default optimizations -# before reporting errors to developers. -# -# -mcpu=<cpu-type> means optimize code for the particular type of CPU without -# breaking compatibility with other CPUs. -# -# -march=<cpu-type> means to take full advantage of the ABI and instructions -# for the particular CPU; this will break compatibility with older CPUs (for -# example, -march=athlon-xp code will not run on a regular Athlon, and -# -march=i686 code will not run on a Pentium Classic. -# -# CPU types supported in gcc-3.2 and higher: athlon-xp, athlon-mp, -# athlon-tbird, athlon, k6, k6-2, k6-3, i386, i486, i586 (Pentium), i686 -# (PentiumPro), pentium, pentium-mmx, pentiumpro, pentium2 (Celeron), -# pentium3, and pentium4. -# -# Note that Gentoo Linux 1.4 and higher include at least gcc-3.2. -# -# CPU types supported in gcc-2.95*: k6, i386, i486, i586 (Pentium), i686 -# (Pentium Pro), pentium, pentiumpro Gentoo Linux 1.2 and below use gcc-2.95* -# -# CRITICAL WARNINGS: ****************************************************** # -# K6 markings are deceptive. Avoid setting -march for them. See Bug #24379. # -# Pentium-M CPU's should not enable sse2 until at least gcc-3.4. Bug 50616. # -# ************************************************************************* # -# -# Decent examples: -# -#CFLAGS="-mcpu=athlon-xp -O3 -pipe" -#CFLAGS="-march=pentium3 -O3 -pipe" - -# If you set a CFLAGS above, then this line will set your default C++ flags to -# the same settings. -#CXXFLAGS="${CFLAGS}" - -# Advanced Masking -# ================ -# -# Gentoo is using a new masking system to allow for easier stability testing -# on packages. KEYWORDS are used in ebuilds to mask and unmask packages based -# on the platform they are set for. A special form has been added that -# indicates packages and revisions that are expected to work, but have not yet -# been approved for the stable set. '~arch' is a superset of 'arch' which -# includes the unstable, in testing, packages. Users of the 'x86' architecture -# would add '~x86' to ACCEPT_KEYWORDS to enable unstable/testing packages. -# '~ppc', '~sparc' are the unstable KEYWORDS for their respective platforms. -# -# Please note that this is not for development, alpha, beta, nor cvs release -# packages. "Broken" packages will not be added to testing and should not be -# requested to be added. Alternative routes are available to developers -# for experimental packages, and it is at their discretion to use them. -# -# DO NOT PUT ANYTHING BUT YOUR SPECIFIC ~ARCHITECTURE IN THE LIST. -# IF YOU ARE UNSURE OF YOUR ARCH, OR THE IMPLICATIONS, DO NOT MODIFY THIS. -# -#ACCEPT_KEYWORDS="~arch" - -# Portage Directories -# =================== -# -# Each of these settings controls an aspect of portage's storage and file -# system usage. If you change any of these, be sure it is available when -# you try to use portage. *** DO NOT INCLUDE A TRAILING "/" *** -# -# PORTAGE_TMPDIR is the location portage will use for compilations and -# temporary storage of data. This can get VERY large depending upon -# the application being installed. -#PORTAGE_TMPDIR=/var/tmp -# -# PORTDIR is the location of the portage tree. This is the repository -# for all profile information as well as all ebuilds. This directory -# itself can reach 200M. If you change this, you must update your -# /etc/make.profile symlink accordingly. -#PORTDIR=/usr/portage -# -# DISTDIR is where all of the source code tarballs will be placed for -# emerges. The source code is maintained here unless you delete -# it. The entire repository of tarballs for gentoo is 9G. This is -# considerably more than any user will ever download. 2-3G is -# a large DISTDIR. -#DISTDIR=${PORTDIR}/distfiles -# -# PKGDIR is the location of binary packages that you can have created -# with '--buildpkg' or '-b' while emerging a package. This can get -# upto several hundred megs, or even a few gigs. -#PKGDIR=${PORTDIR}/packages -# -# PORT_LOGDIR is the location where portage will store all the logs it -# creates from each individual merge. They are stored as NNNN-$PF.log -# in the directory specified. This is disabled until you enable it by -# providing a directory. Permissions will be modified as needed IF the -# directory exists, otherwise logging will be disabled. NNNN is the -# increment at the time the log is created. Logs are thus sequential. -#PORT_LOGDIR=/var/log/portage -# -# PORTDIR_OVERLAY is a directory where local ebuilds may be stored without -# concern that they will be deleted by rsync updates. Default is not -# defined. -#PORTDIR_OVERLAY=/usr/local/portage - -# Fetching files -# ============== -# -# If you need to set a proxy for wget or lukemftp, add the appropriate "export -# ftp_proxy=<proxy>" and "export http_proxy=<proxy>" lines to /etc/profile if -# all users on your system should use them. -# -# Portage uses wget by default. Here are some settings for some alternate -# downloaders -- note that you need to merge these programs first before they -# will be available. -# -# Default fetch command (5 tries, passive ftp for firewall compatibility) -#FETCHCOMMAND="/usr/bin/wget -t 5 --passive-ftp \${URI} -P \${DISTDIR}" -#RESUMECOMMAND="/usr/bin/wget -c -t 5 --passive-ftp \${URI} -P \${DISTDIR}" -# -# Using wget, ratelimiting downloads -#FETCHCOMMAND="/usr/bin/wget -t 5 --passive-ftp --limit-rate=200k \${URI} -P \${DISTDIR}" -#RESUMECOMMAND="/usr/bin/wget -c -t 5 --passive-ftp --limit-rate=200k \${URI} -P \${DISTDIR}" -# -# Lukemftp (BSD ftp): -#FETCHCOMMAND="/usr/bin/lukemftp -s -a -o \${DISTDIR}/\${FILE} \${URI}" -#RESUMECOMMAND="/usr/bin/lukemftp -s -a -R -o \${DISTDIR}/\${FILE} \${URI}" -# -# Portage uses GENTOO_MIRRORS to specify mirrors to use for source retrieval. -# The list is a space separated list which is read left to right. If you use -# another mirror we highly recommend leaving the default mirror at the end of -# the list so that portage will fall back to it if the files cannot be found -# on your specified mirror. We _HIGHLY_ recommend that you change this setting -# to a nearby mirror by merging and using the 'mirrorselect' tool. -#GENTOO_MIRRORS="<your_mirror_here> http://gentoo.osuosl.org http://www.ibiblio.org/pub/Linux/distributions/gentoo" -# -# Portage uses PORTAGE_BINHOST to specify mirrors for prebuilt-binary packages. -# The list is a single entry specifying the full address of the directory -# serving the tbz2's for your system. Running emerge with either '--getbinpkg' -# or '--getbinpkgonly' will cause portage to retrieve the metadata from all -# packages in the directory specified, and use that data to determine what will -# be downloaded and merged. '-g' or '-gK' are the recommend parameters. Please -# consult the man pages and 'emerge --help' for more information. For FTP, the -# default connection is passive -- If you require an active connection, affix -# an asterisk (*) to the end of the host:port string before the path. -#PORTAGE_BINHOST="http://grp.mirror.site/gentoo/grp/1.4/i686/athlon-xp/" -# This ftp connection is passive ftp. -#PORTAGE_BINHOST="ftp://login:pass@grp.mirror.site/pub/grp/i686/athlon-xp/" -# This ftp connection is active ftp. -#PORTAGE_BINHOST="ftp://login:pass@grp.mirror.site:21*/pub/grp/i686/athlon-xp/" - -# Synchronizing Portage -# ===================== -# -# Each of these settings affects how Gentoo synchronizes your Portage tree. -# Synchronization is handled by rsync and these settings allow some control -# over how it is done. -# -# -# SYNC is the server used by rsync to retrieve a localized rsync mirror -# rotation. This allows you to select servers that are geographically -# close to you, yet still distribute the load over a number of servers. -# Please do not single out specific rsync mirrors. Doing so places undue -# stress on particular mirrors. Instead you may use one of the following -# continent specific rotations: -# -# SYNC refactoring code is now in. This means that your SYNC var just got a wee -# bit more interesting. -# -# for CVS -# old format: cvs://user@host:cvsroot -# this is deprecated. it assumes gentoo-x86, and ssh. -# -# Use the new format. -# -# new format: cvs://[CVS_RSH:]user@host:cvsroot:cvs-module -# example- -# cvs://ssh:ferringb@cvs.gentoo.org:/var/cvsroot:gentoo-x86 -# if, for example, I wanted CVS_RSH to be rsh- -# cvs://ssh:ferringb@cvs.gentoo.org:/var/cvsroot:gentoo-x86 -# -# if you're just after a straight cvs connection, pserver fex -# cvs://user@host:cvsroot:cvs-module -# -# currently, it shouldn't support specifying a local cvs root. -# this will be added. -# -# for snaphots (previously emerge-webrsync) -# snapshot[-mirror] -# -# using -# SYNC="snapshot" -# will randomly choose a mirror to use to -# -# to set it explicitly- use this as an example -# snapshot-http://gentoo.chem.wisc.edu/gentoo/snapshots -# -# Default: "rsync://rsync.gentoo.org/gentoo-portage" -# North America: "rsync://rsync.namerica.gentoo.org/gentoo-portage" -# South America: "rsync://rsync.samerica.gentoo.org/gentoo-portage" -# Europe: "rsync://rsync.europe.gentoo.org/gentoo-portage" -# Asia: "rsync://rsync.asia.gentoo.org/gentoo-portage" -# Australia: "rsync://rsync.au.gentoo.org/gentoo-portage" -#SYNC="rsync://rsync.gentoo.org/gentoo-portage" -# -# RSYNC_RETRIES sets the number of times portage will attempt to retrieve -# a current portage tree before it exits with an error. This allows -# for a more successful retrieval without user intervention most times. -#RSYNC_RETRIES="3" -# -# RSYNC_TIMEOUT sets the length of time rsync will wait before it times out -# on a connection. Most users will benefit from this setting as it will -# reduce the amount of 'dead air' they experience when they run across -# the occasional, unreachable mirror. Dialup users might want to set this -# value up around the 300 second mark. -#RSYNC_TIMEOUT=180 - -# Advanced Features -# ================= -# -# MAKEOPTS provides extra options that may be passed to 'make' when a -# program is compiled. Presently the only use is for specifying -# the number of parallel makes (-j) to perform. The suggested number -# for parallel makes is CPUs+1. -#MAKEOPTS="-j2" -# -# PORTAGE_NICENESS provides a default increment to emerge's niceness level. -# Note: This is an increment. Running emerge in a niced environment will -# reduce it further. Default is unset. -#PORTAGE_NICENESS=3 -# -# AUTOCLEAN enables portage to automatically clean out older or overlapping -# packages from the system after every successful merge. This is the -# same as running 'emerge -c' after every merge. Set with: "yes" or "no". -# This does not affect the unpacked source. See 'noclean' below. -#AUTOCLEAN="yes" -# -# PORTAGE_TMPFS is a location where portage may create temporary files. -# If specified, portage will use this directory whenever possible -# for all rapid operations such as lockfiles and transient data. -# It is _highly_ recommended that this be a tmpfs or ramdisk. Do not -# set this to anything that does not give a significant performance -# enhancement and proper FS compliance for locks and read/write. -# /dev/shm is a glibc mandated tmpfs, and should be a reasonable -# setting for all linux kernel+glibc based systems. -#PORTAGE_TMPFS="/dev/shm" -# -# FEATURES are settings that affect the functionality of portage. Most of -# these settings are for developer use, but some are available to non- -# developers as well. -# -# 'autoaddcvs' causes portage to automatically try to add files to cvs -# that will have to be added later. Done at generation times -# and only has an effect when 'cvs' is also set. -# 'buildpkg' causes binary packages to be created of all packages that -# are being merged. -# 'ccache' enables ccache support via CC. -# 'collision-protect' -# prevents packages from overwriting files that are owned by -# another package or by no package at all. -# 'cvs' causes portage to enable all cvs features (commits, adds), -# and to apply all USE flags in SRC_URI for digests -- for -# developers only. -# 'digest' causes digests to be generated for all packages being merged. -# 'distcc' enables distcc support via CC. -# 'distlocks' enables distfiles locking using fcntl or hardlinks. This -# is enabled by default. Tools exist to help clean the locks -# after crashes: /usr/lib/portage/bin/clean_locks. -# 'fixpackages' allows portage to fix binary packages that are stored in -# PKGDIR. This can consume a lot of time. 'fixpackages' is -# also a script that can be run at any given time to force -# the same actions. -# 'gpg' enables basic verification of Manifest files using gpg. -# This features is UNDER DEVELOPMENT and reacts to features -# of strict and severe. Heavy use of gpg sigs is coming. -# 'keeptemp' prevents the clean phase from deleting the temp files ($T) -# from a merge. -# 'keepwork' prevents the clean phase from deleting the WORKDIR. -# 'maketest' causes ebuilds to perform testing phases if they are capable -# of it. Some packages support this automaticaly via makefiles. -# 'noauto' causes ebuild to perform only the action requested and -# not any other required actions like clean or unpack -- for -# debugging purposes only. -# 'noclean' prevents portage from removing the source and temporary files -# after a merge -- for debugging purposes only. -# 'nostrip' prevents the stripping of binaries. -# 'notitles' disables xterm titlebar updates (which contain status info). -# 'parallel-fetch' -# enable parallel merging/fetching where it makes sense. -# 'prelink' Prelink binaries automatically when merging. -# 'sandbox' enables sandboxing when running emerge and ebuild. -# 'selinux' Enable selinux features, labeling fex. This should be used in -# conjunction with USE="selinux". -# 'strict' causes portage to react strongly to conditions that are -# potentially dangerous, like missing/incorrect Manifest files. -# 'verify-rdepend' -# Don't trust the ebuilds stated RDEPENDS. Verify it. -# 'userpriv' allows portage to drop root privileges while it is compiling, -# as a security measure. As a side effect this can remove -# sandbox access violations for users. -# 'userpriv_fakeroot' -# use fakeroot to run the install phase as a non-root user. -# FEATURES="userpriv_fakeroot userpriv usersandbox sandbox" is -# currently the most de-prived you can run- pkg_setup still runs -# as root, although most pkgs don't require it. -# 'usersandbox' enables sandboxing while portage is running under userpriv. -#FEATURES="sandbox buildpkg ccache distcc userpriv usersandbox notitles noclean noauto cvs keeptemp keepwork autoaddcvs" -#FEATURES="sandbox ccache distcc distlocks autoaddcvs" -# -# CCACHE_SIZE sets the space use limitations for ccache. The default size is -# 2G, and will be set if not defined otherwise and ccache is in features. -# Portage will set the default ccache dir if it is not present in the -# user's environment, for userpriv it sets: ${PORTAGE_TMPDIR}/ccache -# (/var/tmp/ccache), and for regular use the default is /root/.ccache. -# Sizes are specified with 'G' 'M' or 'K'. -# '2G' for 2 gigabytes, '2048M' for 2048 megabytes (same as 2G). -#CCACHE_SIZE="512M" -# -# DISTCC_DIR sets the temporary space used by distcc. -#DISTCC_DIR="${PORTAGE_TMPDIR}/.distcc" -# -# RSYNC_EXCLUDEFROM is a file that portage will pass to rsync when it updates -# the portage tree. Specific chunks of the tree may be excluded from -# consideration. This may cause dependency failures if you are not careful. -# The file format is one pattern per line, blanks and ';' or '#' lines are -# comments. See 'man rsync' for more details on the exclude-from format. -#RSYNC_EXCLUDEFROM=/etc/portage/rsync_excludes - -# logging related variables: -# PORTAGE_LOG_CLASSES: selects messages to be logged, possible values are: -# info, warn, error, log -PORTAGE_LOG_CLASSES="warn error log" - -# PORTAGE_LOG_SYSTEM: selects the module(s) to process the log messages. Modules -# included in portage are (empty means logging is disabled): -# save (saves one log per package in $PORTAGE_TMPDIR/elogs) -# custom (passes all messages to $PORTAGE_LOG_COMMAND) -# syslog (sends all messages to syslog) -# mail (send all messages to the mailserver defined -# in $PORTAGE_LOG_MAILURI) -#PORTAGE_LOG_SYSTEM="save mail" - -# PORTAGE_LOG_COMMAND: only used with the "custom" logging module. Specifies a command -# to process log messages. Two variables are expanded: -# ${PACKAGE} - expands to the cpv entry of the processed -# package (see $PVR in ebuild(5)) -# ${LOGFILE} - absolute path to the logfile -#PORTAGE_LOG_COMMAND="/path/to/logprocessor -p ${PACKAGE} -f ${LOGFILE}" - -# PORTAGE_LOG_MAILURI: this variable holds all important settings for the mail -# module. In most cases listing the recipient adress and -# the receiving mailserver should be sufficient, but you can -# also use advanced settings like authentication or TLS. The -# full syntax is: -# adress [[user:passwd@]mailserver[:port]] -# where -# adress: recipient adress -# user: username for smtp auth (defaults to none) -# passwd: password for smtp auth (defaults to none) -# mailserver: smtp server that should be used to deliver the mail (defaults to localhost) -# port: port to use on the given smtp server (defaults to 25, values > 100000 indicate that starttls should be used on (port-100000)) -# Examples: -#PORTAGE_LOG_MAILURI="root@localhost localhost" (this is also the default setting) -#PORTAGE_LOG_MAILURI="user@some.domain mail.some.domain" (sends mails to user@some.domain using the mailserver mail.some.domain) -#PORTAGE_LOG_MAILURI="user@some.domain user:secret@mail.some.domain:100465" (this is left uncommented as a reader excercise ;) diff --git a/cnf/make.conf.alpha b/cnf/make.conf.alpha deleted file mode 100644 index 0d075cf..0000000 --- a/cnf/make.conf.alpha +++ /dev/null @@ -1,339 +0,0 @@ -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/cnf/make.conf.alpha,v 1.44 2005/02/26 07:21:14 jstubbs Exp $ -# Contains local system settings for Portage system - -# Please review 'man make.conf' for more information. - -# Build-time functionality -# ======================== -# -# The USE variable is used to enable optional build-time functionality. For -# example, quite a few packages have optional X, gtk or GNOME functionality -# that can only be enabled or disabled at compile-time. Gentoo Linux has a -# very extensive set of USE variables described in our USE variable HOWTO at -# http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&chap=1 -# -# The available list of use flags with descriptions is in your portage tree. -# Use 'less' to view them: --> less /usr/portage/profiles/use.desc <-- -# -# 'ufed' is an ncurses/dialog interface available in portage to make handling -# useflags for you. 'emerge app-portage/ufed' -# -# Example: -#USE="X gtk gnome -alsa" - -# Host Setting -# ============ -# -# DO NOT CHANGE THIS SETTING UNLESS YOU ARE USING STAGE1! -# The generic HOST setting on alpha is alpha-unknown-linux-gnu. If your machine -# is an ev6 or ev67 based system you might want to use -# either alphaev6-unknown-linux-gnu or alphaev67-unknown-linux-gnu accordingly. -# -#CHOST="alphaev67-unknown-linux-gnu" -CHOST="alpha-unknown-linux-gnu" - -# Host and optimization settings -# ============================== -# -# For optimal performance, enable a CFLAGS setting appropriate for your CPU. -# -# Please note that if you experience strange issues with a package, it may be -# due to gcc's optimizations interacting in a strange way. Please test the -# package (and in some cases the libraries it uses) at default optimizations -# before reporting errors to developers. -# -# -mcpu=<cpu-type> means optimize code for the particular type of CPU. In -# difference to x86 for example -mcpu does break compatibility -# to older cpu types in case of ev6 or higher. -# On Alpha there is no -march= option in gcc-3. -# -# CPU types supported in gcc-3.2 or higher: ev4, ev45, ev5, ev56, ev6, ev67 -# -# Decent examples: -# -#CFLAGS="-mcpu=ev67 -O3 -pipe " -CFLAGS="-mcpu=ev5 -O3 -pipe " - -# If you set a CFLAGS above, then this line will set your default C++ flags to -# the same settings. -#CXXFLAGS="${CFLAGS}" - -# Advanced Masking -# ================ -# -# Gentoo is using a new masking system to allow for easier stability testing -# on packages. KEYWORDS are used in ebuilds to mask and unmask packages based -# on the platform they are set for. A special form has been added that -# indicates packages and revisions that are expected to work, but have not yet -# been approved for the stable set. '~arch' is a superset of 'arch' which -# includes the unstable, in testing, packages. Users of the 'x86' architecture -# would add '~x86' to ACCEPT_KEYWORDS to enable unstable/testing packages. -# '~ppc', '~sparc' are the unstable KEYWORDS for their respective platforms. -# -# Please note that this is not for development, alpha, beta, nor cvs release -# packages. "Broken" packages will not be added to testing and should not be -# requested to be added. Alternative routes are available to developers -# for experimental packages, and it is at their discretion to use them. -# -# DO NOT PUT ANYTHING BUT YOUR SPECIFIC ~ARCHITECTURE IN THE LIST. -# IF YOU ARE UNSURE OF YOUR ARCH, OR THE IMPLICATIONS, DO NOT MODIFY THIS. -# -#ACCEPT_KEYWORDS="~alpha" - -# Portage Directories -# =================== -# -# Each of these settings controls an aspect of portage's storage and file -# system usage. If you change any of these, be sure it is available when -# you try to use portage. *** DO NOT INCLUDE A TRAILING "/" *** -# -# PORTAGE_TMPDIR is the location portage will use for compilations and -# temporary storage of data. This can get VERY large depending upon -# the application being installed. -#PORTAGE_TMPDIR=/var/tmp -# -# PORTDIR is the location of the portage tree. This is the repository -# for all profile information as well as all ebuilds. This directory -# itself can reach 200M. If you change this, you must update your -# /etc/make.profile symlink accordingly. -#PORTDIR=/usr/portage -# -# DISTDIR is where all of the source code tarballs will be placed for -# emerges. The source code is maintained here unless you delete -# it. The entire repository of tarballs for gentoo is 9G. This is -# considerably more than any user will ever download. 2-3G is -# a large DISTDIR. -#DISTDIR=${PORTDIR}/distfiles -# -# PKGDIR is the location of binary packages that you can have created -# with '--buildpkg' or '-b' while emerging a package. This can get -# upto several hundred megs, or even a few gigs. -#PKGDIR=${PORTDIR}/packages -# -# PORT_LOGDIR is the location where portage will store all the logs it -# creates from each individual merge. They are stored as NNNN-$PF.log -# in the directory specified. This is disabled until you enable it by -# providing a directory. Permissions will be modified as needed IF the -# directory exists, otherwise logging will be disabled. NNNN is the -# increment at the time the log is created. Logs are thus sequential. -#PORT_LOGDIR=/var/log/portage -# -# PORTDIR_OVERLAY is a directory where local ebuilds may be stored without -# concern that they will be deleted by rsync updates. Default is not -# defined. -#PORTDIR_OVERLAY=/usr/local/portage - -# Fetching files -# ============== -# -# If you need to set a proxy for wget or lukemftp, add the appropriate "export -# ftp_proxy=<proxy>" and "export http_proxy=<proxy>" lines to /etc/profile if -# all users on your system should use them. -# -# Portage uses wget by default. Here are some settings for some alternate -# downloaders -- note that you need to merge these programs first before they -# will be available. -# -# Default fetch command (5 tries, passive ftp for firewall compatibility) -#FETCHCOMMAND="/usr/bin/wget -t 5 --passive-ftp \${URI} -P \${DISTDIR}" -#RESUMECOMMAND="/usr/bin/wget -c -t 5 --passive-ftp \${URI} -P \${DISTDIR}" -# -# Using wget, ratelimiting downloads -#FETCHCOMMAND="/usr/bin/wget -t 5 --passive-ftp --limit-rate=200k \${URI} -P \${DISTDIR}" -#RESUMECOMMAND="/usr/bin/wget -c -t 5 --passive-ftp --limit-rate=200k \${URI} -P \${DISTDIR}" -# -# Lukemftp (BSD ftp): -#FETCHCOMMAND="/usr/bin/lukemftp -s -a -o \${DISTDIR}/\${FILE} \${URI}" -#RESUMECOMMAND="/usr/bin/lukemftp -s -a -R -o \${DISTDIR}/\${FILE} \${URI}" -# -# -# Portage uses GENTOO_MIRRORS to specify mirrors to use for source retrieval. -# The list is a space separated list which is read left to right. If you use -# another mirror we highly recommend leaving the default mirror at the end of -# the list so that portage will fall back to it if the files cannot be found -# on your specified mirror. We _HIGHLY_ recommend that you change this setting -# to a nearby mirror by merging and using the 'mirrorselect' tool. -#GENTOO_MIRRORS="<your_mirror_here> http://gentoo.osuosl.org http://www.ibiblio.org/pub/Linux/distributions/gentoo" -# -# Portage uses PORTAGE_BINHOST to specify mirrors for prebuilt-binary packages. -# The list is a single entry specifying the full address of the directory -# serving the tbz2's for your system. Running emerge with either '--getbinpkg' -# or '--getbinpkgonly' will cause portage to retrieve the metadata from all -# packages in the directory specified, and use that data to determine what will -# be downloaded and merged. '-g' or '-gK' are the recommend parameters. Please -# consult the man pages and 'emerge --help' for more information. For FTP, the -# default connection is passive -- If you require an active connection, affix -# an asterisk (*) to the end of the host:port string before the path. -#PORTAGE_BINHOST="http://grp.mirror.site/gentoo/grp/1.4/i686/athlon-xp/" -# This ftp connection is passive ftp. -#PORTAGE_BINHOST="ftp://login:pass@grp.mirror.site/pub/grp/i686/athlon-xp/" -# This ftp connection is active ftp. -#PORTAGE_BINHOST="ftp://login:pass@grp.mirror.site:21*/pub/grp/i686/athlon-xp/" - -# Synchronizing Portage -# ===================== -# -# Each of these settings affects how Gentoo synchronizes your Portage tree. -# Synchronization is handled by rsync and these settings allow some control -# over how it is done. -# -# -# SYNC is the server used by rsync to retrieve a localized rsync mirror -# rotation. This allows you to select servers that are geographically -# close to you, yet still distribute the load over a number of servers. -# Please do not single out specific rsync mirrors. Doing so places undue -# stress on particular mirrors. Instead you may use one of the following -# continent specific rotations: -# -# Default: "rsync://rsync.gentoo.org/gentoo-portage" -# North America: "rsync://rsync.namerica.gentoo.org/gentoo-portage" -# South America: "rsync://rsync.samerica.gentoo.org/gentoo-portage" -# Europe: "rsync://rsync.europe.gentoo.org/gentoo-portage" -# Asia: "rsync://rsync.asia.gentoo.org/gentoo-portage" -# Australia: "rsync://rsync.au.gentoo.org/gentoo-portage" -#SYNC="rsync://rsync.gentoo.org/gentoo-portage" -# -# RSYNC_RETRIES sets the number of times portage will attempt to retrieve -# a current portage tree before it exits with an error. This allows -# for a more successful retrieval without user intervention most times. -#RSYNC_RETRIES="3" -# -# RSYNC_TIMEOUT sets the length of time rsync will wait before it times out -# on a connection. Most users will benefit from this setting as it will -# reduce the amount of 'dead air' they experience when they run across -# the occasional, unreachable mirror. Dialup users might want to set this -# value up around the 300 second mark. -#RSYNC_TIMEOUT=180 - -# Advanced Features -# ================= -# -# MAKEOPTS provides extra options that may be passed to 'make' when a -# program is compiled. Presently the only use is for specifying -# the number of parallel makes (-j) to perform. The suggested number -# for parallel makes is CPUs+1. -#MAKEOPTS="-j2" -# -# PORTAGE_NICENESS provides a default increment to emerge's niceness level. -# Note: This is an increment. Running emerge in a niced environment will -# reduce it further. Default is unset. -#PORTAGE_NICENESS=3 -# -# PORTAGE_TMPFS is a location where portage may create temporary files. -# If specified, portage will use this directory whenever possible -# for all rapid operations such as lockfiles and transient data. -# It is _highly_ recommended that this be a tmpfs or ramdisk. Do not -# set this to anything that does not give a significant performance -# enhancement and proper FS compliance for locks and read/write. -# /dev/shm is a glibc mandated tmpfs, and should be a reasonable -# setting for all linux kernel+glibc based systems. -#PORTAGE_TMPFS="/dev/shm" -# -# FEATURES are settings that affect the functionality of portage. Most of -# these settings are for developer use, but some are available to non- -# developers as well. -# -# 'autoaddcvs' causes portage to automatically try to add files to cvs -# that will have to be added later. Done at generation times -# and only has an effect when 'cvs' is also set. -# 'buildpkg' causes binary packages to be created of all packages that -# are being merged. -# 'ccache' enables ccache support via CC. -# 'collision-protect' -# prevents packages from overwriting files that are owned by -# another package or by no package at all. -# 'cvs' causes portage to enable all cvs features (commits, adds), -# and to apply all USE flags in SRC_URI for digests -- for -# developers only. -# 'digest' causes digests to be generated for all packages being merged. -# 'distcc' enables distcc support via CC. -# 'distlocks' enables distfiles locking using fcntl or hardlinks. This -# is enabled by default. Tools exist to help clean the locks -# after crashes: /usr/lib/portage/bin/clean_locks. -# 'fixpackages' allows portage to fix binary packages that are stored in -# PKGDIR. This can consume a lot of time. 'fixpackages' is -# also a script that can be run at any given time to force -# the same actions. -# 'gpg' enables basic verification of Manifest files using gpg. -# This features is UNDER DEVELOPMENT and reacts to features -# of strict and severe. Heavy use of gpg sigs is coming. -# 'keeptemp' prevents the clean phase from deleting the temp files ($T) -# from a merge. -# 'keepwork' prevents the clean phase from deleting the WORKDIR. -# 'maketest' causes ebuilds to perform testing phases if they are capable -# of it. Some packages support this automaticaly via makefiles. -# 'noauto' causes ebuild to perform only the action requested and -# not any other required actions like clean or unpack -- for -# debugging purposes only. -# 'noclean' prevents portage from removing the source and temporary files -# after a merge -- for debugging purposes only. -# 'nostrip' prevents the stripping of binaries. -# 'notitles' disables xterm titlebar updates (which contain status info). -# 'sandbox' enables sandboxing when running emerge and ebuild. -# 'strict' causes portage to react strongly to conditions that are -# potentially dangerous, like missing/incorrect Manifest files. -# 'userpriv' allows portage to drop root privileges while it is compiling, -# as a security measure. As a side effect this can remove -# sandbox access violations for users. -# 'usersandbox' enables sandboxing while portage is running under userpriv. -#FEATURES="sandbox buildpkg ccache distcc userpriv usersandbox notitles noclean noauto cvs keeptemp keepwork autoaddcvs" -#FEATURES="sandbox ccache distcc distlocks autoaddcvs" -# -# CCACHE_SIZE sets the space use limitations for ccache. The default size is -# 2G, and will be set if not defined otherwise and ccache is in features. -# Portage will set the default ccache dir if it is not present in the -# user's environment, for userpriv it sets: ${PORTAGE_TMPDIR}/ccache -# (/var/tmp/ccache), and for regular use the default is /root/.ccache. -# Sizes are specified with 'G' 'M' or 'K'. -# '2G' for 2 gigabytes, '2048M' for 2048 megabytes (same as 2G). -#CCACHE_SIZE="512M" -# -# DISTCC_DIR sets the temporary space used by distcc. -#DISTCC_DIR="${PORTAGE_TMPDIR}/.distcc" -# -# RSYNC_EXCLUDEFROM is a file that portage will pass to rsync when it updates -# the portage tree. Specific chunks of the tree may be excluded from -# consideration. This may cause dependency failures if you are not careful. -# The file format is one pattern per line, blanks and ';' or '#' lines are -# comments. See 'man rsync' for more details on the exclude-from format. -#RSYNC_EXCLUDEFROM=/etc/portage/rsync_excludes - -# logging related variables: -# PORTAGE_LOG_CLASSES: selects messages to be logged, possible values are: -# info, warn, error, log -PORTAGE_LOG_CLASSES="warn error log" - -# PORTAGE_LOG_SYSTEM: selects the module(s) to process the log messages. Modules -# included in portage are (empty means logging is disabled): -# save (saves one log per package in $PORTAGE_TMPDIR/elogs) -# custom (passes all messages to $PORTAGE_LOG_COMMAND) -# syslog (sends all messages to syslog) -# mail (send all messages to the mailserver defined -# in $PORTAGE_LOG_MAILURI) -#PORTAGE_LOG_SYSTEM="save mail" - -# PORTAGE_LOG_COMMAND: only used with the "custom" logging module. Specifies a command -# to process log messages. Two variables are expanded: -# ${PACKAGE} - expands to the cpv entry of the processed -# package (see $PVR in ebuild(5)) -# ${LOGFILE} - absolute path to the logfile -#PORTAGE_LOG_COMMAND="/path/to/logprocessor -p ${PACKAGE} -f ${LOGFILE}" - -# PORTAGE_LOG_MAILURI: this variable holds all important settings for the mail -# module. In most cases listing the recipient adress and -# the receiving mailserver should be sufficient, but you can -# also use advanced settings like authentication or TLS. The -# full syntax is: -# adress [[user:passwd@]mailserver[:port]] -# where -# adress: recipient adress -# user: username for smtp auth (defaults to none) -# passwd: password for smtp auth (defaults to none) -# mailserver: smtp server that should be used to deliver the mail (defaults to localhost) -# port: port to use on the given smtp server (defaults to 25, values > 100000 indicate that starttls should be used on (port-100000)) -# Examples: -#PORTAGE_LOG_MAILURI="root@localhost localhost" (this is also the default setting) -#PORTAGE_LOG_MAILURI="user@some.domain mail.some.domain" (sends mails to user@some.domain using the mailserver mail.some.domain) -#PORTAGE_LOG_MAILURI="user@some.domain user:secret@mail.some.domain:100465" (this is left uncommented as a reader excercise ;) diff --git a/cnf/make.conf.amd64 b/cnf/make.conf.amd64 deleted file mode 100644 index a8049b4..0000000 --- a/cnf/make.conf.amd64 +++ /dev/null @@ -1,350 +0,0 @@ -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/cnf/make.conf.amd64,v 1.9 2005/02/26 07:21:14 jstubbs Exp $ -# Contains local system settings for Portage system - -# Please review 'man make.conf' for more information. - -# Build-time functionality -# ======================== -# -# The USE variable is used to enable optional build-time functionality. For -# example, quite a few packages have optional X, gtk or GNOME functionality -# that can only be enabled or disabled at compile-time. Gentoo Linux has a -# very extensive set of USE variables described in our USE variable HOWTO at -# http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&chap=1 -# -# The available list of use flags with descriptions is in your portage tree. -# Use 'less' to view them: --> less /usr/portage/profiles/use.desc <-- -# -# 'ufed' is an ncurses/dialog interface available in portage to make handling -# useflags for you. 'emerge app-portage/ufed' -# -# Example: -#USE="X gtk gnome -alsa" - -# Host Setting -# ============ -# -CHOST="x86_64-pc-linux-gnu" - -# Host and optimization settings -# ============================== -# -# For optimal performance, enable a CFLAGS setting appropriate for your CPU. -# -# Please note that if you experience strange issues with a package, it may be -# due to gcc's optimizations interacting in a strange way. Please test the -# package (and in some cases the libraries it uses) at default optimizations -# before reporting errors to developers. -# -# -mcpu=<cpu-type> means optimize code for the particular type of CPU without -# breaking compatibility with other CPUs. GCC 3.4 has deprecated support for -# -mcpu, so use -mtune instead if using this compiler. -# -# -march=<cpu-type> means to take full advantage of the ABI and instructions -# for the particular CPU; this will break compatibility with older CPUs (for -# example, -march=athlon-xp code will not run on a regular Athlon, and -# -march=i686 code will not run on a Pentium Classic.) -# -# CPU types supported in gcc-3.2 and higher: athlon-xp, athlon-mp, -# athlon-tbird, athlon, k6, k6-2, k6-3, i386, i486, i586 (Pentium), i686 -# (PentiumPro), pentium, pentium-mmx, pentiumpro, pentium2 (Celeron), -# pentium3, and pentium4. -# -# Note that Gentoo Linux 1.4 and higher include at least gcc-3.2. -# -# amd64 CPU types supported in gcc-3.4: athlon64, opteron, k8 -# -# CRITICAL WARNINGS: ****************************************************** # -# K6 markings are deceptive. Avoid setting -march for them. See Bug #24379. # -# Pentium-M CPU's should not enable sse2 until at least gcc-3.4. Bug 50616. # -# GCC 3.3 doesnt support an amd64 specific -march setting, use 3.4. # -# ************************************************************************* # -# -# Decent examples: -# -#CFLAGS="-mtune=k8 -O2 -pipe" -#CFLAGS="-march=athlon64 -O2 -pipe" - -# If you set a CFLAGS above, then this line will set your default C++ flags to -# the same settings. -#CXXFLAGS="${CFLAGS}" - -# Advanced Masking -# ================ -# -# Gentoo is using a new masking system to allow for easier stability testing -# on packages. KEYWORDS are used in ebuilds to mask and unmask packages based -# on the platform they are set for. A special form has been added that -# indicates packages and revisions that are expected to work, but have not yet -# been approved for the stable set. '~arch' is a superset of 'arch' which -# includes the unstable, in testing, packages. Users of the 'x86' architecture -# would add '~x86' to ACCEPT_KEYWORDS to enable unstable/testing packages. -# '~ppc', '~sparc' are the unstable KEYWORDS for their respective platforms. -# -# Please note that this is not for development, alpha, beta, nor cvs release -# packages. "Broken" packages will not be added to testing and should not be -# requested to be added. Alternative routes are available to developers -# for experimental packages, and it is at their discretion to use them. -# -# DO NOT PUT ANYTHING BUT YOUR SPECIFIC ~ARCHITECTURE IN THE LIST. -# IF YOU ARE UNSURE OF YOUR ARCH, OR THE IMPLICATIONS, DO NOT MODIFY THIS. -# -#ACCEPT_KEYWORDS="~amd64" - -# Portage Directories -# =================== -# -# Each of these settings controls an aspect of portage's storage and file -# system usage. If you change any of these, be sure it is available when -# you try to use portage. *** DO NOT INCLUDE A TRAILING "/" *** -# -# PORTAGE_TMPDIR is the location portage will use for compilations and -# temporary storage of data. This can get VERY large depending upon -# the application being installed. -#PORTAGE_TMPDIR=/var/tmp -# -# PORTDIR is the location of the portage tree. This is the repository -# for all profile information as well as all ebuilds. This directory -# itself can reach 200M. If you change this, you must update your -# /etc/make.profile symlink accordingly. -#PORTDIR=/usr/portage -# -# DISTDIR is where all of the source code tarballs will be placed for -# emerges. The source code is maintained here unless you delete -# it. The entire repository of tarballs for gentoo is 9G. This is -# considerably more than any user will ever download. 2-3G is -# a large DISTDIR. -#DISTDIR=${PORTDIR}/distfiles -# -# PKGDIR is the location of binary packages that you can have created -# with '--buildpkg' or '-b' while emerging a package. This can get -# upto several hundred megs, or even a few gigs. -#PKGDIR=${PORTDIR}/packages -# -# PORT_LOGDIR is the location where portage will store all the logs it -# creates from each individual merge. They are stored as NNNN-$PF.log -# in the directory specified. This is disabled until you enable it by -# providing a directory. Permissions will be modified as needed IF the -# directory exists, otherwise logging will be disabled. NNNN is the -# increment at the time the log is created. Logs are thus sequential. -#PORT_LOGDIR=/var/log/portage -# -# PORTDIR_OVERLAY is a directory where local ebuilds may be stored without -# concern that they will be deleted by rsync updates. Default is not -# defined. -#PORTDIR_OVERLAY=/usr/local/portage - -# Fetching files -# ============== -# -# If you need to set a proxy for wget or lukemftp, add the appropriate "export -# ftp_proxy=<proxy>" and "export http_proxy=<proxy>" lines to /etc/profile if -# all users on your system should use them. -# -# Portage uses wget by default. Here are some settings for some alternate -# downloaders -- note that you need to merge these programs first before they -# will be available. -# -# Default fetch command (5 tries, passive ftp for firewall compatibility) -#FETCHCOMMAND="/usr/bin/wget -t 5 --passive-ftp \${URI} -P \${DISTDIR}" -#RESUMECOMMAND="/usr/bin/wget -c -t 5 --passive-ftp \${URI} -P \${DISTDIR}" -# -# Using wget, ratelimiting downloads -#FETCHCOMMAND="/usr/bin/wget -t 5 --passive-ftp --limit-rate=200k \${URI} -P \${DISTDIR}" -#RESUMECOMMAND="/usr/bin/wget -c -t 5 --passive-ftp --limit-rate=200k \${URI} -P \${DISTDIR}" -# -# Lukemftp (BSD ftp): -#FETCHCOMMAND="/usr/bin/lukemftp -s -a -o \${DISTDIR}/\${FILE} \${URI}" -#RESUMECOMMAND="/usr/bin/lukemftp -s -a -R -o \${DISTDIR}/\${FILE} \${URI}" -# -# -# Portage uses GENTOO_MIRRORS to specify mirrors to use for source retrieval. -# The list is a space separated list which is read left to right. If you use -# another mirror we highly recommend leaving the default mirror at the end of -# the list so that portage will fall back to it if the files cannot be found -# on your specified mirror. We _HIGHLY_ recommend that you change this setting -# to a nearby mirror by merging and using the 'mirrorselect' tool. -#GENTOO_MIRRORS="<your_mirror_here> http://gentoo.osuosl.org http://www.ibiblio.org/pub/Linux/distributions/gentoo" -# -# Portage uses PORTAGE_BINHOST to specify mirrors for prebuilt-binary packages. -# The list is a single entry specifying the full address of the directory -# serving the tbz2's for your system. Running emerge with either '--getbinpkg' -# or '--getbinpkgonly' will cause portage to retrieve the metadata from all -# packages in the directory specified, and use that data to determine what will -# be downloaded and merged. '-g' or '-gK' are the recommend parameters. Please -# consult the man pages and 'emerge --help' for more information. For FTP, the -# default connection is passive -- If you require an active connection, affix -# an asterisk (*) to the end of the host:port string before the path. -#PORTAGE_BINHOST="http://grp.mirror.site/gentoo/grp/1.4/i686/athlon-xp/" -# This ftp connection is passive ftp. -#PORTAGE_BINHOST="ftp://login:pass@grp.mirror.site/pub/grp/i686/athlon-xp/" -# This ftp connection is active ftp. -#PORTAGE_BINHOST="ftp://login:pass@grp.mirror.site:21*/pub/grp/i686/athlon-xp/" - -# Synchronizing Portage -# ===================== -# -# Each of these settings affects how Gentoo synchronizes your Portage tree. -# Synchronization is handled by rsync and these settings allow some control -# over how it is done. -# -# -# SYNC is the server used by rsync to retrieve a localized rsync mirror -# rotation. This allows you to select servers that are geographically -# close to you, yet still distribute the load over a number of servers. -# Please do not single out specific rsync mirrors. Doing so places undue -# stress on particular mirrors. Instead you may use one of the following -# continent specific rotations: -# -# Default: "rsync://rsync.gentoo.org/gentoo-portage" -# North America: "rsync://rsync.namerica.gentoo.org/gentoo-portage" -# South America: "rsync://rsync.samerica.gentoo.org/gentoo-portage" -# Europe: "rsync://rsync.europe.gentoo.org/gentoo-portage" -# Asia: "rsync://rsync.asia.gentoo.org/gentoo-portage" -# Australia: "rsync://rsync.au.gentoo.org/gentoo-portage" -#SYNC="rsync://rsync.gentoo.org/gentoo-portage" -# -# RSYNC_RETRIES sets the number of times portage will attempt to retrieve -# a current portage tree before it exits with an error. This allows -# for a more successful retrieval without user intervention most times. -#RSYNC_RETRIES="3" -# -# RSYNC_TIMEOUT sets the length of time rsync will wait before it times out -# on a connection. Most users will benefit from this setting as it will -# reduce the amount of 'dead air' they experience when they run across -# the occasional, unreachable mirror. Dialup users might want to set this -# value up around the 300 second mark. -#RSYNC_TIMEOUT=180 - -# Advanced Features -# ================= -# -# MAKEOPTS provides extra options that may be passed to 'make' when a -# program is compiled. Presently the only use is for specifying -# the number of parallel makes (-j) to perform. The suggested number -# for parallel makes is CPUs+1. -#MAKEOPTS="-j2" -# -# PORTAGE_NICENESS provides a default increment to emerge's niceness level. -# Note: This is an increment. Running emerge in a niced environment will -# reduce it further. Default is unset. -#PORTAGE_NICENESS=3 -# -# PORTAGE_TMPFS is a location where portage may create temporary files. -# If specified, portage will use this directory whenever possible -# for all rapid operations such as lockfiles and transient data. -# It is _highly_ recommended that this be a tmpfs or ramdisk. Do not -# set this to anything that does not give a significant performance -# enhancement and proper FS compliance for locks and read/write. -# /dev/shm is a glibc mandated tmpfs, and should be a reasonable -# setting for all linux kernel+glibc based systems. -#PORTAGE_TMPFS="/dev/shm" -# -# FEATURES are settings that affect the functionality of portage. Most of -# these settings are for developer use, but some are available to non- -# developers as well. -# -# 'autoaddcvs' causes portage to automatically try to add files to cvs -# that will have to be added later. Done at generation times -# and only has an effect when 'cvs' is also set. -# 'buildpkg' causes binary packages to be created of all packages that -# are being merged. -# 'ccache' enables ccache support via CC. -# 'collision-protect' -# prevents packages from overwriting files that are owned by -# another package or by no package at all. -# 'cvs' causes portage to enable all cvs features (commits, adds), -# and to apply all USE flags in SRC_URI for digests -- for -# developers only. -# 'digest' causes digests to be generated for all packages being merged. -# 'distcc' enables distcc support via CC. -# 'distlocks' enables distfiles locking using fcntl or hardlinks. This -# is enabled by default. Tools exist to help clean the locks -# after crashes: /usr/lib/portage/bin/clean_locks. -# 'fixpackages' allows portage to fix binary packages that are stored in -# PKGDIR. This can consume a lot of time. 'fixpackages' is -# also a script that can be run at any given time to force -# the same actions. -# 'gpg' enables basic verification of Manifest files using gpg. -# This features is UNDER DEVELOPMENT and reacts to features -# of strict and severe. Heavy use of gpg sigs is coming. -# 'keeptemp' prevents the clean phase from deleting the temp files ($T) -# from a merge. -# 'keepwork' prevents the clean phase from deleting the WORKDIR. -# 'maketest' causes ebuilds to perform testing phases if they are capable -# of it. Some packages support this automaticaly via makefiles. -# 'noauto' causes ebuild to perform only the action requested and -# not any other required actions like clean or unpack -- for -# debugging purposes only. -# 'noclean' prevents portage from removing the source and temporary files -# after a merge -- for debugging purposes only. -# 'nostrip' prevents the stripping of binaries. -# 'notitles' disables xterm titlebar updates (which contain status info). -# 'sandbox' enables sandboxing when running emerge and ebuild. -# 'strict' causes portage to react strongly to conditions that are -# potentially dangerous, like missing/incorrect Manifest files. -# 'userpriv' allows portage to drop root privileges while it is compiling, -# as a security measure. As a side effect this can remove -# sandbox access violations for users. -# 'usersandbox' enables sandboxing while portage is running under userpriv. -#FEATURES="sandbox buildpkg ccache distcc userpriv usersandbox notitles noclean noauto cvs keeptemp keepwork autoaddcvs" -#FEATURES="sandbox ccache distcc distlocks autoaddcvs" -# -# CCACHE_SIZE sets the space use limitations for ccache. The default size is -# 2G, and will be set if not defined otherwise and ccache is in features. -# Portage will set the default ccache dir if it is not present in the -# user's environment, for userpriv it sets: ${PORTAGE_TMPDIR}/ccache -# (/var/tmp/ccache), and for regular use the default is /root/.ccache. -# Sizes are specified with 'G' 'M' or 'K'. -# '2G' for 2 gigabytes, '2048M' for 2048 megabytes (same as 2G). -#CCACHE_SIZE="512M" -# -# DISTCC_DIR sets the temporary space used by distcc. -#DISTCC_DIR="${PORTAGE_TMPDIR}/.distcc" -# -# RSYNC_EXCLUDEFROM is a file that portage will pass to rsync when it updates -# the portage tree. Specific chunks of the tree may be excluded from -# consideration. This may cause dependency failures if you are not careful. -# The file format is one pattern per line, blanks and ';' or '#' lines are -# comments. See 'man rsync' for more details on the exclude-from format. -#RSYNC_EXCLUDEFROM=/etc/portage/rsync_excludes - -# logging related variables: -# PORTAGE_LOG_CLASSES: selects messages to be logged, possible values are: -# info, warn, error, log -PORTAGE_LOG_CLASSES="warn error log" - -# PORTAGE_LOG_SYSTEM: selects the module(s) to process the log messages. Modules -# included in portage are (empty means logging is disabled): -# save (saves one log per package in $PORTAGE_TMPDIR/elogs) -# custom (passes all messages to $PORTAGE_LOG_COMMAND) -# syslog (sends all messages to syslog) -# mail (send all messages to the mailserver defined -# in $PORTAGE_LOG_MAILURI) -#PORTAGE_LOG_SYSTEM="save mail" - -# PORTAGE_LOG_COMMAND: only used with the "custom" logging module. Specifies a command -# to process log messages. Two variables are expanded: -# ${PACKAGE} - expands to the cpv entry of the processed -# package (see $PVR in ebuild(5)) -# ${LOGFILE} - absolute path to the logfile -#PORTAGE_LOG_COMMAND="/path/to/logprocessor -p ${PACKAGE} -f ${LOGFILE}" - -# PORTAGE_LOG_MAILURI: this variable holds all important settings for the mail -# module. In most cases listing the recipient adress and -# the receiving mailserver should be sufficient, but you can -# also use advanced settings like authentication or TLS. The -# full syntax is: -# adress [[user:passwd@]mailserver[:port]] -# where -# adress: recipient adress -# user: username for smtp auth (defaults to none) -# passwd: password for smtp auth (defaults to none) -# mailserver: smtp server that should be used to deliver the mail (defaults to localhost) -# port: port to use on the given smtp server (defaults to 25, values > 100000 indicate that starttls should be used on (port-100000)) -# Examples: -#PORTAGE_LOG_MAILURI="root@localhost localhost" (this is also the default setting) -#PORTAGE_LOG_MAILURI="user@some.domain mail.some.domain" (sends mails to user@some.domain using the mailserver mail.some.domain) -#PORTAGE_LOG_MAILURI="user@some.domain user:secret@mail.some.domain:100465" (this is left uncommented as a reader excercise ;) diff --git a/cnf/make.conf.arm b/cnf/make.conf.arm deleted file mode 100644 index e7d7167..0000000 --- a/cnf/make.conf.arm +++ /dev/null @@ -1,347 +0,0 @@ -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/cnf/make.conf.arm,v 1.35 2005/02/26 07:21:14 jstubbs Exp $ -# Contains local system settings for Portage system - -# Please review 'man make.conf' for more information. - -# Build-time functionality -# ======================== -# -# The USE variable is used to enable optional build-time functionality. For -# example, quite a few packages have optional X, gtk or GNOME functionality -# that can only be enabled or disabled at compile-time. Gentoo Linux has a -# very extensive set of USE variables described in our USE variable HOWTO at -# http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&chap=1 -# -# The available list of use flags with descriptions is in your portage tree. -# Use 'less' to view them: --> less /usr/portage/profiles/use.desc <-- -# -# 'ufed' is an ncurses/dialog interface available in portage to make handling -# useflags for you. 'emerge app-portage/ufed' -# -# Example: -#USE="X gtk gnome -alsa" - -# Host Setting -# ============ -# -# DO NOT CHANGE THIS SETTING UNLESS YOU ARE USING STAGE1! -# It's very important you select the right CHOST from the start. A wrong -# CHOST could easily lead to weird errors either in compiling or running. -# -# Netwinder (or any StrongArm110): armv4l-unknown-linux-gnu -# nslu2: armvbe-unknown-linux-gnu -# Generic ARM: arm-unknown-linux-gnu -# -CHOST="armv4l-unknown-linux-gnu" - -# Host and optimization settings -# ============================== -# -# For optimal performance, enable a CFLAGS setting appropriate for your CPU. -# -# Please note that if you experience strange issues with a package, it may be -# due to gcc's optimizations interacting in a strange way. Please test the -# package (and in some cases the libraries it uses) at default optimizations -# before reporting errors to developers. -# -# -mcpu=<cpu-type> means optimize code for the particular type of CPU without -# breaking compatibility with other CPUs. -# -# -march=<cpu-type> means to take full advantage of the ABI and instructions -# for the particular CPU; this will break compatibility with older CPUs (for -# example, -march=xscale code will not run on a StrongARM 11x0, and -# -march=strongarm110 code will not run on a regular StrongARM). -# -# Don't use -O3. Even -O2 may be risky in some cases. -# -# For a full listing of supported CPU models, please refer to the GCC website: -# http://gcc.gnu.org/onlinedocs/gcc-3.3/gcc/ARM-Options.html -# -# Netwinder: -#CFLAGS="-mcpu=strongarm110 -O2 -pipe" -# NSLU2: -#CFLAGS="-mcpu=armeb -O2 -pipe" - -# If you set a CFLAGS above, then this line will set your default C++ flags to -# the same settings. -#CXXFLAGS="${CFLAGS}" - -# Advanced Masking -# ================ -# -# Gentoo is using a new masking system to allow for easier stability testing -# on packages. KEYWORDS are used in ebuilds to mask and unmask packages based -# on the platform they are set for. A special form has been added that -# indicates packages and revisions that are expected to work, but have not yet -# been approved for the stable set. '~arch' is a superset of 'arch' which -# includes the unstable, in testing, packages. Users of the 'x86' architecture -# would add '~x86' to ACCEPT_KEYWORDS to enable unstable/testing packages. -# '~ppc', '~sparc' are the unstable KEYWORDS for their respective platforms. -# -# Please note that this is not for development, alpha, beta, nor cvs release -# packages. "Broken" packages will not be added to testing and should not be -# requested to be added. Alternative routes are available to developers -# for experimental packages, and it is at their discretion to use them. -# -# DO NOT PUT ANYTHING BUT YOUR SPECIFIC ~ARCHITECTURE IN THE LIST. -# IF YOU ARE UNSURE OF YOUR ARCH, OR THE IMPLICATIONS, DO NOT MODIFY THIS. -# -#ACCEPT_KEYWORDS="~arch" - -# Portage Directories -# =================== -# -# Each of these settings controls an aspect of portage's storage and file -# system usage. If you change any of these, be sure it is available when -# you try to use portage. *** DO NOT INCLUDE A TRAILING "/" *** -# -# PORTAGE_TMPDIR is the location portage will use for compilations and -# temporary storage of data. This can get VERY large depending upon -# the application being installed. -#PORTAGE_TMPDIR=/var/tmp -# -# PORTDIR is the location of the portage tree. This is the repository -# for all profile information as well as all ebuilds. This directory -# itself can reach 200M. If you change this, you must update your -# /etc/make.profile symlink accordingly. -#PORTDIR=/usr/portage -# -# DISTDIR is where all of the source code tarballs will be placed for -# emerges. The source code is maintained here unless you delete -# it. The entire repository of tarballs for gentoo is 9G. This is -# considerably more than any user will ever download. 2-3G is -# a large DISTDIR. -#DISTDIR=${PORTDIR}/distfiles -# -# PKGDIR is the location of binary packages that you can have created -# with '--buildpkg' or '-b' while emerging a package. This can get -# upto several hundred megs, or even a few gigs. -#PKGDIR=${PORTDIR}/packages -# -# PORT_LOGDIR is the location where portage will store all the logs it -# creates from each individual merge. They are stored as NNNN-$PF.log -# in the directory specified. This is disabled until you enable it by -# providing a directory. Permissions will be modified as needed IF the -# directory exists, otherwise logging will be disabled. NNNN is the -# increment at the time the log is created. Logs are thus sequential. -#PORT_LOGDIR=/var/log/portage -# -# PORTDIR_OVERLAY is a directory where local ebuilds may be stored without -# concern that they will be deleted by rsync updates. Default is not -# defined. -#PORTDIR_OVERLAY=/usr/local/portage - -# Fetching files -# ============== -# -# If you need to set a proxy for wget or lukemftp, add the appropriate "export -# ftp_proxy=<proxy>" and "export http_proxy=<proxy>" lines to /etc/profile if -# all users on your system should use them. -# -# Portage uses wget by default. Here are some settings for some alternate -# downloaders -- note that you need to merge these programs first before they -# will be available. -# -# Default fetch command (5 tries, passive ftp for firewall compatibility) -#FETCHCOMMAND="/usr/bin/wget -t 5 --passive-ftp \${URI} -P \${DISTDIR}" -#RESUMECOMMAND="/usr/bin/wget -c -t 5 --passive-ftp \${URI} -P \${DISTDIR}" -# -# Using wget, ratelimiting downloads -#FETCHCOMMAND="/usr/bin/wget -t 5 --passive-ftp --limit-rate=200k \${URI} -P \${DISTDIR}" -#RESUMECOMMAND="/usr/bin/wget -c -t 5 --passive-ftp --limit-rate=200k \${URI} -P \${DISTDIR}" -# -# Lukemftp (BSD ftp): -#FETCHCOMMAND="/usr/bin/lukemftp -s -a -o \${DISTDIR}/\${FILE} \${URI}" -#RESUMECOMMAND="/usr/bin/lukemftp -s -a -R -o \${DISTDIR}/\${FILE} \${URI}" -# -# -# Portage uses GENTOO_MIRRORS to specify mirrors to use for source retrieval. -# The list is a space separated list which is read left to right. If you use -# another mirror we highly recommend leaving the default mirror at the end of -# the list so that portage will fall back to it if the files cannot be found -# on your specified mirror. We _HIGHLY_ recommend that you change this setting -# to a nearby mirror by merging and using the 'mirrorselect' tool. -#GENTOO_MIRRORS="<your_mirror_here> http://gentoo.osuosl.org http://www.ibiblio.org/pub/Linux/distributions/gentoo" -# -# Portage uses PORTAGE_BINHOST to specify mirrors for prebuilt-binary packages. -# The list is a single entry specifying the full address of the directory -# serving the tbz2's for your system. Running emerge with either '--getbinpkg' -# or '--getbinpkgonly' will cause portage to retrieve the metadata from all -# packages in the directory specified, and use that data to determine what will -# be downloaded and merged. '-g' or '-gK' are the recommend parameters. Please -# consult the man pages and 'emerge --help' for more information. For FTP, the -# default connection is passive -- If you require an active connection, affix -# an asterisk (*) to the end of the host:port string before the path. -#PORTAGE_BINHOST="http://grp.mirror.site/gentoo/grp/1.4/i686/athlon-xp/" -# This ftp connection is passive ftp. -#PORTAGE_BINHOST="ftp://login:pass@grp.mirror.site/pub/grp/i686/athlon-xp/" -# This ftp connection is active ftp. -#PORTAGE_BINHOST="ftp://login:pass@grp.mirror.site:21*/pub/grp/i686/athlon-xp/" - -# Synchronizing Portage -# ===================== -# -# Each of these settings affects how Gentoo synchronizes your Portage tree. -# Synchronization is handled by rsync and these settings allow some control -# over how it is done. -# -# -# SYNC is the server used by rsync to retrieve a localized rsync mirror -# rotation. This allows you to select servers that are geographically -# close to you, yet still distribute the load over a number of servers. -# Please do not single out specific rsync mirrors. Doing so places undue -# stress on particular mirrors. Instead you may use one of the following -# continent specific rotations: -# -# Default: "rsync://rsync.gentoo.org/gentoo-portage" -# North America: "rsync://rsync.namerica.gentoo.org/gentoo-portage" -# South America: "rsync://rsync.samerica.gentoo.org/gentoo-portage" -# Europe: "rsync://rsync.europe.gentoo.org/gentoo-portage" -# Asia: "rsync://rsync.asia.gentoo.org/gentoo-portage" -# Australia: "rsync://rsync.au.gentoo.org/gentoo-portage" -#SYNC="rsync://rsync.gentoo.org/gentoo-portage" -# -# RSYNC_RETRIES sets the number of times portage will attempt to retrieve -# a current portage tree before it exits with an error. This allows -# for a more successful retrieval without user intervention most times. -#RSYNC_RETRIES="3" -# -# RSYNC_TIMEOUT sets the length of time rsync will wait before it times out -# on a connection. Most users will benefit from this setting as it will -# reduce the amount of 'dead air' they experience when they run across -# the occasional, unreachable mirror. Dialup users might want to set this -# value up around the 300 second mark. -#RSYNC_TIMEOUT=180 - -# Advanced Features -# ================= -# -# MAKEOPTS provides extra options that may be passed to 'make' when a -# program is compiled. Presently the only use is for specifying -# the number of parallel makes (-j) to perform. The suggested number -# for parallel makes is CPUs+1. -#MAKEOPTS="-j2" -# -# PORTAGE_NICENESS provides a default increment to emerge's niceness level. -# Note: This is an increment. Running emerge in a niced environment will -# reduce it further. Default is unset. -#PORTAGE_NICENESS=3 -# -# PORTAGE_TMPFS is a location where portage may create temporary files. -# If specified, portage will use this directory whenever possible -# for all rapid operations such as lockfiles and transient data. -# It is _highly_ recommended that this be a tmpfs or ramdisk. Do not -# set this to anything that does not give a significant performance -# enhancement and proper FS compliance for locks and read/write. -# /dev/shm is a glibc mandated tmpfs, and should be a reasonable -# setting for all linux kernel+glibc based systems. -#PORTAGE_TMPFS="/dev/shm" -# -# FEATURES are settings that affect the functionality of portage. Most of -# these settings are for developer use, but some are available to non- -# developers as well. -# -# 'autoaddcvs' causes portage to automatically try to add files to cvs -# that will have to be added later. Done at generation times -# and only has an effect when 'cvs' is also set. -# 'buildpkg' causes binary packages to be created of all packages that -# are being merged. -# 'ccache' enables ccache support via CC. -# 'collision-protect' -# prevents packages from overwriting files that are owned by -# another package or by no package at all. -# 'cvs' causes portage to enable all cvs features (commits, adds), -# and to apply all USE flags in SRC_URI for digests -- for -# developers only. -# 'digest' causes digests to be generated for all packages being merged. -# 'distcc' enables distcc support via CC. -# 'distlocks' enables distfiles locking using fcntl or hardlinks. This -# is enabled by default. Tools exist to help clean the locks -# after crashes: /usr/lib/portage/bin/clean_locks. -# 'fixpackages' allows portage to fix binary packages that are stored in -# PKGDIR. This can consume a lot of time. 'fixpackages' is -# also a script that can be run at any given time to force -# the same actions. -# 'gpg' enables basic verification of Manifest files using gpg. -# This features is UNDER DEVELOPMENT and reacts to features -# of strict and severe. Heavy use of gpg sigs is coming. -# 'keeptemp' prevents the clean phase from deleting the temp files ($T) -# from a merge. -# 'keepwork' prevents the clean phase from deleting the WORKDIR. -# 'maketest' causes ebuilds to perform testing phases if they are capable -# of it. Some packages support this automaticaly via makefiles. -# 'noauto' causes ebuild to perform only the action requested and -# not any other required actions like clean or unpack -- for -# debugging purposes only. -# 'noclean' prevents portage from removing the source and temporary files -# after a merge -- for debugging purposes only. -# 'nostrip' prevents the stripping of binaries. -# 'notitles' disables xterm titlebar updates (which contain status info). -# 'sandbox' enables sandboxing when running emerge and ebuild. -# 'strict' causes portage to react strongly to conditions that are -# potentially dangerous, like missing/incorrect Manifest files. -# 'userpriv' allows portage to drop root privileges while it is compiling, -# as a security measure. As a side effect this can remove -# sandbox access violations for users. -# 'usersandbox' enables sandboxing while portage is running under userpriv. -#FEATURES="sandbox buildpkg ccache distcc userpriv usersandbox notitles noclean noauto cvs keeptemp keepwork autoaddcvs" -#FEATURES="sandbox ccache distcc distlocks autoaddcvs" -# -# CCACHE_SIZE sets the space use limitations for ccache. The default size is -# 2G, and will be set if not defined otherwise and ccache is in features. -# Portage will set the default ccache dir if it is not present in the -# user's environment, for userpriv it sets: ${PORTAGE_TMPDIR}/ccache -# (/var/tmp/ccache), and for regular use the default is /root/.ccache. -# Sizes are specified with 'G' 'M' or 'K'. -# '2G' for 2 gigabytes, '2048M' for 2048 megabytes (same as 2G). -#CCACHE_SIZE="512M" -# -# DISTCC_DIR sets the temporary space used by distcc. -#DISTCC_DIR="${PORTAGE_TMPDIR}/.distcc" -# -# RSYNC_EXCLUDEFROM is a file that portage will pass to rsync when it updates -# the portage tree. Specific chunks of the tree may be excluded from -# consideration. This may cause dependency failures if you are not careful. -# The file format is one pattern per line, blanks and ';' or '#' lines are -# comments. See 'man rsync' for more details on the exclude-from format. -#RSYNC_EXCLUDEFROM=/etc/portage/rsync_excludes - -# logging related variables: -# PORTAGE_LOG_CLASSES: selects messages to be logged, possible values are: -# info, warn, error, log -PORTAGE_LOG_CLASSES="warn error log" - -# PORTAGE_LOG_SYSTEM: selects the module(s) to process the log messages. Modules -# included in portage are (empty means logging is disabled): -# save (saves one log per package in $PORTAGE_TMPDIR/elogs) -# custom (passes all messages to $PORTAGE_LOG_COMMAND) -# syslog (sends all messages to syslog) -# mail (send all messages to the mailserver defined -# in $PORTAGE_LOG_MAILURI) -#PORTAGE_LOG_SYSTEM="save mail" - -# PORTAGE_LOG_COMMAND: only used with the "custom" logging module. Specifies a command -# to process log messages. Two variables are expanded: -# ${PACKAGE} - expands to the cpv entry of the processed -# package (see $PVR in ebuild(5)) -# ${LOGFILE} - absolute path to the logfile -#PORTAGE_LOG_COMMAND="/path/to/logprocessor -p ${PACKAGE} -f ${LOGFILE}" - -# PORTAGE_LOG_MAILURI: this variable holds all important settings for the mail -# module. In most cases listing the recipient adress and -# the receiving mailserver should be sufficient, but you can -# also use advanced settings like authentication or TLS. The -# full syntax is: -# adress [[user:passwd@]mailserver[:port]] -# where -# adress: recipient adress -# user: username for smtp auth (defaults to none) -# passwd: password for smtp auth (defaults to none) -# mailserver: smtp server that should be used to deliver the mail (defaults to localhost) -# port: port to use on the given smtp server (defaults to 25, values > 100000 indicate that starttls should be used on (port-100000)) -# Examples: -#PORTAGE_LOG_MAILURI="root@localhost localhost" (this is also the default setting) -#PORTAGE_LOG_MAILURI="user@some.domain mail.some.domain" (sends mails to user@some.domain using the mailserver mail.some.domain) -#PORTAGE_LOG_MAILURI="user@some.domain user:secret@mail.some.domain:100465" (this is left uncommented as a reader excercise ;) diff --git a/cnf/make.conf.hppa b/cnf/make.conf.hppa deleted file mode 100644 index 587b14b..0000000 --- a/cnf/make.conf.hppa +++ /dev/null @@ -1,356 +0,0 @@ -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/cnf/make.conf.hppa,v 1.41 2005/02/26 07:21:14 jstubbs Exp $ -# Contains local system settings for Portage system - -# Please review 'man make.conf' for more information. - -# Build-time functionality -# ======================== -# -# The USE variable is used to enable optional build-time functionality. For -# example, quite a few packages have optional X, gtk or GNOME functionality -# that can only be enabled or disabled at compile-time. Gentoo Linux has a -# very extensive set of USE variables described in our USE variable HOWTO at -# http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&chap=1 -# -# The available list of use flags with descriptions is in your portage tree. -# Use 'less' to view them: --> less /usr/portage/profiles/use.desc <-- -# -# 'ufed' is an ncurses/dialog interface available in portage to make handling -# useflags for you. 'emerge app-portage/ufed' -# -# Example: -#USE="X gtk gnome -alsa" - -# Host Setting -# ============ -# -# DO NOT CHANGE THIS SETTING UNLESS YOU ARE USING STAGE1! -# The generic CHOST value for hppa is hppa-unknown-linux-gnu. -# But you might want to use hppa1.1-unknown-linux-gnu or hppa2.0-unknown-linux-gnu -# according to your station. -# -CHOST="hppa-unknown-linux-gnu" -#CHOST="hppa1.1-unknown-linux-gnu" -#CHOST="hppa2.0-unknown-linux-gnu" - -# Host and optimization settings -# ============================== -# -# For optimal performance, enable a CFLAGS setting appropriate for your CPU. -# -# Please note that if you experience strange issues with a package, it may be -# due to gcc's optimizations interacting in a strange way. Please test the -# package (and in some cases the libraries it uses) at default optimizations -# before reporting errors to developers. -# -# -march=<cpu-type> means to take full advantage of the ABI and instructions -# for the particular CPU; this will break compatibility with older CPUs (for -# example, -march=2.0 code will not run on a regular hppa1.1 station) -# -# -mschedule=cpu-type create schedule code according to the constraints for the machine -# cpu-type. The choices for cpu-type are 700 7100, 7100LC, 7200, and 8000. -# Use 'cat /proc/cpuinfo' to know the right schedule for your hppa. -# Note that you must use 7100LC for 7300LC. -# -# Architectures types supported in gcc-3.2 and higher: 1.0, 1.1 and 2.0 -# Note that 64bit userspace is not yet implemented. -# -# Decent examples: -# - -# Use this one if you have a hppa1.1 -#CFLAGS="-march=1.1 -O2 -pipe -mschedule=7100LC" - -# Or this one if you have a hppa2.0 -# Note that -march=2.0 was unstable on some stations. -# -march=1.0 will create problems too. -#CFLAGS="-O2 -pipe -mschedule=8000" - - -# If you set a CFLAGS above, then this line will set your default C++ flags to -# the same settings. -#CXXFLAGS="${CFLAGS}" - -# Btw it's recommended to use this setting for stability. -# There are still many bugs with higher level of optimisation. -#CXXFLAGS="-O1 -pipe" - -# Advanced Masking -# ================ -# -# Gentoo is using a new masking system to allow for easier stability testing -# on packages. KEYWORDS are used in ebuilds to mask and unmask packages based -# on the platform they are set for. A special form has been added that -# indicates packages and revisions that are expected to work, but have not yet -# been approved for the stable set. '~arch' is a superset of 'arch' which -# includes the unstable, in testing, packages. Users of the 'hppa' architecture -# would add '~hppa' to ACCEPT_KEYWORDS to enable unstable/testing packages. -# '~ppc', '~sparc' are the unstable KEYWORDS for their respective platforms. -# -# Please note that this is not for development, alpha, beta, nor cvs release -# packages. "Broken" packages will not be added to testing and should not be -# requested to be added. Alternative routes are available to developers -# for experimental packages, and it is at their discretion to use them. -# -# DO NOT PUT ANYTHING BUT YOUR SPECIFIC ~ARCHITECTURE IN THE LIST. -# IF YOU ARE UNSURE OF YOUR ARCH, OR THE IMPLICATIONS, DO NOT MODIFY THIS. -# -#ACCEPT_KEYWORDS="~arch" - -# Portage Directories -# =================== -# -# Each of these settings controls an aspect of portage's storage and file -# system usage. If you change any of these, be sure it is available when -# you try to use portage. *** DO NOT INCLUDE A TRAILING "/" *** -# -# PORTAGE_TMPDIR is the location portage will use for compilations and -# temporary storage of data. This can get VERY large depending upon -# the application being installed. -#PORTAGE_TMPDIR=/var/tmp -# -# PORTDIR is the location of the portage tree. This is the repository -# for all profile information as well as all ebuilds. This directory -# itself can reach 200M. If you change this, you must update your -# /etc/make.profile symlink accordingly. -#PORTDIR=/usr/portage -# -# DISTDIR is where all of the source code tarballs will be placed for -# emerges. The source code is maintained here unless you delete -# it. The entire repository of tarballs for gentoo is 9G. This is -# considerably more than any user will ever download. 2-3G is -# a large DISTDIR. -#DISTDIR=${PORTDIR}/distfiles -# -# PKGDIR is the location of binary packages that you can have created -# with '--buildpkg' or '-b' while emerging a package. This can get -# upto several hundred megs, or even a few gigs. -#PKGDIR=${PORTDIR}/packages -# -# PORT_LOGDIR is the location where portage will store all the logs it -# creates from each individual merge. They are stored as NNNN-$PF.log -# in the directory specified. This is disabled until you enable it by -# providing a directory. Permissions will be modified as needed IF the -# directory exists, otherwise logging will be disabled. NNNN is the -# increment at the time the log is created. Logs are thus sequential. -#PORT_LOGDIR=/var/log/portage -# -# PORTDIR_OVERLAY is a directory where local ebuilds may be stored without -# concern that they will be deleted by rsync updates. Default is not -# defined. -#PORTDIR_OVERLAY=/usr/local/portage - -# Fetching files -# ============== -# -# If you need to set a proxy for wget or lukemftp, add the appropriate "export -# ftp_proxy=<proxy>" and "export http_proxy=<proxy>" lines to /etc/profile if -# all users on your system should use them. -# -# Portage uses wget by default. Here are some settings for some alternate -# downloaders -- note that you need to merge these programs first before they -# will be available. -# -# Default fetch command (5 tries, passive ftp for firewall compatibility) -#FETCHCOMMAND="/usr/bin/wget -t 5 --passive-ftp \${URI} -P \${DISTDIR}" -#RESUMECOMMAND="/usr/bin/wget -c -t 5 --passive-ftp \${URI} -P \${DISTDIR}" -# -# Using wget, ratelimiting downloads -#FETCHCOMMAND="/usr/bin/wget -t 5 --passive-ftp --limit-rate=200k \${URI} -P \${DISTDIR}" -#RESUMECOMMAND="/usr/bin/wget -c -t 5 --passive-ftp --limit-rate=200k \${URI} -P \${DISTDIR}" -# -# Lukemftp (BSD ftp): -#FETCHCOMMAND="/usr/bin/lukemftp -s -a -o \${DISTDIR}/\${FILE} \${URI}" -#RESUMECOMMAND="/usr/bin/lukemftp -s -a -R -o \${DISTDIR}/\${FILE} \${URI}" -# -# -# Portage uses GENTOO_MIRRORS to specify mirrors to use for source retrieval. -# The list is a space separated list which is read left to right. If you use -# another mirror we highly recommend leaving the default mirror at the end of -# the list so that portage will fall back to it if the files cannot be found -# on your specified mirror. We _HIGHLY_ recommend that you change this setting -# to a nearby mirror by merging and using the 'mirrorselect' tool. -#GENTOO_MIRRORS="<your_mirror_here> http://gentoo.osuosl.org http://www.ibiblio.org/pub/Linux/distributions/gentoo" -# -# Portage uses PORTAGE_BINHOST to specify mirrors for prebuilt-binary packages. -# The list is a single entry specifying the full address of the directory -# serving the tbz2's for your system. Running emerge with either '--getbinpkg' -# or '--getbinpkgonly' will cause portage to retrieve the metadata from all -# packages in the directory specified, and use that data to determine what will -# be downloaded and merged. '-g' or '-gK' are the recommend parameters. Please -# consult the man pages and 'emerge --help' for more information. For FTP, the -# default connection is passive -- If you require an active connection, affix -# an asterisk (*) to the end of the host:port string before the path. -#PORTAGE_BINHOST="http://grp.mirror.site/gentoo/grp/1.4/i686/athlon-xp/" -# This ftp connection is passive ftp. -#PORTAGE_BINHOST="ftp://login:pass@grp.mirror.site/pub/grp/i686/athlon-xp/" -# This ftp connection is active ftp. -#PORTAGE_BINHOST="ftp://login:pass@grp.mirror.site:21*/pub/grp/i686/athlon-xp/" - -# Synchronizing Portage -# ===================== -# -# Each of these settings affects how Gentoo synchronizes your Portage tree. -# Synchronization is handled by rsync and these settings allow some control -# over how it is done. -# -# -# SYNC is the server used by rsync to retrieve a localized rsync mirror -# rotation. This allows you to select servers that are geographically -# close to you, yet still distribute the load over a number of servers. -# Please do not single out specific rsync mirrors. Doing so places undue -# stress on particular mirrors. Instead you may use one of the following -# continent specific rotations: -# -# Default: "rsync://rsync.gentoo.org/gentoo-portage" -# North America: "rsync://rsync.namerica.gentoo.org/gentoo-portage" -# South America: "rsync://rsync.samerica.gentoo.org/gentoo-portage" -# Europe: "rsync://rsync.europe.gentoo.org/gentoo-portage" -# Asia: "rsync://rsync.asia.gentoo.org/gentoo-portage" -# Australia: "rsync://rsync.au.gentoo.org/gentoo-portage" -#SYNC="rsync://rsync.gentoo.org/gentoo-portage" -# -# RSYNC_RETRIES sets the number of times portage will attempt to retrieve -# a current portage tree before it exits with an error. This allows -# for a more successful retrieval without user intervention most times. -#RSYNC_RETRIES="3" -# -# RSYNC_TIMEOUT sets the length of time rsync will wait before it times out -# on a connection. Most users will benefit from this setting as it will -# reduce the amount of 'dead air' they experience when they run across -# the occasional, unreachable mirror. Dialup users might want to set this -# value up around the 300 second mark. -#RSYNC_TIMEOUT=180 - -# Advanced Features -# ================= -# -# MAKEOPTS provides extra options that may be passed to 'make' when a -# program is compiled. Presently the only use is for specifying -# the number of parallel makes (-j) to perform. The suggested number -# for parallel makes is CPUs+1. -#MAKEOPTS="-j2" -# -# PORTAGE_NICENESS provides a default increment to emerge's niceness level. -# Note: This is an increment. Running emerge in a niced environment will -# reduce it further. Default is unset. -#PORTAGE_NICENESS=3 -# -# PORTAGE_TMPFS is a location where portage may create temporary files. -# If specified, portage will use this directory whenever possible -# for all rapid operations such as lockfiles and transient data. -# It is _highly_ recommended that this be a tmpfs or ramdisk. Do not -# set this to anything that does not give a significant performance -# enhancement and proper FS compliance for locks and read/write. -# /dev/shm is a glibc mandated tmpfs, and should be a reasonable -# setting for all linux kernel+glibc based systems. -#PORTAGE_TMPFS="/dev/shm" -# -# FEATURES are settings that affect the functionality of portage. Most of -# these settings are for developer use, but some are available to non- -# developers as well. -# -# 'autoaddcvs' causes portage to automatically try to add files to cvs -# that will have to be added later. Done at generation times -# and only has an effect when 'cvs' is also set. -# 'buildpkg' causes binary packages to be created of all packages that -# are being merged. -# 'ccache' enables ccache support via CC. -# 'collision-protect' -# prevents packages from overwriting files that are owned by -# another package or by no package at all. -# 'cvs' causes portage to enable all cvs features (commits, adds), -# and to apply all USE flags in SRC_URI for digests -- for -# developers only. -# 'digest' causes digests to be generated for all packages being merged. -# 'distcc' enables distcc support via CC. -# 'distlocks' enables distfiles locking using fcntl or hardlinks. This -# is enabled by default. Tools exist to help clean the locks -# after crashes: /usr/lib/portage/bin/clean_locks. -# 'fixpackages' allows portage to fix binary packages that are stored in -# PKGDIR. This can consume a lot of time. 'fixpackages' is -# also a script that can be run at any given time to force -# the same actions. -# 'gpg' enables basic verification of Manifest files using gpg. -# This features is UNDER DEVELOPMENT and reacts to features -# of strict and severe. Heavy use of gpg sigs is coming. -# 'keeptemp' prevents the clean phase from deleting the temp files ($T) -# from a merge. -# 'keepwork' prevents the clean phase from deleting the WORKDIR. -# 'maketest' causes ebuilds to perform testing phases if they are capable -# of it. Some packages support this automaticaly via makefiles. -# 'noauto' causes ebuild to perform only the action requested and -# not any other required actions like clean or unpack -- for -# debugging purposes only. -# 'noclean' prevents portage from removing the source and temporary files -# after a merge -- for debugging purposes only. -# 'nostrip' prevents the stripping of binaries. -# 'notitles' disables xterm titlebar updates (which contain status info). -# 'sandbox' enables sandboxing when running emerge and ebuild. -# 'strict' causes portage to react strongly to conditions that are -# potentially dangerous, like missing/incorrect Manifest files. -# 'userpriv' allows portage to drop root privileges while it is compiling, -# as a security measure. As a side effect this can remove -# sandbox access violations for users. -# 'usersandbox' enables sandboxing while portage is running under userpriv. -#FEATURES="sandbox buildpkg ccache distcc userpriv usersandbox notitles noclean noauto cvs keeptemp keepwork autoaddcvs" -#FEATURES="sandbox ccache distcc distlocks autoaddcvs" -# -# CCACHE_SIZE sets the space use limitations for ccache. The default size is -# 2G, and will be set if not defined otherwise and ccache is in features. -# Portage will set the default ccache dir if it is not present in the -# user's environment, for userpriv it sets: ${PORTAGE_TMPDIR}/ccache -# (/var/tmp/ccache), and for regular use the default is /root/.ccache. -# Sizes are specified with 'G' 'M' or 'K'. -# '2G' for 2 gigabytes, '2048M' for 2048 megabytes (same as 2G). -#CCACHE_SIZE="512M" -# -# DISTCC_DIR sets the temporary space used by distcc. -#DISTCC_DIR="${PORTAGE_TMPDIR}/.distcc" -# -# RSYNC_EXCLUDEFROM is a file that portage will pass to rsync when it updates -# the portage tree. Specific chunks of the tree may be excluded from -# consideration. This may cause dependency failures if you are not careful. -# The file format is one pattern per line, blanks and ';' or '#' lines are -# comments. See 'man rsync' for more details on the exclude-from format. -#RSYNC_EXCLUDEFROM=/etc/portage/rsync_excludes - -# logging related variables: -# PORTAGE_LOG_CLASSES: selects messages to be logged, possible values are: -# info, warn, error, log -PORTAGE_LOG_CLASSES="warn error log" - -# PORTAGE_LOG_SYSTEM: selects the module(s) to process the log messages. Modules -# included in portage are (empty means logging is disabled): -# save (saves one log per package in $PORTAGE_TMPDIR/elogs) -# custom (passes all messages to $PORTAGE_LOG_COMMAND) -# syslog (sends all messages to syslog) -# mail (send all messages to the mailserver defined -# in $PORTAGE_LOG_MAILURI) -#PORTAGE_LOG_SYSTEM="save mail" - -# PORTAGE_LOG_COMMAND: only used with the "custom" logging module. Specifies a command -# to process log messages. Two variables are expanded: -# ${PACKAGE} - expands to the cpv entry of the processed -# package (see $PVR in ebuild(5)) -# ${LOGFILE} - absolute path to the logfile -#PORTAGE_LOG_COMMAND="/path/to/logprocessor -p ${PACKAGE} -f ${LOGFILE}" - -# PORTAGE_LOG_MAILURI: this variable holds all important settings for the mail -# module. In most cases listing the recipient adress and -# the receiving mailserver should be sufficient, but you can -# also use advanced settings like authentication or TLS. The -# full syntax is: -# adress [[user:passwd@]mailserver[:port]] -# where -# adress: recipient adress -# user: username for smtp auth (defaults to none) -# passwd: password for smtp auth (defaults to none) -# mailserver: smtp server that should be used to deliver the mail (defaults to localhost) -# port: port to use on the given smtp server (defaults to 25, values > 100000 indicate that starttls should be used on (port-100000)) -# Examples: -#PORTAGE_LOG_MAILURI="root@localhost localhost" (this is also the default setting) -#PORTAGE_LOG_MAILURI="user@some.domain mail.some.domain" (sends mails to user@some.domain using the mailserver mail.some.domain) -#PORTAGE_LOG_MAILURI="user@some.domain user:secret@mail.some.domain:100465" (this is left uncommented as a reader excercise ;) diff --git a/cnf/make.conf.ia64 b/cnf/make.conf.ia64 deleted file mode 100644 index f98e35f..0000000 --- a/cnf/make.conf.ia64 +++ /dev/null @@ -1,318 +0,0 @@ -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/cnf/make.conf.ia64,v 1.5 2005/02/26 07:21:14 jstubbs Exp $ -# Contains local system settings for Portage system - -# Please review 'man make.conf' for more information. - -# Build-time functionality -# ======================== -# -# The USE variable is used to enable optional build-time functionality. For -# example, quite a few packages have optional X, gtk or GNOME functionality -# that can only be enabled or disabled at compile-time. Gentoo Linux has a -# very extensive set of USE variables described in our USE variable HOWTO at -# http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&chap=1 -# -# The available list of use flags with descriptions is in your portage tree. -# Use 'less' to view them: --> less /usr/portage/profiles/use.desc <-- -# -# 'ufed' is an ncurses/dialog interface available in portage to make handling -# useflags for you. 'emerge app-portage/ufed' -# -# Example: -#USE="X gtk gnome -alsa" - -# Host Setting -# ============ -# -# All Itanium systems should use this host setting: - -CHOST="ia64-unknown-linux-gnu" - -# Host and optimization settings -# ============================== -# -#CFLAGS="-O2 -pipe" - -# If you set a CFLAGS above, then this line will set your default C++ flags to -# the same settings. -#CXXFLAGS="${CFLAGS}" - -# Advanced Masking -# ================ -# -# Gentoo is using a new masking system to allow for easier stability testing -# on packages. KEYWORDS are used in ebuilds to mask and unmask packages based -# on the platform they are set for. A special form has been added that -# indicates packages and revisions that are expected to work, but have not yet -# been approved for the stable set. '~arch' is a superset of 'arch' which -# includes the unstable, in testing, packages. Users of the 'x86' architecture -# would add '~x86' to ACCEPT_KEYWORDS to enable unstable/testing packages. -# '~ppc', '~sparc' are the unstable KEYWORDS for their respective platforms. -# -# Please note that this is not for development, alpha, beta, nor cvs release -# packages. "Broken" packages will not be added to testing and should not be -# requested to be added. Alternative routes are available to developers -# for experimental packages, and it is at their discretion to use them. -# -# DO NOT PUT ANYTHING BUT YOUR SPECIFIC ~ARCHITECTURE IN THE LIST. -# IF YOU ARE UNSURE OF YOUR ARCH, OR THE IMPLICATIONS, DO NOT MODIFY THIS. -# -#ACCEPT_KEYWORDS="~arch" - -# Portage Directories -# =================== -# -# Each of these settings controls an aspect of portage's storage and file -# system usage. If you change any of these, be sure it is available when -# you try to use portage. *** DO NOT INCLUDE A TRAILING "/" *** -# -# PORTAGE_TMPDIR is the location portage will use for compilations and -# temporary storage of data. This can get VERY large depending upon -# the application being installed. -#PORTAGE_TMPDIR=/var/tmp -# -# PORTDIR is the location of the portage tree. This is the repository -# for all profile information as well as all ebuilds. This directory -# itself can reach 200M. If you change this, you must update your -# /etc/make.profile symlink accordingly. -#PORTDIR=/usr/portage -# -# DISTDIR is where all of the source code tarballs will be placed for -# emerges. The source code is maintained here unless you delete -# it. The entire repository of tarballs for gentoo is 9G. This is -# considerably more than any user will ever download. 2-3G is -# a large DISTDIR. -#DISTDIR=${PORTDIR}/distfiles -# -# PKGDIR is the location of binary packages that you can have created -# with '--buildpkg' or '-b' while emerging a package. This can get -# upto several hundred megs, or even a few gigs. -#PKGDIR=${PORTDIR}/packages -# -# PORT_LOGDIR is the location where portage will store all the logs it -# creates from each individual merge. They are stored as NNNN-$PF.log -# in the directory specified. This is disabled until you enable it by -# providing a directory. Permissions will be modified as needed IF the -# directory exists, otherwise logging will be disabled. NNNN is the -# increment at the time the log is created. Logs are thus sequential. -#PORT_LOGDIR=/var/log/portage -# -# PORTDIR_OVERLAY is a directory where local ebuilds may be stored without -# concern that they will be deleted by rsync updates. Default is not -# defined. -#PORTDIR_OVERLAY=/usr/local/portage - -# Fetching files -# ============== -# -# If you need to set a proxy for wget or lukemftp, add the appropriate "export -# ftp_proxy=<proxy>" and "export http_proxy=<proxy>" lines to /etc/profile if -# all users on your system should use them. -# -# Portage uses wget by default. Here are some settings for some alternate -# downloaders -- note that you need to merge these programs first before they -# will be available. -# -# Default fetch command (5 tries, passive ftp for firewall compatibility) -#FETCHCOMMAND="/usr/bin/wget -t 5 --passive-ftp \${URI} -P \${DISTDIR}" -#RESUMECOMMAND="/usr/bin/wget -c -t 5 --passive-ftp \${URI} -P \${DISTDIR}" -# -# Using wget, ratelimiting downloads -#FETCHCOMMAND="/usr/bin/wget -t 5 --passive-ftp --limit-rate=200k \${URI} -P \${DISTDIR}" -#RESUMECOMMAND="/usr/bin/wget -c -t 5 --passive-ftp --limit-rate=200k \${URI} -P \${DISTDIR}" -# -# Lukemftp (BSD ftp): -#FETCHCOMMAND="/usr/bin/lukemftp -s -a -o \${DISTDIR}/\${FILE} \${URI}" -#RESUMECOMMAND="/usr/bin/lukemftp -s -a -R -o \${DISTDIR}/\${FILE} \${URI}" -# -# -# Portage uses GENTOO_MIRRORS to specify mirrors to use for source retrieval. -# The list is a space separated list which is read left to right. If you use -# another mirror we highly recommend leaving the default mirror at the end of -# the list so that portage will fall back to it if the files cannot be found -# on your specified mirror. We _HIGHLY_ recommend that you change this setting -# to a nearby mirror by merging and using the 'mirrorselect' tool. -#GENTOO_MIRRORS="<your_mirror_here> http://gentoo.osuosl.org http://www.ibiblio.org/pub/Linux/distributions/gentoo" -# -# Portage uses PORTAGE_BINHOST to specify mirrors for prebuilt-binary packages. -# The list is a single entry specifying the full address of the directory -# serving the tbz2's for your system. Running emerge with either '--getbinpkg' -# or '--getbinpkgonly' will cause portage to retrieve the metadata from all -# packages in the directory specified, and use that data to determine what will -# be downloaded and merged. '-g' or '-gK' are the recommend parameters. Please -# consult the man pages and 'emerge --help' for more information. For FTP, the -# default connection is passive -- If you require an active connection, affix -# an asterisk (*) to the end of the host:port string before the path. -#PORTAGE_BINHOST="http://grp.mirror.site/gentoo/grp/1.4/i686/athlon-xp/" -# This ftp connection is passive ftp. -#PORTAGE_BINHOST="ftp://login:pass@grp.mirror.site/pub/grp/i686/athlon-xp/" -# This ftp connection is active ftp. -#PORTAGE_BINHOST="ftp://login:pass@grp.mirror.site:21*/pub/grp/i686/athlon-xp/" - -# Synchronizing Portage -# ===================== -# -# Each of these settings affects how Gentoo synchronizes your Portage tree. -# Synchronization is handled by rsync and these settings allow some control -# over how it is done. -# -# -# SYNC is the server used by rsync to retrieve a localized rsync mirror -# rotation. This allows you to select servers that are geographically -# close to you, yet still distribute the load over a number of servers. -# Please do not single out specific rsync mirrors. Doing so places undue -# stress on particular mirrors. Instead you may use one of the following -# continent specific rotations: -# -# Default: "rsync://rsync.gentoo.org/gentoo-portage" -# North America: "rsync://rsync.namerica.gentoo.org/gentoo-portage" -# South America: "rsync://rsync.samerica.gentoo.org/gentoo-portage" -# Europe: "rsync://rsync.europe.gentoo.org/gentoo-portage" -# Asia: "rsync://rsync.asia.gentoo.org/gentoo-portage" -# Australia: "rsync://rsync.au.gentoo.org/gentoo-portage" -#SYNC="rsync://rsync.gentoo.org/gentoo-portage" -# -# RSYNC_RETRIES sets the number of times portage will attempt to retrieve -# a current portage tree before it exits with an error. This allows -# for a more successful retrieval without user intervention most times. -#RSYNC_RETRIES="3" -# -# RSYNC_TIMEOUT sets the length of time rsync will wait before it times out -# on a connection. Most users will benefit from this setting as it will -# reduce the amount of 'dead air' they experience when they run across -# the occasional, unreachable mirror. Dialup users might want to set this -# value up around the 300 second mark. -#RSYNC_TIMEOUT=180 - -# Advanced Features -# ================= -# -# MAKEOPTS provides extra options that may be passed to 'make' when a -# program is compiled. Presently the only use is for specifying -# the number of parallel makes (-j) to perform. The suggested number -# for parallel makes is CPUs+1. -#MAKEOPTS="-j2" -# -# PORTAGE_NICENESS provides a default increment to emerge's niceness level. -# Note: This is an increment. Running emerge in a niced environment will -# reduce it further. Default is unset. -#PORTAGE_NICENESS=3 -# -# PORTAGE_TMPFS is a location where portage may create temporary files. -# If specified, portage will use this directory whenever possible -# for all rapid operations such as lockfiles and transient data. -# It is _highly_ recommended that this be a tmpfs or ramdisk. Do not -# set this to anything that does not give a significant performance -# enhancement and proper FS compliance for locks and read/write. -# /dev/shm is a glibc mandated tmpfs, and should be a reasonable -# setting for all linux kernel+glibc based systems. -#PORTAGE_TMPFS="/dev/shm" -# -# FEATURES are settings that affect the functionality of portage. Most of -# these settings are for developer use, but some are available to non- -# developers as well. -# -# 'autoaddcvs' causes portage to automatically try to add files to cvs -# that will have to be added later. Done at generation times -# and only has an effect when 'cvs' is also set. -# 'buildpkg' causes binary packages to be created of all packages that -# are being merged. -# 'ccache' enables ccache support via CC. -# 'collision-protect' -# prevents packages from overwriting files that are owned by -# another package or by no package at all. -# 'cvs' causes portage to enable all cvs features (commits, adds), -# and to apply all USE flags in SRC_URI for digests -- for -# developers only. -# 'digest' causes digests to be generated for all packages being merged. -# 'distcc' enables distcc support via CC. -# 'distlocks' enables distfiles locking using fcntl or hardlinks. This -# is enabled by default. Tools exist to help clean the locks -# after crashes: /usr/lib/portage/bin/clean_locks. -# 'fixpackages' allows portage to fix binary packages that are stored in -# PKGDIR. This can consume a lot of time. 'fixpackages' is -# also a script that can be run at any given time to force -# the same actions. -# 'gpg' enables basic verification of Manifest files using gpg. -# This features is UNDER DEVELOPMENT and reacts to features -# of strict and severe. Heavy use of gpg sigs is coming. -# 'keeptemp' prevents the clean phase from deleting the temp files ($T) -# from a merge. -# 'keepwork' prevents the clean phase from deleting the WORKDIR. -# 'maketest' causes ebuilds to perform testing phases if they are capable -# of it. Some packages support this automaticaly via makefiles. -# 'noauto' causes ebuild to perform only the action requested and -# not any other required actions like clean or unpack -- for -# debugging purposes only. -# 'noclean' prevents portage from removing the source and temporary files -# after a merge -- for debugging purposes only. -# 'nostrip' prevents the stripping of binaries. -# 'notitles' disables xterm titlebar updates (which contain status info). -# 'sandbox' enables sandboxing when running emerge and ebuild. -# 'strict' causes portage to react strongly to conditions that are -# potentially dangerous, like missing/incorrect Manifest files. -# 'userpriv' allows portage to drop root privileges while it is compiling, -# as a security measure. As a side effect this can remove -# sandbox access violations for users. -# 'usersandbox' enables sandboxing while portage is running under userpriv. -#FEATURES="sandbox buildpkg ccache distcc userpriv usersandbox notitles noclean noauto cvs keeptemp keepwork autoaddcvs" -#FEATURES="sandbox ccache distcc distlocks autoaddcvs" -# -# CCACHE_SIZE sets the space use limitations for ccache. The default size is -# 2G, and will be set if not defined otherwise and ccache is in features. -# Portage will set the default ccache dir if it is not present in the -# user's environment, for userpriv it sets: ${PORTAGE_TMPDIR}/ccache -# (/var/tmp/ccache), and for regular use the default is /root/.ccache. -# Sizes are specified with 'G' 'M' or 'K'. -# '2G' for 2 gigabytes, '2048M' for 2048 megabytes (same as 2G). -#CCACHE_SIZE="512M" -# -# DISTCC_DIR sets the temporary space used by distcc. -#DISTCC_DIR="${PORTAGE_TMPDIR}/.distcc" -# -# RSYNC_EXCLUDEFROM is a file that portage will pass to rsync when it updates -# the portage tree. Specific chunks of the tree may be excluded from -# consideration. This may cause dependency failures if you are not careful. -# The file format is one pattern per line, blanks and ';' or '#' lines are -# comments. See 'man rsync' for more details on the exclude-from format. -#RSYNC_EXCLUDEFROM=/etc/portage/rsync_excludes - -# logging related variables: -# PORTAGE_LOG_CLASSES: selects messages to be logged, possible values are: -# info, warn, error, log -PORTAGE_LOG_CLASSES="warn error log" - -# PORTAGE_LOG_SYSTEM: selects the module(s) to process the log messages. Modules -# included in portage are (empty means logging is disabled): -# save (saves one log per package in $PORTAGE_TMPDIR/elogs) -# custom (passes all messages to $PORTAGE_LOG_COMMAND) -# syslog (sends all messages to syslog) -# mail (send all messages to the mailserver defined -# in $PORTAGE_LOG_MAILURI) -#PORTAGE_LOG_SYSTEM="save mail" - -# PORTAGE_LOG_COMMAND: only used with the "custom" logging module. Specifies a command -# to process log messages. Two variables are expanded: -# ${PACKAGE} - expands to the cpv entry of the processed -# package (see $PVR in ebuild(5)) -# ${LOGFILE} - absolute path to the logfile -#PORTAGE_LOG_COMMAND="/path/to/logprocessor -p ${PACKAGE} -f ${LOGFILE}" - -# PORTAGE_LOG_MAILURI: this variable holds all important settings for the mail -# module. In most cases listing the recipient adress and -# the receiving mailserver should be sufficient, but you can -# also use advanced settings like authentication or TLS. The -# full syntax is: -# adress [[user:passwd@]mailserver[:port]] -# where -# adress: recipient adress -# user: username for smtp auth (defaults to none) -# passwd: password for smtp auth (defaults to none) -# mailserver: smtp server that should be used to deliver the mail (defaults to localhost) -# port: port to use on the given smtp server (defaults to 25, values > 100000 indicate that starttls should be used on (port-100000)) -# Examples: -#PORTAGE_LOG_MAILURI="root@localhost localhost" (this is also the default setting) -#PORTAGE_LOG_MAILURI="user@some.domain mail.some.domain" (sends mails to user@some.domain using the mailserver mail.some.domain) -#PORTAGE_LOG_MAILURI="user@some.domain user:secret@mail.some.domain:100465" (this is left uncommented as a reader excercise ;) diff --git a/cnf/make.conf.mac b/cnf/make.conf.mac deleted file mode 100644 index da51ef9..0000000 --- a/cnf/make.conf.mac +++ /dev/null @@ -1,6 +0,0 @@ -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/cnf/make.conf.mac,v 1.2 2004/09/30 06:34:27 vapier Exp $ -# Contains local system settings for Portage system - -#Nothing needed here diff --git a/cnf/make.conf.mips b/cnf/make.conf.mips deleted file mode 100644 index 1081bb9..0000000 --- a/cnf/make.conf.mips +++ /dev/null @@ -1,336 +0,0 @@ -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/cnf/make.conf.mips,v 1.42 2005/02/26 07:21:14 jstubbs Exp $ -# Contains local system settings for Portage system - -# Please review 'man make.conf' for more information. - -# Build-time functionality -# ======================== -# -# The USE variable is used to enable optional build-time functionality. For -# example, quite a few packages have optional X, gtk or GNOME functionality -# that can only be enabled or disabled at compile-time. Gentoo Linux has a -# very extensive set of USE variables described in our USE variable HOWTO at -# http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&chap=1 -# -# The available list of use flags with descriptions is in your portage tree. -# Use 'less' to view them: --> less /usr/portage/profiles/use.desc <-- -# -# 'ufed' is an ncurses/dialog interface available in portage to make handling -# useflags for you. 'emerge app-portage/ufed' -# -# Example: -#USE="X gtk gnome -alsa" - -# Host Setting -# ============ -# -# All MIPS systems should use this host setting: - -CHOST="mips-unknown-linux-gnu" - -# Host and optimization settings -# ============================== -# -# For optimal performance, enable a CFLAGS setting appropriate for your CPU. -# -# Please note that if you experience strange issues with a package, it may be -# due to gcc's optimizations interacting in a strange way. Please test the -# package (and in some cases the libraries it uses) at default optimizations -# before reporting errors to developers. -# -# -mcpu=<cpu-type> for MIPS systems selects the type of processor you want -# to optimize your code for. Code generated under those options will run best -# on that processor, and may not run at all on others. -# -# GCC 3.2 supports many mips processor types including: r2000, r3000, r3900, r4000, -# r4100, r4300, r4400, r4600, r4650, r5000, r6000, r8000 , orion -# -#CFLAGS="-O2 -pipe" - -# If you set a CFLAGS above, then this line will set your default C++ flags to -# the same settings. -#CXXFLAGS="${CFLAGS}" - -# Advanced Masking -# ================ -# -# Gentoo is using a new masking system to allow for easier stability testing -# on packages. KEYWORDS are used in ebuilds to mask and unmask packages based -# on the platform they are set for. A special form has been added that -# indicates packages and revisions that are expected to work, but have not yet -# been approved for the stable set. '~arch' is a superset of 'arch' which -# includes the unstable, in testing, packages. Users of the 'x86' architecture -# would add '~x86' to ACCEPT_KEYWORDS to enable unstable/testing packages. -# '~ppc', '~sparc' are the unstable KEYWORDS for their respective platforms. -# -# Please note that this is not for development, alpha, beta, nor cvs release -# packages. "Broken" packages will not be added to testing and should not be -# requested to be added. Alternative routes are available to developers -# for experimental packages, and it is at their discretion to use them. -# -# DO NOT PUT ANYTHING BUT YOUR SPECIFIC ~ARCHITECTURE IN THE LIST. -# IF YOU ARE UNSURE OF YOUR ARCH, OR THE IMPLICATIONS, DO NOT MODIFY THIS. -# -#ACCEPT_KEYWORDS="~mips" - - - - - -# Portage Directories -# =================== -# -# Each of these settings controls an aspect of portage's storage and file -# system usage. If you change any of these, be sure it is available when -# you try to use portage. *** DO NOT INCLUDE A TRAILING "/" *** -# -# PORTAGE_TMPDIR is the location portage will use for compilations and -# temporary storage of data. This can get VERY large depending upon -# the application being installed. -#PORTAGE_TMPDIR=/var/tmp -# -# PORTDIR is the location of the portage tree. This is the repository -# for all profile information as well as all ebuilds. This directory -# itself can reach 200M. If you change this, you must update your -# /etc/make.profile symlink accordingly. -#PORTDIR=/usr/portage -# -# DISTDIR is where all of the source code tarballs will be placed for -# emerges. The source code is maintained here unless you delete -# it. The entire repository of tarballs for gentoo is 9G. This is -# considerably more than any user will ever download. 2-3G is -# a large DISTDIR. -#DISTDIR=${PORTDIR}/distfiles -# -# PKGDIR is the location of binary packages that you can have created -# with '--buildpkg' or '-b' while emerging a package. This can get -# upto several hundred megs, or even a few gigs. -#PKGDIR=${PORTDIR}/packages -# -# PORT_LOGDIR is the location where portage will store all the logs it -# creates from each individual merge. They are stored as NNNN-$PF.log -# in the directory specified. This is disabled until you enable it by -# providing a directory. Permissions will be modified as needed IF the -# directory exists, otherwise logging will be disabled. NNNN is the -# increment at the time the log is created. Logs are thus sequential. -#PORT_LOGDIR=/var/log/portage -# -# PORTDIR_OVERLAY is a directory where local ebuilds may be stored without -# concern that they will be deleted by rsync updates. Default is not -# defined. -#PORTDIR_OVERLAY=/usr/local/portage - -# Fetching files -# ============== -# -# If you need to set a proxy for wget or lukemftp, add the appropriate "export -# ftp_proxy=<proxy>" and "export http_proxy=<proxy>" lines to /etc/profile if -# all users on your system should use them. -# -# Portage uses wget by default. Here are some settings for some alternate -# downloaders -- note that you need to merge these programs first before they -# will be available. -# -# Default fetch command (5 tries, passive ftp for firewall compatibility) -#FETCHCOMMAND="/usr/bin/wget -t 5 --passive-ftp \${URI} -P \${DISTDIR}" -#RESUMECOMMAND="/usr/bin/wget -c -t 5 --passive-ftp \${URI} -P \${DISTDIR}" -# -# Using wget, ratelimiting downloads -#FETCHCOMMAND="/usr/bin/wget -t 5 --passive-ftp --limit-rate=200k \${URI} -P \${DISTDIR}" -#RESUMECOMMAND="/usr/bin/wget -c -t 5 --passive-ftp --limit-rate=200k \${URI} -P \${DISTDIR}" -# -# Lukemftp (BSD ftp): -#FETCHCOMMAND="/usr/bin/lukemftp -s -a -o \${DISTDIR}/\${FILE} \${URI}" -#RESUMECOMMAND="/usr/bin/lukemftp -s -a -R -o \${DISTDIR}/\${FILE} \${URI}" -# -# -# Portage uses GENTOO_MIRRORS to specify mirrors to use for source retrieval. -# The list is a space separated list which is read left to right. If you use -# another mirror we highly recommend leaving the default mirror at the end of -# the list so that portage will fall back to it if the files cannot be found -# on your specified mirror. We _HIGHLY_ recommend that you change this setting -# to a nearby mirror by merging and using the 'mirrorselect' tool. -#GENTOO_MIRRORS="<your_mirror_here> http://gentoo.osuosl.org http://www.ibiblio.org/pub/Linux/distributions/gentoo" -# -# Portage uses PORTAGE_BINHOST to specify mirrors for prebuilt-binary packages. -# The list is a single entry specifying the full address of the directory -# serving the tbz2's for your system. Running emerge with either '--getbinpkg' -# or '--getbinpkgonly' will cause portage to retrieve the metadata from all -# packages in the directory specified, and use that data to determine what will -# be downloaded and merged. '-g' or '-gK' are the recommend parameters. Please -# consult the man pages and 'emerge --help' for more information. For FTP, the -# default connection is passive -- If you require an active connection, affix -# an asterisk (*) to the end of the host:port string before the path. -#PORTAGE_BINHOST="http://grp.mirror.site/gentoo/grp/1.4/i686/athlon-xp/" -# This ftp connection is passive ftp. -#PORTAGE_BINHOST="ftp://login:pass@grp.mirror.site/pub/grp/i686/athlon-xp/" -# This ftp connection is active ftp. -#PORTAGE_BINHOST="ftp://login:pass@grp.mirror.site:21*/pub/grp/i686/athlon-xp/" - -# Synchronizing Portage -# ===================== -# -# Each of these settings affects how Gentoo synchronizes your Portage tree. -# Synchronization is handled by rsync and these settings allow some control -# over how it is done. -# -# -# SYNC is the server used by rsync to retrieve a localized rsync mirror -# rotation. This allows you to select servers that are geographically -# close to you, yet still distribute the load over a number of servers. -# Please do not single out specific rsync mirrors. Doing so places undue -# stress on particular mirrors. Instead you may use one of the following -# continent specific rotations: -# -# Default: "rsync://rsync.gentoo.org/gentoo-portage" -# North America: "rsync://rsync.namerica.gentoo.org/gentoo-portage" -# South America: "rsync://rsync.samerica.gentoo.org/gentoo-portage" -# Europe: "rsync://rsync.europe.gentoo.org/gentoo-portage" -# Asia: "rsync://rsync.asia.gentoo.org/gentoo-portage" -# Australia: "rsync://rsync.au.gentoo.org/gentoo-portage" -#SYNC="rsync://rsync.gentoo.org/gentoo-portage" -# -# RSYNC_RETRIES sets the number of times portage will attempt to retrieve -# a current portage tree before it exits with an error. This allows -# for a more successful retrieval without user intervention most times. -#RSYNC_RETRIES="3" -# -# RSYNC_TIMEOUT sets the length of time rsync will wait before it times out -# on a connection. Most users will benefit from this setting as it will -# reduce the amount of 'dead air' they experience when they run across -# the occasional, unreachable mirror. Dialup users might want to set this -# value up around the 300 second mark. -#RSYNC_TIMEOUT=180 - -# Advanced Features -# ================= -# -# MAKEOPTS provides extra options that may be passed to 'make' when a -# program is compiled. Presently the only use is for specifying -# the number of parallel makes (-j) to perform. The suggested number -# for parallel makes is CPUs+1. -#MAKEOPTS="-j2" -# -# PORTAGE_NICENESS provides a default increment to emerge's niceness level. -# Note: This is an increment. Running emerge in a niced environment will -# reduce it further. Default is unset. -#PORTAGE_NICENESS=3 -# -# PORTAGE_TMPFS is a location where portage may create temporary files. -# If specified, portage will use this directory whenever possible -# for all rapid operations such as lockfiles and transient data. -# It is _highly_ recommended that this be a tmpfs or ramdisk. Do not -# set this to anything that does not give a significant performance -# enhancement and proper FS compliance for locks and read/write. -# /dev/shm is a glibc mandated tmpfs, and should be a reasonable -# setting for all linux kernel+glibc based systems. -#PORTAGE_TMPFS="/dev/shm" -# -# FEATURES are settings that affect the functionality of portage. Most of -# these settings are for developer use, but some are available to non- -# developers as well. -# -# 'autoaddcvs' causes portage to automatically try to add files to cvs -# that will have to be added later. Done at generation times -# and only has an effect when 'cvs' is also set. -# 'buildpkg' causes binary packages to be created of all packages that -# are being merged. -# 'ccache' enables ccache support via CC. -# 'collision-protect' -# prevents packages from overwriting files that are owned by -# another package or by no package at all. -# 'cvs' causes portage to enable all cvs features (commits, adds), -# and to apply all USE flags in SRC_URI for digests -- for -# developers only. -# 'digest' causes digests to be generated for all packages being merged. -# 'distcc' enables distcc support via CC. -# 'distlocks' enables distfiles locking using fcntl or hardlinks. This -# is enabled by default. Tools exist to help clean the locks -# after crashes: /usr/lib/portage/bin/clean_locks. -# 'fixpackages' allows portage to fix binary packages that are stored in -# PKGDIR. This can consume a lot of time. 'fixpackages' is -# also a script that can be run at any given time to force -# the same actions. -# 'gpg' enables basic verification of Manifest files using gpg. -# This features is UNDER DEVELOPMENT and reacts to features -# of strict and severe. Heavy use of gpg sigs is coming. -# 'keeptemp' prevents the clean phase from deleting the temp files ($T) -# from a merge. -# 'keepwork' prevents the clean phase from deleting the WORKDIR. -# 'maketest' causes ebuilds to perform testing phases if they are capable -# of it. Some packages support this automaticaly via makefiles. -# 'noauto' causes ebuild to perform only the action requested and -# not any other required actions like clean or unpack -- for -# debugging purposes only. -# 'noclean' prevents portage from removing the source and temporary files -# after a merge -- for debugging purposes only. -# 'nostrip' prevents the stripping of binaries. -# 'notitles' disables xterm titlebar updates (which contain status info). -# 'sandbox' enables sandboxing when running emerge and ebuild. -# 'strict' causes portage to react strongly to conditions that are -# potentially dangerous, like missing/incorrect Manifest files. -# 'userpriv' allows portage to drop root privileges while it is compiling, -# as a security measure. As a side effect this can remove -# sandbox access violations for users. -# 'usersandbox' enables sandboxing while portage is running under userpriv. -#FEATURES="sandbox buildpkg ccache distcc userpriv usersandbox notitles noclean noauto cvs keeptemp keepwork autoaddcvs" -#FEATURES="sandbox ccache distcc distlocks autoaddcvs" -# -# CCACHE_SIZE sets the space use limitations for ccache. The default size is -# 2G, and will be set if not defined otherwise and ccache is in features. -# Portage will set the default ccache dir if it is not present in the -# user's environment, for userpriv it sets: ${PORTAGE_TMPDIR}/ccache -# (/var/tmp/ccache), and for regular use the default is /root/.ccache. -# Sizes are specified with 'G' 'M' or 'K'. -# '2G' for 2 gigabytes, '2048M' for 2048 megabytes (same as 2G). -#CCACHE_SIZE="512M" -# -# DISTCC_DIR sets the temporary space used by distcc. -#DISTCC_DIR="${PORTAGE_TMPDIR}/.distcc" -# -# RSYNC_EXCLUDEFROM is a file that portage will pass to rsync when it updates -# the portage tree. Specific chunks of the tree may be excluded from -# consideration. This may cause dependency failures if you are not careful. -# The file format is one pattern per line, blanks and ';' or '#' lines are -# comments. See 'man rsync' for more details on the exclude-from format. -#RSYNC_EXCLUDEFROM=/etc/portage/rsync_excludes - -# logging related variables: -# PORTAGE_LOG_CLASSES: selects messages to be logged, possible values are: -# info, warn, error, log -PORTAGE_LOG_CLASSES="warn error log" - -# PORTAGE_LOG_SYSTEM: selects the module(s) to process the log messages. Modules -# included in portage are (empty means logging is disabled): -# save (saves one log per package in $PORTAGE_TMPDIR/elogs) -# custom (passes all messages to $PORTAGE_LOG_COMMAND) -# syslog (sends all messages to syslog) -# mail (send all messages to the mailserver defined -# in $PORTAGE_LOG_MAILURI) -#PORTAGE_LOG_SYSTEM="save mail" - -# PORTAGE_LOG_COMMAND: only used with the "custom" logging module. Specifies a command -# to process log messages. Two variables are expanded: -# ${PACKAGE} - expands to the cpv entry of the processed -# package (see $PVR in ebuild(5)) -# ${LOGFILE} - absolute path to the logfile -#PORTAGE_LOG_COMMAND="/path/to/logprocessor -p ${PACKAGE} -f ${LOGFILE}" - -# PORTAGE_LOG_MAILURI: this variable holds all important settings for the mail -# module. In most cases listing the recipient adress and -# the receiving mailserver should be sufficient, but you can -# also use advanced settings like authentication or TLS. The -# full syntax is: -# adress [[user:passwd@]mailserver[:port]] -# where -# adress: recipient adress -# user: username for smtp auth (defaults to none) -# passwd: password for smtp auth (defaults to none) -# mailserver: smtp server that should be used to deliver the mail (defaults to localhost) -# port: port to use on the given smtp server (defaults to 25, values > 100000 indicate that starttls should be used on (port-100000)) -# Examples: -#PORTAGE_LOG_MAILURI="root@localhost localhost" (this is also the default setting) -#PORTAGE_LOG_MAILURI="user@some.domain mail.some.domain" (sends mails to user@some.domain using the mailserver mail.some.domain) -#PORTAGE_LOG_MAILURI="user@some.domain user:secret@mail.some.domain:100465" (this is left uncommented as a reader excercise ;) diff --git a/cnf/make.conf.ppc b/cnf/make.conf.ppc deleted file mode 100644 index b951328..0000000 --- a/cnf/make.conf.ppc +++ /dev/null @@ -1,369 +0,0 @@ -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/cnf/make.conf.ppc,v 1.61 2005/02/26 07:21:14 jstubbs Exp $ -# Contains local system settings for Portage system - -# Please review 'man make.conf' for more information. - -# Build-time functionality -# ======================== -# -# The USE variable is used to enable optional build-time functionality. For -# example, quite a few packages have optional X, gtk or GNOME functionality -# that can only be enabled or disabled at compile-time. Gentoo Linux has a -# very extensive set of USE variables described in our USE variable HOWTO at -# http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&chap=1 -# -# The available list of use flags with descriptions is in your portage tree. -# Use 'less' to view them: --> less /usr/portage/profiles/use.desc <-- -# -# 'ufed' is an ncurses/dialog interface available in portage to make handling -# useflags for you. 'emerge app-portage/ufed' -# -# Example: -#USE="X gtk gnome -alsa" - -# Host Setting -# ============ -# -# All PowerPC systems should use this host setting: - -CHOST="powerpc-unknown-linux-gnu" - -# Host and optimization settings -# ============================== -# -# For optimal performance, enable a CFLAGS setting appropriate for your CPU. -# -# Please note that if you experience strange issues with a package, it may be -# due to gcc's optimizations interacting in a strange way. Please test the -# package (and in some cases the libraries it uses) at default optimizations -# before reporting errors to developers. -# -# -mcpu=<cpu-type> for PowerPC systems selects the type of processor you want -# to optimize your code for. Code generated under those options will run best -# on that processor, and may not run at all on others. -# -# GCC 3.2 supports many powerpc processor types including: rios, rios1, rsc, -# rios2, rs64a, 601, 602, 603, 603e, 604, 604e, 620, 630, 740, 7400, 7450, 750, -# power, power2, powerpc, 403, 505, 801, 821, 823, and 860 and common. -# -# Recommended settings for GCC 3.2 only (Gentoo 1.4 or newer) : -# -# -maltivec enables optional (still limited) altivec support and should be used -# only for G4 processors, on GCC 3.2 or newer. It also requires that you have -# the alitvec option compiled into your kernel to take full advantage of this -# feature. Note: you should also include -mabi=altivec flag if using this option. -# -# Long term testing has shown that -O3 opts can be unreliable on G4's but work -# on G3 series processors or earlier. Use on a G4 at your own risk =) -# -# Due to some failures with the cpu string of 7450, the dev team recommends -# using -mcpu=7400 for all G4 series processors until GCC 3.2 is more mature -# -#CFLAGS="-O2 -pipe -mcpu=7400 -maltivec -mabi=altivec" -# -# -# All non G4 PPC boxen should choose this next option. It will work fine for -# all G3 and pre machines. (note it will not hurt pre G3 machines either to -# use this mcpu option as it is the default for gcc 3.2.x anyway) -# -#CFLAGS="-O3 -pipe -mcpu=750" - -# Recommended settings for GCC 2.95.3 only (Gentoo 1.2 or older): -# -# PowerPC 750 > up: this works on G3's and G4s, gcc 2.95.3 doesn't make the -# distinction between G3 and G4, so this is fine for all NewWorld machines, if -# you use yaboot to boot you should select this option -# -#CFLAGS="-O2 -pipe -mcpu=750 -mpowerpc-gfxopt -mmultiple -mstring" -# -# This will run on all other processors, by building more generic code This is -# safe for all PPC machines running gcc 2.95.3, and works for all OldWorld -# machines - if you use BootX to boot you should select this option -#CFLAGS="-O2 -pipe -mmultiple -mstring" - -# If you set a CFLAGS above, then this line will set your default C++ flags to -# the same settings. -#CXXFLAGS="${CFLAGS}" - -# Advanced Masking -# ================ -# -# Gentoo is using a new masking system to allow for easier stability testing -# on packages. KEYWORDS are used in ebuilds to mask and unmask packages based -# on the platform they are set for. A special form has been added that -# indicates packages and revisions that are expected to work, but have not yet -# been approved for the stable set. '~arch' is a superset of 'arch' which -# includes the unstable, in testing, packages. Users of the 'x86' architecture -# would add '~x86' to ACCEPT_KEYWORDS to enable unstable/testing packages. -# '~ppc', '~sparc' are the unstable KEYWORDS for their respective platforms. -# -# Please note that this is not for development, alpha, beta, nor cvs release -# packages. "Broken" packages will not be added to testing and should not be -# requested to be added. Alternative routes are available to developers -# for experimental packages, and it is at their discretion to use them. -# -# DO NOT PUT ANYTHING BUT YOUR SPECIFIC ~ARCHITECTURE IN THE LIST. -# IF YOU ARE UNSURE OF YOUR ARCH, OR THE IMPLICATIONS, DO NOT MODIFY THIS. -# -# Note: this really shouldn't be enabled until _AFTER_ you bootstrap and emerge -# system. If you want the testing things update after these steps are completed. -# -#ACCEPT_KEYWORDS="~ppc" - -# Portage Directories -# =================== -# -# Each of these settings controls an aspect of portage's storage and file -# system usage. If you change any of these, be sure it is available when -# you try to use portage. *** DO NOT INCLUDE A TRAILING "/" *** -# -# PORTAGE_TMPDIR is the location portage will use for compilations and -# temporary storage of data. This can get VERY large depending upon -# the application being installed. -#PORTAGE_TMPDIR=/var/tmp -# -# PORTDIR is the location of the portage tree. This is the repository -# for all profile information as well as all ebuilds. This directory -# itself can reach 200M. If you change this, you must update your -# /etc/make.profile symlink accordingly. -#PORTDIR=/usr/portage -# -# DISTDIR is where all of the source code tarballs will be placed for -# emerges. The source code is maintained here unless you delete -# it. The entire repository of tarballs for gentoo is 9G. This is -# considerably more than any user will ever download. 2-3G is -# a large DISTDIR. -#DISTDIR=${PORTDIR}/distfiles -# -# PKGDIR is the location of binary packages that you can have created -# with '--buildpkg' or '-b' while emerging a package. This can get -# upto several hundred megs, or even a few gigs. -#PKGDIR=${PORTDIR}/packages -# -# PORT_LOGDIR is the location where portage will store all the logs it -# creates from each individual merge. They are stored as NNNN-$PF.log -# in the directory specified. This is disabled until you enable it by -# providing a directory. Permissions will be modified as needed IF the -# directory exists, otherwise logging will be disabled. NNNN is the -# increment at the time the log is created. Logs are thus sequential. -#PORT_LOGDIR=/var/log/portage -# -# PORTDIR_OVERLAY is a directory where local ebuilds may be stored without -# concern that they will be deleted by rsync updates. Default is not -# defined. -#PORTDIR_OVERLAY=/usr/local/portage - -# Fetching files -# ============== -# -# If you need to set a proxy for wget or lukemftp, add the appropriate "export -# ftp_proxy=<proxy>" and "export http_proxy=<proxy>" lines to /etc/profile if -# all users on your system should use them. -# -# Portage uses wget by default. Here are some settings for some alternate -# downloaders -- note that you need to merge these programs first before they -# will be available. -# -# Default fetch command (5 tries, passive ftp for firewall compatibility) -#FETCHCOMMAND="/usr/bin/wget -t 5 --passive-ftp \${URI} -P \${DISTDIR}" -#RESUMECOMMAND="/usr/bin/wget -c -t 5 --passive-ftp \${URI} -P \${DISTDIR}" -# -# Using wget, ratelimiting downloads -#FETCHCOMMAND="/usr/bin/wget -t 5 --passive-ftp --limit-rate=200k \${URI} -P \${DISTDIR}" -#RESUMECOMMAND="/usr/bin/wget -c -t 5 --passive-ftp --limit-rate=200k \${URI} -P \${DISTDIR}" -# -# Lukemftp (BSD ftp): -#FETCHCOMMAND="/usr/bin/lukemftp -s -a -o \${DISTDIR}/\${FILE} \${URI}" -#RESUMECOMMAND="/usr/bin/lukemftp -s -a -R -o \${DISTDIR}/\${FILE} \${URI}" -# -# -# Portage uses GENTOO_MIRRORS to specify mirrors to use for source retrieval. -# The list is a space separated list which is read left to right. If you use -# another mirror we highly recommend leaving the default mirror at the end of -# the list so that portage will fall back to it if the files cannot be found -# on your specified mirror. We _HIGHLY_ recommend that you change this setting -# to a nearby mirror by merging and using the 'mirrorselect' tool. -#GENTOO_MIRRORS="<your_mirror_here> http://gentoo.osuosl.org http://www.ibiblio.org/pub/Linux/distributions/gentoo" -# -# Portage uses PORTAGE_BINHOST to specify mirrors for prebuilt-binary packages. -# The list is a single entry specifying the full address of the directory -# serving the tbz2's for your system. Running emerge with either '--getbinpkg' -# or '--getbinpkgonly' will cause portage to retrieve the metadata from all -# packages in the directory specified, and use that data to determine what will -# be downloaded and merged. '-g' or '-gK' are the recommend parameters. Please -# consult the man pages and 'emerge --help' for more information. For FTP, the -# default connection is passive -- If you require an active connection, affix -# an asterisk (*) to the end of the host:port string before the path. -#PORTAGE_BINHOST="http://grp.mirror.site/gentoo/grp/1.4/i686/athlon-xp/" -# This ftp connection is passive ftp. -#PORTAGE_BINHOST="ftp://login:pass@grp.mirror.site/pub/grp/i686/athlon-xp/" -# This ftp connection is active ftp. -#PORTAGE_BINHOST="ftp://login:pass@grp.mirror.site:21*/pub/grp/i686/athlon-xp/" - -# Synchronizing Portage -# ===================== -# -# Each of these settings affects how Gentoo synchronizes your Portage tree. -# Synchronization is handled by rsync and these settings allow some control -# over how it is done. -# -# -# SYNC is the server used by rsync to retrieve a localized rsync mirror -# rotation. This allows you to select servers that are geographically -# close to you, yet still distribute the load over a number of servers. -# Please do not single out specific rsync mirrors. Doing so places undue -# stress on particular mirrors. Instead you may use one of the following -# continent specific rotations: -# -# Default: "rsync://rsync.gentoo.org/gentoo-portage" -# North America: "rsync://rsync.namerica.gentoo.org/gentoo-portage" -# South America: "rsync://rsync.samerica.gentoo.org/gentoo-portage" -# Europe: "rsync://rsync.europe.gentoo.org/gentoo-portage" -# Asia: "rsync://rsync.asia.gentoo.org/gentoo-portage" -# Australia: "rsync://rsync.au.gentoo.org/gentoo-portage" -#SYNC="rsync://rsync.gentoo.org/gentoo-portage" -# -# RSYNC_RETRIES sets the number of times portage will attempt to retrieve -# a current portage tree before it exits with an error. This allows -# for a more successful retrieval without user intervention most times. -#RSYNC_RETRIES="3" -# -# RSYNC_TIMEOUT sets the length of time rsync will wait before it times out -# on a connection. Most users will benefit from this setting as it will -# reduce the amount of 'dead air' they experience when they run across -# the occasional, unreachable mirror. Dialup users might want to set this -# value up around the 300 second mark. -#RSYNC_TIMEOUT=180 - -# Advanced Features -# ================= -# -# MAKEOPTS provides extra options that may be passed to 'make' when a -# program is compiled. Presently the only use is for specifying -# the number of parallel makes (-j) to perform. The suggested number -# for parallel makes is CPUs+1. -#MAKEOPTS="-j2" -# -# PORTAGE_NICENESS provides a default increment to emerge's niceness level. -# Note: This is an increment. Running emerge in a niced environment will -# reduce it further. Default is unset. -#PORTAGE_NICENESS=3 -# -# PORTAGE_TMPFS is a location where portage may create temporary files. -# If specified, portage will use this directory whenever possible -# for all rapid operations such as lockfiles and transient data. -# It is _highly_ recommended that this be a tmpfs or ramdisk. Do not -# set this to anything that does not give a significant performance -# enhancement and proper FS compliance for locks and read/write. -# /dev/shm is a glibc mandated tmpfs, and should be a reasonable -# setting for all linux kernel+glibc based systems. -#PORTAGE_TMPFS="/dev/shm" -# -# FEATURES are settings that affect the functionality of portage. Most of -# these settings are for developer use, but some are available to non- -# developers as well. -# -# 'autoaddcvs' causes portage to automatically try to add files to cvs -# that will have to be added later. Done at generation times -# and only has an effect when 'cvs' is also set. -# 'buildpkg' causes binary packages to be created of all packages that -# are being merged. -# 'ccache' enables ccache support via CC. -# 'collision-protect' -# prevents packages from overwriting files that are owned by -# another package or by no package at all. -# 'cvs' causes portage to enable all cvs features (commits, adds), -# and to apply all USE flags in SRC_URI for digests -- for -# developers only. -# 'digest' causes digests to be generated for all packages being merged. -# 'distcc' enables distcc support via CC. -# 'distlocks' enables distfiles locking using fcntl or hardlinks. This -# is enabled by default. Tools exist to help clean the locks -# after crashes: /usr/lib/portage/bin/clean_locks. -# 'fixpackages' allows portage to fix binary packages that are stored in -# PKGDIR. This can consume a lot of time. 'fixpackages' is -# also a script that can be run at any given time to force -# the same actions. -# 'gpg' enables basic verification of Manifest files using gpg. -# This features is UNDER DEVELOPMENT and reacts to features -# of strict and severe. Heavy use of gpg sigs is coming. -# 'keeptemp' prevents the clean phase from deleting the temp files ($T) -# from a merge. -# 'keepwork' prevents the clean phase from deleting the WORKDIR. -# 'maketest' causes ebuilds to perform testing phases if they are capable -# of it. Some packages support this automaticaly via makefiles. -# 'noauto' causes ebuild to perform only the action requested and -# not any other required actions like clean or unpack -- for -# debugging purposes only. -# 'noclean' prevents portage from removing the source and temporary files -# after a merge -- for debugging purposes only. -# 'nostrip' prevents the stripping of binaries. -# 'notitles' disables xterm titlebar updates (which contain status info). -# 'sandbox' enables sandboxing when running emerge and ebuild. -# 'strict' causes portage to react strongly to conditions that are -# potentially dangerous, like missing/incorrect Manifest files. -# 'userpriv' allows portage to drop root privileges while it is compiling, -# as a security measure. As a side effect this can remove -# sandbox access violations for users. -# 'usersandbox' enables sandboxing while portage is running under userpriv. -#FEATURES="sandbox buildpkg ccache distcc userpriv usersandbox notitles noclean noauto cvs keeptemp keepwork autoaddcvs" -#FEATURES="sandbox ccache distcc distlocks autoaddcvs" -# -# CCACHE_SIZE sets the space use limitations for ccache. The default size is -# 2G, and will be set if not defined otherwise and ccache is in features. -# Portage will set the default ccache dir if it is not present in the -# user's environment, for userpriv it sets: ${PORTAGE_TMPDIR}/ccache -# (/var/tmp/ccache), and for regular use the default is /root/.ccache. -# Sizes are specified with 'G' 'M' or 'K'. -# '2G' for 2 gigabytes, '2048M' for 2048 megabytes (same as 2G). -#CCACHE_SIZE="512M" -# -# DISTCC_DIR sets the temporary space used by distcc. -#DISTCC_DIR="${PORTAGE_TMPDIR}/.distcc" -# -# RSYNC_EXCLUDEFROM is a file that portage will pass to rsync when it updates -# the portage tree. Specific chunks of the tree may be excluded from -# consideration. This may cause dependency failures if you are not careful. -# The file format is one pattern per line, blanks and ';' or '#' lines are -# comments. See 'man rsync' for more details on the exclude-from format. -#RSYNC_EXCLUDEFROM=/etc/portage/rsync_excludes - -# logging related variables: -# PORTAGE_LOG_CLASSES: selects messages to be logged, possible values are: -# info, warn, error, log -PORTAGE_LOG_CLASSES="warn error log" - -# PORTAGE_LOG_SYSTEM: selects the module(s) to process the log messages. Modules -# included in portage are (empty means logging is disabled): -# save (saves one log per package in $PORTAGE_TMPDIR/elogs) -# custom (passes all messages to $PORTAGE_LOG_COMMAND) -# syslog (sends all messages to syslog) -# mail (send all messages to the mailserver defined -# in $PORTAGE_LOG_MAILURI) -#PORTAGE_LOG_SYSTEM="save mail" - -# PORTAGE_LOG_COMMAND: only used with the "custom" logging module. Specifies a command -# to process log messages. Two variables are expanded: -# ${PACKAGE} - expands to the cpv entry of the processed -# package (see $PVR in ebuild(5)) -# ${LOGFILE} - absolute path to the logfile -#PORTAGE_LOG_COMMAND="/path/to/logprocessor -p ${PACKAGE} -f ${LOGFILE}" - -# PORTAGE_LOG_MAILURI: this variable holds all important settings for the mail -# module. In most cases listing the recipient adress and -# the receiving mailserver should be sufficient, but you can -# also use advanced settings like authentication or TLS. The -# full syntax is: -# adress [[user:passwd@]mailserver[:port]] -# where -# adress: recipient adress -# user: username for smtp auth (defaults to none) -# passwd: password for smtp auth (defaults to none) -# mailserver: smtp server that should be used to deliver the mail (defaults to localhost) -# port: port to use on the given smtp server (defaults to 25, values > 100000 indicate that starttls should be used on (port-100000)) -# Examples: -#PORTAGE_LOG_MAILURI="root@localhost localhost" (this is also the default setting) -#PORTAGE_LOG_MAILURI="user@some.domain mail.some.domain" (sends mails to user@some.domain using the mailserver mail.some.domain) -#PORTAGE_LOG_MAILURI="user@some.domain user:secret@mail.some.domain:100465" (this is left uncommented as a reader excercise ;) diff --git a/cnf/make.conf.ppc64 b/cnf/make.conf.ppc64 deleted file mode 100644 index 8d13e44..0000000 --- a/cnf/make.conf.ppc64 +++ /dev/null @@ -1,348 +0,0 @@ -# Copyright 1999-2005 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/cnf/make.conf.ppc64,v 1.2 2005/02/21 12:45:49 genone Exp $ -# Contains local system settings for Portage system - -# Please review 'man make.conf' for more information. - -# Build-time functionality -# ======================== -# -# The USE variable is used to enable optional build-time functionality. For -# example, quite a few packages have optional X, gtk or GNOME functionality -# that can only be enabled or disabled at compile-time. Gentoo Linux has a -# very extensive set of USE variables described in our USE variable HOWTO at -# http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&chap=1 -# -# The available list of use flags with descriptions is in your portage tree. -# Use 'less' to view them: --> less /usr/portage/profiles/use.desc <-- -# -# 'ufed' is an ncurses/dialog interface available in portage to make handling -# useflags for you. 'emerge app-portage/ufed' -# -# Example: -#USE="X gtk gnome -alsa" - -# Host Setting -# ============ -# -# All PowerPC64 systems should use this host setting: - -CHOST="powerpc64-unknown-linux-gnu" - -# Host and optimization settings -# ============================== -# -# For optimal performance, enable a CFLAGS setting appropriate for your CPU. -# -# Please note that if you experience strange issues with a package, it may be -# due to gcc's optimizations interacting in a strange way. Please test the -# package (and in some cases the libraries it uses) at default optimizations -# before reporting errors to developers. -# -# -mtarget=<cpu-type> for PowerPC64 systems instructs the gcc compiler that -# it can use instruction scheduling specific for that type of processor -# specified -# -# -mcpu=<cpu-type> for PowerPC64 systems selects the type of processor you want -# to optimize your code for. Code generated under those options will run best -# on that processor. -# -# -mcpu=<cpu-type> and -mtarget=<cpu-type> should both be specified -# -# GCC 3.x supports many ppc64 processor types including: power3, power4, -# 970 (aka G5), and power5. -# -# RS64 processors should specify power3. -# -# Additional options of interest: -# -# -maltivec enables optional altivec support and should be used -# only for 970 processors. It also requires that you have -# the alitvec option compiled into your kernel to take full advantage of this -# feature. Note: you should also include -mabi=altivec flag if using this option. -# -# -O3 for the most part seems ok but should be used with caution as -# for instance app-editors/vim has problems if it is used. -O2 is a -# good selection. -# -#Example CFLAGS setting -#CFLAGS="-O2 -pipe -mcpu=970 -mtarget=970 -maltivec -mabi=altivec" -# -#or -# -#CFLAGS="-O2 -pipe -mcpu=power3 -mtarget=power3" -# -# If you set a CFLAGS above, then this line will set your default C++ flags to -# the same settings. -#CXXFLAGS="${CFLAGS}" - -# Advanced Masking -# ================ -# -# Gentoo is using a new masking system to allow for easier stability testing -# on packages. KEYWORDS are used in ebuilds to mask and unmask packages based -# on the platform they are set for. A special form has been added that -# indicates packages and revisions that are expected to work, but have not yet -# been approved for the stable set. '~arch' is a superset of 'arch' which -# includes the unstable, in testing, packages. Users of the 'ppc64' architecture -# would add '~ppc64' to ACCEPT_KEYWORDS to enable unstable/testing packages. -# '~ppc64', '~sparc' are the unstable KEYWORDS for their respective platforms. -# -# Please note that this is not for development, alpha, beta, nor cvs release -# packages. "Broken" packages will not be added to testing and should not be -# requested to be added. Alternative routes are available to developers -# for experimental packages, and it is at their discretion to use them. -# -# DO NOT PUT ANYTHING BUT YOUR SPECIFIC ~ARCHITECTURE IN THE LIST. -# IF YOU ARE UNSURE OF YOUR ARCH, OR THE IMPLICATIONS, DO NOT MODIFY THIS. -# -# Note: this really shouldn't be enabled until _AFTER_ you bootstrap and emerge -# system. If you want the testing things update after these steps are completed. -# -#ACCEPT_KEYWORDS="ppc64" - -# Portage Directories -# =================== -# -# Each of these settings controls an aspect of portage's storage and file -# system usage. If you change any of these, be sure it is available when -# you try to use portage. *** DO NOT INCLUDE A TRAILING "/" *** -# -# PORTAGE_TMPDIR is the location portage will use for compilations and -# temporary storage of data. This can get VERY large depending upon -# the application being installed. -#PORTAGE_TMPDIR=/var/tmp -# -# PORTDIR is the location of the portage tree. This is the repository -# for all profile information as well as all ebuilds. This directory -# itself can reach 200M. WE DO NOT RECOMMEND that you change this. -#PORTDIR=/usr/portage -# -# DISTDIR is where all of the source code tarballs will be placed for -# emerges. The source code is maintained here unless you delete -# it. The entire repository of tarballs for gentoo is 9G. This is -# considerably more than any user will ever download. 2-3G is -# a large DISTDIR. -#DISTDIR=${PORTDIR}/distfiles -# -# PKGDIR is the location of binary packages that you can have created -# with '--buildpkg' or '-b' while emerging a package. This can get -# upto several hundred megs, or even a few gigs. -#PKGDIR=${PORTDIR}/packages -# -# PORT_LOGDIR is the location where portage will store all the logs it -# creates from each individual merge. They are stored as NNNN-$PF.log -# in the directory specified. This is disabled until you enable it by -# providing a directory. Permissions will be modified as needed IF the -# directory exists, otherwise logging will be disabled. NNNN is the -# increment at the time the log is created. Logs are thus sequential. -#PORT_LOGDIR=/var/log/portage -# -# PORTDIR_OVERLAY is a directory where local ebuilds may be stored without -# concern that they will be deleted by rsync updates. Default is not -# defined. -#PORTDIR_OVERLAY=/usr/local/portage - -# Fetching files -# ============== -# -# If you need to set a proxy for wget or lukemftp, add the appropriate "export -# ftp_proxy=<proxy>" and "export http_proxy=<proxy>" lines to /etc/profile if -# all users on your system should use them. -# -# Portage uses wget by default. Here are some settings for some alternate -# downloaders -- note that you need to merge these programs first before they -# will be available. -# -# Default fetch command (5 tries, passive ftp for firewall compatibility) -#FETCHCOMMAND="/usr/bin/wget -t 5 --passive-ftp \${URI} -P \${DISTDIR}" -#RESUMECOMMAND="/usr/bin/wget -c -t 5 --passive-ftp \${URI} -P \${DISTDIR}" -# -# Using wget, ratelimiting downloads -#FETCHCOMMAND="/usr/bin/wget -t 5 --passive-ftp --limit-rate=200k \${URI} -P \${DISTDIR}" -#RESUMECOMMAND="/usr/bin/wget -c -t 5 --passive-ftp --limit-rate=200k \${URI} -P \${DISTDIR}" -# -# Lukemftp (BSD ftp): -#FETCHCOMMAND="/usr/bin/lukemftp -s -a -o \${DISTDIR}/\${FILE} \${URI}" -#RESUMECOMMAND="/usr/bin/lukemftp -s -a -R -o \${DISTDIR}/\${FILE} \${URI}" -# -# -# Portage uses GENTOO_MIRRORS to specify mirrors to use for source retrieval. -# The list is a space separated list which is read left to right. If you use -# another mirror we highly recommend leaving the default mirror at the end of -# the list so that portage will fall back to it if the files cannot be found -# on your specified mirror. We _HIGHLY_ recommend that you change this setting -# to a nearby mirror by merging and using the 'mirrorselect' tool. -#GENTOO_MIRRORS="<your_mirror_here> http://gentoo.osuosl.org http://www.ibiblio.org/pub/Linux/distributions/gentoo" -# -# Portage uses PORTAGE_BINHOST to specify mirrors for prebuilt-binary packages. -# The list is a single entry specifying the full address of the directory -# serving the tbz2's for your system. Running emerge with either '--getbinpkg' -# or '--getbinpkgonly' will cause portage to retrieve the metadata from all -# packages in the directory specified, and use that data to determine what will -# be downloaded and merged. '-g' or '-gK' are the recommend parameters. Please -# consult the man pages and 'emerge --help' for more information. For FTP, the -# default connection is passive -- If you require an active connection, affix -# an asterisk (*) to the end of the host:port string before the path. -#PORTAGE_BINHOST="http://grp.mirror.site/gentoo/grp/1.4/i686/athlon-xp/" -# This ftp connection is passive ftp. -#PORTAGE_BINHOST="ftp://login:pass@grp.mirror.site/pub/grp/i686/athlon-xp/" -# This ftp connection is active ftp. -#PORTAGE_BINHOST="ftp://login:pass@grp.mirror.site:21*/pub/grp/i686/athlon-xp/" - -# Synchronizing Portage -# ===================== -# -# Each of these settings affects how Gentoo synchronizes your Portage tree. -# Synchronization is handled by rsync and these settings allow some control -# over how it is done. -# -# -# SYNC is the server used by rsync to retrieve a localized rsync mirror -# rotation. This allows you to select servers that are geographically -# close to you, yet still distribute the load over a number of servers. -# Please do not single out specific rsync mirrors. Doing so places undue -# stress on particular mirrors. Instead you may use one of the following -# continent specific rotations: -# -# Default: "rsync://rsync.gentoo.org/gentoo-portage" -# North America: "rsync://rsync.namerica.gentoo.org/gentoo-portage" -# South America: "rsync://rsync.samerica.gentoo.org/gentoo-portage" -# Europe: "rsync://rsync.europe.gentoo.org/gentoo-portage" -# Asia: "rsync://rsync.asia.gentoo.org/gentoo-portage" -# Australia: "rsync://rsync.au.gentoo.org/gentoo-portage" -#SYNC="rsync://rsync.gentoo.org/gentoo-portage" -# -# RSYNC_RETRIES sets the number of times portage will attempt to retrieve -# a current portage tree before it exits with an error. This allows -# for a more successful retrieval without user intervention most times. -#RSYNC_RETRIES="3" -# -# RSYNC_TIMEOUT sets the length of time rsync will wait before it times out -# on a connection. Most users will benefit from this setting as it will -# reduce the amount of 'dead air' they experience when they run across -# the occasional, unreachable mirror. Dialup users might want to set this -# value up around the 300 second mark. -#RSYNC_TIMEOUT=180 - -# Advanced Features -# ================= -# -# MAKEOPTS provides extra options that may be passed to 'make' when a -# program is compiled. Presently the only use is for specifying -# the number of parallel makes (-j) to perform. The suggested number -# for parallel makes is CPUs+1. -#MAKEOPTS="-j2" -# -# PORTAGE_NICENESS provides a default increment to emerge's niceness level. -# Note: This is an increment. Running emerge in a niced environment will -# reduce it further. Default is unset. -#PORTAGE_NICENESS=3 -# -# FEATURES are settings that affect the functionality of portage. Most of -# these settings are for developer use, but some are available to non- -# developers as well. -# -# 'autoaddcvs' causes portage to automatically try to add files to cvs -# that will have to be added later. Done at generation times -# and only has an effect when 'cvs' is also set. -# 'buildpkg' causes binary packages to be created of all packages that -# are being merged. -# 'ccache' enables ccache support via CC. -# 'collision-protect' -# prevents packages from overwriting files that are owned by -# another package or by no package at all. -# 'cvs' causes portage to enable all cvs features (commits, adds), -# and to apply all USE flags in SRC_URI for digests -- for -# developers only. -# 'digest' causes digests to be generated for all packages being merged. -# 'distcc' enables distcc support via CC. -# 'distlocks' enables distfiles locking using fcntl or hardlinks. This -# is enabled by default. Tools exist to help clean the locks -# after crashes: /usr/lib/portage/bin/clean_locks. -# 'fixpackages' allows portage to fix binary packages that are stored in -# PKGDIR. This can consume a lot of time. 'fixpackages' is -# also a script that can be run at any given time to force -# the same actions. -# 'gpg' enables basic verification of Manifest files using gpg. -# This features is UNDER DEVELOPMENT and reacts to features -# of strict and severe. Heavy use of gpg sigs is coming. -# 'keeptemp' prevents the clean phase from deleting the temp files ($T) -# from a merge. -# 'keepwork' prevents the clean phase from deleting the WORKDIR. -# 'maketest' causes ebuilds to perform testing phases if they are capable -# of it. Some packages support this automaticaly via makefiles. -# 'noauto' causes ebuild to perform only the action requested and -# not any other required actions like clean or unpack -- for -# debugging purposes only. -# 'noclean' prevents portage from removing the source and temporary files -# after a merge -- for debugging purposes only. -# 'nostrip' prevents the stripping of binaries. -# 'notitles' disables xterm titlebar updates (which contain status info). -# 'sandbox' enables sandboxing when running emerge and ebuild. -# 'strict' causes portage to react strongly to conditions that are -# potentially dangerous, like missing/incorrect Manifest files. -# 'userpriv' allows portage to drop root privileges while it is compiling, -# as a security measure. As a side effect this can remove -# sandbox access violations for users. -# 'usersandbox' enables sandboxing while portage is running under userpriv. -#FEATURES="sandbox buildpkg ccache distcc userpriv usersandbox notitles noclean noauto cvs keeptemp keepwork autoaddcvs" -#FEATURES="sandbox ccache distcc distlocks autoaddcvs" -# -# CCACHE_SIZE sets the space use limitations for ccache. The default size is -# 2G, and will be set if not defined otherwise and ccache is in features. -# Portage will set the default ccache dir if it is not present in the -# user's environment, for userpriv it sets: ${PORTAGE_TMPDIR}/ccache -# (/var/tmp/ccache), and for regular use the default is /root/.ccache. -# Sizes are specified with 'G' 'M' or 'K'. -# '2G' for 2 gigabytes, '2048M' for 2048 megabytes (same as 2G). -#CCACHE_SIZE="512M" -# -# DISTCC_DIR sets the temporary space used by distcc. -#DISTCC_DIR="${PORTAGE_TMPDIR}/.distcc" -# -# RSYNC_EXCLUDEFROM is a file that portage will pass to rsync when it updates -# the portage tree. Specific chunks of the tree may be excluded from -# consideration. This may cause dependency failures if you are not careful. -# The file format is one pattern per line, blanks and ';' or '#' lines are -# comments. See 'man rsync' for more details on the exclude-from format. -#RSYNC_EXCLUDEFROM=/etc/portage/rsync_excludes - -# logging related variables: -# PORTAGE_LOG_CLASSES: selects messages to be logged, possible values are: -# info, warn, error, log -PORTAGE_LOG_CLASSES="warn error log" - -# PORTAGE_LOG_SYSTEM: selects the module(s) to process the log messages. Modules -# included in portage are (empty means logging is disabled): -# save (saves one log per package in $PORTAGE_TMPDIR/elogs) -# custom (passes all messages to $PORTAGE_LOG_COMMAND) -# syslog (sends all messages to syslog) -# mail (send all messages to the mailserver defined -# in $PORTAGE_LOG_MAILURI) -#PORTAGE_LOG_SYSTEM="save mail" - -# PORTAGE_LOG_COMMAND: only used with the "custom" logging module. Specifies a command -# to process log messages. Two variables are expanded: -# ${PACKAGE} - expands to the cpv entry of the processed -# package (see $PVR in ebuild(5)) -# ${LOGFILE} - absolute path to the logfile -#PORTAGE_LOG_COMMAND="/path/to/logprocessor -p ${PACKAGE} -f ${LOGFILE}" - -# PORTAGE_LOG_MAILURI: this variable holds all important settings for the mail -# module. In most cases listing the recipient adress and -# the receiving mailserver should be sufficient, but you can -# also use advanced settings like authentication or TLS. The -# full syntax is: -# adress [[user:passwd@]mailserver[:port]] -# where -# adress: recipient adress -# user: username for smtp auth (defaults to none) -# passwd: password for smtp auth (defaults to none) -# mailserver: smtp server that should be used to deliver the mail (defaults to localhost) -# port: port to use on the given smtp server (defaults to 25, values > 100000 indicate that starttls should be used on (port-100000)) -# Examples: -#PORTAGE_LOG_MAILURI="root@localhost localhost" (this is also the default setting) -#PORTAGE_LOG_MAILURI="user@some.domain mail.some.domain" (sends mails to user@some.domain using the mailserver mail.some.domain) -#PORTAGE_LOG_MAILURI="user@some.domain user:secret@mail.some.domain:100465" (this is left uncommented as a reader excercise ;) diff --git a/cnf/make.conf.s390 b/cnf/make.conf.s390 deleted file mode 100644 index c8705b5..0000000 --- a/cnf/make.conf.s390 +++ /dev/null @@ -1,318 +0,0 @@ -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/cnf/make.conf.s390,v 1.7 2005/02/26 07:21:14 jstubbs Exp $ -# Contains local system settings for Portage system - -# Please review 'man make.conf' for more information. - -# Build-time functionality -# ======================== -# -# The USE variable is used to enable optional build-time functionality. For -# example, quite a few packages have optional X, gtk or GNOME functionality -# that can only be enabled or disabled at compile-time. Gentoo Linux has a -# very extensive set of USE variables described in our USE variable HOWTO at -# http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&chap=1 -# -# The available list of use flags with descriptions is in your portage tree. -# Use 'less' to view them: --> less /usr/portage/profiles/use.desc <-- -# -# 'ufed' is an ncurses/dialog interface available in portage to make handling -# useflags for you. 'emerge app-portage/ufed' -# -# Example: -#USE="X gtk gnome -alsa" - -# Host Setting -# ============ -# -# All s390 systems should use this host setting: - -CHOST="s390-ibm-linux-gnu" - -# Host and optimization settings -# ============================== -# -#CFLAGS="-O2 -pipe" - -# If you set a CFLAGS above, then this line will set your default C++ flags to -# the same settings. -#CXXFLAGS="${CFLAGS}" - -# Advanced Masking -# ================ -# -# Gentoo is using a new masking system to allow for easier stability testing -# on packages. KEYWORDS are used in ebuilds to mask and unmask packages based -# on the platform they are set for. A special form has been added that -# indicates packages and revisions that are expected to work, but have not yet -# been approved for the stable set. '~arch' is a superset of 'arch' which -# includes the unstable, in testing, packages. Users of the 'x86' architecture -# would add '~x86' to ACCEPT_KEYWORDS to enable unstable/testing packages. -# '~ppc', '~sparc' are the unstable KEYWORDS for their respective platforms. -# -# Please note that this is not for development, alpha, beta, nor cvs release -# packages. "Broken" packages will not be added to testing and should not be -# requested to be added. Alternative routes are available to developers -# for experimental packages, and it is at their discretion to use them. -# -# DO NOT PUT ANYTHING BUT YOUR SPECIFIC ~ARCHITECTURE IN THE LIST. -# IF YOU ARE UNSURE OF YOUR ARCH, OR THE IMPLICATIONS, DO NOT MODIFY THIS. -# -#ACCEPT_KEYWORDS="~arch" - -# Portage Directories -# =================== -# -# Each of these settings controls an aspect of portage's storage and file -# system usage. If you change any of these, be sure it is available when -# you try to use portage. *** DO NOT INCLUDE A TRAILING "/" *** -# -# PORTAGE_TMPDIR is the location portage will use for compilations and -# temporary storage of data. This can get VERY large depending upon -# the application being installed. -#PORTAGE_TMPDIR=/var/tmp -# -# PORTDIR is the location of the portage tree. This is the repository -# for all profile information as well as all ebuilds. This directory -# itself can reach 200M. If you change this, you must update your -# /etc/make.profile symlink accordingly. -#PORTDIR=/usr/portage -# -# DISTDIR is where all of the source code tarballs will be placed for -# emerges. The source code is maintained here unless you delete -# it. The entire repository of tarballs for gentoo is 9G. This is -# considerably more than any user will ever download. 2-3G is -# a large DISTDIR. -#DISTDIR=${PORTDIR}/distfiles -# -# PKGDIR is the location of binary packages that you can have created -# with '--buildpkg' or '-b' while emerging a package. This can get -# upto several hundred megs, or even a few gigs. -#PKGDIR=${PORTDIR}/packages -# -# PORT_LOGDIR is the location where portage will store all the logs it -# creates from each individual merge. They are stored as NNNN-$PF.log -# in the directory specified. This is disabled until you enable it by -# providing a directory. Permissions will be modified as needed IF the -# directory exists, otherwise logging will be disabled. NNNN is the -# increment at the time the log is created. Logs are thus sequential. -#PORT_LOGDIR=/var/log/portage -# -# PORTDIR_OVERLAY is a directory where local ebuilds may be stored without -# concern that they will be deleted by rsync updates. Default is not -# defined. -#PORTDIR_OVERLAY=/usr/local/portage - -# Fetching files -# ============== -# -# If you need to set a proxy for wget or lukemftp, add the appropriate "export -# ftp_proxy=<proxy>" and "export http_proxy=<proxy>" lines to /etc/profile if -# all users on your system should use them. -# -# Portage uses wget by default. Here are some settings for some alternate -# downloaders -- note that you need to merge these programs first before they -# will be available. -# -# Default fetch command (5 tries, passive ftp for firewall compatibility) -#FETCHCOMMAND="/usr/bin/wget -t 5 --passive-ftp \${URI} -P \${DISTDIR}" -#RESUMECOMMAND="/usr/bin/wget -c -t 5 --passive-ftp \${URI} -P \${DISTDIR}" -# -# Using wget, ratelimiting downloads -#FETCHCOMMAND="/usr/bin/wget -t 5 --passive-ftp --limit-rate=200k \${URI} -P \${DISTDIR}" -#RESUMECOMMAND="/usr/bin/wget -c -t 5 --passive-ftp --limit-rate=200k \${URI} -P \${DISTDIR}" -# -# Lukemftp (BSD ftp): -#FETCHCOMMAND="/usr/bin/lukemftp -s -a -o \${DISTDIR}/\${FILE} \${URI}" -#RESUMECOMMAND="/usr/bin/lukemftp -s -a -R -o \${DISTDIR}/\${FILE} \${URI}" -# -# -# Portage uses GENTOO_MIRRORS to specify mirrors to use for source retrieval. -# The list is a space separated list which is read left to right. If you use -# another mirror we highly recommend leaving the default mirror at the end of -# the list so that portage will fall back to it if the files cannot be found -# on your specified mirror. We _HIGHLY_ recommend that you change this setting -# to a nearby mirror by merging and using the 'mirrorselect' tool. -#GENTOO_MIRRORS="<your_mirror_here> http://gentoo.osuosl.org http://www.ibiblio.org/pub/Linux/distributions/gentoo" -# -# Portage uses PORTAGE_BINHOST to specify mirrors for prebuilt-binary packages. -# The list is a single entry specifying the full address of the directory -# serving the tbz2's for your system. Running emerge with either '--getbinpkg' -# or '--getbinpkgonly' will cause portage to retrieve the metadata from all -# packages in the directory specified, and use that data to determine what will -# be downloaded and merged. '-g' or '-gK' are the recommend parameters. Please -# consult the man pages and 'emerge --help' for more information. For FTP, the -# default connection is passive -- If you require an active connection, affix -# an asterisk (*) to the end of the host:port string before the path. -#PORTAGE_BINHOST="http://grp.mirror.site/gentoo/grp/1.4/i686/athlon-xp/" -# This ftp connection is passive ftp. -#PORTAGE_BINHOST="ftp://login:pass@grp.mirror.site/pub/grp/i686/athlon-xp/" -# This ftp connection is active ftp. -#PORTAGE_BINHOST="ftp://login:pass@grp.mirror.site:21*/pub/grp/i686/athlon-xp/" - -# Synchronizing Portage -# ===================== -# -# Each of these settings affects how Gentoo synchronizes your Portage tree. -# Synchronization is handled by rsync and these settings allow some control -# over how it is done. -# -# -# SYNC is the server used by rsync to retrieve a localized rsync mirror -# rotation. This allows you to select servers that are geographically -# close to you, yet still distribute the load over a number of servers. -# Please do not single out specific rsync mirrors. Doing so places undue -# stress on particular mirrors. Instead you may use one of the following -# continent specific rotations: -# -# Default: "rsync://rsync.gentoo.org/gentoo-portage" -# North America: "rsync://rsync.namerica.gentoo.org/gentoo-portage" -# South America: "rsync://rsync.samerica.gentoo.org/gentoo-portage" -# Europe: "rsync://rsync.europe.gentoo.org/gentoo-portage" -# Asia: "rsync://rsync.asia.gentoo.org/gentoo-portage" -# Australia: "rsync://rsync.au.gentoo.org/gentoo-portage" -#SYNC="rsync://rsync.gentoo.org/gentoo-portage" -# -# RSYNC_RETRIES sets the number of times portage will attempt to retrieve -# a current portage tree before it exits with an error. This allows -# for a more successful retrieval without user intervention most times. -#RSYNC_RETRIES="3" -# -# RSYNC_TIMEOUT sets the length of time rsync will wait before it times out -# on a connection. Most users will benefit from this setting as it will -# reduce the amount of 'dead air' they experience when they run across -# the occasional, unreachable mirror. Dialup users might want to set this -# value up around the 300 second mark. -#RSYNC_TIMEOUT=180 - -# Advanced Features -# ================= -# -# MAKEOPTS provides extra options that may be passed to 'make' when a -# program is compiled. Presently the only use is for specifying -# the number of parallel makes (-j) to perform. The suggested number -# for parallel makes is CPUs+1. -#MAKEOPTS="-j2" -# -# PORTAGE_NICENESS provides a default increment to emerge's niceness level. -# Note: This is an increment. Running emerge in a niced environment will -# reduce it further. Default is unset. -#PORTAGE_NICENESS=3 -# -# PORTAGE_TMPFS is a location where portage may create temporary files. -# If specified, portage will use this directory whenever possible -# for all rapid operations such as lockfiles and transient data. -# It is _highly_ recommended that this be a tmpfs or ramdisk. Do not -# set this to anything that does not give a significant performance -# enhancement and proper FS compliance for locks and read/write. -# /dev/shm is a glibc mandated tmpfs, and should be a reasonable -# setting for all linux kernel+glibc based systems. -#PORTAGE_TMPFS="/dev/shm" -# -# FEATURES are settings that affect the functionality of portage. Most of -# these settings are for developer use, but some are available to non- -# developers as well. -# -# 'autoaddcvs' causes portage to automatically try to add files to cvs -# that will have to be added later. Done at generation times -# and only has an effect when 'cvs' is also set. -# 'buildpkg' causes binary packages to be created of all packages that -# are being merged. -# 'ccache' enables ccache support via CC. -# 'collision-protect' -# prevents packages from overwriting files that are owned by -# another package or by no package at all. -# 'cvs' causes portage to enable all cvs features (commits, adds), -# and to apply all USE flags in SRC_URI for digests -- for -# developers only. -# 'digest' causes digests to be generated for all packages being merged. -# 'distcc' enables distcc support via CC. -# 'distlocks' enables distfiles locking using fcntl or hardlinks. This -# is enabled by default. Tools exist to help clean the locks -# after crashes: /usr/lib/portage/bin/clean_locks. -# 'fixpackages' allows portage to fix binary packages that are stored in -# PKGDIR. This can consume a lot of time. 'fixpackages' is -# also a script that can be run at any given time to force -# the same actions. -# 'gpg' enables basic verification of Manifest files using gpg. -# This features is UNDER DEVELOPMENT and reacts to features -# of strict and severe. Heavy use of gpg sigs is coming. -# 'keeptemp' prevents the clean phase from deleting the temp files ($T) -# from a merge. -# 'keepwork' prevents the clean phase from deleting the WORKDIR. -# 'maketest' causes ebuilds to perform testing phases if they are capable -# of it. Some packages support this automaticaly via makefiles. -# 'noauto' causes ebuild to perform only the action requested and -# not any other required actions like clean or unpack -- for -# debugging purposes only. -# 'noclean' prevents portage from removing the source and temporary files -# after a merge -- for debugging purposes only. -# 'nostrip' prevents the stripping of binaries. -# 'notitles' disables xterm titlebar updates (which contain status info). -# 'sandbox' enables sandboxing when running emerge and ebuild. -# 'strict' causes portage to react strongly to conditions that are -# potentially dangerous, like missing/incorrect Manifest files. -# 'userpriv' allows portage to drop root privileges while it is compiling, -# as a security measure. As a side effect this can remove -# sandbox access violations for users. -# 'usersandbox' enables sandboxing while portage is running under userpriv. -#FEATURES="sandbox buildpkg ccache distcc userpriv usersandbox notitles noclean noauto cvs keeptemp keepwork autoaddcvs" -#FEATURES="sandbox ccache distcc distlocks autoaddcvs" -# -# CCACHE_SIZE sets the space use limitations for ccache. The default size is -# 2G, and will be set if not defined otherwise and ccache is in features. -# Portage will set the default ccache dir if it is not present in the -# user's environment, for userpriv it sets: ${PORTAGE_TMPDIR}/ccache -# (/var/tmp/ccache), and for regular use the default is /root/.ccache. -# Sizes are specified with 'G' 'M' or 'K'. -# '2G' for 2 gigabytes, '2048M' for 2048 megabytes (same as 2G). -#CCACHE_SIZE="512M" -# -# DISTCC_DIR sets the temporary space used by distcc. -#DISTCC_DIR="${PORTAGE_TMPDIR}/.distcc" -# -# RSYNC_EXCLUDEFROM is a file that portage will pass to rsync when it updates -# the portage tree. Specific chunks of the tree may be excluded from -# consideration. This may cause dependency failures if you are not careful. -# The file format is one pattern per line, blanks and ';' or '#' lines are -# comments. See 'man rsync' for more details on the exclude-from format. -#RSYNC_EXCLUDEFROM=/etc/portage/rsync_excludes - -# logging related variables: -# PORTAGE_LOG_CLASSES: selects messages to be logged, possible values are: -# info, warn, error, log -PORTAGE_LOG_CLASSES="warn error log" - -# PORTAGE_LOG_SYSTEM: selects the module(s) to process the log messages. Modules -# included in portage are (empty means logging is disabled): -# save (saves one log per package in $PORTAGE_TMPDIR/elogs) -# custom (passes all messages to $PORTAGE_LOG_COMMAND) -# syslog (sends all messages to syslog) -# mail (send all messages to the mailserver defined -# in $PORTAGE_LOG_MAILURI) -#PORTAGE_LOG_SYSTEM="save mail" - -# PORTAGE_LOG_COMMAND: only used with the "custom" logging module. Specifies a command -# to process log messages. Two variables are expanded: -# ${PACKAGE} - expands to the cpv entry of the processed -# package (see $PVR in ebuild(5)) -# ${LOGFILE} - absolute path to the logfile -#PORTAGE_LOG_COMMAND="/path/to/logprocessor -p ${PACKAGE} -f ${LOGFILE}" - -# PORTAGE_LOG_MAILURI: this variable holds all important settings for the mail -# module. In most cases listing the recipient adress and -# the receiving mailserver should be sufficient, but you can -# also use advanced settings like authentication or TLS. The -# full syntax is: -# adress [[user:passwd@]mailserver[:port]] -# where -# adress: recipient adress -# user: username for smtp auth (defaults to none) -# passwd: password for smtp auth (defaults to none) -# mailserver: smtp server that should be used to deliver the mail (defaults to localhost) -# port: port to use on the given smtp server (defaults to 25, values > 100000 indicate that starttls should be used on (port-100000)) -# Examples: -#PORTAGE_LOG_MAILURI="root@localhost localhost" (this is also the default setting) -#PORTAGE_LOG_MAILURI="user@some.domain mail.some.domain" (sends mails to user@some.domain using the mailserver mail.some.domain) -#PORTAGE_LOG_MAILURI="user@some.domain user:secret@mail.some.domain:100465" (this is left uncommented as a reader excercise ;) diff --git a/cnf/make.conf.sh b/cnf/make.conf.sh deleted file mode 100644 index 7be671f..0000000 --- a/cnf/make.conf.sh +++ /dev/null @@ -1,315 +0,0 @@ -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/cnf/make.conf.sh,v 1.4 2005/02/21 12:45:49 genone Exp $ -# Contains local system settings for Portage system - -# Please review 'man make.conf' for more information. - -# Build-time functionality -# ======================== -# -# The USE variable is used to enable optional build-time functionality. For -# example, quite a few packages have optional X, gtk or GNOME functionality -# that can only be enabled or disabled at compile-time. Gentoo Linux has a -# very extensive set of USE variables described in our USE variable HOWTO at -# http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&chap=1 -# -# The available list of use flags with descriptions is in your portage tree. -# Use 'less' to view them: --> less /usr/portage/profiles/use.desc <-- -# -# 'ufed' is an ncurses/dialog interface available in portage to make handling -# useflags for you. 'emerge app-portage/ufed' -# -# Example: -#USE="X gtk gnome -alsa" - -# Host Setting -# ============ -# -# Change this line as appropriate (sh, sh2, sh3, sh4, sh5). -CHOST="sh-unknown-linux-gnu" - -# Host and optimization settings -# ============================== -# -# For optimal performance, enable a CFLAGS setting appropriate for your CPU. -# -# Please note that if you experience strange issues with a package, it may be -# due to gcc's optimizations interacting in a strange way. Please test the -# package (and in some cases the libraries it uses) at default optimizations -# before reporting errors to developers. -# -# Decent examples: -# -#CFLAGS="-Os -pipe" - -# If you set a CFLAGS above, then this line will set your default C++ flags to -# the same settings. -#CXXFLAGS="${CFLAGS}" - -# Advanced Masking -# ================ -# -# Gentoo is using a new masking system to allow for easier stability testing -# on packages. KEYWORDS are used in ebuilds to mask and unmask packages based -# on the platform they are set for. A special form has been added that -# indicates packages and revisions that are expected to work, but have not yet -# been approved for the stable set. '~arch' is a superset of 'arch' which -# includes the unstable, in testing, packages. Users of the 'x86' architecture -# would add '~x86' to ACCEPT_KEYWORDS to enable unstable/testing packages. -# '~ppc', '~sparc' are the unstable KEYWORDS for their respective platforms. -# -# Please note that this is not for development, alpha, beta, nor cvs release -# packages. "Broken" packages will not be added to testing and should not be -# requested to be added. Alternative routes are available to developers -# for experimental packages, and it is at their discretion to use them. -# -# DO NOT PUT ANYTHING BUT YOUR SPECIFIC ~ARCHITECTURE IN THE LIST. -# IF YOU ARE UNSURE OF YOUR ARCH, OR THE IMPLICATIONS, DO NOT MODIFY THIS. -# -#ACCEPT_KEYWORDS="~arch" - -# Portage Directories -# =================== -# -# Each of these settings controls an aspect of portage's storage and file -# system usage. If you change any of these, be sure it is available when -# you try to use portage. *** DO NOT INCLUDE A TRAILING "/" *** -# -# PORTAGE_TMPDIR is the location portage will use for compilations and -# temporary storage of data. This can get VERY large depending upon -# the application being installed. -#PORTAGE_TMPDIR=/var/tmp -# -# PORTDIR is the location of the portage tree. This is the repository -# for all profile information as well as all ebuilds. This directory -# itself can reach 200M. WE DO NOT RECOMMEND that you change this. -#PORTDIR=/usr/portage -# -# DISTDIR is where all of the source code tarballs will be placed for -# emerges. The source code is maintained here unless you delete -# it. The entire repository of tarballs for gentoo is 9G. This is -# considerably more than any user will ever download. 2-3G is -# a large DISTDIR. -#DISTDIR=${PORTDIR}/distfiles -# -# PKGDIR is the location of binary packages that you can have created -# with '--buildpkg' or '-b' while emerging a package. This can get -# upto several hundred megs, or even a few gigs. -#PKGDIR=${PORTDIR}/packages -# -# PORT_LOGDIR is the location where portage will store all the logs it -# creates from each individual merge. They are stored as NNNN-$PF.log -# in the directory specified. This is disabled until you enable it by -# providing a directory. Permissions will be modified as needed IF the -# directory exists, otherwise logging will be disabled. NNNN is the -# increment at the time the log is created. Logs are thus sequential. -#PORT_LOGDIR=/var/log/portage -# -# PORTDIR_OVERLAY is a directory where local ebuilds may be stored without -# concern that they will be deleted by rsync updates. Default is not -# defined. -#PORTDIR_OVERLAY=/usr/local/portage - -# Fetching files -# ============== -# -# If you need to set a proxy for wget or lukemftp, add the appropriate "export -# ftp_proxy=<proxy>" and "export http_proxy=<proxy>" lines to /etc/profile if -# all users on your system should use them. -# -# Portage uses wget by default. Here are some settings for some alternate -# downloaders -- note that you need to merge these programs first before they -# will be available. -# -# Default fetch command (5 tries, passive ftp for firewall compatibility) -#FETCHCOMMAND="/usr/bin/wget -t 5 --passive-ftp \${URI} -P \${DISTDIR}" -#RESUMECOMMAND="/usr/bin/wget -c -t 5 --passive-ftp \${URI} -P \${DISTDIR}" -# -# Using wget, ratelimiting downloads -#FETCHCOMMAND="/usr/bin/wget -t 5 --passive-ftp --limit-rate=200k \${URI} -P \${DISTDIR}" -#RESUMECOMMAND="/usr/bin/wget -c -t 5 --passive-ftp --limit-rate=200k \${URI} -P \${DISTDIR}" -# -# Lukemftp (BSD ftp): -#FETCHCOMMAND="/usr/bin/lukemftp -s -a -o \${DISTDIR}/\${FILE} \${URI}" -#RESUMECOMMAND="/usr/bin/lukemftp -s -a -R -o \${DISTDIR}/\${FILE} \${URI}" -# -# -# Portage uses GENTOO_MIRRORS to specify mirrors to use for source retrieval. -# The list is a space separated list which is read left to right. If you use -# another mirror we highly recommend leaving the default mirror at the end of -# the list so that portage will fall back to it if the files cannot be found -# on your specified mirror. We _HIGHLY_ recommend that you change this setting -# to a nearby mirror by merging and using the 'mirrorselect' tool. -#GENTOO_MIRRORS="<your_mirror_here> http://gentoo.osuosl.org http://www.ibiblio.org/pub/Linux/distributions/gentoo" -# -# Portage uses PORTAGE_BINHOST to specify mirrors for prebuilt-binary packages. -# The list is a single entry specifying the full address of the directory -# serving the tbz2's for your system. Running emerge with either '--getbinpkg' -# or '--getbinpkgonly' will cause portage to retrieve the metadata from all -# packages in the directory specified, and use that data to determine what will -# be downloaded and merged. '-g' or '-gK' are the recommend parameters. Please -# consult the man pages and 'emerge --help' for more information. For FTP, the -# default connection is passive -- If you require an active connection, affix -# an asterisk (*) to the end of the host:port string before the path. -#PORTAGE_BINHOST="http://grp.mirror.site/gentoo/grp/1.4/i686/athlon-xp/" -# This ftp connection is passive ftp. -#PORTAGE_BINHOST="ftp://login:pass@grp.mirror.site/pub/grp/i686/athlon-xp/" -# This ftp connection is active ftp. -#PORTAGE_BINHOST="ftp://login:pass@grp.mirror.site:21*/pub/grp/i686/athlon-xp/" - -# Synchronizing Portage -# ===================== -# -# Each of these settings affects how Gentoo synchronizes your Portage tree. -# Synchronization is handled by rsync and these settings allow some control -# over how it is done. -# -# -# SYNC is the server used by rsync to retrieve a localized rsync mirror -# rotation. This allows you to select servers that are geographically -# close to you, yet still distribute the load over a number of servers. -# Please do not single out specific rsync mirrors. Doing so places undue -# stress on particular mirrors. Instead you may use one of the following -# continent specific rotations: -# -# Default: "rsync://rsync.gentoo.org/gentoo-portage" -# North America: "rsync://rsync.namerica.gentoo.org/gentoo-portage" -# South America: "rsync://rsync.samerica.gentoo.org/gentoo-portage" -# Europe: "rsync://rsync.europe.gentoo.org/gentoo-portage" -# Asia: "rsync://rsync.asia.gentoo.org/gentoo-portage" -# Australia: "rsync://rsync.au.gentoo.org/gentoo-portage" -#SYNC="rsync://rsync.gentoo.org/gentoo-portage" -# -# RSYNC_RETRIES sets the number of times portage will attempt to retrieve -# a current portage tree before it exits with an error. This allows -# for a more successful retrieval without user intervention most times. -#RSYNC_RETRIES="3" -# -# RSYNC_TIMEOUT sets the length of time rsync will wait before it times out -# on a connection. Most users will benefit from this setting as it will -# reduce the amount of 'dead air' they experience when they run across -# the occasional, unreachable mirror. Dialup users might want to set this -# value up around the 300 second mark. -#RSYNC_TIMEOUT=180 - -# Advanced Features -# ================= -# -# MAKEOPTS provides extra options that may be passed to 'make' when a -# program is compiled. Presently the only use is for specifying -# the number of parallel makes (-j) to perform. The suggested number -# for parallel makes is CPUs+1. -#MAKEOPTS="-j2" -# -# PORTAGE_NICENESS provides a default increment to emerge's niceness level. -# Note: This is an increment. Running emerge in a niced environment will -# reduce it further. Default is unset. -#PORTAGE_NICENESS=3 -# -# FEATURES are settings that affect the functionality of portage. Most of -# these settings are for developer use, but some are available to non- -# developers as well. -# -# 'autoaddcvs' causes portage to automatically try to add files to cvs -# that will have to be added later. Done at generation times -# and only has an effect when 'cvs' is also set. -# 'buildpkg' causes binary packages to be created of all packages that -# are being merged. -# 'ccache' enables ccache support via CC. -# 'collision-protect' -# prevents packages from overwriting files that are owned by -# another package or by no package at all. -# 'cvs' causes portage to enable all cvs features (commits, adds), -# and to apply all USE flags in SRC_URI for digests -- for -# developers only. -# 'digest' causes digests to be generated for all packages being merged. -# 'distcc' enables distcc support via CC. -# 'distlocks' enables distfiles locking using fcntl or hardlinks. This -# is enabled by default. Tools exist to help clean the locks -# after crashes: /usr/lib/portage/bin/clean_locks. -# 'fixpackages' allows portage to fix binary packages that are stored in -# PKGDIR. This can consume a lot of time. 'fixpackages' is -# also a script that can be run at any given time to force -# the same actions. -# 'gpg' enables basic verification of Manifest files using gpg. -# This features is UNDER DEVELOPMENT and reacts to features -# of strict and severe. Heavy use of gpg sigs is coming. -# 'keeptemp' prevents the clean phase from deleting the temp files ($T) -# from a merge. -# 'keepwork' prevents the clean phase from deleting the WORKDIR. -# 'maketest' causes ebuilds to perform testing phases if they are capable -# of it. Some packages support this automaticaly via makefiles. -# 'noauto' causes ebuild to perform only the action requested and -# not any other required actions like clean or unpack -- for -# debugging purposes only. -# 'noclean' prevents portage from removing the source and temporary files -# after a merge -- for debugging purposes only. -# 'nostrip' prevents the stripping of binaries. -# 'notitles' disables xterm titlebar updates (which contain status info). -# 'sandbox' enables sandboxing when running emerge and ebuild. -# 'strict' causes portage to react strongly to conditions that are -# potentially dangerous, like missing/incorrect Manifest files. -# 'userpriv' allows portage to drop root privileges while it is compiling, -# as a security measure. As a side effect this can remove -# sandbox access violations for users. -# 'usersandbox' enables sandboxing while portage is running under userpriv. -#FEATURES="sandbox buildpkg ccache distcc userpriv usersandbox notitles noclean noauto cvs keeptemp keepwork autoaddcvs" -#FEATURES="sandbox ccache distcc distlocks autoaddcvs" -# -# CCACHE_SIZE sets the space use limitations for ccache. The default size is -# 2G, and will be set if not defined otherwise and ccache is in features. -# Portage will set the default ccache dir if it is not present in the -# user's environment, for userpriv it sets: ${PORTAGE_TMPDIR}/ccache -# (/var/tmp/ccache), and for regular use the default is /root/.ccache. -# Sizes are specified with 'G' 'M' or 'K'. -# '2G' for 2 gigabytes, '2048M' for 2048 megabytes (same as 2G). -#CCACHE_SIZE="512M" -# -# DISTCC_DIR sets the temporary space used by distcc. -#DISTCC_DIR="${PORTAGE_TMPDIR}/.distcc" -# -# RSYNC_EXCLUDEFROM is a file that portage will pass to rsync when it updates -# the portage tree. Specific chunks of the tree may be excluded from -# consideration. This may cause dependency failures if you are not careful. -# The file format is one pattern per line, blanks and ';' or '#' lines are -# comments. See 'man rsync' for more details on the exclude-from format. -#RSYNC_EXCLUDEFROM=/etc/portage/rsync_excludes - -# logging related variables: -# PORTAGE_LOG_CLASSES: selects messages to be logged, possible values are: -# info, warn, error, log -PORTAGE_LOG_CLASSES="warn error log" - -# PORTAGE_LOG_SYSTEM: selects the module(s) to process the log messages. Modules -# included in portage are (empty means logging is disabled): -# save (saves one log per package in $PORTAGE_TMPDIR/elogs) -# custom (passes all messages to $PORTAGE_LOG_COMMAND) -# syslog (sends all messages to syslog) -# mail (send all messages to the mailserver defined -# in $PORTAGE_LOG_MAILURI) -#PORTAGE_LOG_SYSTEM="save mail" - -# PORTAGE_LOG_COMMAND: only used with the "custom" logging module. Specifies a command -# to process log messages. Two variables are expanded: -# ${PACKAGE} - expands to the cpv entry of the processed -# package (see $PVR in ebuild(5)) -# ${LOGFILE} - absolute path to the logfile -#PORTAGE_LOG_COMMAND="/path/to/logprocessor -p ${PACKAGE} -f ${LOGFILE}" - -# PORTAGE_LOG_MAILURI: this variable holds all important settings for the mail -# module. In most cases listing the recipient adress and -# the receiving mailserver should be sufficient, but you can -# also use advanced settings like authentication or TLS. The -# full syntax is: -# adress [[user:passwd@]mailserver[:port]] -# where -# adress: recipient adress -# user: username for smtp auth (defaults to none) -# passwd: password for smtp auth (defaults to none) -# mailserver: smtp server that should be used to deliver the mail (defaults to localhost) -# port: port to use on the given smtp server (defaults to 25, values > 100000 indicate that starttls should be used on (port-100000)) -# Examples: -#PORTAGE_LOG_MAILURI="root@localhost localhost" (this is also the default setting) -#PORTAGE_LOG_MAILURI="user@some.domain mail.some.domain" (sends mails to user@some.domain using the mailserver mail.some.domain) -#PORTAGE_LOG_MAILURI="user@some.domain user:secret@mail.some.domain:100465" (this is left uncommented as a reader excercise ;) diff --git a/cnf/make.conf.sparc b/cnf/make.conf.sparc deleted file mode 100644 index 302bac9..0000000 --- a/cnf/make.conf.sparc +++ /dev/null @@ -1,353 +0,0 @@ -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/cnf/make.conf.sparc,v 1.47 2005/02/26 07:21:14 jstubbs Exp $ -# Contains local system settings for Portage system - -# Please review 'man make.conf' for more information. - -# Build-time functionality -# ======================== -# -# The USE variable is used to enable optional build-time functionality. For -# example, quite a few packages have optional X, gtk or GNOME functionality -# that can only be enabled or disabled at compile-time. Gentoo Linux has a -# very extensive set of USE variables described in our USE variable HOWTO at -# http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&chap=1 -# -# The available list of use flags with descriptions is in your portage tree. -# Use 'less' to view them: --> less /usr/portage/profiles/use.desc <-- -# -# 'ufed' is an ncurses/dialog interface available in portage to make handling -# useflags for you. 'emerge app-portage/ufed' -# -# Example: -#USE="X gtk gnome -alsa" - -# Host Setting -# ============ -# This should be left to the default value of sparc-unknown-linux-gnu unless -# you are absolutely certain of the consequences. In addition to potentially -# destroying your system, you will recieve no support and your bugs will be -# marked INVALID if you change this. -# -# CHOST="sparc-unknown-linux-gnu" - -# Host and optimization settings -# ============================== -# -# For optimal performance, enable a CFLAGS setting appropriate for your CPU. -# -# Please note that if you experience strange issues with a package, it may be -# due to gcc's optimizations interacting in a strange way. Please test the -# package (and in some cases the libraries it uses) at default optimizations -# before reporting errors to developers. -# -# Sparc specific cpu optimizatiobn flags can be found here: -# http://gcc.gnu.org/onlinedocs/gcc-3.3/gcc/SPARC-Options.html#SPARC%20Options -# -# -mcpu=<cpu-type> means optimize code for the particular type of CPU without -# breaking compatibility with other CPUs. -# -# -mtune=<cpu-type> set the instruction scheduling parameters for machine, but -# do not set the instruction set or register set. -# -# Here is a list of each supported architecture and their supported -# implementations: -# -# gcc-3.2 and higher: -# v7: cypress -# v8: supersparc, hypersparc -# sparclite: f930, f934, sparclite86x -# sparclet: tsc701 -# v9: ultrasparc -# -# Additionally in gcc-3.3 and higher: -# v9: ultrasparc3 -# -# Decent examples: -# -#CFLAGS="-mcpu=supersparc -O3 -pipe" -#CFLAGS="-mcpu=ultrasparc -O3 -pipe" -#CFLAGS="-mcpu=v8 -mtune=v9 -O2 -pipe" - -# If you set a CFLAGS above, then this line will set your default C++ flags to -# the same settings. -#CXXFLAGS="${CFLAGS}" - -# Advanced Masking -# ================ -# -# Gentoo is using a new masking system to allow for easier stability testing -# on packages. KEYWORDS are used in ebuilds to mask and unmask packages based -# on the platform they are set for. A special form has been added that -# indicates packages and revisions that are expected to work, but have not yet -# been approved for the stable set. '~arch' is a superset of 'arch' which -# includes the unstable, in testing, packages. Users of the 'x86' architecture -# would add '~x86' to ACCEPT_KEYWORDS to enable unstable/testing packages. -# '~ppc', '~sparc' are the unstable KEYWORDS for their respective platforms. -# -# Please note that this is not for development, alpha, beta, nor cvs release -# packages. "Broken" packages will not be added to testing and should not be -# requested to be added. Alternative routes are available to developers -# for experimental packages, and it is at their discretion to use them. -# -# DO NOT PUT ANYTHING BUT YOUR SPECIFIC ~ARCHITECTURE IN THE LIST. -# IF YOU ARE UNSURE OF YOUR ARCH, OR THE IMPLICATIONS, DO NOT MODIFY THIS. -# -#ACCEPT_KEYWORDS="~sparc" - -# Portage Directories -# =================== -# -# Each of these settings controls an aspect of portage's storage and file -# system usage. If you change any of these, be sure it is available when -# you try to use portage. *** DO NOT INCLUDE A TRAILING "/" *** -# -# PORTAGE_TMPDIR is the location portage will use for compilations and -# temporary storage of data. This can get VERY large depending upon -# the application being installed. -#PORTAGE_TMPDIR=/var/tmp -# -# PORTDIR is the location of the portage tree. This is the repository -# for all profile information as well as all ebuilds. This directory -# itself can reach 200M. If you change this, you must update your -# /etc/make.profile symlink accordingly. -#PORTDIR=/usr/portage -# -# DISTDIR is where all of the source code tarballs will be placed for -# emerges. The source code is maintained here unless you delete -# it. The entire repository of tarballs for gentoo is 9G. This is -# considerably more than any user will ever download. 2-3G is -# a large DISTDIR. -#DISTDIR=${PORTDIR}/distfiles -# -# PKGDIR is the location of binary packages that you can have created -# with '--buildpkg' or '-b' while emerging a package. This can get -# upto several hundred megs, or even a few gigs. -#PKGDIR=${PORTDIR}/packages -# -# PORT_LOGDIR is the location where portage will store all the logs it -# creates from each individual merge. They are stored as NNNN-$PF.log -# in the directory specified. This is disabled until you enable it by -# providing a directory. Permissions will be modified as needed IF the -# directory exists, otherwise logging will be disabled. NNNN is the -# increment at the time the log is created. Logs are thus sequential. -#PORT_LOGDIR=/var/log/portage -# -# PORTDIR_OVERLAY is a directory where local ebuilds may be stored without -# concern that they will be deleted by rsync updates. Default is not -# defined. -#PORTDIR_OVERLAY=/usr/local/portage - -# Fetching files -# ============== -# -# If you need to set a proxy for wget or lukemftp, add the appropriate "export -# ftp_proxy=<proxy>" and "export http_proxy=<proxy>" lines to /etc/profile if -# all users on your system should use them. -# -# Portage uses wget by default. Here are some settings for some alternate -# downloaders -- note that you need to merge these programs first before they -# will be available. -# -# Default fetch command (5 tries, passive ftp for firewall compatibility) -#FETCHCOMMAND="/usr/bin/wget -t 5 --passive-ftp \${URI} -P \${DISTDIR}" -#RESUMECOMMAND="/usr/bin/wget -c -t 5 --passive-ftp \${URI} -P \${DISTDIR}" -# -# Using wget, ratelimiting downloads -#FETCHCOMMAND="/usr/bin/wget -t 5 --passive-ftp --limit-rate=200k \${URI} -P \${DISTDIR}" -#RESUMECOMMAND="/usr/bin/wget -c -t 5 --passive-ftp --limit-rate=200k \${URI} -P \${DISTDIR}" -# -# Lukemftp (BSD ftp): -#FETCHCOMMAND="/usr/bin/lukemftp -s -a -o \${DISTDIR}/\${FILE} \${URI}" -#RESUMECOMMAND="/usr/bin/lukemftp -s -a -R -o \${DISTDIR}/\${FILE} \${URI}" -# -# -# Portage uses GENTOO_MIRRORS to specify mirrors to use for source retrieval. -# The list is a space separated list which is read left to right. If you use -# another mirror we highly recommend leaving the default mirror at the end of -# the list so that portage will fall back to it if the files cannot be found -# on your specified mirror. We _HIGHLY_ recommend that you change this setting -# to a nearby mirror by merging and using the 'mirrorselect' tool. -#GENTOO_MIRRORS="<your_mirror_here> http://distfiles.gentoo.org http://www.ibiblio.org/pub/Linux/distributions/gentoo" -# -# Portage uses PORTAGE_BINHOST to specify mirrors for prebuilt-binary packages. -# The list is a single entry specifying the full address of the directory -# serving the tbz2's for your system. Running emerge with either '--getbinpkg' -# or '--getbinpkgonly' will cause portage to retrieve the metadata from all -# packages in the directory specified, and use that data to determine what will -# be downloaded and merged. '-g' or '-gK' are the recommend parameters. Please -# consult the man pages and 'emerge --help' for more information. For FTP, the -# default connection is passive -- If you require an active connection, affix -# an asterisk (*) to the end of the host:port string before the path. -#PORTAGE_BINHOST="http://grp.mirror.site/gentoo/grp/1.4/i686/athlon-xp/" -# This ftp connection is passive ftp. -#PORTAGE_BINHOST="ftp://login:pass@grp.mirror.site/pub/grp/i686/athlon-xp/" -# This ftp connection is active ftp. -#PORTAGE_BINHOST="ftp://login:pass@grp.mirror.site:21*/pub/grp/i686/athlon-xp/" - -# Synchronizing Portage -# ===================== -# -# Each of these settings affects how Gentoo synchronizes your Portage tree. -# Synchronization is handled by rsync and these settings allow some control -# over how it is done. -# -# -# SYNC is the server used by rsync to retrieve a localized rsync mirror -# rotation. This allows you to select servers that are geographically -# close to you, yet still distribute the load over a number of servers. -# Please do not single out specific rsync mirrors. Doing so places undue -# stress on particular mirrors. Instead you may use one of the following -# continent specific rotations: -# -# Default: "rsync://rsync.gentoo.org/gentoo-portage" -# North America: "rsync://rsync.namerica.gentoo.org/gentoo-portage" -# South America: "rsync://rsync.samerica.gentoo.org/gentoo-portage" -# Europe: "rsync://rsync.europe.gentoo.org/gentoo-portage" -# Asia: "rsync://rsync.asia.gentoo.org/gentoo-portage" -# Australia: "rsync://rsync.au.gentoo.org/gentoo-portage" -#SYNC="rsync://rsync.gentoo.org/gentoo-portage" -# -# RSYNC_RETRIES sets the number of times portage will attempt to retrieve -# a current portage tree before it exits with an error. This allows -# for a more successful retrieval without user intervention most times. -#RSYNC_RETRIES="3" -# -# RSYNC_TIMEOUT sets the length of time rsync will wait before it times out -# on a connection. Most users will benefit from this setting as it will -# reduce the amount of 'dead air' they experience when they run across -# the occasional, unreachable mirror. Dialup users might want to set this -# value up around the 300 second mark. -#RSYNC_TIMEOUT=180 - -# Advanced Features -# ================= -# -# MAKEOPTS provides extra options that may be passed to 'make' when a -# program is compiled. Presently the only use is for specifying -# the number of parallel makes (-j) to perform. The suggested number -# for parallel makes is CPUs+1. -#MAKEOPTS="-j2" -# -# PORTAGE_NICENESS provides a default increment to emerge's niceness level. -# Note: This is an increment. Running emerge in a niced environment will -# reduce it further. Default is unset. -#PORTAGE_NICENESS=3 -# -# PORTAGE_TMPFS is a location where portage may create temporary files. -# If specified, portage will use this directory whenever possible -# for all rapid operations such as lockfiles and transient data. -# It is _highly_ recommended that this be a tmpfs or ramdisk. Do not -# set this to anything that does not give a significant performance -# enhancement and proper FS compliance for locks and read/write. -# /dev/shm is a glibc mandated tmpfs, and should be a reasonable -# setting for all linux kernel+glibc based systems. -#PORTAGE_TMPFS="/dev/shm" -# -# FEATURES are settings that affect the functionality of portage. Most of -# these settings are for developer use, but some are available to non- -# developers as well. -# -# 'autoaddcvs' causes portage to automatically try to add files to cvs -# that will have to be added later. Done at generation times -# and only has an effect when 'cvs' is also set. -# 'buildpkg' causes binary packages to be created of all packages that -# are being merged. -# 'ccache' enables ccache support via CC. -# 'collision-protect' -# prevents packages from overwriting files that are owned by -# another package or by no package at all. -# 'cvs' causes portage to enable all cvs features (commits, adds), -# and to apply all USE flags in SRC_URI for digests -- for -# developers only. -# 'digest' causes digests to be generated for all packages being merged. -# 'distcc' enables distcc support via CC. -# 'distlocks' enables distfiles locking using fcntl or hardlinks. This -# is enabled by default. Tools exist to help clean the locks -# after crashes: /usr/lib/portage/bin/clean_locks. -# 'fixpackages' allows portage to fix binary packages that are stored in -# PKGDIR. This can consume a lot of time. 'fixpackages' is -# also a script that can be run at any given time to force -# the same actions. -# 'gpg' enables basic verification of Manifest files using gpg. -# This features is UNDER DEVELOPMENT and reacts to features -# of strict and severe. Heavy use of gpg sigs is coming. -# 'keeptemp' prevents the clean phase from deleting the temp files ($T) -# from a merge. -# 'keepwork' prevents the clean phase from deleting the WORKDIR. -# 'maketest' causes ebuilds to perform testing phases if they are capable -# of it. Some packages support this automaticaly via makefiles. -# 'noauto' causes ebuild to perform only the action requested and -# not any other required actions like clean or unpack -- for -# debugging purposes only. -# 'noclean' prevents portage from removing the source and temporary files -# after a merge -- for debugging purposes only. -# 'nostrip' prevents the stripping of binaries. -# 'notitles' disables xterm titlebar updates (which contain status info). -# 'sandbox' enables sandboxing when running emerge and ebuild. -# 'strict' causes portage to react strongly to conditions that are -# potentially dangerous, like missing/incorrect Manifest files. -# 'userpriv' allows portage to drop root privileges while it is compiling, -# as a security measure. As a side effect this can remove -# sandbox access violations for users. -# 'usersandbox' enables sandboxing while portage is running under userpriv. -#FEATURES="sandbox buildpkg ccache distcc userpriv usersandbox notitles noclean noauto cvs keeptemp keepwork autoaddcvs" -#FEATURES="sandbox ccache distcc distlocks autoaddcvs" -# -# CCACHE_SIZE sets the space use limitations for ccache. The default size is -# 2G, and will be set if not defined otherwise and ccache is in features. -# Portage will set the default ccache dir if it is not present in the -# user's environment, for userpriv it sets: ${PORTAGE_TMPDIR}/ccache -# (/var/tmp/ccache), and for regular use the default is /root/.ccache. -# Sizes are specified with 'G' 'M' or 'K'. -# '2G' for 2 gigabytes, '2048M' for 2048 megabytes (same as 2G). -#CCACHE_SIZE="512M" -# -# DISTCC_DIR sets the temporary space used by distcc. -#DISTCC_DIR="${PORTAGE_TMPDIR}/.distcc" -# -# RSYNC_EXCLUDEFROM is a file that portage will pass to rsync when it updates -# the portage tree. Specific chunks of the tree may be excluded from -# consideration. This may cause dependency failures if you are not careful. -# The file format is one pattern per line, blanks and ';' or '#' lines are -# comments. See 'man rsync' for more details on the exclude-from format. -#RSYNC_EXCLUDEFROM=/etc/portage/rsync_excludes - -# logging related variables: -# PORTAGE_LOG_CLASSES: selects messages to be logged, possible values are: -# info, warn, error, log -PORTAGE_LOG_CLASSES="warn error log" - -# PORTAGE_LOG_SYSTEM: selects the module(s) to process the log messages. Modules -# included in portage are (empty means logging is disabled): -# save (saves one log per package in $PORTAGE_TMPDIR/elogs) -# custom (passes all messages to $PORTAGE_LOG_COMMAND) -# syslog (sends all messages to syslog) -# mail (send all messages to the mailserver defined -# in $PORTAGE_LOG_MAILURI) -#PORTAGE_LOG_SYSTEM="save mail" - -# PORTAGE_LOG_COMMAND: only used with the "custom" logging module. Specifies a command -# to process log messages. Two variables are expanded: -# ${PACKAGE} - expands to the cpv entry of the processed -# package (see $PVR in ebuild(5)) -# ${LOGFILE} - absolute path to the logfile -#PORTAGE_LOG_COMMAND="/path/to/logprocessor -p ${PACKAGE} -f ${LOGFILE}" - -# PORTAGE_LOG_MAILURI: this variable holds all important settings for the mail -# module. In most cases listing the recipient adress and -# the receiving mailserver should be sufficient, but you can -# also use advanced settings like authentication or TLS. The -# full syntax is: -# adress [[user:passwd@]mailserver[:port]] -# where -# adress: recipient adress -# user: username for smtp auth (defaults to none) -# passwd: password for smtp auth (defaults to none) -# mailserver: smtp server that should be used to deliver the mail (defaults to localhost) -# port: port to use on the given smtp server (defaults to 25, values > 100000 indicate that starttls should be used on (port-100000)) -# Examples: -#PORTAGE_LOG_MAILURI="root@localhost localhost" (this is also the default setting) -#PORTAGE_LOG_MAILURI="user@some.domain mail.some.domain" (sends mails to user@some.domain using the mailserver mail.some.domain) -#PORTAGE_LOG_MAILURI="user@some.domain user:secret@mail.some.domain:100465" (this is left uncommented as a reader excercise ;) diff --git a/cnf/make.conf.x86 b/cnf/make.conf.x86 deleted file mode 100644 index 3a857dc..0000000 --- a/cnf/make.conf.x86 +++ /dev/null @@ -1,353 +0,0 @@ -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/cnf/make.conf.x86,v 1.9 2005/02/26 07:21:14 jstubbs Exp $ -# Contains local system settings for Portage system - -# Please review 'man make.conf' for more information. - -# Build-time functionality -# ======================== -# -# The USE variable is used to enable optional build-time functionality. For -# example, quite a few packages have optional X, gtk or GNOME functionality -# that can only be enabled or disabled at compile-time. Gentoo Linux has a -# very extensive set of USE variables described in our USE variable HOWTO at -# http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&chap=1 -# -# The available list of use flags with descriptions is in your portage tree. -# Use 'less' to view them: --> less /usr/portage/profiles/use.desc <-- -# -# 'ufed' is an ncurses/dialog interface available in portage to make handling -# useflags for you. 'emerge app-portage/ufed' -# -# Example: -#USE="X gtk gnome -alsa" - -# Host Setting -# ============ -# -# DO NOT CHANGE THIS SETTING UNLESS YOU ARE USING STAGE1! -# Change this line as appropriate (i686, i586, i486 or i386). -# All modern systems (even Athlons) should use "i686-pc-linux-gnu". -# All K6's are i586. -CHOST="i686-pc-linux-gnu" - -# Host and optimization settings -# ============================== -# -# For optimal performance, enable a CFLAGS setting appropriate for your CPU. -# -# Please note that if you experience strange issues with a package, it may be -# due to gcc's optimizations interacting in a strange way. Please test the -# package (and in some cases the libraries it uses) at default optimizations -# before reporting errors to developers. -# -# -mcpu=<cpu-type> means optimize code for the particular type of CPU without -# breaking compatibility with other CPUs. -# -# -march=<cpu-type> means to take full advantage of the ABI and instructions -# for the particular CPU; this will break compatibility with older CPUs (for -# example, -march=athlon-xp code will not run on a regular Athlon, and -# -march=i686 code will not run on a Pentium Classic. -# -# CPU types supported in gcc-3.2 and higher: athlon-xp, athlon-mp, -# athlon-tbird, athlon, k6, k6-2, k6-3, i386, i486, i586 (Pentium), i686 -# (PentiumPro), pentium, pentium-mmx, pentiumpro, pentium2 (Celeron), -# pentium3, and pentium4. -# -# Note that Gentoo Linux 1.4 and higher include at least gcc-3.2. -# -# CPU types supported in gcc-2.95*: k6, i386, i486, i586 (Pentium), i686 -# (Pentium Pro), pentium, pentiumpro Gentoo Linux 1.2 and below use gcc-2.95* -# -# CRITICAL WARNINGS: ****************************************************** # -# K6 markings are deceptive. Avoid setting -march for them. See Bug #24379. # -# Pentium-M CPU's should not enable sse2 until at least gcc-3.4. Bug 50616. # -# ************************************************************************* # -# -# Decent examples: -# -#CFLAGS="-mcpu=athlon-xp -O3 -pipe" -#CFLAGS="-march=pentium3 -O3 -pipe" - -# If you set a CFLAGS above, then this line will set your default C++ flags to -# the same settings. -#CXXFLAGS="${CFLAGS}" - -# Advanced Masking -# ================ -# -# Gentoo is using a new masking system to allow for easier stability testing -# on packages. KEYWORDS are used in ebuilds to mask and unmask packages based -# on the platform they are set for. A special form has been added that -# indicates packages and revisions that are expected to work, but have not yet -# been approved for the stable set. '~arch' is a superset of 'arch' which -# includes the unstable, in testing, packages. Users of the 'x86' architecture -# would add '~x86' to ACCEPT_KEYWORDS to enable unstable/testing packages. -# '~ppc', '~sparc' are the unstable KEYWORDS for their respective platforms. -# -# Please note that this is not for development, alpha, beta, nor cvs release -# packages. "Broken" packages will not be added to testing and should not be -# requested to be added. Alternative routes are available to developers -# for experimental packages, and it is at their discretion to use them. -# -# DO NOT PUT ANYTHING BUT YOUR SPECIFIC ~ARCHITECTURE IN THE LIST. -# IF YOU ARE UNSURE OF YOUR ARCH, OR THE IMPLICATIONS, DO NOT MODIFY THIS. -# -#ACCEPT_KEYWORDS="~arch" - -# Portage Directories -# =================== -# -# Each of these settings controls an aspect of portage's storage and file -# system usage. If you change any of these, be sure it is available when -# you try to use portage. *** DO NOT INCLUDE A TRAILING "/" *** -# -# PORTAGE_TMPDIR is the location portage will use for compilations and -# temporary storage of data. This can get VERY large depending upon -# the application being installed. -#PORTAGE_TMPDIR=/var/tmp -# -# PORTDIR is the location of the portage tree. This is the repository -# for all profile information as well as all ebuilds. This directory -# itself can reach 200M. If you change this, you must update your -# /etc/make.profile symlink accordingly. -#PORTDIR=/usr/portage -# -# DISTDIR is where all of the source code tarballs will be placed for -# emerges. The source code is maintained here unless you delete -# it. The entire repository of tarballs for gentoo is 9G. This is -# considerably more than any user will ever download. 2-3G is -# a large DISTDIR. -#DISTDIR=${PORTDIR}/distfiles -# -# PKGDIR is the location of binary packages that you can have created -# with '--buildpkg' or '-b' while emerging a package. This can get -# upto several hundred megs, or even a few gigs. -#PKGDIR=${PORTDIR}/packages -# -# PORT_LOGDIR is the location where portage will store all the logs it -# creates from each individual merge. They are stored as NNNN-$PF.log -# in the directory specified. This is disabled until you enable it by -# providing a directory. Permissions will be modified as needed IF the -# directory exists, otherwise logging will be disabled. NNNN is the -# increment at the time the log is created. Logs are thus sequential. -#PORT_LOGDIR=/var/log/portage -# -# PORTDIR_OVERLAY is a directory where local ebuilds may be stored without -# concern that they will be deleted by rsync updates. Default is not -# defined. -#PORTDIR_OVERLAY=/usr/local/portage - -# Fetching files -# ============== -# -# If you need to set a proxy for wget or lukemftp, add the appropriate "export -# ftp_proxy=<proxy>" and "export http_proxy=<proxy>" lines to /etc/profile if -# all users on your system should use them. -# -# Portage uses wget by default. Here are some settings for some alternate -# downloaders -- note that you need to merge these programs first before they -# will be available. -# -# Default fetch command (5 tries, passive ftp for firewall compatibility) -#FETCHCOMMAND="/usr/bin/wget -t 5 --passive-ftp \${URI} -P \${DISTDIR}" -#RESUMECOMMAND="/usr/bin/wget -c -t 5 --passive-ftp \${URI} -P \${DISTDIR}" -# -# Using wget, ratelimiting downloads -#FETCHCOMMAND="/usr/bin/wget -t 5 --passive-ftp --limit-rate=200k \${URI} -P \${DISTDIR}" -#RESUMECOMMAND="/usr/bin/wget -c -t 5 --passive-ftp --limit-rate=200k \${URI} -P \${DISTDIR}" -# -# Lukemftp (BSD ftp): -#FETCHCOMMAND="/usr/bin/lukemftp -s -a -o \${DISTDIR}/\${FILE} \${URI}" -#RESUMECOMMAND="/usr/bin/lukemftp -s -a -R -o \${DISTDIR}/\${FILE} \${URI}" -# -# -# Portage uses GENTOO_MIRRORS to specify mirrors to use for source retrieval. -# The list is a space separated list which is read left to right. If you use -# another mirror we highly recommend leaving the default mirror at the end of -# the list so that portage will fall back to it if the files cannot be found -# on your specified mirror. We _HIGHLY_ recommend that you change this setting -# to a nearby mirror by merging and using the 'mirrorselect' tool. -#GENTOO_MIRRORS="<your_mirror_here> http://gentoo.osuosl.org http://www.ibiblio.org/pub/Linux/distributions/gentoo" -# -# Portage uses PORTAGE_BINHOST to specify mirrors for prebuilt-binary packages. -# The list is a single entry specifying the full address of the directory -# serving the tbz2's for your system. Running emerge with either '--getbinpkg' -# or '--getbinpkgonly' will cause portage to retrieve the metadata from all -# packages in the directory specified, and use that data to determine what will -# be downloaded and merged. '-g' or '-gK' are the recommend parameters. Please -# consult the man pages and 'emerge --help' for more information. For FTP, the -# default connection is passive -- If you require an active connection, affix -# an asterisk (*) to the end of the host:port string before the path. -#PORTAGE_BINHOST="http://grp.mirror.site/gentoo/grp/1.4/i686/athlon-xp/" -# This ftp connection is passive ftp. -#PORTAGE_BINHOST="ftp://login:pass@grp.mirror.site/pub/grp/i686/athlon-xp/" -# This ftp connection is active ftp. -#PORTAGE_BINHOST="ftp://login:pass@grp.mirror.site:21*/pub/grp/i686/athlon-xp/" - -# Synchronizing Portage -# ===================== -# -# Each of these settings affects how Gentoo synchronizes your Portage tree. -# Synchronization is handled by rsync and these settings allow some control -# over how it is done. -# -# -# SYNC is the server used by rsync to retrieve a localized rsync mirror -# rotation. This allows you to select servers that are geographically -# close to you, yet still distribute the load over a number of servers. -# Please do not single out specific rsync mirrors. Doing so places undue -# stress on particular mirrors. Instead you may use one of the following -# continent specific rotations: -# -# Default: "rsync://rsync.gentoo.org/gentoo-portage" -# North America: "rsync://rsync.namerica.gentoo.org/gentoo-portage" -# South America: "rsync://rsync.samerica.gentoo.org/gentoo-portage" -# Europe: "rsync://rsync.europe.gentoo.org/gentoo-portage" -# Asia: "rsync://rsync.asia.gentoo.org/gentoo-portage" -# Australia: "rsync://rsync.au.gentoo.org/gentoo-portage" -#SYNC="rsync://rsync.gentoo.org/gentoo-portage" -# -# RSYNC_RETRIES sets the number of times portage will attempt to retrieve -# a current portage tree before it exits with an error. This allows -# for a more successful retrieval without user intervention most times. -#RSYNC_RETRIES="3" -# -# RSYNC_TIMEOUT sets the length of time rsync will wait before it times out -# on a connection. Most users will benefit from this setting as it will -# reduce the amount of 'dead air' they experience when they run across -# the occasional, unreachable mirror. Dialup users might want to set this -# value up around the 300 second mark. -#RSYNC_TIMEOUT=180 - -# Advanced Features -# ================= -# -# MAKEOPTS provides extra options that may be passed to 'make' when a -# program is compiled. Presently the only use is for specifying -# the number of parallel makes (-j) to perform. The suggested number -# for parallel makes is CPUs+1. -#MAKEOPTS="-j2" -# -# PORTAGE_NICENESS provides a default increment to emerge's niceness level. -# Note: This is an increment. Running emerge in a niced environment will -# reduce it further. Default is unset. -#PORTAGE_NICENESS=3 -# -# PORTAGE_TMPFS is a location where portage may create temporary files. -# If specified, portage will use this directory whenever possible -# for all rapid operations such as lockfiles and transient data. -# It is _highly_ recommended that this be a tmpfs or ramdisk. Do not -# set this to anything that does not give a significant performance -# enhancement and proper FS compliance for locks and read/write. -# /dev/shm is a glibc mandated tmpfs, and should be a reasonable -# setting for all linux kernel+glibc based systems. -#PORTAGE_TMPFS="/dev/shm" -# -# FEATURES are settings that affect the functionality of portage. Most of -# these settings are for developer use, but some are available to non- -# developers as well. -# -# 'autoaddcvs' causes portage to automatically try to add files to cvs -# that will have to be added later. Done at generation times -# and only has an effect when 'cvs' is also set. -# 'buildpkg' causes binary packages to be created of all packages that -# are being merged. -# 'ccache' enables ccache support via CC. -# 'collision-protect' -# prevents packages from overwriting files that are owned by -# another package or by no package at all. -# 'cvs' causes portage to enable all cvs features (commits, adds), -# and to apply all USE flags in SRC_URI for digests -- for -# developers only. -# 'digest' causes digests to be generated for all packages being merged. -# 'distcc' enables distcc support via CC. -# 'distlocks' enables distfiles locking using fcntl or hardlinks. This -# is enabled by default. Tools exist to help clean the locks -# after crashes: /usr/lib/portage/bin/clean_locks. -# 'fixpackages' allows portage to fix binary packages that are stored in -# PKGDIR. This can consume a lot of time. 'fixpackages' is -# also a script that can be run at any given time to force -# the same actions. -# 'gpg' enables basic verification of Manifest files using gpg. -# This features is UNDER DEVELOPMENT and reacts to features -# of strict and severe. Heavy use of gpg sigs is coming. -# 'keeptemp' prevents the clean phase from deleting the temp files ($T) -# from a merge. -# 'keepwork' prevents the clean phase from deleting the WORKDIR. -# 'maketest' causes ebuilds to perform testing phases if they are capable -# of it. Some packages support this automaticaly via makefiles. -# 'noauto' causes ebuild to perform only the action requested and -# not any other required actions like clean or unpack -- for -# debugging purposes only. -# 'noclean' prevents portage from removing the source and temporary files -# after a merge -- for debugging purposes only. -# 'nostrip' prevents the stripping of binaries. -# 'notitles' disables xterm titlebar updates (which contain status info). -# 'sandbox' enables sandboxing when running emerge and ebuild. -# 'strict' causes portage to react strongly to conditions that are -# potentially dangerous, like missing/incorrect Manifest files. -# 'userpriv' allows portage to drop root privileges while it is compiling, -# as a security measure. As a side effect this can remove -# sandbox access violations for users. -# 'usersandbox' enables sandboxing while portage is running under userpriv. -#FEATURES="sandbox buildpkg ccache distcc userpriv usersandbox notitles noclean noauto cvs keeptemp keepwork autoaddcvs" -#FEATURES="sandbox ccache distcc distlocks autoaddcvs" -# -# CCACHE_SIZE sets the space use limitations for ccache. The default size is -# 2G, and will be set if not defined otherwise and ccache is in features. -# Portage will set the default ccache dir if it is not present in the -# user's environment, for userpriv it sets: ${PORTAGE_TMPDIR}/ccache -# (/var/tmp/ccache), and for regular use the default is /root/.ccache. -# Sizes are specified with 'G' 'M' or 'K'. -# '2G' for 2 gigabytes, '2048M' for 2048 megabytes (same as 2G). -#CCACHE_SIZE="512M" -# -# DISTCC_DIR sets the temporary space used by distcc. -#DISTCC_DIR="${PORTAGE_TMPDIR}/.distcc" -# -# RSYNC_EXCLUDEFROM is a file that portage will pass to rsync when it updates -# the portage tree. Specific chunks of the tree may be excluded from -# consideration. This may cause dependency failures if you are not careful. -# The file format is one pattern per line, blanks and ';' or '#' lines are -# comments. See 'man rsync' for more details on the exclude-from format. -#RSYNC_EXCLUDEFROM=/etc/portage/rsync_excludes - -# logging related variables: -# PORTAGE_LOG_CLASSES: selects messages to be logged, possible values are: -# info, warn, error, log -PORTAGE_LOG_CLASSES="warn error log" - -# PORTAGE_LOG_SYSTEM: selects the module(s) to process the log messages. Modules -# included in portage are (empty means logging is disabled): -# save (saves one log per package in $PORTAGE_TMPDIR/elogs) -# custom (passes all messages to $PORTAGE_LOG_COMMAND) -# syslog (sends all messages to syslog) -# mail (send all messages to the mailserver defined -# in $PORTAGE_LOG_MAILURI) -#PORTAGE_LOG_SYSTEM="save mail" - -# PORTAGE_LOG_COMMAND: only used with the "custom" logging module. Specifies a command -# to process log messages. Two variables are expanded: -# ${PACKAGE} - expands to the cpv entry of the processed -# package (see $PVR in ebuild(5)) -# ${LOGFILE} - absolute path to the logfile -#PORTAGE_LOG_COMMAND="/path/to/logprocessor -p ${PACKAGE} -f ${LOGFILE}" - -# PORTAGE_LOG_MAILURI: this variable holds all important settings for the mail -# module. In most cases listing the recipient adress and -# the receiving mailserver should be sufficient, but you can -# also use advanced settings like authentication or TLS. The -# full syntax is: -# adress [[user:passwd@]mailserver[:port]] -# where -# adress: recipient adress -# user: username for smtp auth (defaults to none) -# passwd: password for smtp auth (defaults to none) -# mailserver: smtp server that should be used to deliver the mail (defaults to localhost) -# port: port to use on the given smtp server (defaults to 25, values > 100000 indicate that starttls should be used on (port-100000)) -# Examples: -#PORTAGE_LOG_MAILURI="root@localhost localhost" (this is also the default setting) -#PORTAGE_LOG_MAILURI="user@some.domain mail.some.domain" (sends mails to user@some.domain using the mailserver mail.some.domain) -#PORTAGE_LOG_MAILURI="user@some.domain user:secret@mail.some.domain:100465" (this is left uncommented as a reader excercise ;) diff --git a/cnf/make.conf.x86-fbsd b/cnf/make.conf.x86-fbsd deleted file mode 100644 index 502d0c3..0000000 --- a/cnf/make.conf.x86-fbsd +++ /dev/null @@ -1,311 +0,0 @@ -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/cnf/make.conf.x86-fbsd,v 1.2 2005/02/23 00:22:13 vapier Exp $ -# Contains local system settings for Portage system - -# Please review 'man make.conf' for more information. - -# Build-time functionality -# ======================== -# -# The USE variable is used to enable optional build-time functionality. For -# example, quite a few packages have optional X, gtk or GNOME functionality -# that can only be enabled or disabled at compile-time. Gentoo Linux has a -# very extensive set of USE variables described in our USE variable HOWTO at -# http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&chap=1 -# -# The available list of use flags with descriptions is in your portage tree. -# Use 'less' to view them: --> less /usr/portage/profiles/use.desc <-- -# -# 'ufed' is an ncurses/dialog interface available in portage to make handling -# useflags for you. 'emerge app-portage/ufed' -# -# Example: -#USE="X gtk gnome -alsa" - -# Host Setting -# ============ -# -# DO NOT CHANGE THIS SETTING UNLESS YOU ARE USING STAGE1! -# Change this line as appropriate (i686, i586, i486 or i386). -# All modern systems (even Athlons) should use "i686-pc-linux-gnu". -# All K6's are i586. -CHOST="i686-unknown-freebsd5.3" - -# Host and optimization settings -# ============================== -# -# For optimal performance, enable a CFLAGS setting appropriate for your CPU. -# -# Please note that if you experience strange issues with a package, it may be -# due to gcc's optimizations interacting in a strange way. Please test the -# package (and in some cases the libraries it uses) at default optimizations -# before reporting errors to developers. -# -# -mtune=<cpu-type> means optimize code for the particular type of CPU without -# breaking compatibility with other CPUs. -# -# -march=<cpu-type> means to take full advantage of the ABI and instructions -# for the particular CPU; this will break compatibility with older CPUs (for -# example, -march=athlon-xp code will not run on a regular Athlon, and -# -march=i686 code will not run on a Pentium Classic. -# -# CPU types supported in gcc-3.2 and higher: athlon-xp, athlon-mp, -# athlon-tbird, athlon, k6, k6-2, k6-3, i386, i486, i586 (Pentium), i686 -# (PentiumPro), pentium, pentium-mmx, pentiumpro, pentium2 (Celeron), -# pentium3, and pentium4. -# -# Note that Gentoo Linux 1.4 and higher include at least gcc-3.2. -# -# CPU types supported in gcc-2.95*: k6, i386, i486, i586 (Pentium), i686 -# (Pentium Pro), pentium, pentiumpro Gentoo Linux 1.2 and below use gcc-2.95* -# -# CRITICAL WARNINGS: ****************************************************** # -# K6 markings are deceptive. Avoid setting -march for them. See Bug #24379. # -# Pentium-M CPU's should not enable sse2 until at least gcc-3.4. Bug 50616. # -# ************************************************************************* # -# -# Decent examples: -# -#CFLAGS="-mtune=athlon-xp -O3 -pipe" -#CFLAGS="-march=pentium3 -O3 -pipe" - -# If you set a CFLAGS above, then this line will set your default C++ flags to -# the same settings. -#CXXFLAGS="${CFLAGS}" - -# Advanced Masking -# ================ -# -# Gentoo is using a new masking system to allow for easier stability testing -# on packages. KEYWORDS are used in ebuilds to mask and unmask packages based -# on the platform they are set for. A special form has been added that -# indicates packages and revisions that are expected to work, but have not yet -# been approved for the stable set. '~arch' is a superset of 'arch' which -# includes the unstable, in testing, packages. Users of the 'x86' architecture -# would add '~x86' to ACCEPT_KEYWORDS to enable unstable/testing packages. -# '~ppc', '~sparc' are the unstable KEYWORDS for their respective platforms. -# -# Please note that this is not for development, alpha, beta, nor cvs release -# packages. "Broken" packages will not be added to testing and should not be -# requested to be added. Alternative routes are available to developers -# for experimental packages, and it is at their discretion to use them. -# -# DO NOT PUT ANYTHING BUT YOUR SPECIFIC ~ARCHITECTURE IN THE LIST. -# IF YOU ARE UNSURE OF YOUR ARCH, OR THE IMPLICATIONS, DO NOT MODIFY THIS. -# -#ACCEPT_KEYWORDS="~arch" - -# Portage Directories -# =================== -# -# Each of these settings controls an aspect of portage's storage and file -# system usage. If you change any of these, be sure it is available when -# you try to use portage. *** DO NOT INCLUDE A TRAILING "/" *** -# -# PORTAGE_TMPDIR is the location portage will use for compilations and -# temporary storage of data. This can get VERY large depending upon -# the application being installed. -#PORTAGE_TMPDIR=/var/tmp -# -# PORTDIR is the location of the portage tree. This is the repository -# for all profile information as well as all ebuilds. This directory -# itself can reach 200M. If you change this, you must update your -# /etc/make.profile symlink accordingly. -#PORTDIR=/usr/portage -# -# DISTDIR is where all of the source code tarballs will be placed for -# emerges. The source code is maintained here unless you delete -# it. The entire repository of tarballs for gentoo is 9G. This is -# considerably more than any user will ever download. 2-3G is -# a large DISTDIR. -#DISTDIR=${PORTDIR}/distfiles -# -# PKGDIR is the location of binary packages that you can have created -# with '--buildpkg' or '-b' while emerging a package. This can get -# upto several hundred megs, or even a few gigs. -#PKGDIR=${PORTDIR}/packages -# -# PORT_LOGDIR is the location where portage will store all the logs it -# creates from each individual merge. They are stored as NNNN-$PF.log -# in the directory specified. This is disabled until you enable it by -# providing a directory. Permissions will be modified as needed IF the -# directory exists, otherwise logging will be disabled. NNNN is the -# increment at the time the log is created. Logs are thus sequential. -#PORT_LOGDIR=/var/log/portage -# -# PORTDIR_OVERLAY is a directory where local ebuilds may be stored without -# concern that they will be deleted by rsync updates. Default is not -# defined. -#PORTDIR_OVERLAY=/usr/local/portage - -# Fetching files -# ============== -# -# If you need to set a proxy for wget or lukemftp, add the appropriate "export -# ftp_proxy=<proxy>" and "export http_proxy=<proxy>" lines to /etc/profile if -# all users on your system should use them. -# -# Portage uses wget by default. Here are some settings for some alternate -# downloaders -- note that you need to merge these programs first before they -# will be available. -# -# Default fetch command (5 tries, passive ftp for firewall compatibility) -#FETCHCOMMAND="/usr/bin/wget -t 5 --passive-ftp \${URI} -P \${DISTDIR}" -#RESUMECOMMAND="/usr/bin/wget -c -t 5 --passive-ftp \${URI} -P \${DISTDIR}" -# -# Using wget, ratelimiting downloads -#FETCHCOMMAND="/usr/bin/wget -t 5 --passive-ftp --limit-rate=200k \${URI} -P \${DISTDIR}" -#RESUMECOMMAND="/usr/bin/wget -c -t 5 --passive-ftp --limit-rate=200k \${URI} -P \${DISTDIR}" -# -# Lukemftp (BSD ftp): -#FETCHCOMMAND="/usr/bin/lukemftp -s -a -o \${DISTDIR}/\${FILE} \${URI}" -#RESUMECOMMAND="/usr/bin/lukemftp -s -a -R -o \${DISTDIR}/\${FILE} \${URI}" -# -# Portage uses GENTOO_MIRRORS to specify mirrors to use for source retrieval. -# The list is a space separated list which is read left to right. If you use -# another mirror we highly recommend leaving the default mirror at the end of -# the list so that portage will fall back to it if the files cannot be found -# on your specified mirror. We _HIGHLY_ recommend that you change this setting -# to a nearby mirror by merging and using the 'mirrorselect' tool. -#GENTOO_MIRRORS="<your_mirror_here> http://distfiles.gentoo.org http://www.ibiblio.org/pub/Linux/distributions/gentoo" -# -# Portage uses PORTAGE_BINHOST to specify mirrors for prebuilt-binary packages. -# The list is a single entry specifying the full address of the directory -# serving the tbz2's for your system. Running emerge with either '--getbinpkg' -# or '--getbinpkgonly' will cause portage to retrieve the metadata from all -# packages in the directory specified, and use that data to determine what will -# be downloaded and merged. '-g' or '-gK' are the recommend parameters. Please -# consult the man pages and 'emerge --help' for more information. For FTP, the -# default connection is passive -- If you require an active connection, affix -# an asterisk (*) to the end of the host:port string before the path. -#PORTAGE_BINHOST="http://grp.mirror.site/gentoo/grp/1.4/i686/athlon-xp/" -# This ftp connection is passive ftp. -#PORTAGE_BINHOST="ftp://login:pass@grp.mirror.site/pub/grp/i686/athlon-xp/" -# This ftp connection is active ftp. -#PORTAGE_BINHOST="ftp://login:pass@grp.mirror.site:21*/pub/grp/i686/athlon-xp/" - -# Synchronizing Portage -# ===================== -# -# Each of these settings affects how Gentoo synchronizes your Portage tree. -# Synchronization is handled by rsync and these settings allow some control -# over how it is done. -# -# -# SYNC is the server used by rsync to retrieve a localized rsync mirror -# rotation. This allows you to select servers that are geographically -# close to you, yet still distribute the load over a number of servers. -# Please do not single out specific rsync mirrors. Doing so places undue -# stress on particular mirrors. Instead you may use one of the following -# continent specific rotations: -# -# Default: "rsync://rsync.gentoo.org/gentoo-portage" -# North America: "rsync://rsync.namerica.gentoo.org/gentoo-portage" -# South America: "rsync://rsync.samerica.gentoo.org/gentoo-portage" -# Europe: "rsync://rsync.europe.gentoo.org/gentoo-portage" -# Asia: "rsync://rsync.asia.gentoo.org/gentoo-portage" -# Australia: "rsync://rsync.au.gentoo.org/gentoo-portage" -#SYNC="rsync://rsync.gentoo.org/gentoo-portage" -# -# RSYNC_RETRIES sets the number of times portage will attempt to retrieve -# a current portage tree before it exits with an error. This allows -# for a more successful retrieval without user intervention most times. -#RSYNC_RETRIES="3" -# -# RSYNC_TIMEOUT sets the length of time rsync will wait before it times out -# on a connection. Most users will benefit from this setting as it will -# reduce the amount of 'dead air' they experience when they run across -# the occasional, unreachable mirror. Dialup users might want to set this -# value up around the 300 second mark. -#RSYNC_TIMEOUT=180 - -# Advanced Features -# ================= -# -# MAKEOPTS provides extra options that may be passed to 'make' when a -# program is compiled. Presently the only use is for specifying -# the number of parallel makes (-j) to perform. The suggested number -# for parallel makes is CPUs+1. -#MAKEOPTS="-j2" -# -# PORTAGE_NICENESS provides a default increment to emerge's niceness level. -# Note: This is an increment. Running emerge in a niced environment will -# reduce it further. Default is unset. -#PORTAGE_NICENESS=3 -# -# AUTOCLEAN enables portage to automatically clean out older or overlapping -# packages from the system after every successful merge. This is the -# same as running 'emerge -c' after every merge. Set with: "yes" or "no". -# This does not affect the unpacked source. See 'noclean' below. -#AUTOCLEAN="yes" -# -# FEATURES are settings that affect the functionality of portage. Most of -# these settings are for developer use, but some are available to non- -# developers as well. -# -# 'autoaddcvs' causes portage to automatically try to add files to cvs -# that will have to be added later. Done at generation times -# and only has an effect when 'cvs' is also set. -# 'buildpkg' causes binary packages to be created of all packages that -# are being merged. -# 'ccache' enables ccache support via CC. -# 'collision-protect' -# prevents packages from overwriting files that are owned by -# another package or by no package at all. -# 'cvs' causes portage to enable all cvs features (commits, adds), -# and to apply all USE flags in SRC_URI for digests -- for -# developers only. -# 'digest' causes digests to be generated for all packages being merged. -# 'distcc' enables distcc support via CC. -# 'distlocks' enables distfiles locking using fcntl or hardlinks. This -# is enabled by default. Tools exist to help clean the locks -# after crashes: /usr/lib/portage/bin/clean_locks. -# 'fixpackages' allows portage to fix binary packages that are stored in -# PKGDIR. This can consume a lot of time. 'fixpackages' is -# also a script that can be run at any given time to force -# the same actions. -# 'gpg' enables basic verification of Manifest files using gpg. -# This features is UNDER DEVELOPMENT and reacts to features -# of strict and severe. Heavy use of gpg sigs is coming. -# 'keeptemp' prevents the clean phase from deleting the temp files ($T) -# from a merge. -# 'keepwork' prevents the clean phase from deleting the WORKDIR. -# 'maketest' causes ebuilds to perform testing phases if they are capable -# of it. Some packages support this automaticaly via makefiles. -# 'noauto' causes ebuild to perform only the action requested and -# not any other required actions like clean or unpack -- for -# debugging purposes only. -# 'noclean' prevents portage from removing the source and temporary files -# after a merge -- for debugging purposes only. -# 'nostrip' prevents the stripping of binaries. -# 'notitles' disables xterm titlebar updates (which contain status info). -# 'sandbox' enables sandboxing when running emerge and ebuild. Doesn't -# work on *BSD-based systems. -# 'strict' causes portage to react strongly to conditions that are -# potentially dangerous, like missing/incorrect Manifest files. -# 'userpriv' allows portage to drop root privileges while it is compiling, -# as a security measure. As a side effect this can remove -# sandbox access violations for users. -# 'usersandbox' enables sandboxing while portage is running under userpriv. -#FEATURES="sandbox buildpkg ccache distcc userpriv usersandbox notitles noclean noauto cvs keeptemp keepwork autoaddcvs" -#FEATURES="sandbox ccache distcc distlocks autoaddcvs" -# -# CCACHE_SIZE sets the space use limitations for ccache. The default size is -# 2G, and will be set if not defined otherwise and ccache is in features. -# Portage will set the default ccache dir if it is not present in the -# user's environment, for userpriv it sets: ${PORTAGE_TMPDIR}/ccache -# (/var/tmp/ccache), and for regular use the default is /root/.ccache. -# Sizes are specified with 'G' 'M' or 'K'. -# '2G' for 2 gigabytes, '2048M' for 2048 megabytes (same as 2G). -#CCACHE_SIZE="512M" -# -# DISTCC_DIR sets the temporary space used by distcc. -#DISTCC_DIR="${PORTAGE_TMPDIR}/.distcc" -# -# RSYNC_EXCLUDEFROM is a file that portage will pass to rsync when it updates -# the portage tree. Specific chunks of the tree may be excluded from -# consideration. This may cause dependency failures if you are not careful. -# The file format is one pattern per line, blanks and ';' or '#' lines are -# comments. See 'man rsync' for more details on the exclude-from format. -#RSYNC_EXCLUDEFROM=/etc/portage/rsync_excludes diff --git a/cnf/make.globals b/cnf/make.globals deleted file mode 100644 index d4cd396..0000000 --- a/cnf/make.globals +++ /dev/null @@ -1,75 +0,0 @@ -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/cnf/make.globals,v 1.59 2005/04/26 09:40:59 genone Exp $ -# System-wide defaults for the Portage system - -# ***************************** -# ** DO NOT EDIT THIS FILE ** -# *************************************************** -# **** CHANGES TO make.conf *OVERRIDE* THIS FILE **** -# *************************************************** -# ** Incremental Variables Accumulate Across Files ** -# ** USE, CONFIG_*, and FEATURES are incremental ** -# *************************************************** - -GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/Linux/distributions/gentoo" -SYNC="rsync://rsync.gentoo.org/gentoo-portage" - -# Host-type -CHOST=i686-pc-linux-gnu -PORTAGE_TMPDIR=/var/tmp - -PORTDIR=/usr/portage -DISTDIR=${PORTDIR}/distfiles -PKGDIR=${PORTDIR}/packages -RPMDIR=${PORTDIR}/rpm -CONFIG_PROTECT="/etc /var/qmail/control /usr/share/config /usr/kde/2/share/config /usr/kde/3/share/config" -CONFIG_PROTECT_MASK="/etc/gconf" - -# Options passed to make during the build process -MAKEOPTS="-j2" - -# Fetching command (5 tries, passive ftp for firewall compatibility) -FETCHCOMMAND="/usr/bin/wget -t 5 --passive-ftp -P \${DISTDIR} \${URI}" -RESUMECOMMAND="/usr/bin/wget -c -t 5 --passive-ftp -P \${DISTDIR} \${URI}" - -CFLAGS="-O2 -mcpu=i686 -pipe" -CXXFLAGS=${CFLAGS} - -# Debug build -- if defined, binaries won't be stripped -#DEBUGBUILD=true - -# Default maintainer options -#FEATURES="digest sandbox noclean noauto buildpkg usersandbox" -# Default user options -FEATURES="sandbox distlocks ccache autoaddcvs strict" - -# By default output colored text where possible, set to "true" to output only -#black&white text -NOCOLOR="false" - -PORTAGE_BINHOST_CHUNKSIZE="3000" -USE_EXPAND="VIDEO_CARDS INPUT_DEVICES LINGUAS" - -# By default wait 5 secs before cleaning a package -CLEAN_DELAY="5" - -# Set to yes automatically run "emerge --clean" after each merge -# Important, as without this you may experience missing symlinks when -# downgrading libraries during a batch (world/system) update. -# DEPRECATED, THIS IS ALWAYS ENABLED IN >=PORTAGE-2.1 -AUTOCLEAN="yes" - -# Number of times 'emerge --sync' will run before giving up. -RSYNC_RETRIES="3" -# Number of seconds rsync will wait before timing out. -RSYNC_TIMEOUT="180" - -# ***************************** -# ** DO NOT EDIT THIS FILE ** -# *************************************************** -# **** CHANGES TO make.conf *OVERRIDE* THIS FILE **** -# *************************************************** -# ** Incremental Variables Accumulate Across Files ** -# ** USE, CONFIG_*, and FEATURES are incremental ** -# *************************************************** diff --git a/cnf/make.globals.alpha b/cnf/make.globals.alpha deleted file mode 100644 index f6eb584..0000000 --- a/cnf/make.globals.alpha +++ /dev/null @@ -1,74 +0,0 @@ -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/cnf/make.globals.alpha,v 1.17 2005/04/26 09:40:59 genone Exp $ -# System-wide defaults for the Portage system - -# ***************************** -# ** DO NOT EDIT THIS FILE ** -# *************************************************** -# **** CHANGES TO make.conf *OVERRIDE* THIS FILE **** -# *************************************************** -# ** Incremental Variables Accumulate Across Files ** -# ** USE, CONFIG_*, and FEATURES are incremental ** -# *************************************************** - -GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/Linux/distributions/gentoo" -SYNC="rsync://rsync.gentoo.org/gentoo-portage" -# Host-type -CHOST="alpha-unknown-linux-gnu" -PORTAGE_TMPDIR=/var/tmp - -PORTDIR=/usr/portage -DISTDIR=${PORTDIR}/distfiles -PKGDIR=${PORTDIR}/packages -RPMDIR=${PORTDIR}/rpm -CONFIG_PROTECT="/etc /var/qmail/control /usr/share/config /usr/kde/2/share/config /usr/kde/3/share/config" -CONFIG_PROTECT_MASK="/etc/gconf" - -# Options passed to make during the build process -MAKEOPTS="-j2" - -# Fetching command (5 tries, passive ftp for firewall compatibility) -FETCHCOMMAND="/usr/bin/wget -t 5 --passive-ftp -P \${DISTDIR} \${URI}" -RESUMECOMMAND="/usr/bin/wget -c -t 5 --passive-ftp -P \${DISTDIR} \${URI}" - -CFLAGS="-O2 -pipe" -CXXFLAGS=${CFLAGS} - -# Debug build -- if defined, binaries won't be stripped -#DEBUGBUILD=true - -# Default maintainer options -#FEATURES="digest sandbox noclean noauto buildpkg" -# Default user options -FEATURES="distlocks ccache autoaddcvs strict" - -# By default output colored text where possible, set to "true" to output only -#black&white text -NOCOLOR="false" - -PORTAGE_BINHOST_CHUNKSIZE="3000" -USE_EXPAND="VIDEO_CARDS INPUT_DEVICES LINGUAS" - -# By default wait 5 secs before cleaning a package -CLEAN_DELAY="5" - -# Set to yes automatically run "emerge --clean" after each merge -# Important, as without this you may experience missing symlinks when -# downgrading libraries during a batch (world/system) update. -# DEPRECATED, THIS IS ALWAYS ENABLED IN >=PORTAGE-2.1 -AUTOCLEAN="yes" - -# Number of times 'emerge --sync' will run before giving up. -RSYNC_RETRIES="3" -# Number of seconds rsync will wait before timing out. -RSYNC_TIMEOUT="180" - -# ***************************** -# ** DO NOT EDIT THIS FILE ** -# *************************************************** -# **** CHANGES TO make.conf *OVERRIDE* THIS FILE **** -# *************************************************** -# ** Incremental Variables Accumulate Across Files ** -# ** USE, CONFIG_*, and FEATURES are incremental ** -# *************************************************** diff --git a/cnf/make.globals.amd64 b/cnf/make.globals.amd64 deleted file mode 100644 index b63d34d..0000000 --- a/cnf/make.globals.amd64 +++ /dev/null @@ -1,74 +0,0 @@ -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/cnf/make.globals.amd64,v 1.8 2005/04/26 09:40:59 genone Exp $ -# System-wide defaults for the Portage system - -# ***************************** -# ** DO NOT EDIT THIS FILE ** -# *************************************************** -# **** CHANGES TO make.conf *OVERRIDE* THIS FILE **** -# *************************************************** -# ** Incremental Variables Accumulate Across Files ** -# ** USE, CONFIG_*, and FEATURES are incremental ** -# *************************************************** - -GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/Linux/distributions/gentoo" -SYNC="rsync://rsync.gentoo.org/gentoo-portage" -# Host-type -CHOST=x86_64-pc-linux-gnu -PORTAGE_TMPDIR=/var/tmp - -PORTDIR=/usr/portage -DISTDIR=${PORTDIR}/distfiles -PKGDIR=${PORTDIR}/packages -RPMDIR=${PORTDIR}/rpm -CONFIG_PROTECT="/etc /var/qmail/control /usr/share/config /usr/kde/2/share/config /usr/kde/3/share/config" -CONFIG_PROTECT_MASK="/etc/gconf" - -# Options passed to make during the build process -MAKEOPTS="-j2" - -# Fetching command (5 tries, passive ftp for firewall compatibility) -FETCHCOMMAND="/usr/bin/wget -t 5 --passive-ftp -P \${DISTDIR} \${URI}" -RESUMECOMMAND="/usr/bin/wget -c -t 5 --passive-ftp -P \${DISTDIR} \${URI}" - -CFLAGS="-march=x86-64 -O2 -pipe" -CXXFLAGS=${CFLAGS} - -# Debug build -- if defined, binaries won't be stripped -#DEBUGBUILD=true - -# Default maintainer options -#FEATURES="digest sandbox noclean noauto buildpkg usersandbox" -# Default user options -FEATURES="sandbox distlocks ccache autoaddcvs strict" - -# By default output colored text where possible, set to "true" to output only -#black&white text -NOCOLOR="false" - -PORTAGE_BINHOST_CHUNKSIZE="3000" -USE_EXPAND="VIDEO_CARDS INPUT_DEVICES LINGUAS" - -# By default wait 5 secs before cleaning a package -CLEAN_DELAY="5" - -# Set to yes automatically run "emerge --clean" after each merge -# Important, as without this you may experience missing symlinks when -# downgrading libraries during a batch (world/system) update. -# DEPRECATED, THIS IS ALWAYS ENABLED IN >=PORTAGE-2.1 -AUTOCLEAN="yes" - -# Number of times 'emerge --sync' will run before giving up. -RSYNC_RETRIES="3" -# Number of seconds rsync will wait before timing out. -RSYNC_TIMEOUT="180" - -# ***************************** -# ** DO NOT EDIT THIS FILE ** -# *************************************************** -# **** CHANGES TO make.conf *OVERRIDE* THIS FILE **** -# *************************************************** -# ** Incremental Variables Accumulate Across Files ** -# ** USE, CONFIG_*, and FEATURES are incremental ** -# *************************************************** diff --git a/cnf/make.globals.arm b/cnf/make.globals.arm deleted file mode 100644 index 78473aa..0000000 --- a/cnf/make.globals.arm +++ /dev/null @@ -1,74 +0,0 @@ -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/cnf/make.globals.arm,v 1.15 2005/04/26 09:40:59 genone Exp $ -# System-wide defaults for the Portage system - -# ***************************** -# ** DO NOT EDIT THIS FILE ** -# *************************************************** -# **** CHANGES TO make.conf *OVERRIDE* THIS FILE **** -# *************************************************** -# ** Incremental Variables Accumulate Across Files ** -# ** USE, CONFIG_*, and FEATURES are incremental ** -# *************************************************** - -GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/Linux/distributions/gentoo" -SYNC="rsync://rsync.gentoo.org/gentoo-portage" -# Host-type -CHOST=arm-unknown-linux-gnu -PORTAGE_TMPDIR=/var/tmp - -PORTDIR=/usr/portage -DISTDIR=${PORTDIR}/distfiles -PKGDIR=${PORTDIR}/packages -RPMDIR=${PORTDIR}/rpm -CONFIG_PROTECT="/etc /var/qmail/control /usr/share/config /usr/kde/2/share/config /usr/kde/3/share/config" -CONFIG_PROTECT_MASK="/etc/gconf" - -# Options passed to make during the build process -MAKEOPTS="-j2" - -# Fetching command (5 tries, passive ftp for firewall compatibility) -FETCHCOMMAND="/usr/bin/wget -t 5 --passive-ftp -P \${DISTDIR} \${URI}" -RESUMECOMMAND="/usr/bin/wget -c -t 5 --passive-ftp -P \${DISTDIR} \${URI}" - -CFLAGS="-O2 -mcpu=strongarm110 -pipe" -CXXFLAGS=${CFLAGS} - -# Debug build -- if defined, binaries won't be stripped -#DEBUGBUILD=true - -# Default maintainer options -#FEATURES="digest sandbox noclean noauto buildpkg usersandbox" -# Default user options -FEATURES="sandbox distlocks ccache autoaddcvs strict" - -# By default output colored text where possible, set to "true" to output only -#black&white text -NOCOLOR="false" - -PORTAGE_BINHOST_CHUNKSIZE="3000" -USE_EXPAND="VIDEO_CARDS INPUT_DEVICES LINGUAS" - -# By default wait 5 secs before cleaning a package -CLEAN_DELAY="5" - -# Set to yes automatically run "emerge --clean" after each merge -# Important, as without this you may experience missing symlinks when -# downgrading libraries during a batch (world/system) update. -# DEPRECATED, THIS IS ALWAYS ENABLED IN >=PORTAGE-2.1 -AUTOCLEAN="yes" - -# Number of times 'emerge --sync' will run before giving up. -RSYNC_RETRIES="3" -# Number of seconds rsync will wait before timing out. -RSYNC_TIMEOUT="180" - -# ***************************** -# ** DO NOT EDIT THIS FILE ** -# *************************************************** -# **** CHANGES TO make.conf *OVERRIDE* THIS FILE **** -# *************************************************** -# ** Incremental Variables Accumulate Across Files ** -# ** USE, CONFIG_*, and FEATURES are incremental ** -# *************************************************** diff --git a/cnf/make.globals.hppa b/cnf/make.globals.hppa deleted file mode 100644 index b90a925..0000000 --- a/cnf/make.globals.hppa +++ /dev/null @@ -1,74 +0,0 @@ -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/cnf/make.globals.hppa,v 1.18 2005/04/26 09:40:59 genone Exp $ -# System-wide defaults for the Portage system - -# ***************************** -# ** DO NOT EDIT THIS FILE ** -# *************************************************** -# **** CHANGES TO make.conf *OVERRIDE* THIS FILE **** -# *************************************************** -# ** Incremental Variables Accumulate Across Files ** -# ** USE, CONFIG_*, and FEATURES are incremental ** -# *************************************************** - -GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/Linux/distributions/gentoo" -SYNC="rsync://rsync.gentoo.org/gentoo-portage" -# Host-type -CHOST=hppa-unknown-linux-gnu -PORTAGE_TMPDIR=/var/tmp - -PORTDIR=/usr/portage -DISTDIR=${PORTDIR}/distfiles -PKGDIR=${PORTDIR}/packages -RPMDIR=${PORTDIR}/rpm -CONFIG_PROTECT="/etc /var/qmail/control /usr/share/config /usr/kde/2/share/config /usr/kde/3/share/config" -CONFIG_PROTECT_MASK="/etc/gconf" - -# Options passed to make during the build process -MAKEOPTS="-j2" - -# Fetching command (5 tries, passive ftp for firewall compatibility) -FETCHCOMMAND="/usr/bin/wget -t 5 --passive-ftp -P \${DISTDIR} \${URI}" -RESUMECOMMAND="/usr/bin/wget -c -t 5 --passive-ftp -P \${DISTDIR} \${URI}" - -CFLAGS="-O2 -pipe" -CXXFLAGS="-O1 -pipe" - -# Debug build -- if defined, binaries won't be stripped -#DEBUGBUILD=true - -# Default maintainer options -#FEATURES="digest sandbox noclean noauto buildpkg" -# Default user options -FEATURES="distlocks ccache autoaddcvs strict" - -# By default output colored text where possible, set to "true" to output only -#black&white text -NOCOLOR="false" - -PORTAGE_BINHOST_CHUNKSIZE="3000" -USE_EXPAND="VIDEO_CARDS INPUT_DEVICES LINGUAS" - -# By default wait 5 secs before cleaning a package -CLEAN_DELAY="5" - -# Set to yes automatically run "emerge --clean" after each merge -# Important, as without this you may experience missing symlinks when -# downgrading libraries during a batch (world/system) update. -# DEPRECATED, THIS IS ALWAYS ENABLED IN >=PORTAGE-2.1 -AUTOCLEAN="yes" - -# Number of times 'emerge --sync' will run before giving up. -RSYNC_RETRIES="3" -# Number of seconds rsync will wait before timing out. -RSYNC_TIMEOUT="180" - -# ***************************** -# ** DO NOT EDIT THIS FILE ** -# *************************************************** -# **** CHANGES TO make.conf *OVERRIDE* THIS FILE **** -# *************************************************** -# ** Incremental Variables Accumulate Across Files ** -# ** USE, CONFIG_*, and FEATURES are incremental ** -# *************************************************** diff --git a/cnf/make.globals.ia64 b/cnf/make.globals.ia64 deleted file mode 100644 index 5b81f3f..0000000 --- a/cnf/make.globals.ia64 +++ /dev/null @@ -1,74 +0,0 @@ -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/cnf/make.globals.ia64,v 1.4 2005/04/26 09:40:59 genone Exp $ -# System-wide defaults for the Portage system - -# ***************************** -# ** DO NOT EDIT THIS FILE ** -# *************************************************** -# **** CHANGES TO make.conf *OVERRIDE* THIS FILE **** -# *************************************************** -# ** Incremental Variables Accumulate Across Files ** -# ** USE, CONFIG_*, and FEATURES are incremental ** -# *************************************************** - -GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/Linux/distributions/gentoo" -SYNC="rsync://rsync.gentoo.org/gentoo-portage" -# Host-type -CHOST=ia64-unknown-linux-gnu -PORTAGE_TMPDIR=/var/tmp - -PORTDIR=/usr/portage -DISTDIR=${PORTDIR}/distfiles -PKGDIR=${PORTDIR}/packages -RPMDIR=${PORTDIR}/rpm -CONFIG_PROTECT="/etc /var/qmail/control /usr/share/config /usr/kde/2/share/config /usr/kde/3/share/config" -CONFIG_PROTECT_MASK="/etc/gconf" - -# Options passed to make during the build process -MAKEOPTS="-j2" - -# Fetching command (5 tries, passive ftp for firewall compatibility) -FETCHCOMMAND="/usr/bin/wget -t 5 --passive-ftp -P \${DISTDIR} \${URI}" -RESUMECOMMAND="/usr/bin/wget -c -t 5 --passive-ftp -P \${DISTDIR} \${URI}" - -CFLAGS="-O2 -pipe" -CXXFLAGS=${CFLAGS} - -# Debug build -- if defined, binaries won't be stripped -#DEBUGBUILD=true - -# Default maintainer options -#FEATURES="digest sandbox noclean noauto buildpkg usersandbox" -# Default user options -FEATURES="sandbox distlocks ccache autoaddcvs strict" - -# By default output colored text where possible, set to "true" to output only -#black&white text -NOCOLOR="false" - -PORTAGE_BINHOST_CHUNKSIZE="3000" -USE_EXPAND="VIDEO_CARDS INPUT_DEVICES LINGUAS" - -# By default wait 5 secs before cleaning a package -CLEAN_DELAY="5" - -# Set to yes automatically run "emerge --clean" after each merge -# Important, as without this you may experience missing symlinks when -# downgrading libraries during a batch (world/system) update. -# DEPRECATED, THIS IS ALWAYS ENABLED IN >=PORTAGE-2.1 -AUTOCLEAN="yes" - -# Number of times 'emerge --sync' will run before giving up. -RSYNC_RETRIES="3" -# Number of seconds rsync will wait before timing out. -RSYNC_TIMEOUT="180" - -# ***************************** -# ** DO NOT EDIT THIS FILE ** -# *************************************************** -# **** CHANGES TO make.conf *OVERRIDE* THIS FILE **** -# *************************************************** -# ** Incremental Variables Accumulate Across Files ** -# ** USE, CONFIG_*, and FEATURES are incremental ** -# *************************************************** diff --git a/cnf/make.globals.mac b/cnf/make.globals.mac deleted file mode 100644 index d504df6..0000000 --- a/cnf/make.globals.mac +++ /dev/null @@ -1,74 +0,0 @@ -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/cnf/make.globals.mac,v 1.12 2005/04/26 09:40:59 genone Exp $ -# System-wide defaults for the Portage system - -# ***************************** -# ** DO NOT EDIT THIS FILE ** -# *************************************************** -# **** CHANGES TO make.conf *OVERRIDE* THIS FILE **** -# *************************************************** -# ** Incremental Variables Accumulate Across Files ** -# ** USE, CONFIG_*, and FEATURES are incremental ** -# *************************************************** - -GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/Linux/distributions/gentoo" -SYNC="rsync://rsync.gentoo.org/gentoo-portage" -# Host-type -CHOST=ppc-darwin -PORTAGE_TMPDIR=/var/tmp - -PORTDIR=/usr/portage -DISTDIR=${PORTDIR}/distfiles -PKGDIR=${PORTDIR}/packages -RPMDIR=${PORTDIR}/rpm -CONFIG_PROTECT="/etc /var/qmail/control /usr/share/config /usr/kde/2/share/config /usr/kde/3/share/config" -CONFIG_PROTECT_MASK="/etc/gconf" - -# Options passed to make during the build process -MAKEOPTS="-j2" - -# Fetching command (5 tries, passive ftp for firewall compatibility) -FETCHCOMMAND="/usr/bin/ftp -o \${DISTDIR}/\${FILE} \${URI}" -RESUMECOMMAND="/usr/bin/ftp -R -o \${DISTDIR}/${FILE} \${URI}" - -CFLAGS="-O2 -pipe" -CXXFLAGS=${CFLAGS} - -# Debug build -- if defined, binaries won't be stripped -#DEBUGBUILD=true - -# Default maintainer options -#FEATURES="digest sandbox noclean noauto buildpkg usersandbox" -# Default user options -FEATURES="-sandbox distlocks ccache autoaddcvs strict" - -# By default output colored text where possible, set to "true" to output only -#black&white text -NOCOLOR="false" - -PORTAGE_BINHOST_CHUNKSIZE="3000" -USE_EXPAND="VIDEO_CARDS INPUT_DEVICES LINGUAS" - -# By default wait 5 secs before cleaning a package -CLEAN_DELAY="5" - -# Set to yes automatically run "emerge --clean" after each merge -# Important, as without this you may experience missing symlinks when -# downgrading libraries during a batch (world/system) update. -# DEPRECATED, THIS IS ALWAYS ENABLED IN >=PORTAGE-2.1 -AUTOCLEAN="yes" - -# Number of times 'emerge --sync' will run before giving up. -RSYNC_RETRIES="3" -# Number of seconds rsync will wait before timing out. -RSYNC_TIMEOUT="180" - -# ***************************** -# ** DO NOT EDIT THIS FILE ** -# *************************************************** -# **** CHANGES TO make.conf *OVERRIDE* THIS FILE **** -# *************************************************** -# ** Incremental Variables Accumulate Across Files ** -# ** USE, CONFIG_*, and FEATURES are incremental ** -# *************************************************** diff --git a/cnf/make.globals.mips b/cnf/make.globals.mips deleted file mode 100644 index 7cb49a8..0000000 --- a/cnf/make.globals.mips +++ /dev/null @@ -1,74 +0,0 @@ -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/cnf/make.globals.mips,v 1.17 2005/04/26 09:40:59 genone Exp $ -# System-wide defaults for the Portage system - -# ***************************** -# ** DO NOT EDIT THIS FILE ** -# *************************************************** -# **** CHANGES TO make.conf *OVERRIDE* THIS FILE **** -# *************************************************** -# ** Incremental Variables Accumulate Across Files ** -# ** USE, CONFIG_*, and FEATURES are incremental ** -# *************************************************** - -GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/Linux/distributions/gentoo" -SYNC="rsync://rsync.gentoo.org/gentoo-portage" -# Host-type -CHOST="mips-unknown-linux-gnu" -PORTAGE_TMPDIR=/var/tmp - -PORTDIR=/usr/portage -DISTDIR=${PORTDIR}/distfiles -PKGDIR=${PORTDIR}/packages -RPMDIR=${PORTDIR}/rpm -CONFIG_PROTECT="/etc /var/qmail/control /usr/share/config /usr/kde/2/share/config /usr/kde/3/share/config" -CONFIG_PROTECT_MASK="/etc/gconf" - -# Options passed to make during the build process -MAKEOPTS="-j2" - -# Fetching command (5 tries, passive ftp for firewall compatibility) -FETCHCOMMAND="/usr/bin/wget -t 5 --passive-ftp -P \${DISTDIR} \${URI}" -RESUMECOMMAND="/usr/bin/wget -c -t 5 --passive-ftp -P \${DISTDIR} \${URI}" - -CFLAGS="-O2 -pipe" -CXXFLAGS=${CFLAGS} - -# Debug build -- if defined, binaries won't be stripped -#DEBUGBUILD=true - -# Default maintainer options -#FEATURES="digest sandbox noclean noauto buildpkg" -# Default user options -FEATURES="distlocks ccache autoaddcvs strict" - -# By default output colored text where possible, set to "true" to output only -#black&white text -NOCOLOR="false" - -PORTAGE_BINHOST_CHUNKSIZE="3000" -USE_EXPAND="VIDEO_CARDS INPUT_DEVICES LINGUAS" - -# By default wait 5 secs before cleaning a package -CLEAN_DELAY="5" - -# Set to yes automatically run "emerge --clean" after each merge -# Important, as without this you may experience missing symlinks when -# downgrading libraries during a batch (world/system) update. -# DEPRECATED, THIS IS ALWAYS ENABLED IN >=PORTAGE-2.1 -AUTOCLEAN="yes" - -# Number of times 'emerge --sync' will run before giving up. -RSYNC_RETRIES="3" -# Number of seconds rsync will wait before timing out. -RSYNC_TIMEOUT="180" - -# ***************************** -# ** DO NOT EDIT THIS FILE ** -# *************************************************** -# **** CHANGES TO make.conf *OVERRIDE* THIS FILE **** -# *************************************************** -# ** Incremental Variables Accumulate Across Files ** -# ** USE, CONFIG_*, and FEATURES are incremental ** -# *************************************************** diff --git a/cnf/make.globals.ppc b/cnf/make.globals.ppc deleted file mode 100644 index 750e17a..0000000 --- a/cnf/make.globals.ppc +++ /dev/null @@ -1,74 +0,0 @@ -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/cnf/make.globals.ppc,v 1.31 2005/04/26 09:40:59 genone Exp $ -# System-wide defaults for the Portage system - -# ***************************** -# ** DO NOT EDIT THIS FILE ** -# *************************************************** -# **** CHANGES TO make.conf *OVERRIDE* THIS FILE **** -# *************************************************** -# ** Incremental Variables Accumulate Across Files ** -# ** USE, CONFIG_*, and FEATURES are incremental ** -# *************************************************** - -GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/Linux/distributions/gentoo" -SYNC="rsync://rsync.gentoo.org/gentoo-portage" -# Host-type -CHOST="powerpc-unknown-linux-gnu" -PORTAGE_TMPDIR=/var/tmp - -PORTDIR=/usr/portage -DISTDIR=${PORTDIR}/distfiles -PKGDIR=${PORTDIR}/packages -RPMDIR=${PORTDIR}/rpm -CONFIG_PROTECT="/etc /var/qmail/control /usr/share/config /usr/kde/2/share/config /usr/kde/3/share/config" -CONFIG_PROTECT_MASK="/etc/gconf" - -# Options passed to make during the build process -MAKEOPTS="-j2" - -# Fetching command (5 tries, passive ftp for firewall compatibility) -FETCHCOMMAND="/usr/bin/wget -t 5 --passive-ftp -P \${DISTDIR} \${URI}" -RESUMECOMMAND="/usr/bin/wget -c -t 5 --passive-ftp -P \${DISTDIR} \${URI}" - -CFLAGS="-O2 -pipe" -CXXFLAGS=${CFLAGS} - -# Debug build -- if defined, binaries won't be stripped -#DEBUGBUILD=true - -# Default maintainer options -#FEATURES="digest sandbox noclean noauto buildpkg" -# Default user options -FEATURES="distlocks ccache autoaddcvs strict" - -# By default output colored text where possible, set to "true" to output only -#black&white text -NOCOLOR="false" - -PORTAGE_BINHOST_CHUNKSIZE="3000" -USE_EXPAND="VIDEO_CARDS INPUT_DEVICES LINGUAS" - -# By default wait 5 secs before cleaning a package -CLEAN_DELAY="5" - -# Set to yes automatically run "emerge --clean" after each merge -# Important, as without this you may experience missing symlinks when -# downgrading libraries during a batch (world/system) update. -# DEPRECATED, THIS IS ALWAYS ENABLED IN >=PORTAGE-2.1 -AUTOCLEAN="yes" - -# Number of times 'emerge --sync' will run before giving up. -RSYNC_RETRIES="3" -# Number of seconds rsync will wait before timing out. -RSYNC_TIMEOUT="180" - -# ***************************** -# ** DO NOT EDIT THIS FILE ** -# *************************************************** -# **** CHANGES TO make.conf *OVERRIDE* THIS FILE **** -# *************************************************** -# ** Incremental Variables Accumulate Across Files ** -# ** USE, CONFIG_*, and FEATURES are incremental ** -# *************************************************** diff --git a/cnf/make.globals.ppc64 b/cnf/make.globals.ppc64 deleted file mode 100644 index 9e8afa2..0000000 --- a/cnf/make.globals.ppc64 +++ /dev/null @@ -1,74 +0,0 @@ -# Copyright 1999-2005 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/cnf/make.globals.ppc64,v 1.2 2005/04/26 09:40:59 genone Exp $ -# System-wide defaults for the Portage system - -# ***************************** -# ** DO NOT EDIT THIS FILE ** -# *************************************************** -# **** CHANGES TO make.conf *OVERRIDE* THIS FILE **** -# *************************************************** -# ** Incremental Variables Accumulate Across Files ** -# ** USE, CONFIG_*, and FEATURES are incremental ** -# *************************************************** - -GENTOO_MIRRORS="http://gentoo.osuosl.org http://distro.ibiblio.org/pub/Linux/distributions/gentoo" -SYNC="rsync://rsync.gentoo.org/gentoo-portage" -# Host-type -CHOST="powerpc64-unknown-linux-gnu" -PORTAGE_TMPDIR=/var/tmp - -PORTDIR=/usr/portage -DISTDIR=${PORTDIR}/distfiles -PKGDIR=${PORTDIR}/packages -RPMDIR=${PORTDIR}/rpm -CONFIG_PROTECT="/etc /var/qmail/control /usr/share/config /usr/kde/2/share/config /usr/kde/3/share/config" -CONFIG_PROTECT_MASK="/etc/gconf" - -# Options passed to make during the build process -MAKEOPTS="-j2" - -# Fetching command (5 tries, passive ftp for firewall compatibility) -FETCHCOMMAND="/usr/bin/wget -t 5 --passive-ftp -P \${DISTDIR} \${URI}" -RESUMECOMMAND="/usr/bin/wget -c -t 5 --passive-ftp -P \${DISTDIR} \${URI}" - -CFLAGS="-O2 -pipe" -CXXFLAGS=${CFLAGS} - -# Debug build -- if defined, binaries won't be stripped -#DEBUGBUILD=true - -# Default maintainer options -#FEATURES="digest sandbox noclean noauto buildpkg" -# Default user options -FEATURES="distlocks ccache autoaddcvs strict" - -# By default output colored text where possible, set to "true" to output only -#black&white text -NOCOLOR="false" - -PORTAGE_BINHOST_CHUNKSIZE="3000" -USE_EXPAND="VIDEO_CARDS INPUT_DEVICES LINGUAS" - -# By default wait 5 secs before cleaning a package -CLEAN_DELAY="5" - -# Set to yes automatically run "emerge --clean" after each merge -# Important, as without this you may experience missing symlinks when -# downgrading libraries during a batch (world/system) update. -# DEPRECATED, THIS IS ALWAYS ENABLED IN >=PORTAGE-2.1 -AUTOCLEAN="yes" - -# Number of times 'emerge --sync' will run before giving up. -RSYNC_RETRIES="3" -# Number of seconds rsync will wait before timing out. -RSYNC_TIMEOUT="180" - -# ***************************** -# ** DO NOT EDIT THIS FILE ** -# *************************************************** -# **** CHANGES TO make.conf *OVERRIDE* THIS FILE **** -# *************************************************** -# ** Incremental Variables Accumulate Across Files ** -# ** USE, CONFIG_*, and FEATURES are incremental ** -# *************************************************** diff --git a/cnf/make.globals.s390 b/cnf/make.globals.s390 deleted file mode 100644 index 5f42e88..0000000 --- a/cnf/make.globals.s390 +++ /dev/null @@ -1,74 +0,0 @@ -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/cnf/make.globals.s390,v 1.5 2005/04/26 09:40:59 genone Exp $ -# System-wide defaults for the Portage system - -# ***************************** -# ** DO NOT EDIT THIS FILE ** -# *************************************************** -# **** CHANGES TO make.conf *OVERRIDE* THIS FILE **** -# *************************************************** -# ** Incremental Variables Accumulate Across Files ** -# ** USE, CONFIG_*, and FEATURES are incremental ** -# *************************************************** - -GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/Linux/distributions/gentoo" -SYNC="rsync://rsync.gentoo.org/gentoo-portage" -# Host-type -CHOST=s390-ibm-linux-gnu -PORTAGE_TMPDIR=/var/tmp - -PORTDIR=/usr/portage -DISTDIR=${PORTDIR}/distfiles -PKGDIR=${PORTDIR}/packages -RPMDIR=${PORTDIR}/rpm -CONFIG_PROTECT="/etc /var/qmail/control /usr/share/config /usr/kde/2/share/config /usr/kde/3/share/config" -CONFIG_PROTECT_MASK="/etc/gconf" - -# Options passed to make during the build process -MAKEOPTS="-j2" - -# Fetching command (5 tries, passive ftp for firewall compatibility) -FETCHCOMMAND="/usr/bin/wget -t 5 --passive-ftp -P \${DISTDIR} \${URI}" -RESUMECOMMAND="/usr/bin/wget -c -t 5 --passive-ftp -P \${DISTDIR} \${URI}" - -CFLAGS="-O2 -pipe" -CXXFLAGS=${CFLAGS} - -# Debug build -- if defined, binaries won't be stripped -#DEBUGBUILD=true - -# Default maintainer options -#FEATURES="digest sandbox noclean noauto buildpkg usersandbox" -# Default user options -FEATURES="sandbox distlocks ccache autoaddcvs strict" - -# By default output colored text where possible, set to "true" to output only -#black&white text -NOCOLOR="false" - -PORTAGE_BINHOST_CHUNKSIZE="3000" -USE_EXPAND="VIDEO_CARDS INPUT_DEVICES LINGUAS" - -# By default wait 5 secs before cleaning a package -CLEAN_DELAY="5" - -# Set to yes automatically run "emerge --clean" after each merge -# Important, as without this you may experience missing symlinks when -# downgrading libraries during a batch (world/system) update. -# DEPRECATED, THIS IS ALWAYS ENABLED IN >=PORTAGE-2.1 -AUTOCLEAN="yes" - -# Number of times 'emerge --sync' will run before giving up. -RSYNC_RETRIES="3" -# Number of seconds rsync will wait before timing out. -RSYNC_TIMEOUT="180" - -# ***************************** -# ** DO NOT EDIT THIS FILE ** -# *************************************************** -# **** CHANGES TO make.conf *OVERRIDE* THIS FILE **** -# *************************************************** -# ** Incremental Variables Accumulate Across Files ** -# ** USE, CONFIG_*, and FEATURES are incremental ** -# *************************************************** diff --git a/cnf/make.globals.sh b/cnf/make.globals.sh deleted file mode 100644 index 134dc23..0000000 --- a/cnf/make.globals.sh +++ /dev/null @@ -1,74 +0,0 @@ -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/cnf/make.globals.sh,v 1.3 2005/04/26 09:40:59 genone Exp $ -# System-wide defaults for the Portage system - -# ***************************** -# ** DO NOT EDIT THIS FILE ** -# *************************************************** -# **** CHANGES TO make.conf *OVERRIDE* THIS FILE **** -# *************************************************** -# ** Incremental Variables Accumulate Across Files ** -# ** USE, CONFIG_*, and FEATURES are incremental ** -# *************************************************** - -GENTOO_MIRRORS="http://gentoo.osuosl.org http://distro.ibiblio.org/pub/Linux/distributions/gentoo" -SYNC="rsync://rsync.gentoo.org/gentoo-portage" -# Host-type -CHOST=sh-unknown-linux-gnu -PORTAGE_TMPDIR=/var/tmp - -PORTDIR=/usr/portage -DISTDIR=${PORTDIR}/distfiles -PKGDIR=${PORTDIR}/packages -RPMDIR=${PORTDIR}/rpm -CONFIG_PROTECT="/etc /var/qmail/control /usr/share/config /usr/kde/2/share/config /usr/kde/3/share/config" -CONFIG_PROTECT_MASK="/etc/gconf" - -# Options passed to make during the build process -MAKEOPTS="-j2" - -# Fetching command (5 tries, passive ftp for firewall compatibility) -FETCHCOMMAND="/usr/bin/wget -t 5 --passive-ftp -P \${DISTDIR} \${URI}" -RESUMECOMMAND="/usr/bin/wget -c -t 5 --passive-ftp -P \${DISTDIR} \${URI}" - -CFLAGS="-Os -pipe" -CXXFLAGS=${CFLAGS} - -# Debug build -- if defined, binaries won't be stripped -#DEBUGBUILD=true - -# Default maintainer options -#FEATURES="digest sandbox noclean noauto buildpkg usersandbox" -# Default user options -FEATURES="sandbox distlocks ccache autoaddcvs strict" - -# By default output colored text where possible, set to "true" to output only -#black&white text -NOCOLOR="false" - -PORTAGE_BINHOST_CHUNKSIZE="3000" -USE_EXPAND="VIDEO_CARDS INPUT_DEVICES LINGUAS" - -# By default wait 5 secs before cleaning a package -CLEAN_DELAY="5" - -# Set to yes automatically run "emerge --clean" after each merge -# Important, as without this you may experience missing symlinks when -# downgrading libraries during a batch (world/system) update. -# DEPRECATED, THIS IS ALWAYS ENABLED IN >=PORTAGE-2.1 -AUTOCLEAN="yes" - -# Number of times 'emerge --sync' will run before giving up. -RSYNC_RETRIES="3" -# Number of seconds rsync will wait before timing out. -RSYNC_TIMEOUT="180" - -# ***************************** -# ** DO NOT EDIT THIS FILE ** -# *************************************************** -# **** CHANGES TO make.conf *OVERRIDE* THIS FILE **** -# *************************************************** -# ** Incremental Variables Accumulate Across Files ** -# ** USE, CONFIG_*, and FEATURES are incremental ** -# *************************************************** diff --git a/cnf/make.globals.sparc b/cnf/make.globals.sparc deleted file mode 100644 index 394a375..0000000 --- a/cnf/make.globals.sparc +++ /dev/null @@ -1,74 +0,0 @@ -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/cnf/make.globals.sparc,v 1.17 2005/04/26 09:40:59 genone Exp $ -# System-wide defaults for the Portage system - -# ***************************** -# ** DO NOT EDIT THIS FILE ** -# *************************************************** -# **** CHANGES TO make.conf *OVERRIDE* THIS FILE **** -# *************************************************** -# ** Incremental Variables Accumulate Across Files ** -# ** USE, CONFIG_*, and FEATURES are incremental ** -# *************************************************** - -GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/Linux/distributions/gentoo" -SYNC="rsync://rsync.gentoo.org/gentoo-portage" -# Host-type -CHOST="sparc-unknown-linux-gnu" -PORTAGE_TMPDIR=/var/tmp - -PORTDIR=/usr/portage -DISTDIR=${PORTDIR}/distfiles -PKGDIR=${PORTDIR}/packages -RPMDIR=${PORTDIR}/rpm -CONFIG_PROTECT="/etc /var/qmail/control /usr/share/config /usr/kde/2/share/config /usr/kde/3/share/config" -CONFIG_PROTECT_MASK="/etc/gconf" - -# Options passed to make during the build process -MAKEOPTS="-j2" - -# Fetching command (5 tries, passive ftp for firewall compatibility) -FETCHCOMMAND="/usr/bin/wget -t 5 --passive-ftp -P \${DISTDIR} \${URI}" -RESUMECOMMAND="/usr/bin/wget -c -t 5 --passive-ftp -P \${DISTDIR} \${URI}" - -CFLAGS="-O2 -pipe" -CXXFLAGS=${CFLAGS} - -# Debug build -- if defined, binaries won't be stripped -#DEBUGBUILD=true - -# Default maintainer options -#FEATURES="digest sandbox noclean noauto buildpkg" -# Default user options -FEATURES="distlocks ccache autoaddcvs strict" - -# By default output colored text where possible, set to "true" to output only -#black&white text -NOCOLOR="false" - -PORTAGE_BINHOST_CHUNKSIZE="3000" -USE_EXPAND="VIDEO_CARDS INPUT_DEVICES LINGUAS" - -# By default wait 5 secs before cleaning a package -CLEAN_DELAY="5" - -# Set to yes automatically run "emerge --clean" after each merge -# Important, as without this you may experience missing symlinks when -# downgrading libraries during a batch (world/system) update. -# DEPRECATED, THIS IS ALWAYS ENABLED IN >=PORTAGE-2.1 -AUTOCLEAN="yes" - -# Number of times 'emerge --sync' will run before giving up. -RSYNC_RETRIES="3" -# Number of seconds rsync will wait before timing out. -RSYNC_TIMEOUT="180" - -# ***************************** -# ** DO NOT EDIT THIS FILE ** -# *************************************************** -# **** CHANGES TO make.conf *OVERRIDE* THIS FILE **** -# *************************************************** -# ** Incremental Variables Accumulate Across Files ** -# ** USE, CONFIG_*, and FEATURES are incremental ** -# *************************************************** diff --git a/cnf/make.globals.x86 b/cnf/make.globals.x86 deleted file mode 100644 index e9df1c2..0000000 --- a/cnf/make.globals.x86 +++ /dev/null @@ -1,74 +0,0 @@ -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/cnf/make.globals.x86,v 1.7 2005/04/26 09:40:59 genone Exp $ -# System-wide defaults for the Portage system - -# ***************************** -# ** DO NOT EDIT THIS FILE ** -# *************************************************** -# **** CHANGES TO make.conf *OVERRIDE* THIS FILE **** -# *************************************************** -# ** Incremental Variables Accumulate Across Files ** -# ** USE, CONFIG_*, and FEATURES are incremental ** -# *************************************************** - -GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/Linux/distributions/gentoo" -SYNC="rsync://rsync.gentoo.org/gentoo-portage" -# Host-type -CHOST=i686-pc-linux-gnu -PORTAGE_TMPDIR=/var/tmp - -PORTDIR=/usr/portage -DISTDIR=${PORTDIR}/distfiles -PKGDIR=${PORTDIR}/packages -RPMDIR=${PORTDIR}/rpm -CONFIG_PROTECT="/etc /var/qmail/control /usr/share/config /usr/kde/2/share/config /usr/kde/3/share/config" -CONFIG_PROTECT_MASK="/etc/gconf" - -# Options passed to make during the build process -MAKEOPTS="-j2" - -# Fetching command (5 tries, passive ftp for firewall compatibility) -FETCHCOMMAND="/usr/bin/wget -t 5 --passive-ftp -P \${DISTDIR} \${URI}" -RESUMECOMMAND="/usr/bin/wget -c -t 5 --passive-ftp -P \${DISTDIR} \${URI}" - -CFLAGS="-O2 -mcpu=i686 -pipe" -CXXFLAGS=${CFLAGS} - -# Debug build -- if defined, binaries won't be stripped -#DEBUGBUILD=true - -# Default maintainer options -#FEATURES="digest sandbox noclean noauto buildpkg usersandbox" -# Default user options -FEATURES="sandbox distlocks ccache autoaddcvs strict" - -# By default output colored text where possible, set to "true" to output only -#black&white text -NOCOLOR="false" - -PORTAGE_BINHOST_CHUNKSIZE="3000" -USE_EXPAND="VIDEO_CARDS INPUT_DEVICES LINGUAS" - -# By default wait 5 secs before cleaning a package -CLEAN_DELAY="5" - -# Set to yes automatically run "emerge --clean" after each merge -# Important, as without this you may experience missing symlinks when -# downgrading libraries during a batch (world/system) update. -# DEPRECATED, THIS IS ALWAYS ENABLED IN >=PORTAGE-2.1 -AUTOCLEAN="yes" - -# Number of times 'emerge --sync' will run before giving up. -RSYNC_RETRIES="3" -# Number of seconds rsync will wait before timing out. -RSYNC_TIMEOUT="180" - -# ***************************** -# ** DO NOT EDIT THIS FILE ** -# *************************************************** -# **** CHANGES TO make.conf *OVERRIDE* THIS FILE **** -# *************************************************** -# ** Incremental Variables Accumulate Across Files ** -# ** USE, CONFIG_*, and FEATURES are incremental ** -# *************************************************** diff --git a/cnf/make.globals.x86-fbsd b/cnf/make.globals.x86-fbsd deleted file mode 100644 index 0d800aa..0000000 --- a/cnf/make.globals.x86-fbsd +++ /dev/null @@ -1,72 +0,0 @@ -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/cnf/make.globals.x86-fbsd,v 1.3 2005/04/26 09:40:59 genone Exp $ -# System-wide defaults for the Portage system - -# ***************************** -# ** DO NOT EDIT THIS FILE ** -# *************************************************** -# **** CHANGES TO make.conf *OVERRIDE* THIS FILE **** -# *************************************************** -# ** Incremental Variables Accumulate Across Files ** -# ** USE, CONFIG_*, and FEATURES are incremental ** -# *************************************************** - -GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/Linux/distributions/gentoo" -SYNC="rsync://rsync.gentoo.org/gentoo-portage" -# Host-type -CHOST=i686-unknown-freebsd5.3 -PORTAGE_TMPDIR=/var/tmp - -PORTDIR=/usr/portage -DISTDIR=${PORTDIR}/distfiles -PKGDIR=${PORTDIR}/packages -RPMDIR=${PORTDIR}/rpm -CONFIG_PROTECT="/etc /var/qmail/control /usr/share/config /usr/kde/2/share/config /usr/kde/3/share/config" -CONFIG_PROTECT_MASK="/etc/gconf" - -# Options passed to make during the build process -MAKEOPTS="-j2" - -# Fetching command (5 tries, passive ftp for firewall compatibility) -FETCHCOMMAND='/usr/bin/fetch -o "${DISTDIR}/${FILE}" "${URI}"' -RESUMECOMMAND='/usr/bin/fetch -r -o "${DISTDIR}/${FILE}" "${URI}"' - -CFLAGS="-O2 -mtune=i686 -pipe" -CXXFLAGS=${CFLAGS} - -# Debug build -- if defined, binaries won't be stripped -#DEBUGBUILD=true - -# Default maintainer options -#FEATURES="digest sandbox noclean noauto buildpkg usersandbox" -# Default user options -FEATURES="-sandbox distlocks autoaddcvs strict" - -# By default output colored text where possible, set to "true" to output only -#black&white text -NOCOLOR="false" - -PORTAGE_BINHOST_CHUNKSIZE="3000" -USE_EXPAND="VIDEO_CARDS INPUT_DEVICES LINGUAS" - -# By default wait 5 secs before cleaning a package -CLEAN_DELAY="5" -# Set to yes automatically run "emerge --clean" after each merge -# Important, as without this you may experience missing symlinks when -# downgrading libraries during a batch (world/system) update. -AUTOCLEAN="yes" - -# Number of times 'emerge --sync' will run before giving up. -RSYNC_RETRIES="3" -# Number of seconds rsync will wait before timing out. -RSYNC_TIMEOUT="180" - -# ***************************** -# ** DO NOT EDIT THIS FILE ** -# *************************************************** -# **** CHANGES TO make.conf *OVERRIDE* THIS FILE **** -# *************************************************** -# ** Incremental Variables Accumulate Across Files ** -# ** USE, CONFIG_*, and FEATURES are incremental ** -# *************************************************** diff --git a/compile b/compile deleted file mode 100755 index a81e000..0000000 --- a/compile +++ /dev/null @@ -1,136 +0,0 @@ -#! /bin/sh -# Wrapper for compilers which do not understand `-c -o'. - -scriptversion=2003-11-09.00 - -# Copyright (C) 1999, 2000, 2003 Free Software Foundation, Inc. -# Written by Tom Tromey <tromey@cygnus.com>. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# This file is maintained in Automake, please report -# bugs to <bug-automake@gnu.org> or send patches to -# <automake-patches@gnu.org>. - -case $1 in - '') - echo "$0: No command. Try \`$0 --help' for more information." 1>&2 - exit 1; - ;; - -h | --h*) - cat <<\EOF -Usage: compile [--help] [--version] PROGRAM [ARGS] - -Wrapper for compilers which do not understand `-c -o'. -Remove `-o dest.o' from ARGS, run PROGRAM with the remaining -arguments, and rename the output as expected. - -If you are trying to build a whole package this is not the -right script to run: please start by reading the file `INSTALL'. - -Report bugs to <bug-automake@gnu.org>. -EOF - exit 0 - ;; - -v | --v*) - echo "compile $scriptversion" - exit 0 - ;; -esac - - -prog=$1 -shift - -ofile= -cfile= -args= -while test $# -gt 0; do - case "$1" in - -o) - # configure might choose to run compile as `compile cc -o foo foo.c'. - # So we do something ugly here. - ofile=$2 - shift - case "$ofile" in - *.o | *.obj) - ;; - *) - args="$args -o $ofile" - ofile= - ;; - esac - ;; - *.c) - cfile=$1 - args="$args $1" - ;; - *) - args="$args $1" - ;; - esac - shift -done - -if test -z "$ofile" || test -z "$cfile"; then - # If no `-o' option was seen then we might have been invoked from a - # pattern rule where we don't need one. That is ok -- this is a - # normal compilation that the losing compiler can handle. If no - # `.c' file was seen then we are probably linking. That is also - # ok. - exec "$prog" $args -fi - -# Name of file we expect compiler to create. -cofile=`echo $cfile | sed -e 's|^.*/||' -e 's/\.c$/.o/'` - -# Create the lock directory. -# Note: use `[/.-]' here to ensure that we don't use the same name -# that we are using for the .o file. Also, base the name on the expected -# object file name, since that is what matters with a parallel build. -lockdir=`echo $cofile | sed -e 's|[/.-]|_|g'`.d -while true; do - if mkdir $lockdir > /dev/null 2>&1; then - break - fi - sleep 1 -done -# FIXME: race condition here if user kills between mkdir and trap. -trap "rmdir $lockdir; exit 1" 1 2 15 - -# Run the compile. -"$prog" $args -status=$? - -if test -f "$cofile"; then - mv "$cofile" "$ofile" -fi - -rmdir $lockdir -exit $status - -# Local Variables: -# mode: shell-script -# sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-end: "$" -# End: diff --git a/configure.in b/configure.in deleted file mode 100644 index 34bb822..0000000 --- a/configure.in +++ /dev/null @@ -1,105 +0,0 @@ -dnl Process this file with autoconf to produce a configure script. -AC_INIT(portage, cvs, dev-portage@gentoo.org) -AM_INIT_AUTOMAKE -dnl AM_CONFIG_HEADER(config.h) - -dnl Checks for programs. -dnl store clfags prior, otherwise it's not propogaed. -if test x$CFLAGS != x -then -CFLAGS=$CFLAGS -fi - -AC_PREFIX_DEFAULT([/usr]) -AC_PROG_CC -AC_PROG_INSTALL - -dnl Checks for libraries. -dnl Replace `main' with a function in -lc: -AC_CHECK_LIB(c, main) -dnl Replace `main' with a function in -ldl: -AC_CHECK_LIB(dl, main) -dnl Replace `main' with a function in -lgcc: -AC_CHECK_LIB(gcc, main) -dnl Replace `main' with a function in -lpthread: -AC_CHECK_LIB(pthread, main) - -dnl Checks for header files. -AC_HEADER_DIRENT -AC_HEADER_STDC -AC_HEADER_SYS_WAIT -AC_CHECK_HEADERS(fcntl.h limits.h strings.h sys/file.h sys/time.h unistd.h) - -dnl Checks for typedefs, structures, and compiler characteristics. -AC_C_CONST -AC_TYPE_UID_T -AC_TYPE_MODE_T -AC_TYPE_SIZE_T - -dnl Checks for library functions. -AC_FUNC_ALLOCA -AC_TYPE_SIGNAL -AC_CHECK_FUNCS(getcwd mkdir regcomp rmdir strdup strerror strspn strstr) - -AC_ARG_ENABLE(tbz2tool, -AC_HELP_STRING([--enable-tbz2tool],[build tbz2tool, tool for creating binpkgs (default yes)]), -[case "${enableval}" in - yes) enable_tbz2tool=true;; - no) enable_tbz2tool=false;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-tbz2tool);; -esac], -[enable_tbz2tool=true]) - -AC_ARG_ENABLE(filter-env, -AC_HELP_STRING([--enable-filter-env],[build filter-env, tool for filtering bash progs/env (default yes)]), -[case "${enableval}" in - yes) enable_filter_env=true;; - no) enable_filter_env=false;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-filter-env);; -esac], -[enable_filter_env=true]) - -AC_ARG_ENABLE(missingos, -AC_HELP_STRING([--enable-missingos],[build compatibility missingos code for python 2.2 (default auto)]), -[case "${enableval}" in - yes) enable_missingos=true;; - no) enable_missingos=false;; - auto) enable_missingos=auto;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-missingos);; -esac], -[enable_missingos=auto]) - -AC_ARG_ENABLE(just-compiled-sources, -AC_HELP_STRING([--enable-just-compiled-sources],[install just the bytecode, not the sources (default no)]), -[case "${enableval}" in - yes) enable_py_sources=false;; - no) enable_py_sources=true;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-just-compiled-sources);; -esac], -[enable_py_sources=true]) - -if test x$enable_missingos = xauto -then - pyver=[`python -c 'import sys;print sys.version[0:3]';`] - case ${pyver} in - 2.4) ;; - 2.3) ;; - 2.2) enable_missingos=true;; - *) AC_MSG_WARN([unable to determine python version, ${pyver}]);; - esac -fi - -AC_CONFIG_FILES([ Makefile ]) -AC_CONFIG_FILES([ src/Makefile ]) -AC_CONFIG_FILES([ src/filter-env/Makefile ]) -AC_CONFIG_FILES([ man/Makefile ]) -AC_CONFIG_FILES([ src/python-missingos/Makefile ]) -AC_CONFIG_FILES([ bin/Makefile ]) -AC_CONFIG_FILES([ pym/Makefile ]) - -AC_SUBST(PORTAGE_BASE,"/usr/lib/portage") -AM_CONDITIONAL(INSTALL_PYTHON_SOURCES, test x$enable_py_sources = xtrue) -AM_CONDITIONAL(BUILD_TBZ2TOOL, test x$enable_tbz2tool = xtrue) -AM_CONDITIONAL(BUILD_MISSINGOS, test x$enable_missingos = xtrue) -AM_CONDITIONAL(BUILD_FILTER_ENV, test x$enable_filter_env = xtrue) -AC_OUTPUT diff --git a/depcomp b/depcomp deleted file mode 100755 index 25bdb18..0000000 --- a/depcomp +++ /dev/null @@ -1,526 +0,0 @@ -#! /bin/sh -# depcomp - compile a program generating dependencies as side-effects - -scriptversion=2004-04-25.13 - -# Copyright (C) 1999, 2000, 2003, 2004 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>. - -case $1 in - '') - echo "$0: No command. Try \`$0 --help' for more information." 1>&2 - exit 1; - ;; - -h | --h*) - cat <<\EOF -Usage: depcomp [--help] [--version] PROGRAM [ARGS] - -Run PROGRAMS ARGS to compile a file, generating dependencies -as side-effects. - -Environment variables: - depmode Dependency tracking mode. - source Source file read by `PROGRAMS ARGS'. - object Object file output by `PROGRAMS ARGS'. - depfile Dependency file to output. - tmpdepfile Temporary file to use when outputing dependencies. - libtool Whether libtool is used (yes/no). - -Report bugs to <bug-automake@gnu.org>. -EOF - exit 0 - ;; - -v | --v*) - echo "depcomp $scriptversion" - exit 0 - ;; -esac - -if test -z "$depmode" || test -z "$source" || test -z "$object"; then - echo "depcomp: Variables source, object and depmode must be set" 1>&2 - exit 1 -fi -# `libtool' can also be set to `yes' or `no'. - -if test -z "$depfile"; then - base=`echo "$object" | sed -e 's,^.*/,,' -e 's,\.\([^.]*\)$,.P\1,'` - dir=`echo "$object" | sed 's,/.*$,/,'` - if test "$dir" = "$object"; then - dir= - fi - # FIXME: should be _deps on DOS. - depfile="$dir.deps/$base" -fi - -tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} - -rm -f "$tmpdepfile" - -# Some modes work just like other modes, but use different flags. We -# parameterize here, but still list the modes in the big case below, -# to make depend.m4 easier to write. Note that we *cannot* use a case -# here, because this file can only contain one case statement. -if test "$depmode" = hp; then - # HP compiler uses -M and no extra arg. - gccflag=-M - depmode=gcc -fi - -if test "$depmode" = dashXmstdout; then - # This is just like dashmstdout with a different argument. - dashmflag=-xM - depmode=dashmstdout -fi - -case "$depmode" in -gcc3) -## gcc 3 implements dependency tracking that does exactly what -## we want. Yay! Note: for some reason libtool 1.4 doesn't like -## it if -MD -MP comes after the -MF stuff. Hmm. - "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile" - exit $stat - fi - mv "$tmpdepfile" "$depfile" - ;; - -gcc) -## There are various ways to get dependency output from gcc. Here's -## why we pick this rather obscure method: -## - Don't want to use -MD because we'd like the dependencies to end -## up in a subdir. Having to rename by hand is ugly. -## (We might end up doing this anyway to support other compilers.) -## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like -## -MM, not -M (despite what the docs say). -## - Using -M directly means running the compiler twice (even worse -## than renaming). - if test -z "$gccflag"; then - gccflag=-MD, - fi - "$@" -Wp,"$gccflag$tmpdepfile" - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - echo "$object : \\" > "$depfile" - alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz -## The second -e expression handles DOS-style file names with drive letters. - sed -e 's/^[^:]*: / /' \ - -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" -## This next piece of magic avoids the `deleted header file' problem. -## The problem is that when a header file which appears in a .P file -## is deleted, the dependency causes make to die (because there is -## typically no way to rebuild the header). We avoid this by adding -## dummy dependencies for each header file. Too bad gcc doesn't do -## this for us directly. - tr ' ' ' -' < "$tmpdepfile" | -## Some versions of gcc put a space before the `:'. On the theory -## that the space means something, we add a space to the output as -## well. -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -hp) - # This case exists only to let depend.m4 do its work. It works by - # looking at the text of this script. This case will never be run, - # since it is checked for above. - exit 1 - ;; - -sgi) - if test "$libtool" = yes; then - "$@" "-Wp,-MDupdate,$tmpdepfile" - else - "$@" -MDupdate "$tmpdepfile" - fi - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - - if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files - echo "$object : \\" > "$depfile" - - # Clip off the initial element (the dependent). Don't try to be - # clever and replace this with sed code, as IRIX sed won't handle - # lines with more than a fixed number of characters (4096 in - # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; - # the IRIX cc adds comments like `#:fec' to the end of the - # dependency line. - tr ' ' ' -' < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ - tr ' -' ' ' >> $depfile - echo >> $depfile - - # The second pass generates a dummy entry for each header file. - tr ' ' ' -' < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ - >> $depfile - else - # The sourcefile does not contain any dependencies, so just - # store a dummy comment line, to avoid errors with the Makefile - # "include basename.Plo" scheme. - echo "#dummy" > "$depfile" - fi - rm -f "$tmpdepfile" - ;; - -aix) - # The C for AIX Compiler uses -M and outputs the dependencies - # in a .u file. In older versions, this file always lives in the - # current directory. Also, the AIX compiler puts `$object:' at the - # start of each line; $object doesn't have directory information. - # Version 6 uses the directory in both cases. - stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` - tmpdepfile="$stripped.u" - if test "$libtool" = yes; then - "$@" -Wc,-M - else - "$@" -M - fi - stat=$? - - if test -f "$tmpdepfile"; then : - else - stripped=`echo "$stripped" | sed 's,^.*/,,'` - tmpdepfile="$stripped.u" - fi - - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile" - exit $stat - fi - - if test -f "$tmpdepfile"; then - outname="$stripped.o" - # Each line is of the form `foo.o: dependent.h'. - # Do two passes, one to just change these to - # `$object: dependent.h' and one to simply `dependent.h:'. - sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" - sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" - else - # The sourcefile does not contain any dependencies, so just - # store a dummy comment line, to avoid errors with the Makefile - # "include basename.Plo" scheme. - echo "#dummy" > "$depfile" - fi - rm -f "$tmpdepfile" - ;; - -icc) - # Intel's C compiler understands `-MD -MF file'. However on - # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c - # ICC 7.0 will fill foo.d with something like - # foo.o: sub/foo.c - # foo.o: sub/foo.h - # which is wrong. We want: - # sub/foo.o: sub/foo.c - # sub/foo.o: sub/foo.h - # sub/foo.c: - # sub/foo.h: - # ICC 7.1 will output - # foo.o: sub/foo.c sub/foo.h - # and will wrap long lines using \ : - # foo.o: sub/foo.c ... \ - # sub/foo.h ... \ - # ... - - "$@" -MD -MF "$tmpdepfile" - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - # Each line is of the form `foo.o: dependent.h', - # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. - # Do two passes, one to just change these to - # `$object: dependent.h' and one to simply `dependent.h:'. - sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" - # Some versions of the HPUX 10.20 sed can't process this invocation - # correctly. Breaking it into two sed invocations is a workaround. - sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | - sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -tru64) - # The Tru64 compiler uses -MD to generate dependencies as a side - # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. - # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put - # dependencies in `foo.d' instead, so we check for that too. - # Subdirectories are respected. - dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` - test "x$dir" = "x$object" && dir= - base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` - - if test "$libtool" = yes; then - # Dependencies are output in .lo.d with libtool 1.4. - # They are output in .o.d with libtool 1.5. - tmpdepfile1="$dir.libs/$base.lo.d" - tmpdepfile2="$dir.libs/$base.o.d" - tmpdepfile3="$dir.libs/$base.d" - "$@" -Wc,-MD - else - tmpdepfile1="$dir$base.o.d" - tmpdepfile2="$dir$base.d" - tmpdepfile3="$dir$base.d" - "$@" -MD - fi - - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" - exit $stat - fi - - if test -f "$tmpdepfile1"; then - tmpdepfile="$tmpdepfile1" - elif test -f "$tmpdepfile2"; then - tmpdepfile="$tmpdepfile2" - else - tmpdepfile="$tmpdepfile3" - fi - if test -f "$tmpdepfile"; then - sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" - # That's a tab and a space in the []. - sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" - else - echo "#dummy" > "$depfile" - fi - rm -f "$tmpdepfile" - ;; - -#nosideeffect) - # This comment above is used by automake to tell side-effect - # dependency tracking mechanisms from slower ones. - -dashmstdout) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout, regardless of -o. - "$@" || exit $? - - # Remove the call to Libtool. - if test "$libtool" = yes; then - while test $1 != '--mode=compile'; do - shift - done - shift - fi - - # Remove `-o $object'. - IFS=" " - for arg - do - case $arg in - -o) - shift - ;; - $object) - shift - ;; - *) - set fnord "$@" "$arg" - shift # fnord - shift # $arg - ;; - esac - done - - test -z "$dashmflag" && dashmflag=-M - # Require at least two characters before searching for `:' - # in the target name. This is to cope with DOS-style filenames: - # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. - "$@" $dashmflag | - sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" - rm -f "$depfile" - cat < "$tmpdepfile" > "$depfile" - tr ' ' ' -' < "$tmpdepfile" | \ -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -dashXmstdout) - # This case only exists to satisfy depend.m4. It is never actually - # run, as this mode is specially recognized in the preamble. - exit 1 - ;; - -makedepend) - "$@" || exit $? - # Remove any Libtool call - if test "$libtool" = yes; then - while test $1 != '--mode=compile'; do - shift - done - shift - fi - # X makedepend - shift - cleared=no - for arg in "$@"; do - case $cleared in - no) - set ""; shift - cleared=yes ;; - esac - case "$arg" in - -D*|-I*) - set fnord "$@" "$arg"; shift ;; - # Strip any option that makedepend may not understand. Remove - # the object too, otherwise makedepend will parse it as a source file. - -*|$object) - ;; - *) - set fnord "$@" "$arg"; shift ;; - esac - done - obj_suffix="`echo $object | sed 's/^.*\././'`" - touch "$tmpdepfile" - ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" - rm -f "$depfile" - cat < "$tmpdepfile" > "$depfile" - sed '1,2d' "$tmpdepfile" | tr ' ' ' -' | \ -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" "$tmpdepfile".bak - ;; - -cpp) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout. - "$@" || exit $? - - # Remove the call to Libtool. - if test "$libtool" = yes; then - while test $1 != '--mode=compile'; do - shift - done - shift - fi - - # Remove `-o $object'. - IFS=" " - for arg - do - case $arg in - -o) - shift - ;; - $object) - shift - ;; - *) - set fnord "$@" "$arg" - shift # fnord - shift # $arg - ;; - esac - done - - "$@" -E | - sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | - sed '$ s: \\$::' > "$tmpdepfile" - rm -f "$depfile" - echo "$object : \\" > "$depfile" - cat < "$tmpdepfile" >> "$depfile" - sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -msvisualcpp) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout, regardless of -o, - # because we must use -o when running libtool. - "$@" || exit $? - IFS=" " - for arg - do - case "$arg" in - "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") - set fnord "$@" - shift - shift - ;; - *) - set fnord "$@" "$arg" - shift - shift - ;; - esac - done - "$@" -E | - sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" - rm -f "$depfile" - echo "$object : \\" > "$depfile" - . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" - echo " " >> "$depfile" - . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -none) - exec "$@" - ;; - -*) - echo "Unknown depmode $depmode" 1>&2 - exit 1 - ;; -esac - -exit 0 - -# Local Variables: -# mode: shell-script -# sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-end: "$" -# End: diff --git a/install-sh b/install-sh deleted file mode 100755 index e4160c9..0000000 --- a/install-sh +++ /dev/null @@ -1,325 +0,0 @@ -#!/bin/sh -# install - install a program, script, or datafile - -scriptversion=2004-04-01.17 - -# This originates from X11R5 (mit/util/scripts/install.sh), which was -# later released in X11R6 (xc/config/util/install.sh) with the -# following copyright and license. -# -# Copyright (C) 1994 X Consortium -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- -# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -# Except as contained in this notice, the name of the X Consortium shall not -# be used in advertising or otherwise to promote the sale, use or other deal- -# ings in this Software without prior written authorization from the X Consor- -# tium. -# -# -# FSF changes to this file are in the public domain. -# -# Calling this script install-sh is preferred over install.sh, to prevent -# `make' implicit rules from creating a file called install from it -# when there is no Makefile. -# -# This script is compatible with the BSD install script, but was written -# from scratch. It can only install one file at a time, a restriction -# shared with many OS's install programs. - -# set DOITPROG to echo to test this script - -# Don't use :- since 4.3BSD and earlier shells don't like it. -doit="${DOITPROG-}" - -# put in absolute paths if you don't have them in your path; or use env. vars. - -mvprog="${MVPROG-mv}" -cpprog="${CPPROG-cp}" -chmodprog="${CHMODPROG-chmod}" -chownprog="${CHOWNPROG-chown}" -chgrpprog="${CHGRPPROG-chgrp}" -stripprog="${STRIPPROG-strip}" -rmprog="${RMPROG-rm}" -mkdirprog="${MKDIRPROG-mkdir}" - -transformbasename= -transform_arg= -instcmd="$mvprog" -chmodcmd="$chmodprog 0755" -chowncmd= -chgrpcmd= -stripcmd= -rmcmd="$rmprog -f" -mvcmd="$mvprog" -src= -dst= -dir_arg= - -usage="Usage: $0 [OPTION]... SRCFILE DSTFILE - or: $0 [OPTION]... SRCFILES... DIRECTORY - or: $0 -d DIRECTORIES... - -In the first form, install SRCFILE to DSTFILE, removing SRCFILE by default. -In the second, create the directory path DIR. - -Options: --b=TRANSFORMBASENAME --c copy source (using $cpprog) instead of moving (using $mvprog). --d create directories instead of installing files. --g GROUP $chgrp installed files to GROUP. --m MODE $chmod installed files to MODE. --o USER $chown installed files to USER. --s strip installed files (using $stripprog). --t=TRANSFORM ---help display this help and exit. ---version display version info and exit. - -Environment variables override the default commands: - CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG -" - -while test -n "$1"; do - case $1 in - -b=*) transformbasename=`echo $1 | sed 's/-b=//'` - shift - continue;; - - -c) instcmd=$cpprog - shift - continue;; - - -d) dir_arg=true - shift - continue;; - - -g) chgrpcmd="$chgrpprog $2" - shift - shift - continue;; - - --help) echo "$usage"; exit 0;; - - -m) chmodcmd="$chmodprog $2" - shift - shift - continue;; - - -o) chowncmd="$chownprog $2" - shift - shift - continue;; - - -s) stripcmd=$stripprog - shift - continue;; - - -t=*) transformarg=`echo $1 | sed 's/-t=//'` - shift - continue;; - - --version) echo "$0 $scriptversion"; exit 0;; - - *) # When -d is used, all remaining arguments are directories to create. - test -n "$dir_arg" && break - # Otherwise, the last argument is the destination. Remove it from $@. - for arg - do - if test -n "$dstarg"; then - # $@ is not empty: it contains at least $arg. - set fnord "$@" "$dstarg" - shift # fnord - fi - shift # arg - dstarg=$arg - done - break;; - esac -done - -if test -z "$1"; then - if test -z "$dir_arg"; then - echo "$0: no input file specified." >&2 - exit 1 - fi - # It's OK to call `install-sh -d' without argument. - # This can happen when creating conditional directories. - exit 0 -fi - -for src -do - # Protect names starting with `-'. - case $src in - -*) src=./$src ;; - esac - - if test -n "$dir_arg"; then - dst=$src - src= - - if test -d "$dst"; then - instcmd=: - chmodcmd= - else - instcmd=$mkdirprog - fi - else - # Waiting for this to be detected by the "$instcmd $src $dsttmp" command - # might cause directories to be created, which would be especially bad - # if $src (and thus $dsttmp) contains '*'. - if test ! -f "$src" && test ! -d "$src"; then - echo "$0: $src does not exist." >&2 - exit 1 - fi - - if test -z "$dstarg"; then - echo "$0: no destination specified." >&2 - exit 1 - fi - - dst=$dstarg - # Protect names starting with `-'. - case $dst in - -*) dst=./$dst ;; - esac - - # If destination is a directory, append the input filename; won't work - # if double slashes aren't ignored. - if test -d "$dst"; then - dst=$dst/`basename "$src"` - fi - fi - - # This sed command emulates the dirname command. - dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` - - # Make sure that the destination directory exists. - - # Skip lots of stat calls in the usual case. - if test ! -d "$dstdir"; then - defaultIFS=' - ' - IFS="${IFS-$defaultIFS}" - - oIFS=$IFS - # Some sh's can't handle IFS=/ for some reason. - IFS='%' - set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` - IFS=$oIFS - - pathcomp= - - while test $# -ne 0 ; do - pathcomp=$pathcomp$1 - shift - if test ! -d "$pathcomp"; then - $mkdirprog "$pathcomp" || lasterr=$? - # mkdir can fail with a `File exist' error in case several - # install-sh are creating the directory concurrently. This - # is OK. - test ! -d "$pathcomp" && { (exit ${lasterr-1}); exit; } - fi - pathcomp=$pathcomp/ - done - fi - - if test -n "$dir_arg"; then - $doit $instcmd "$dst" \ - && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \ - && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \ - && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \ - && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; } - - else - # If we're going to rename the final executable, determine the name now. - if test -z "$transformarg"; then - dstfile=`basename "$dst"` - else - dstfile=`basename "$dst" $transformbasename \ - | sed $transformarg`$transformbasename - fi - - # don't allow the sed command to completely eliminate the filename. - test -z "$dstfile" && dstfile=`basename "$dst"` - - # Make a couple of temp file names in the proper directory. - dsttmp=$dstdir/_inst.$$_ - rmtmp=$dstdir/_rm.$$_ - - # Trap to clean up those temp files at exit. - trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0 - trap '(exit $?); exit' 1 2 13 15 - - # Move or copy the file name to the temp name - $doit $instcmd "$src" "$dsttmp" && - - # and set any options; do chmod last to preserve setuid bits. - # - # If any of these fail, we abort the whole thing. If we want to - # ignore errors from any of these, just make sure not to ignore - # errors from the above "$doit $instcmd $src $dsttmp" command. - # - { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ - && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ - && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ - && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } && - - # Now rename the file to the real destination. - { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \ - || { - # The rename failed, perhaps because mv can't rename something else - # to itself, or perhaps because mv is so ancient that it does not - # support -f. - - # Now remove or move aside any old file at destination location. - # We try this two ways since rm can't unlink itself on some - # systems and the destination file might be busy for other - # reasons. In this case, the final cleanup might fail but the new - # file should still install successfully. - { - if test -f "$dstdir/$dstfile"; then - $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \ - || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \ - || { - echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 - (exit 1); exit - } - else - : - fi - } && - - # Now rename the file to the real destination. - $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" - } - } - fi || { (exit 1); exit; } -done - -# The final little trick to "correctly" pass the exit status to the exit trap. -{ - (exit 0); exit -} - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-end: "$" -# End: diff --git a/man/Makefile.am b/man/Makefile.am deleted file mode 100644 index 47e8233..0000000 --- a/man/Makefile.am +++ /dev/null @@ -1,12 +0,0 @@ -man_MANS = dispatch-conf.1 \ - ebuild.1 \ - ebuild.5 \ - emerge.1 \ - env-update.1 \ - etc-update.1 \ - make.conf.5 \ - portage.5 \ - quickpkg.1 \ - repoman.1 - -EXTRA_DIST = $(man_MANS) diff --git a/man/check-kernel.eclass.5 b/man/check-kernel.eclass.5 deleted file mode 100644 index 4f12d12..0000000 --- a/man/check-kernel.eclass.5 +++ /dev/null @@ -1,53 +0,0 @@ -.TH "CHECK-KERNEL.ECLASS" "5" "Aug 2004" "Portage 2.0.51" "portage" -.SH "NAME" -check-kernel.eclass \- check kernel sources -.SH "DESCRIPTION" -The \fBcheck-kernel\fR eclass provides an easy interface for detecting kernel -sources and retrieving various information. -.SH "VARIABLES" -The following variables are exported by the \fBcheck-kernel\fR eclass: -.TP -.BR KV_full -Full kernel version (eg. 2.4.27-gentoo-r1) -.TP -.BR KV_major -Major kernel version (eg. 2) -.TP -.BR KV_minor -Minor kernel version (eg. 4) -.TP -.BR KV_micro -Micro kernel version (eg. 27) -.SH "FUNCTIONS" -.TP -.BR check_version_h -Checks to make sure the /usr/src/linux symlink is correctly setup. If it is not, -this function will print a huge error message and halt the emerge process. -.TP -.BR get_KV_info -Parses the kernel's version.h to fill in the \fB${KV_full}\fR, \fB${KV_major}\fR, -\fB${KV_minor}\fR, and \fB${KV_micro}\fR variables. -.TP -\fINOTE:\fR The following functions all return shell true/false. -.TP -.BR is_2_4_kernel -Checks for kernel version 2.4. -.TP -.BR is_2_5_kernel -Checks for kernel version 2.5. -.TP -.BR is_2_6_kernel -Checks for kernel version 2.6. -.TP -.BR kernel_supports_modules -Check to see if the kernel supports modules (CONFIG_MODULES). -.SH "REPORTING BUGS" -Please report bugs via http://bugs.gentoo.org/ -.SH "SEE ALSO" -.BR ebuild (5) -.SH "FILES" -.BR /usr/portage/eclass/check-kernel.eclass -.SH "AUTHORS" -Aaron Walker <ka0ttic@gentoo.org> -.SH "CVS HEADER" -$Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/man/check-kernel.eclass.5,v 1.4 2005/02/10 01:37:36 vapier Exp $ diff --git a/man/check-reqs.eclass.5 b/man/check-reqs.eclass.5 deleted file mode 100644 index 593d497..0000000 --- a/man/check-reqs.eclass.5 +++ /dev/null @@ -1,55 +0,0 @@ -.TH CHECK-REQS.ECLASS 5 "Dec 2004" "Portage 2.0.51" "portage" -.SH NAME -check-reqs.eclass \- functions for checking proper build requirements -.SH DESCRIPTION -The \fBcheck-reqs\fR eclass provides a uniform interface for handling ebuilds -which require an abnormally high amount of system resources. The variable(s) -and function(s) mentioned here should usually be set/called from \fBpkg_setup\fR. -.br - -\fBNOTE\fR: Minimum criteria for use of this eclass is a build that requires ->256MB of RAM and/or >1GB of temporary or install space. -.SH VARIABLES -\fBNOTE\fR: all numerical values are evaluated as megabytes (MB). -.TP -.B CHECKREQS_ACTION = \fI"(warn|error|ignore)"\fR -Defines action to take if current system resources do not satisfy requirements. -\fBNOTE\fR: this variable is for end user only. Ebuilds must *not* override or -set a default for this variable. -.TP -.B CHECKREQS_MEMORY = \fI"256"\fR -Defines amount of memory required. Note that the \fBcheck-reqs\fR eclass does -not take swap space into account when checking current memory resources. -.TP -.B CHECKREQS_DISK_BUILD = \fI"1024"\fR -Defines amount of temporary build space required. -.TP -.B CHECKREQS_DISK_USR = \fI"1024"\fR -Defines amount of /usr space required. -.TP -.B CHECKREQS_DISK_VAR = \fI"1024"\fR -Defines amount of /var space required. -.SH FUNCTIONS -\fBNOTE\fR: all numerical values are evaluated as megabytes (MB). Any values -should merely be rough estimates, and a high degree of precision should not -be implied -- for example, "2048" (or "2000") are more appropriate than "2137". -.TP -.B check_reqs -Performs resource checks based on above defined variables. If the checks fail, -the action specified by \fBCHECKREQS_ACTION\fR will be executed. If for some -reason the \fBcheck-reqs\fR eclass is unable to determine current resources, -then no action will be performed. This function should be called from within -\fBpkg_setup\fR. -.SH REPORTING BUGS -Please report bugs via http://bugs.gentoo.org/ -.SH SEE ALSO -.BR ebuild (5) -.SH FILES -.BR /usr/portage/eclass/check-reqs.eclass -.SH AUTHORS -.nf -Aaron Walker <ka0ttic@gentoo.org> -Ciaran McCreesh <ciaranm@gentoo.org> -.fi -.SH CVS HEADER -$Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/man/check-reqs.eclass.5,v 1.3 2005/05/10 11:13:07 swegener Exp $ diff --git a/man/cvs.eclass.5 b/man/cvs.eclass.5 deleted file mode 100644 index 3536d1a..0000000 --- a/man/cvs.eclass.5 +++ /dev/null @@ -1,80 +0,0 @@ -.TH CVS.ECLASS 5 "Nov 2004" "Portage 2.0.51" portage -.SH NAME -cvs.eclass \- provides generic cvs fetching functions -.SH DESCRIPTION -The \fBcvs\fR eclass contains a suite of functions that are used to -create 'live' cvs ebuilds. These ebuilds are called 'live' because -they will checkout a cvs repository at the time of emerge and compile -the source from the checkout. This eclass usually generates pretty -unstable ebuilds ... but you can't get anymore bleeding edge than -a live cvs checkout :). - -Common usage of this eclass involves setting \fBECVS_SERVER\fR and -\fBECVS_MODULE\fR to grab the relevant cvs sources, and then letting -the eclass define \fBsrc_unpack\fR for you. -.SH VARIABLES -.TP -.B "ECVS_CVS_COMMAND" = \fI"cvs -q -f -z4"\fR -The command to run in order to checkout the module from the cvs -repository. You should not need to change this. -.TP -.B "ECVS_UP_OPTS" = \fI"-dP"\fR -Options to pass to \fBECVS_CVS_COMMAND\fR when running an update. -You should not have to modify this. -.TP -.B "ECVS_CO_OPTS" = \fI""\fR -Options to pass to \fBECVS_CVS_COMMAND\fR when running a checkout. -You should not have to modify this. -.TP -.B "ECVS_TOP_DIR" = \fI"${DISTDIR}/cvs-src"\fR -Where the cvs modules will be stored and then accessed. You -should not have to modify this. -.TP -.B "ECVS_SERVER" = \fI"offline"\fR -Set this to the server that you will be checking the sources out of. -If you set this to 'offline' then the eclass will assume the module -is already checked out and in \fBECVS_TOP_DIR\fR. You almost always -will set this variable. -.TP -.B "ECVS_AUTH" = \fI"pserver"\fR -The authentication method to use to checkout the sources. Please -note that the only method currently supported is 'pserver'. You -should not need to modify this variable. -.TP -.B "ECVS_USER" = \fI"anonymous"\fR -The user to log into the server with. -.TP -.B "ECVS_PASS" = \fI""\fR -The password to log into the server with. -.TP -.B "ECVS_MODULE" = \fI""\fR -The module to checkout from the cvs server. Please note that you -*must* set this variable. -.TP -.B "ECVS_BRANCH" = \fI"HEAD"\fR -The branch to checkout the sources from. The common targets are -HEAD (current 'stable' cvs code) and SPLIT (current 'unstable' cvs -code). -.SH FUNCTIONS -.TP -.B cvs_fetch -This function will setup \fBECVS_TOP_DIR\fR and any other pre-checkout -steps that may need to be taken. Then it will login into the server -and finally checkout the sources from cvs. You usually do not call -this function yourself, but rather let it be handled by \fBcvs_src_unpack\fR. -.TP -.B cvs_src_unpack -This function will determine where the cvs files need to be saved and -then where they need to be placed after the checkout. The final result -is that you will have a copy of \fBECVS_MODULE\fR in \fB${WORKDIR}\fR. Thus -you will usually set \fB${S}\fR to be \fB${WORKDIR}/${ECVS_MODULE}\fR. -.SH REPORTING BUGS -Please report bugs via http://bugs.gentoo.org/ -.SH SEE ALSO -.BR ebuild (5) -.SH FILES -.BR /usr/portage/eclass/cvs.eclass -.SH AUTHORS -Mike Frysinger <vapier@gentoo.org> -.SH CVS HEADER -$Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/man/cvs.eclass.5,v 1.5 2005/02/10 01:37:36 vapier Exp $ diff --git a/man/dispatch-conf.1 b/man/dispatch-conf.1 deleted file mode 100644 index 3658b9c..0000000 --- a/man/dispatch-conf.1 +++ /dev/null @@ -1,93 +0,0 @@ -.TH "DISPATCH-CONF" "1" "May 2004" "Portage 2.0.51" "Portage" -.SH NAME -dispatch-conf \- Sanely update configuration files after emerging new packages -.SH SYNOPSIS -.B dispatch-conf -.SH DESCRIPTION -.I dispatch-conf -is designed to be run after merging new packages in order to see if -there are updates to the configuration files. If a new -configuration file will overwrite an old one, -.I dispatch-conf -will prompt the user for a decision about how to resolve the -discrepancy. -Advantages of -.I dispatch-conf -include easy rollback (changes to config files are stored either using -patches or rcs) and the ability to automatically update config files -that the user has never modified or -that differ from the current version only in CVS cruft or white space. - -.I dispatch-conf -will check all directories in the \fICONFIG_PROTECT\fR variable. All -config files found in \fICONFIG_PROTECT_MASK\fR will automatically be -updated for you by \fIdispatch-conf\fR. See \fBmake.conf\fR(5) for more -information. -.SH OPTIONS -.TP -None. -.SH USAGE -.I dispatch-conf -must be run as root, since the config files to be replaced are generally -owned by root. Before running -.I dispatch-conf -for the first time the settings in -.B /etc/dispatch-conf.conf -should be edited and the archive directory specified in -\fI/etc/dispatch-conf.conf\fR will need to be created. All changes to -config files will be saved in the archive directory either as patches -or using rcs, making restoration to an earlier version rather simple. - -When dispatch-conf finds a config file that has a new update the user -is provided -with a menu of options for how to handle the update: -.TP -.B u -Update (replace) the current config file with the new config file and continue. -.TP -.B z -Zap (delete) the new config file and continue. -.TP -.B n -Skip to the next config file, leaving both the original config file and any -\fICONFIG_PROTECT\fRed files. -.TP -.B e -Edit the new config file, using the editor defined in \fI$EDITOR\fR. -.TP -.B m -Interactively merge the current and new config files. -.TP -.B l -Look at the differences between the pre-merged and merged config files. -.TP -.B t -Toggle between the merged and pre-merged config files (in terms of which -should be installed using the -.Qt u -command). -.TP -.B h -Display a help screen. -.TP -.B q -Quit -.I dispatch-conf. -.SH "REPORTING BUGS" -Please report bugs via http://bugs.gentoo.org/ -.SH "SEE ALSO" -.BR make.conf (5), etc-update (1) -.SH "FILES" -.TP -.B /etc/dispatch-conf.conf -Configuration settings for \fIdispatch-conf\fR are stored here. -.SH AUTHORS -Jeremy Wohl -.br -Karl Trygve Kalleberg <karltk@gentoo.org> -.br -Mike Frysinger <vapier@gentoo.org> -.br -Grant Goodyear <g2boojum@gentoo.org> -.SH "CVS HEADER" -$Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/man/dispatch-conf.1,v 1.4 2005/02/10 01:37:36 vapier Exp $ diff --git a/man/distutils.eclass.5 b/man/distutils.eclass.5 deleted file mode 100644 index 059066d..0000000 --- a/man/distutils.eclass.5 +++ /dev/null @@ -1,39 +0,0 @@ -.TH "DISTUTILS.ECLASS" "5" "Jun 2003" "Portage 2.0.51" "portage" -.SH "NAME" -distutils.eclass \- allow easier installation of distutils-based python modules -.SH "DESCRIPTION" -The \fBdistutils\fR eclass is designed to allow easier installation of -distutils-based python modules and their incorporation into the Gentoo -Linux system. The eclass defines \fBsrc_compile\fR and \fBsrc_install\fR -for you. You should be able to make a quick ebuild without setting up -any extra variables or functions. -.SH "VARIABLES" -.TP -.B PYTHON_SLOT_VERSION = \fI"[0|2.1]"\fR -This allows you to depend on python-2.1. This is usually only -needed by a -py21- ebuild. Otherwise you should not have to set this. -.TP -.B DOCS = \fI"<files to give to dodoc>"\fR -This will cause \fBsrc_install\fR to install a few extra documentation -files than normal. -.SH "FUNCTIONS" -.TP -.B distutils_python_version -This will setup the variables \fBPYVER_MAJOR\fR, \fBPYVER_MINOR\fR, -and \fBPYVER\fR with the corresponding values of the python version. -.TP -.B distutils_python_tkinter -If the package requires tkinter support, then calling this function -will cause the ebuild to fail if tkinter support does not exist. An -informative message will be displayed telling the user they need to -recompile python with tkinter support for the ebuild to emerge. -.SH "REPORTING BUGS" -Please report bugs via http://bugs.gentoo.org/ -.SH "SEE ALSO" -.BR ebuild (5) -.SH "FILES" -.BR /usr/portage/eclass/distutils.eclass -.SH "AUTHORS" -Mike Frysinger <vapier@gentoo.org> -.SH "CVS HEADER" -$Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/man/distutils.eclass.5,v 1.4 2005/02/10 01:37:36 vapier Exp $ diff --git a/man/ebook.eclass.5 b/man/ebook.eclass.5 deleted file mode 100644 index 289517b..0000000 --- a/man/ebook.eclass.5 +++ /dev/null @@ -1,75 +0,0 @@ -.TH "EBOOK.ECLASS" "5" "Aug 2004" "Portage 2.0.51" "portage" -.SH "NAME" -ebook.eclass \- easy installation of ebooks -.SH "DESCRIPTION" -The \fBebook\fR eclass makes writing ebuilds for ebooks a trivial task. -.SH "VARIABLES" -\fINOTE\fR: the following variables should be set \fBBEFORE\fR inheriting the -\fBebook\fR eclass: -.TP -.BR "DESCRIPTION" -Package description. Defaults to "\fB${P}\fR ebook based on ebook eclass". -.TP -.BR "RDEPEND" -Run-time dependencies. Defaults to ">=dev-util/devhelp-0.6". -.TP -.BR "EBOOKNAME" -The name of the ebook. This variable \fImust\fR be set. -.TP -.BR "EBOOKVERSION" -The version of the ebook. This variable \fImust\fR be set, even if there is -no version. See the \fB${NOVERSION}\fR variable below for more information. -.TP -.BR "SRC" -The name of the file to download, minus the file extension. This variable -defaults to \fB${EBOOKNAME}\fR-\fB${EBOOKVERSION}\fR. -.TP -.BR "SRC_URI" -The ebook URI to download. Defaults to "http://lidn.sourceforge.net/books_download/\fB${SRC}\fR.\fB${EBOOKEXT}\fR". -.TP -.BR "EBOOKEXT" -The file name extension of \fB${SRC}\fR. Defaults to tar.gz. -.TP -.BR "EBOOKDESTDIR" -The directory inside \fB${DEVHELPROOT}\fR/books/\fB${EBOOKDIR}\fR in which the -ebook will be installed. This variable defaults to \fB${EBOOKNAME}\fR-\fB${EBOOKVERSION}\fR -or \fB${EBOOKNAME}\fR if the \fB${NOVERSION}\fR variable is set. -.TP -.BR "EBOOKFROMDIR" -The directory in which the ebook's HTML files are located after unpacking -\fB${SRC_URI}\fR. This directory is relative to \fB${WORKDIR}\fR. This -variable defaults to \fB${EBOOKNAME}\fR-\fB${EBOOKVERSION}\fR or \fB${EBOOKNAME}\fR -if the \fB${NOVERSION}\fR variable is set. -.TP -.BR "BOOKDEVHELPFILE" -The file name that the ebook's book.devhelp will be installed as. This variable -defaults to \fB${EBOOKNAME}\fR-\fB${EBOOKVERSION}\fR.devhelp or \fB${EBOOKNAME}\fR.devhelp -if the \fB${NOVERSION}\fR variable is set. -.TP -.BR "BOOKDESTDIR" -The directory in which the ebook's HTML will be installed into. Defaults to -\fB${EBOOKNAME}\fR-\fB${EBOOKVERSION}\fR or \fB${EBOOKNAME}\fR is the \fB${NOVERSION}\fR -variable is set. -.TP -.BR "NOVERSION" -If this variable is not empty, all instances of \fB${EBOOKVERSION}\fR will be -removed from all variables. -.TP -.BR "DEVHELPROOT" -The location of devhelp's data directory. Defaults to usr/share/devhelp. -.SH "FUNCTIONS" -\fINOTE\fR: the following functions will be used as the defaults should they -be omitted from the ebuild. -.TP -.BR "ebook_src_install" -Installs \fB${BOOKDEVHELPFILE}\fR and all HTML files into \fB${DEVHELPROOT}\fR/books/\fB${EBOOKDESTDIR}\fR. -.SH "REPORTING BUGS" -Please report bugs via http://bugs.gentoo.org/ -.SH "SEE ALSO" -.BR ebuild (5) -.SH "FILES" -.BR /usr/portage/eclass/ebook.eclass -.SH "AUTHORS" -Aaron Walker <ka0ttic@gentoo.org> -.SH "CVS HEADER" -$Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/man/ebook.eclass.5,v 1.3 2005/02/10 01:37:36 vapier Exp $ diff --git a/man/ebuild.1 b/man/ebuild.1 deleted file mode 100644 index e2ac0b6..0000000 --- a/man/ebuild.1 +++ /dev/null @@ -1,184 +0,0 @@ -.TH "EBUILD" "1" "Nov 2002" "Portage 2.0.51" "Portage" -.SH "NAME" -ebuild \- manual page for the ebuild program, a low level interface to -the Portage system. -.SH "SYNOPSIS" -.B ebuild -.I file command [command]\fR... -.SH "DESCRIPTION" -The ebuild program is a direct interface to the Portage system. It -allows for direct action upon an ebuild with specific subcommands or -groups of commands to perform in a specific ebuild's context and -functions. Accepting an ebuild script and one or more commands -as arguments, the ebuild program parses the ebuild script and -execute the specified commands. Commands exist to fetch sources, -unpack sources, compile sources, install object files into a temporary -directory "image", merge the image to the local filesystem, create a -bzipped tarball package out of the image, and more. -.SH "FILE" -This must be a valid ebuild script. For further information read -\fBebuild\fR(5). -.SH "COMMANDS" -.TP -.BR help -Show a condensed form of the man page along with a lot of package -specific information. -.TP -.BR setup -Run all package specific setup actions and exotic system checks. -.TP -.BR clean -Cleans the temporary build directory that Portage has created for -this particular ebuild file. The temporary build directory normally -contains the extracted source files as well as a possible -"install image" (all the files that will be merged to the local -filesystem or stored in a package). The location of the build -directory is set by the BUILD_PREFIX variable. For information -on what this variable is, run \fIemerge [\-v] info\fR, or to override -this variable, see \fBmake.conf\fR(5). - -Note: Portage cleans up almost everything after a package has been -successfully merged unless FEATURES contains 'noclean'. Adding noclean -to FEATURES will cause a lot of files to remain and will consume large -amounts of space, very quickly. It is not recommended to leave this on -unless you have use for the sources post\-merge. Optionally one may, -manual clean \fIrm \-rf /var/tmp/portage\fR will take care of all -of these files. -.TP -.BR fetch -Checks to see if all the sources specified in SRC_URI are available in -DISTDIR (see \fBmake.conf\fR(5) for more information) and have a valid -md5 checksum. If the sources aren't available, an attempt is made to -download them from the locations specified in SRC_URI. If multiple -download locations are listed for a particular file, Portage pings -each location to see which location is closer. (May not be true -presently.) The Gentoo Linux mirrors defined by GENTOO_MIRRORS is -always considered first. If for some reason the current or -just\-downloaded sources' md5 digests don't match those recorded -in files/digest\-[package]\-[version\-rev], a warning is printed -and ebuild exits with an error code of 1. -.TP -.BR digest -Creates a digest file for the package in -/usr/portage/[category]/[package]/files/. This digest file lists the -md5sum's of all the files found in the SRC_URI. If the fetched source -of the package is corrupt/bogus in some way, the md5sum will catch this. -.TP -.BR unpack -Extracts the sources to a subdirectory in the \fIbuild directory\fR -(BUILD_PREFIX) by running the \fIsrc_unpack()\fR function in the ebuild -file. If no src_unpack() function has been specified, a default -src_unpack() function is used that extracts all the files specified in -SRC_URI. The sources are normally extracted to -${BUILD_PREFIX}/[package]\-[version\-rev]/work. This particular directory -can be referenced by using the ${WORKDIR} variable. - -If you're creating an ebuild, you'll want to make sure that the S -(source directory) variable defined at at the top of your ebuild script -points to the directory that contains your extracted sources. This -directory is defined by default to be ${WORKDIR}/${P}, so it is not -often required. The src_unpack() function is also responsible for -making the appropriate patches to the sources so that they're ready -for compilation. -.TP -.BR compile -Compiles the extracted sources by running the the \fIsrc_compile()\fR -function specified in the ebuild file. When src_compile() starts, the -current working directory will be set to ${S}. When src_compile() -completes, the sources should be fully compiled. -.TP -.BR test -Run package specific test cases to verify that everything was built -properly. -.TP -.BR preinst -Run package specific actions that need to be done before the package -is installed into the live filesystem. -.TP -.BR install -Installs the package to the temporary \fIinstall directory\fR by running -the \fIsrc_install()\fR function. When completed, the -\fIinstall directory\fR (${BUILD_PREFIX}/[package]\-[version\-rev]/image) -will contain all the files that should either be merged to the local -file system or included in a binary package. -.TP -.BR postinst -Run package specific actions that need to be done after the package -is installed into the live filesystem. Usually helpful messages are -shown here. -.TP -.BR qmerge -This function installs all the files in the \fIinstall directory\fR -to the live filesystem. The process works as follows: first, the -\fIpkg_preinst()\fR function (if specified) is run. Then, the files -are merged into the live filesystem, and the installed files' md5 -digests are recorded in -\fI/var/db/pkg/${CATEOGRY}/${PN}\-[version\-rev]/CONTENTS\fR. After -all the files have been merged, the \fIpkg_postinst()\fR function -(if specified) is executed. -.TP -.BR merge -Normally, to merge an ebuild, you need to \fIfetch\fR, \fIunpack\fR, -\fIcompile\fR, \fIinstall\fR and \fIqmerge\fR. If you're simply -interested in merging the ebuild, you can use this command, which -will perform all these steps for you, stopping along the way if a -particular step doesn't complete successfully. -.TP -.BR unmerge -This function first executes the \fIpkg_prerm\fR function (if specified). -Then it removes all files from the live filesystem that have a valid md5 -checksum and mtime in the package contents file. Any empty directories -are recursively removed. Finally, it runs \fIpkg_postrm\fR function (if -specified). It is safe to merge a new version of a package first and -then unmerge the old one. In fact, this is the recommended package -upgrade method. -.TP -.BR prerm -Run package specific actions that need to be executed before the package is -removed from the filesystem. See also \fIunmerge\fR. -.TP -.BR postrm -Run package specific actions that need to be executed after the package is -removed from the filesystem. See also \fIunmerge\fR. -.TP -.BR config -Run package specific actions needed to be executed after the emerge -process has completed. This usually entails configuration file -setup or other similar setups that the user may wish to run. -.TP -.BR package -This command is a lot like the \fImerge\fR command, except that after -fetching, unpacking, compiling and installing, a .tbz2 binary package -tarball is created and stored in ${PKGDIR}/All (${PKGDIR} defaults to -/usr/portage/packages). A symbolic link is created in -${PKGDIR}/${CATEGORY} that points to the package in ${PKGDIR}/All. -.TP -.BR rpm -Builds a RedHat RPM package from the files in the temporary -\fIinstall directory\fR. At the moment, the ebuild's dependency -information is not incorporated into the RPM. -.SH "REPORTING BUGS" -Please report bugs via http://bugs.gentoo.org/ -.SH "SEE ALSO" -.BR emerge (1), -.BR ebuild (5), -.BR make.conf (5) -.TP -The \fI/usr/sbin/ebuild.sh\fR script. -.TP -The helper apps in \fI/usr/lib/portage/bin\fR. -.SH "FILES" -.TP -\fB/etc/make.conf\fR -Contains variables for the build\-process and overwrites those -in make.globals. -.SH "AUTHORS" -Achim Gottinger <achim@gentoo.org> -.br -Daniel Robbins <drobbins@gentoo.org> -.br -Nicholas Jones <carpaski@gentoo.org> -.br -Mike Frysinger <vapier@gentoo.org> -.SH "CVS HEADER" -$Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/man/ebuild.1,v 1.16 2004/09/17 00:17:10 vapier Exp $" diff --git a/man/ebuild.5 b/man/ebuild.5 deleted file mode 100644 index a5f74de..0000000 --- a/man/ebuild.5 +++ /dev/null @@ -1,825 +0,0 @@ -.TH "EBUILD" "5" "Feb 2003" "Portage 2.0.51" "portage" -.SH "NAME" -ebuild \- the internal format, variables, and functions in an ebuild script -.SH "DESCRIPTION" -The -.BR ebuild (1) -program accepts a single ebuild script as an argument. This script -contains variables and commands that specify how to download, unpack, -patch, compile, install and merge a particular software package from -its original sources. In addition to all of this, the ebuild script -can also contain pre/post install/remove commands, as required. -.SH "EXAMPLES" -Here's a simple example ebuild: - -.DS -.nf -# Copyright 1999\-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: - -inherit some_eclass another_eclass -DESCRIPTION="Super\-useful stream editor (sed)" -HOMEPAGE="http://www.gnu.org/software/sed/sed.html" -SRC_URI="ftp://alpha.gnu.org/pub/gnu/sed/${P}.tar.gz" - -LICENSE="GPL\-2" -SLOT="0" -KEYWORDS="~x86" -IUSE="" - -DEPEND="virtual/libc" -RDEPEND="virtual/libc" - -src_compile() { - econf || die "could not configure" - emake || die "emake failed" -} - -src_install() { - into /usr - doinfo doc/sed.info - doman doc/sed.1 - into / - dobin sed/sed || die "dobin sed failed" - dodir /usr/bin - dosym /bin/sed /usr/bin/sed - dodoc NEWS README* THANKS TODO AUTHORS BUGS ANNOUNCE -} -.fi -.SH "VARIABLES" -.TP -.B MISC USAGE NOTES -- PORTAGE* and PORTDIR* variables may be found in \fBmake.conf\fR(5). -.br -- When assigning values to variables in ebuilds, you \fBcannot have a space\fR -between the variable name and the equal sign. -.TP -.B P -This variable contains the package name without the ebuild revision. -This variable must NEVER be modified. -.br -\fBxfree-4.2.1-r2.ebuild\fR --> \fB$P\fR=='\fIxfree-4.2.1\fR' -.TP -.B PN -Contains the name of the script without the version number. -.br -\fBxfree-4.2.1-r2.ebuild\fR --> \fB$PN\fR=='\fIxfree\fR' -.TP -.B PV -Contains the version number without the revision. -.br -\fBxfree-4.2.1-r2.ebuild\fR --> \fB$PV\fR=='\fI4.2.1\fR' -.TP -.B PR -Contains the revision number or 'r0' if no revision number exists. -.br -\fBxfree-4.2.1-r2.ebuild\fR --> \fB$PR\fR=='\fIr2\fR' -.TP -.B PVR -Contains the version number with the revision. -.br -\fBxfree-4.2.1-r2.ebuild\fR --> \fB$PVR\fR=='\fI4.2.1-r2\fR' -.TP -.B PF -Contains the full package name \fI[PN]\-[PVR]\fR -.br -\fBxfree-4.2.1-r2.ebuild\fR --> \fB$PF\fR=='\fIxfree-4.2.1-r2\fR' -.TP -.B A -Contains all source files required for the package. This variable must -not be defined. It is autogenerated from the \fISRC_URI\fR variables. -.TP -\fBWORKDIR\fR = \fI"${PORTAGE_TMPDIR}/portage/${PF}/work"\fR -Contains the path to the package build root. Do not modify this variable. -.TP -\fBFILESDIR\fR = \fI"${PORTDIR}/${CATEGORY}/${PN}/files"\fR -Contains the path to the 'files' sub folder in the package specific -location in the portage tree. Do not modify this variable. -.TP -\fBS\fR = \fI"${WORKDIR}/${P}"\fR -Contains the path to the temporary \fIbuild directory\fR. This variable -is used by the functions \fIsrc_compile\fR and \fIsrc_install\fR. Both -are executed with \fIS\fR as the current directory. This variable may -be modified to match the extraction directory of a tarball for the package. -.TP -\fBT\fR = \fI"${PORTAGE_TMPDIR}/portage/${PF}/temp"\fR -Contains the path to a \fItemporary directory\fR. You may use this for -whatever you like. -.TP -\fBD\fR = \fI"${PORTAGE_TMPDIR}/portage/${PF}/image"\fR -Contains the path to the temporary \fIinstall directory\fR. Every write -operation that does not involve the helper tools and functions (found below) -should be prefixed with ${D}. Do not modify this variable. This will not be -available inside of the pkg_* functions. -.TP -\fBDESCRIPTION\fR = \fI"A happy little package"\fR -Should contain a short description of the package. -.TP -\fBSRC_URI\fR = \fI"http://happy.com/little/${P}.tar.gz"\fR -Contains a list of URI's for the required source files. It can contain -multiple URI's for a single source file. The fastest location is chosen -if the file was not found at \fIGENTOO_MIRROR\fB\fR. -.TP -\fBHOMEPAGE\fR = \fI"http://happy.com/"\fR -Should contain a list of URL's for the sources main sites and other further -package dependent information. -.TP -\fBKEYWORDS\fR = \fI[-~][x86,ppc,sparc,mips,alpha,arm,hppa]\fR -Should contain appropriate list of arches that the ebuild is know to -work/not work. By default if you do not know if an ebuild runs under -a particular arch simply omit that KEYWORD. If the ebuild will not -work on that arch include it as \-ppc for example. If the ebuild is -being submitted for inclusion, it must have ~arch set for architectures -where it has been PROVEN TO WORK. (Packages KEYWORDed this way may be -unmasked for testing by setting ACCEPT_KEYWORDS="~arch" on the command -line, or in \fBmake.conf\fR(5)) For an authoritative list please review -/usr/portage/profiles/arch.list. -.TP -\fBSLOT\fR -This sets the SLOT for packages that may need to co\-exist. By default -you should set \fBSLOT\fR="0" unless you know what you are doing and need -to do otherwise. This value should \fINEVER\fR be left undefined. -.TP -\fBLICENSE\fR -This should be a space delimited list of licenses that the package falls -under. This \fB_must_\fR be set to a matching license in -/usr/portage/licenses/. If the license does not exist in portage yet you -must add it first. -.TP -\fBIUSE\fR -This should be a list of any and all USE flags that are leveraged within -your build script. The only USE flags that should not be listed here are -arch related flags (see \fBKEYWORDS\fR). -.TP -\fBDEPEND\fR -This should contain a list of all packages that are required for the -program to compile. -.RS -.TP -.B DEPEND Atoms -A depend atom is simply a dependency that is used by portage when calculating -relationships between packages. Please note that if the atom has not already -been emerged, then the latest version available is matched. -.RS -.TP -.B Atom Bases -The base atom is just a full category/packagename. Hence, these are base atoms: - -.nf -.I sys-apps/sed -.I sys-libs/zlib -.I net-misc/dhcp -.fi -.TP -.B Atom Versions -It is nice to be more specific and say that only certain versions of atoms are -acceptable. Note that versions must be combined with a prefix (see below). Hence -you may add a version number as a postfix to the base: - -.nf -sys-apps/sed\fI-4.0.5\fR -sys-libs/zlib\fI-1.1.4-r1\fR -net-misc/dhcp\fI-3.0_p2\fR -.fi - -Versions are normally made up of two or three numbers separated by periods, such -as 1.2 or 4.5.2. This string may be followed by a character such as 1.2a or 4.5.2z. -Note that this letter is \fBnot\fR meant to indicate alpha, beta, etc... status. -For that, use the optional suffix; either _alpha, _beta, _pre (pre-release), _rc -(release candidate), or _p (patch). This means for the 3rd pre-release of a package, -you would use something like 1.2_pre3. -.TP -.B Atom Prefix Operators [> >= = <= <] -Sometimes you want to be able to depend on general versions rather than specifying -exact versions all the time. Hence we provide standard boolean operators: - -.nf -\fI>\fRmedia-libs/libgd-1.6 -\fI>=\fRmedia-libs/libgd-1.6 -\fI=\fRmedia-libs/libgd-1.6 -\fI<=\fRmedia-libs/libgd-1.6 -\fI<\fRmedia-libs/libgd-1.6 -.fi -.TP -.B Extended Atom Prefixes [!~] and Postfixes [*] -Now to get even fancier, we provide the ability to define blocking packages and -version range matching. Also note that these extended prefixes/postfixes may -be combined in any way with the atom classes defined above. Here are some common -examples you may find in the portage tree: - -.nf -\fI!\fRapp-text/dos2unix -=dev-libs/glib-2\fI*\fR -\fI!\fR=net-fs/samba-2\fI*\fR -\fI~\fRnet-libs/libnet-1.0.2a -.fi - -\fI!\fR means block packages from being installed at the same time. -.br -\fI*\fR means match any version of the package so long as the specified base -is matched. So with a version of '2*', we can match '2.1', '2.2', '2.2.1', -etc... and not match version '1.0', '3.0', '4.1', etc... -.br -\fI~\fR means match any revision of the base version specified. So in the -above example, we would match versions '1.0.2a', '1.0.2a-r1', '1.0.2a-r2', -etc... -.RE -.TP -.B Dynamic DEPENDs -Sometimes programs may depend on different things depending on the USE -variable. Portage offers a few options to handle this. Note that when -using the following syntaxes, each case is considered as 1 Atom in the -scope it appears. That means that each Atom both conditionally include -multiple Atoms and be nested to an infinite depth. -.RS -.TP -.B usevar? ( DEPEND Atom ) -To include the jpeg library when the user has jpeg in \fBUSE\fR, simply use the -following syntax: -.br -.B jpeg? ( media-libs/jpeg) -.TP -.B !usevar? ( Atom ) -If you want to include a package only if the user does not have a certain option -in their \fBUSE\fR variable, then use the following syntax: -.br -.B !nophysfs? ( dev-games/physfs ) -.br -This is often useful for those times when you want to want to add optional support -for a feature and have it enabled by default. -.TP -.B usevar? ( Atom if true ) !usevar? ( Atom if false ) -For functionality like the tertiary operator found in C you must use -two statements, one normal and one inverted. If a package uses -GTK2 or GTK1, but not both, then you can handle that like this: -.br -.B gtk2? ( =x11-libs/gtk+-2* ) !gtk2? ( =x11-libs/gtk+-1* ) -.br -That way the default is the superior GTK2 library. -.TP -.B || ( Atom Atom ... ) -When a package can work with a few different packages but a virtual is not -appropriate, this syntax can easily be used. -.nf -.B || ( -.B app-games/unreal-tournament -.B app-games/unreal-tournament-goty -.B ) -.fi -Here we see that unreal-tournament has a normal version and it has a goty version. -Since they provide the same base set of files, another package can use either. -Adding a virtual is inappropriate due to the small scope of it. -.br -Another good example is when a package can be built with multiple video -interfaces, but it can only ever have just one. -.nf -.B || ( -.B sdl? ( media-libs/libsdl ) -.B svga? ( media-libs/svgalib ) -.B opengl? ( virtual/opengl ) -.B ggi? ( media-libs/libggi ) -.B virtual/x11 -.B ) -.fi -Here only one of the packages will be chosen, and the order of preference is -determined by the order in which they appear. So sdl has the best chance of being -chosen, followed by svga, then opengl, then ggi, with a default of X if the user -does not specify any of the previous choices. -.RE - -.RE -.TP -\fBRDEPEND\fR -This should contain a list of all packages that are required for this -program to run (aka runtime depend). If this is not set, then it -defaults to the value of \fBDEPEND\fR. -.br -You may use the same syntax to vary dependencies as seen above in \fBDEPEND\fR. -.TP -\fBPDEPEND\fR -This should contain a list of all packages that will have to be installed after -the program has been merged. -.br -You may use the same syntax to vary dependencies as seen above in \fBDEPEND\fR. -.TP -\fBRESTRICT\fR = \fI[nostrip,nomirror,fetch,nouserpriv]\fR -This should be a space delimited list of portage features to restrict. -.PD 0 -.RS -.TP -.I nostrip -final binaries/libraries will not be stripped of debug symbols. -.TP -.I nouserpriv -Disables userpriv for specific packages. -.TP -.I nomirror -files in \fBSRC_URI\fR will not be downloaded from the \fBGENTOO_MIRRORS\fR. -.TP -.I fetch -like \fInomirror\fR but the files will not be fetched via \fBSRC_URI\fR either. -.RE -.PD 1 -.TP -\fBPROVIDE\fR = \fI"virtual/TARGET"\fR -This variable should only be used when a package provides a virtual target. -For example, blackdown-jdk and sun-jdk provide \fIvirtual/jdk\fR. This -allows for packages to depend on \fIvirtual/jdk\fR rather than on blackdown -or sun specifically. -.SH "PORTAGE DECLARATIONS" -.TP -.B inherit -Inherit is portage's maintainance of extra classes of functions that -are external to ebuilds and provided as inheritable capabilities and -data. They define functions and set data types as drop-in replacements, -expanded, and simplified routines for extremely common tasks to streamline -the build process. Inherit may only be called once in an ebuild and it may -\fBnever be wrapped within any conditionals\fR of any kind. Specification of -the eclasses contains only their name and not the \fI.eclass\fR extention. -.SH "FUNCTIONS" -.TP -.B pkg_nofetch -If you turn on \fIfetch\fR in \fBRESTRICT\fR, then this function will be -run when the files in \fBSRC_URI\fR cannot be found. Useful for -displaying information to the user on *how* to obtain said files. All -you have to do is output a message and let the function return. Do not -end the function with a call to \fBdie\fR. -.TP -.B pkg_setup -This function can be used if the package needs specific setup actions or -checks to be preformed before anything else. -.br -Initial working directory of ${PORTAGE_TMPDIR}. -.TP -.B src_unpack -This function is used to unpack all the sources in \fIA\fR to \fIWORKDIR\fR. -If not defined in the \fIebuild script\fR it calls \fIunpack ${A}\fR. Any -patches and other pre configure/compile modifications should be done here. -.br -Initial working directory of $WORKDIR. -.TP -.B src_compile -All necessary steps for configuration and compilation should be done in here. -.br -Initial working directory of $S. -.TP -.B src_test -Run all package specific test cases. The default is to run 'make check' -followed 'make test'. -.br -Initial working directory of $S. -.TP -.B src_install -Should contain everything required to install the package in the temporary -\fIinstall directory\fR. -.br -Initial working directory of $S. -.TP -.B pkg_preinst pkg_postinst -All modifications required on the live\-filesystem before and after the -package is merged should be placed here. Also commentary for the user -should be listed here as it will be displayed last. -.br -Initial working directory of $PWD. -.TP -.B pkg_prerm pkg_postrm -Like the pkg_*inst functions but for unmerge. -.br -Initial working directory of $PWD. -.TP -.B pkg_config -This function should contain optional basic configuration steps. -.br -Initial working directory of $PWD. -.SH "HELPER FUNCTIONS: GENERAL" -.TP -\fBdie\fR \fI[reason]\fR -Causes the current emerge process to be aborted. The final display will -include \fIreason\fR. -.TP -\fBuse\fR \fI<USE item>\fR -If \fIUSE item\fR is in the \fBUSE\fR variable, \fIUSE item\fR will be -echoed and the function will return 0. If \fIUSE item\fR is not in the -\fBUSE\fR variable, the function will return 1. \fBuseq\fR is a non-echoing -version of \fBuse\fR. -.RS -.TP -.I Example: -.nf -if useq gnome ; then - guiconf="--enable-gui=gnome --with-x" -elif useq gtk ; then - guiconf="--enable-gui=gtk --with-x" -elif useq X ; then - guiconf="--enable-gui=athena --with-x" -else - # No gui version will be built - guiconf="" -fi -.fi -.RE -.TP -\fBuse_with\fR \fI<USE item>\fR \fI[configure option]\fR -Useful for creating custom options to pass to a configure script. If -\fIUSE item\fR is in the \fBUSE\fR variable, then the string -\fI--with-[configure option]\fR will be echoed. If \fIUSE item\fR is -not in the \fBUSE\fR variable, then the string -\fI--without-[configure option]\fR will be echoed. If -\fIconfigure option\fR is not specified, then \fIUSE item\fR will be -used in its place. -.RS -.TP -.I Example: -.nf -USE="jpeg" -myconf="$(use_with jpeg libjpeg)" -(myconf now has the value "--with-libjpeg") - -USE="" -myconf="$(use_with jpeg libjpeg)" -(myconf now has the value "--without-libjpeg") - -USE="opengl" -myconf="$(use_with opengl") -(myconf now has the value "--with-opengl") -.fi -.RE -.TP -\fBuse_enable\fR \fI<USE item>\fR \fI[configure option]\fR -Useful for creating custom options to pass to a configure script. If -\fIUSE item\fR is in the \fBUSE\fR variable, then the string -\fI--enable-[configure option]\fR will be echoed. If \fIUSE item\fR is -not in the \fBUSE\fR variable, then the string -\fI--disable-[configure option]\fR will be echoed. If \fIconfigure option\fR -is not specified, then \fIUSE item\fR will be used in its place. -.br -See \fBuse_with\fR for an example. -.TP -\fBhas\fR \fI<item>\fR \fI<item list>\fR -If \fIitem\fR is in \fIitem list\fR, then \fIitem\fR is echoed and \fBhas\fR -returns 0. Otherwise, nothing is echoed and 1 is returned. As indicated with -use, there is a non-echoing version \fBhasq\fR. Please use \fBhasq\fR in all -places where output is to be disregarded. Never use the output for calculation. -.br -The \fIitem list\fR is delimited by the \fIIFS\fR variable. This variable -has a default value of ' ', or a space. It is a \fBbash\fR(1) setting. -.TP -\fBhas_version\fR \fI<category/package-version>\fR -Check to see if \fIcategory/package-version\fR is installed on the system. -The parameter accepts all values that are acceptable in the \fBDEPEND\fR -variable. The function returns 0 if \fIcategory/package-version\fR is -installed, 1 otherwise. -.TP -\fBbest_version\fR \fI<package name>\fR -This function will look up \fIpackage name\fR in the database of currently -installed programs and echo the "best version" of the package that is -currently installed. The function returns 0 if there is a package that -matches \fIpackage name\fR. Otherwise, the function will return 1. -.RS -.TP -.I Example: -VERINS="$(best_version net-ftp/glftpd)" -.br -(VERINS now has the value "net-ftp/glftpd-1.27" if glftpd-1.27 is installed) -.RE -.SH "HELPER FUNCTIONS: OUTPUT" -.TP -\fBeinfo\fR \fI"informative message"\fR -If you need to display an message that you wish the user to read and take -notice of, then use \fBeinfo\fR. It works just like \fBecho\fR(1), but -adds a little more to the output so as to catch the user's eye. -.TP -\fBewarn\fR \fI"warning message"\fR -Same as \fBeinfo\fR, but should be used when showing a warning to the user. -.TP -\fBeerror\fR \fI"error message"\fR -Same as \fBeinfo\fR, but should be used when showing an error to the user. -.SH "HELPER FUNCTIONS: UNPACK" -.TP -\fBunpack\fR \fI<source>\fR \fI[list of more sources]\fR -This function uncompresses and/or untars a list of sources into the current -directory. The function will append \fIsource\fR to the \fBDISTDIR\fR variable. -.SH "HELPER FUNCTIONS: COMPILE" -.TP -\fBeconf\fR \fI[configure options]\fR -This is used as a replacement for configure. Performs: -.nf -configure \\ - --prefix=/usr \\ - --host=${CHOST} \\ - --mandir=/usr/share/man \\ - --infodir=/usr/share/info \\ - --datadir=/usr/share \\ - --sysconfdir=/etc \\ - --localstatedir=/var/lib \\ - \fI${EXTRA_ECONF}\fR \\ - \fIconfigure options\fR -.fi -Note that the \fIEXTRA_ECONF\fR is for users only, not for ebuild -writers. If you wish to pass more options to configure, just pass the -extra arguements to \fBeconf\fR. -.TP -\fBemake\fR \fI[make options]\fR -This is used as a replacement for make. Performs 'make ${MAKEOPTS} -\fImake options\fR' (as set in /etc/make.globals), default is MAKEOPTS="\-j2". - -\fB***warning***\fR -.br -if you are going to use \fBemake\fR, make sure your build is happy with -parallel makes (make \-j2). It should be tested thoroughly as parallel -makes are notorious for failing _sometimes_ but not always. -.SH "HELPER FUNCTIONS: INSTALL" -.TP -\fBeinstall\fR \fI[make options]\fR -This is used as a replacement for make install. Performs: -.nf -make \\ - prefix=${D}/usr \\ - datadir=${D}/usr/share \\ - infodir=${D}/usr/share/info \\ - localstatedir=${D}/var/lib \\ - mandir=${D}/usr/share/man \\ - sysconfdir=${D}/etc \\ - \fI${EXTRA_EINSTALL}\fR \\ - \fImake options\fR \\ - install -.fi -Please do \fBnot\fR use this in place of 'make install DESTDIR=${D}'. -That is the preferred way of installing make-based packages. Also, do -not utilize the \fIEXTRA_EINSTALL\fR variable since it is for users. - -.PD 0 -.TP -.B prepall -.TP -.B prepalldocs -.TP -.B prepallinfo -.TP -.B prepallman -.TP -.B prepallstrip -.PD 1 -Useful for when a package installs into \fB${D}\fR via scripts -(i.e. makefiles). If you want to be sure that libraries are executable, -aclocal files are installed into the right place, doc/info/man files are -all compressed, and that executables are all stripped of debugging symbols, -then use these suite of functions. -.RS -.PD 0 -.TP -.B prepall: -Runs \fBprepallman\fR, \fBprepallinfo\fR, \fBprepallstrip\fR, sets -libraries +x, and then checks aclocal directories. Please note this -does \fI*not*\fR run \fBprepalldocs\fR. -.TP -.B prepalldocs: -Compresses all doc files in ${D}/usr/share/doc. -.TP -.B prepallinfo: -Compresses all info files in ${D}/usr/share/info. -.TP -.B prepallman: -Compresses all man files in ${D}/usr/share/man. -.TP -.B prepallstrip: -Strips all executable files of debugging symboles. This includes libraries. -.RE - -.TP -\fBprepinfo\fR \fI[dir]\fR -.TP -\fBpreplib\fR \fI[dir]\fR -.TP -\fBpreplib.so\fR \fI[dir]\fR -.TP -\fBprepman\fR \fI[dir]\fR -.TP -\fBprepstrip\fR \fI[dir]\fR -.PD 1 -Similiar to the \fBprepall\fR functions, these are subtle in their differences. -.RS -.PD 0 -.TP -.B prepinfo: -If a \fIdir\fR is not specified, then \fBprepinfo\fR will assume the dir -\fIusr\fR. \fBprepinfo\fR will then compress all the files in -${D}/\fIdir\fR/info. -.TP -.B preplib: -If a \fIdir\fR is not specified, then \fBpreplib\fR will assume the dir -\fIusr\fR. \fBpreplib\fR will then run 'ldconfig -n -N' on ${D}/\fIdir\fR/lib. -.TP -.B preplib.so: -All the files with '.so' in their name and are found in ${D}/\fIdir\fR will -be stripped of their debug symbols. You may specify multiple directories. -.TP -.B prepman: -If a \fIdir\fR is not specified, then \fBprepman\fR will assume the dir -\fIusr\fR. \fBprepman\fR will then compress all the files in -${D}/\fIdir\fR/man/*/. -.TP -.B prepstrip: -All the files found in ${D}/\fIdir\fR will be stripped. You may specify -multiple directories. -.RE -.PD 1 -.TP -\fBdopython\fR \fI<commands>\fR -Performs \fIcommands\fR with python and returns the result. -.TP -\fBdosed\fR \fI"s:orig:change:g" <filename>\fR -Performs sed (including cp/mv \fIfilename\fR) on \fIfilename\fR. -.br -.BR 'dosed\ "s:/usr/local:/usr:g"\ /usr/bin/some-script' -runs sed on ${D}/usr/bin/some-script -.TP -\fBdodir\fR \fI<path>\fR -Creates a directory inside of ${D}. -.br -.BR 'dodir\ /usr/lib/apache' -creates ${D}/usr/lib/apache. Note that the do* functions will run -\fBdodir\fR for you. -.TP -\fBdiropts\fR \fI[options for install(1)]\fR -Can be used to define options for the install function used in -\fBdodir\fR. The default is \fI-m0755\fR. -.TP -\fBinto\fR \fI<path>\fR -Sets the root (\fIDESTTREE\fR) for other functions like \fBdobin\fR, -\fBdosbin\fR, \fBdoman\fR, \fBdoinfo\fR, \fBdolib\fR. -.br -The default root is /usr. -.TP -\fBkeepdir\fR \fI<path>\fR -Tells portage to leave a directory behind even if it is empty. Functions -the same as \fBdodir\fR. -.TP -\fBdobin\fR \fI<binary> [list of more binaries]\fR -Installs a \fIbinary\fR or a list of binaries into \fIDESTTREE\fR/bin. -Creates all necessary dirs. -.TP -\fBdosbin\fR \fI<binary> [list of more binaries]\fR -Installs a \fIbinary\fR or a list of binaries into \fIDESTTREE\fR/sbin. -Creates all necessary dirs. -.TP -\fBdoinitd\fR \fI<init.d script> [list of more init.d scripts]\fR -Install Gentoo \fIinit.d scripts\fR. They will be installed into the -correct location for Gentoo init.d scripts (/etc/init.d/). Creates all -necessary dirs. -.TP -\fBdoconfd\fR \fI<conf.d file> [list of more conf.d file]\fR -Install Gentoo \fIconf.d files\fR. They will be installed into the -correct location for Gentoo conf.d files (/etc/conf.d/). Creates all -necessary dirs. -.TP -\fBdoenvd\fR \fI<env.d entry> [list of more env.d entries]\fR -Install Gentoo \fIenv.d entries\fR. They will be installed into the -correct location for Gentoo env.d entries (/etc/env.d/). Creates all -necessary dirs. - -.PD 0 -.TP -\fBdolib\fR \fI<library>\fR \fI[list of more libraries]\fR -.TP -\fBdolib.a\fR \fI<library>\fR \fI[list of more libraries]\fR -.TP -\fBdolib.so\fR \fI<library>\fR \fI[list of more libraries]\fR -.PD 1 -Installs a library or a list of libraries into \fIDESTTREE\fR/lib. -Creates all necessary dirs. -.TP -\fBlibopts\fR \fI[options for install(1)]\fR -Can be used to define options for the install function used in -the \fBdolib\fR functions. The default is \fI-m0644\fR. -.TP -\fBdoman\fR \fI<man-page> [list of more man\-pages]\fR -Installs manual\-pages into /usr/share/man/man[1\-8n] depending on the -manual file ending. The files are gzipped if they are not already. -Creates all necessary dirs. -.PD 0 -.TP -\fBdohard\fR \fI<filename> <linkname>\fR -.TP -\fBdosym\fR \fI<filename> <linkname>\fR -.PD 1 -Performs the ln command as either a hard link or symlink. -.TP -\fBdohtml\fR \fI [\-a filetypes] [\-r] [\-x list\-of\-dirs\-to\-ignore] [list\-of\-files\-and\-dirs]\fR -Installs the files in the list of files (space\-separated list) into -/usr/share/doc/${PF}/html provided the file ends in .html, .png, .js, -.jpg or .css. Setting \-a limits what types of files will be included, -\-A appends to the default list, setting \-x sets which dirs to exclude -(CVS excluded by default), \-r sets recursive. -.TP -\fBdoinfo\fR \fI<info-file> [list of more info\-files]\fR -Installs info\-pages into \fIDESTDIR\fR/info. Files are automatically -gzipped. Creates all necessary dirs. -.TP -\fBdojar\fR \fI<jar file> [list of more jar files]\fR -Installs jar files into /usr/share/${PN}/lib and adds them to -/usr/share/${PN}/classpath.env. -.TP -\fBdomo\fR \fI<locale-file> [list of more locale\-files] \fR -Installs locale\-files into \fIDESTDIR\fR/usr/share/locale/[LANG] -depending on local\-file's ending. Creates all necessary dirs. - -.PD 0 -.TP -\fBfowners\fR \fI<permissions> <file> [files]\fR -.TP -\fBfperms\fR \fI<permissions> <file> [files]\fR -.PD 1 -Performs chown (\fBfowners\fR) or chmod (\fBfperms\fR), applying -\fIpermissions\fR to \fIfiles\fR. -.TP -\fBinsinto\fR \fI[path]\fR -Sets the root (\fIINSDESTTREE\fR) for the \fBdoins\fR function. -.br -The default root is /. -.TP -\fBinsopts\fR \fI[options for install(1)]\fR -Can be used to define options for the install function used in -\fBdoins\fR. The default is \fI\-m0644\fR. -.TP -\fBdoins\fR \fI<file> [list of more files]\fR -Installs files into \fIINSDESTTREE\fR. This function uses \fBinstall\fR(1). -Creates all necessary dirs. -.TP -\fBexeinto\fR \fI[path]\fR -Sets the root (\fIEXEDESTTREE\fR) for the \fBdoexe\fR function. -.br -The default root is /. -.TP -\fBexeopts\fR \fI[options for install(1)]\fR -Can be used to define options for the install function used in \fBdoexe\fR. -The default is \fI\-m0755\fR. -.TP -\fBdoexe\fR \fI<executable> [list of more executables]\fR -Installs a executable or a list of executable into \fIEXEDESTTREE\fR. -This function uses \fBinstall\fR(1). Creates all necessary dirs. -.TP -\fBdocinto\fR \fI[path]\fR -Sets the relative subdir (\fIDOCDESTTREE\fR) used by \fBdodoc\fR. -.TP -\fBdodoc\fR \fI<document> [list of more documents]\fR -Installs a document or a list of document into /usr/share/doc/${PF}/\fIDOCDESTTREE\fR. -Files are automatically gzipped. Creates all necessary dirs. - -.PD 0 -.TP -\fBnewbin\fR \fI<old file> <new filename>\fR -.TP -\fBnewsbin\fR \fI<old file> <new filename>\fR -.TP -\fBnewinitd\fR \fI<old file> <new filename>\fR -.TP -\fBnewconfd\fR \fI<old file> <new filename>\fR -.TP -\fBnewenvd\fR \fI<old file> <new filename>\fR -.TP -\fBnewlib\fR \fI<old file> <new filename>\fR -.TP -\fBnewlib.so\fR \fI<old file> <new filename>\fR -.TP -\fBnewlib.a\fR \fI<old file> <new filename>\fR -.TP -\fBnewman\fR \fI<old file> <new filename>\fR -.TP -\fBnewinfo\fR \fI<old file> <new filename>\fR -.TP -\fBnewins\fR \fI<old file> <new filename>\fR -.TP -\fBnewexe\fR \fI<old file> <new filename>\fR -.TP -\fBnewdoc\fR \fI<old file> <new filename>\fR -.PD 1 -All these functions act like the do* functions, but they only work with one -file and the file is installed as \fI[new filename]\fR. -.SH "REPORTING BUGS" -Please report bugs via http://bugs.gentoo.org/ -.SH "SEE ALSO" -.BR ebuild (1), -.BR make.conf (5) -.TP -The \fI/usr/sbin/ebuild.sh\fR script. -.TP -The helper apps in \fI/usr/lib/portage/bin\fR. -.SH "FILES" -.TP -\fB/etc/make.conf\fR -Contains variables for the build\-process and overwrites those in make.defaults. -.TP -\fB/etc/make.globals\fR -Contains the default variables for the build\-process, you should edit -\fI/etc/make.conf\fR instead. -.SH "AUTHORS" -.nf -Achim Gottinger <achim@gentoo.org> -Mark Guertin <gerk@gentoo.org> -Nicholas Jones <carpaski@gentoo.org> -Mike Frysinger <vapier@gentoo.org> -.fi -.SH "CVS HEADER" -$Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/man/ebuild.5,v 1.74 2005/02/10 01:37:36 vapier Exp $ diff --git a/man/emerge.1 b/man/emerge.1 deleted file mode 100644 index ab8b9f0..0000000 --- a/man/emerge.1 +++ /dev/null @@ -1,569 +0,0 @@ -.TH "EMERGE" "1" "Jun 2003" "Portage 2.0.51" "Portage" -.SH "NAME" -emerge \- Command\-line interface to the Portage system -.SH "SYNOPSIS" -.TP -.BR emerge -[\fIoptions\fR] [\fIaction\fR] [\fIebuild\fR | \fItbz2file\fR | \fIclass\fR | \fIdependency\fR] ... -.TP -.BR emerge -\fB\-\-sync\fR | \fB\-\-info\fR | \fB\-\-search\fR -.TP -.BR emerge -\fI\-\-help\fR [\fBsystem\fR | \fBconfig\fR | \fBsync\fR] -.TP -.BR emerge -\fI\-\-version\fR | \fI\-V\fR -.SH "DESCRIPTION" -\fBemerge\fR is the definitive command\-line interface to the Portage -system. It is primarily used for installing packages, and \fBemerge\fR -can automatically handle any dependencies that the desired package has. -\fBemerge\fR can also update the \fBportage tree\fR, making new and -updated packages available. \fBemerge\fR gracefully handles updating -installed packages to newer releases as well. It handles both source -and binary packages, and it can be used to create binary packages for -distribution. -.SH "EBUILDS, TBZ2S, CLASSES AND DEPENDENCIES" -\fBemerge\fR primarily installs packages. You can specify -packages to install in one of four main ways: an \fIebuild\fR, -a \fItbz2file\fR, a \fIclass\fR, or a \fIdependency\fR. -.LP -.TP -.BR ebuild -An \fIebuild\fR must be, at a minimum, a valid Portage -package directory name without a version or category, such as -\fBportage\fR or \fBpython\fR. -Both categories and version numbers may be used in addition, such -as \fBsys\-apps/portage\fR or \fB=python\-2.2.1\-r2\fR. -\fBemerge\fR -ignores a trailing slash so that filename completion can be used. -The \fIebuild\fR may also be an actual filename, such as -\fB/usr/portage/app\-admin/python/python\-2.2.1\-r2.ebuild\fR. -WARNING: The implementation of \fBemerge /path/to/ebuild\fR is broken and so this syntax shouldn't be used. -.TP -.BR tbz2file -A \fItbz2file\fR must be a valid .tbz2 created with \fBebuild -<package>\-<version>.ebuild package\fR or \fBemerge \-\-buildpkg -[category/]<package>\fR or \fBquickpkg /var/db/pkg/<category>/<package>\fR. -.TP -.BR class -Package classes are a convenient shorthand for large groups of -packages. Two classes are currently supported: \fBsystem\fR -and \fBworld\fR. \fBsystem\fR refers to a set of packages -deemed necessary for your system to run properly. \fBworld\fR -contains all of the packages in \fBsystem\fR, along with any -other packages listed in \fB/var/lib/portage/world\fR. [See -\fBFILES\fR below for more information]. Note that these -commands are generally used in conjunction with \fB\-\-update\fR. -.TP -.BR dependency -A \fIdependency\fR describes bounds on a package that you wish -to install. \fISee portage(5) for the details on these 'atoms'.\fR For -example, \fB>=dev\-lang/python\-2.2.1\-r2\fR matches the latest -available version of Python greater than or equal -to 2.2.1\-r2. Similarly, \fB<dev\-lang/python\-2.0\fR matches -the latest available version of Python before 2.0. Note that in many -shells you will need to escape characters such as '<' and '='; -use single\- or double\-quotes around the \fIdependency\fR -to get around escaping problems. -.SH "ACTIONS" -.TP -.BR "No action" -If no action is specified, the action is to merge in the specified -packages, satisfying any dependencies that they may have. The -arguments can be \fIebuilds\fR, \fItbz2s\fR, \fIclasses\fR, or -\fIdependencies\fR. \fBNote that you need to use the \-\-usepkg -option if you want to install a tbz2\fR. The packages are added -to the \fBworld\fR file at the end, so that they are considered for -later updating. -.TP -.BR "\-\-clean " (\fB\-c\fR) -Cleans the system by removing packages that will not affect the -functionality of the system. The arguments can be \fIebuilds\fR, -\fIclasses\fR, or \fIdependencies\fR. For example, \fBemerge -clean binutils\fR cleans out old versions of binutils; -\fBemerge \-\-clean net\-www/mozilla\-0.9.9\-r2\fR cleans out that -specific version of Mozilla. This is generally safe to use. -\fBNote that\fR \-\-clean \fBdoes not remove unslotted packages.\fR -.TP -.BR \-\-depclean -Determines all packages installed on the system that have no -explicit reason for being there. \fBemerge\fR generates a list -of packages which it expects to be installed by checking the -\fBsystem\fR package list and the \fBworld\fR file. It then -compares that list to the list of packages which are actually -installed; the differences are listed as unnecessary packages -and then unmerged after a short timeout. \fBWARNING: Removing some -packages may cause packages which link to the removed package -to stop working and complain about missing libraries.\fR -Re\-emerge the complaining package to fix this issue. -\fBNote that changes in USE flags can drastically affect the -output of \-\-depclean.\fR -.TP -.BR \-\-info -This is a list of information to include in bug reports which aids -the developers with fixing any problems you may report. \fBPlease -include this information when submitting a bug report.\fR Expanded -output can be obtained with the \fI\-\-verbose\fR option. -.TP -.BR "\-\-inject " (\fB\-i\fR) -Injecting a package inserts a 'stub' for that package so that Portage -thinks that it is installed. It is handy if you need, say, a binary -version of XFree86 for esoteric hardware, or you just like to roll -your own packages. You \fBmust\fR specify a category and particular -version of a package for injecting. For example, -\fBemerge \-\-inject sys\-kernel/gentoo\-sources\-2.4.19\fR. -.TP -.BR \-\-metadata -Causes portage to process all the metacache files as is normally done -on the tail end of an rsync update using \fBemerge \-\-sync\fR. The processing -creates the cache database that portage uses for pre\-parsed lookups of -package data. -.TP -.BR "\-\-prune " (\fB\-P\fR) -\fBWARNING: This action can remove important packages!\fR Tries -to remove all but the last version installed. Since the command -currently doesn't handle multiple versions of the same package -properly, beware ! This does not check dependencies, so it may also -remove packages necessary for the proper operation of your system. -\fBUse\fR \-\-clean \fBinstead unless you really know what you're -doing\fR. Its arguments can be \fIebuilds\fR, \fIclasses\fR, or -\fIdependencies\fR \-\- see \fB\-\-clean\fR above for examples. You -have been warned ! -.TP -.BR \-\-regen -Causes portage to check and update the dependency cache of all -ebuilds in the portage tree. The cache is used to speed up searches -and the building of dependency trees. This command is not recommended -for rsync users as rsync updates the cache using server\-side caches. If -you do not know the differences between a 'rsync user' and some other -user, then you are a 'rsync user' :). Rsync users should simply run -\fBemerge \-\-sync\fR to regenerate the cache. After a portage update, rsync -users may find it convenient to run \fBemerge \-\-metadata\fR to rebuild the -cache as portage does at the end of a sync operation. -.TP -.BR "\-\-search " (\fB\-s\fR) -Searches for matches of the supplied string in the portage tree. -The \-\-search string is a regular expression. For example, \fBemerge -\-\-search "^kde"\fR searches for any package that starts with "kde"; -\fBemerge \-\-search "gcc$"\fR searches for any package that ends with -"gcc"; \fBemerge \-\-search "office"\fR searches for any package that -contains the word "office". If you want to search the package -descriptions as well, use the \fB\-\-searchdesc\fR option. -.TP -.BR \-\-sync -Initiates a portage tree update with one of the rsync.gentoo.org -mirrors. \fBNote that any changes you have made to the portage -tree will be erased\fR. Except for special circumstances, -this uses \fBrsync\fR to do the update. See \fBmake.conf\fR(5)'s -description of PORTDIR_OVERLAY for a method to avoid deletions. -.TP -.BR "\-\-unmerge " (\fB\-C\fR) -\fBWARNING: This action can remove important packages!\fR Removes -all matching packages. This does no checking of dependencies, so -it may remove packages necessary for the proper operation of your -system. Its arguments can be \fIebuilds\fR, \fIclasses\fR, or -\fIdependencies\fR \-\- see \fB\-\-clean\fR above for examples. -.SH "OPTIONS" -.TP -.BR "\-\-ask " (\fB\-a\fR) -Before performing the merge, display what ebuilds and tbz2s will -be installed, in the same format as when using \fB\-\-pretend\fR; then -ask whether to continue with the merge or abort. Using \fB\-\-ask\fR is -more efficient than using \fB\-\-pretend\fR and then executing the same -command without \fB\-\-pretend\fR, as dependencies will only need to be -calculated once. -.TP -.BR "\-\-buildpkg " (\fB\-b\fR) -Tells emerge to build binary packages for all ebuilds processed in -addition to actually merging the packages. Useful for maintainers -or if you administrate multiple Gentoo Linux systems (build once, -emerge tbz2s everywhere). The package will be created in the -\fI${PKGDIR}/All\fR directory. An alternative for already\-merged -packages is to use \fBquickpkg\fR which creates a tbz2 from the -live filesystem. -.TP -.BR "\-\-buildpkgonly " (\fB\-B\fR) -Creates binary packages for all ebuilds processed without actually -merging the packages. This comes with the caveat that all build-time -dependencies must already be emerged on the system. -.TP -.BR "\-\-changelog " (\fB\-l\fR) -Use this in conjunction with the \fB\-\-pretend\fR action. This will -show the ChangeLog entries for all the packages that will be upgraded. -.TP -.BR "\-\-columns" -Used alongside \fB\-\-pretend\fR to cause the package name, new version, -and old version to be displayed in an aligned format for easy cut\-n\-paste. -.TP -.BR "\-\-debug " (\fB\-d\fR) -Tells emerge to run the emerge command in \fB\-\-debug\fR mode. In this -mode the bash build environment will run with the \-x option, -causing it to output verbose debugging information to stdout. -\fB\-\-debug\fR is great for finding bash syntax errors. -.TP -.BR "\-\-deep " (\fB\-D\fR) -When used in conjunction with \fB\-\-update\fR, this flag forces -\fBemerge\fR to consider the entire dependency tree of packages, -instead of checking only the immediate dependencies of the packages. -As an example, this catches updates in libraries that are not directly -listed in the dependencies of a package. -.TP -.BR "\-\-emptytree " (\fB\-e\fR) -Reinstalls all world packages and their dependencies to the current USE -specifications while differing from the installed set of packages as -little as possible. You should run with \fB\-\-pretend\fR first to make -sure the result is what you expect. -.TP -.BR "\-\-fetchonly " (\fB\-f\fR) -Instead of doing any package building, just perform fetches for all -packages (the main package as well as all dependencies). -.TP -.BR "\-\-fetch\-all\-uri " (\fB\-f\fR) -Instead of doing any package building, just perform fetches for all -packages (the main package as well as all dependencies), grabbing all potential -files. -.TP -.BR "\-\-getbinpkg " (\fB\-g\fR) -Using the server and location defined in \fIPORTAGE_BINHOST\fR (see -\fBmake.conf\fR(5)), portage will download the information from each binary -package found and it will use that information to help build the dependency -list. This option implies \fB\-k\fR. (Use \fB\-gK\fR for binary\-only merging.) -.TP -.BR "\-\-getbinpkgonly " (\fB\-G\fR) -This option is identical to \fB\-g\fR, as above, except it will not use ANY -information from the local machine. All binaries will be downloaded from the -remote server without consulting packages existing in the local packages -directory. -.TP -.BR "\-\-help " (\fB\-h\fR) -Displays help information for emerge. Adding one of the additional -arguments listed above will give you more specific help information -on that subject. The internal \fBemerge\fR help documentation is -updated more frequently than this man page; check it out if you -are having problems that this man page does not help resolve. -.TP -.BR "\-\-newuse " (\fB\-N\fR) -Tells emerge to include installed packages where USE flags have changed -since compilation. An asterisk marks when a USE flag has changed since -the package was compiled. -.TP -.BR "\-\-noconfmem" -Causes portage to disregard merge records indicating that a config file -inside of a \fBCONFIG_PROTECT\fR directory has been merged already. Portage -will normally merge those files only once to prevent the user from -dealing with the same config multiple times. This flag will cause the -file to always be merged. -.TP -.BR "\-\-nodeps " (\fB\-O\fR) -Merges specified packages without merging any dependencies. Note that -the build may fail if the dependencies aren't satisfied. -.TP -.BR "\-\-noreplace " (\fB\-n\fR) -Skips the packages specified on the command\-line that have already -been installed. Without this option, any packages, ebuilds, or deps -you specify on the command\-line *will* cause Portage to remerge -the package, even if it is already installed. Note that Portage will -not remerge dependencies by default. -.TP -.BR "\-\-nospinner" -Disables the spinner for the session. The spinner is active when the -terminal device is determined to be a TTY. This flag disables it regardless. -.TP -.BR "\-\-oneshot " (\fB\-1\fR) -Emerge as normal, but do not add the packages to the world profile -for later updating. -.TP -.BR "\-\-onlydeps " (\fB\-o\fR) -Only merge (or pretend to merge) the dependencies of the packages -specified, not the packages themselves. -.TP -.BR "\-\-pretend " (\fB\-p\fR) -Instead of actually performing the merge, simply display what *would* -have been installed if \fB\-\-pretend\fR weren't used. Using \fB\-\-pretend\fR -is strongly recommended before installing an unfamiliar package. In -the printout, -.br - -.br -\fIN\fR = new, (not yet installed) -.br -\fIS\fR = new, Slot installation (side-by-side versions) -.br -\fIU\fR = updating, (changing versions) -.br -\fID\fR = downgrade, (Best version seems lower) -.br -\fIR\fR = replacing, (Remerging same version)) -.br -\fIF\fR = fetch restricted, (Manual download) -.br -\fIf\fR = fetch restricted, (Already downloaded) -.br -\fIB\fR = blocked by an already installed package -.TP -.BR "\-\-quiet " (\fB\-q\fR) -Results may vary, but the general outcome is a reduced or condensed -output from portage's displays. -.TP -.BR "\-\-resume" -Resumes the last merge operation. Please note that this operation -will only return an error on failure. If there is nothing for portage -to do, then portage will exit with a message and a success condition. -.TP -.BR "\-\-searchdesc " (\fB\-S\fR) -Matches the search string against the description field as well as -the package name. \fBTake caution\fR as the descriptions are also -matched as regular expressions. -.TP -.BR "\-\-skipfirst" -This action is only valid when used with \fB\-\-resume\fR. It removes the -first package in the resume list so that a merge may continue in the presence -of an uncorrectable or inconsequential error. This should only be used in -cases where skipping the package will not result in failed dependencies. -.TP -.BR "\-\-tree " (\fB\-t\fR) -Shows the dependency tree for the given target by indenting dependencies. -This is only really useful in combination with \fB\-\-emptytree\fR or -\fB\-\-update\fR and \fB\-\-deep\fR. -.TP -.BR "\-\-update " (\fB\-u\fR) -Updates packages to the best version available, which may not -always be the highest version number due to masking for testing -and development. This will also update direct dependencies which -may not be what you want. In general, use this option only in -combination with the world or system target. -.TP -.BR "\-\-upgradeonly " (\fB\-U\fR) -Updates packages, but excludes updates that would result in a -lower version of the package being installed. \fBSLOT\fRs are -considered at a basic level. -.br -This option is deprecated and shouldn't be used anymore. Please use the -/etc/portage/package.* files from now on. -.TP -.BR "\-\-usepkg " (\fB\-k\fR) -Tells emerge to use binary packages (from $PKGDIR) if they are available, thus possibly avoiding some -time\-consuming compiles. This option is useful for CD installs; you can export PKGDIR=/mnt/cdrom/packages -and then use this option to have emerge "pull" binary packages from the CD in order to satisfy dependencies. -.TP -.BR "\-\-usepkgonly " (\fB\-K\fR) -Behaves just as \fB\-\-usepkg\fR except that this will only emerge -binary packages. All the binary packages must be available at the -time of dependency calculation or emerge will simply abort. -.TP -.BR "\-\-verbose " (\fB\-v\fR) -Tell emerge to run in verbose mode. Currently this flag causes emerge to print out GNU info errors, if any, and to show the USE flags that will be used for each package when pretending. -.TP -.BR "\-\-version " (\fB\-V\fR) -Displays the version number of \fBemerge\fR. It cannot be used in -conjunction with other options. -.SH "ENVIRONMENT OPTIONS" -.TP -\fBROOT\fR = \fI[path]\fR -Use \fBROOT\fR to specify the target root filesystem to be used for -merging packages or ebuilds. -Defaults to /. -.SH "OUTPUT" -When utilizing \fBemerge\fR with the \fB\-\-pretend\fR and \fB\-\-verbose\fR -flags, the output may be a little hard to understand at first. This section -explains the abbreviations. -.TP -.B [blocks B ] app\-text/dos2unix (from pkg app\-text/hd2u\-0.8.0) -Dos2unix is Blocking hd2u from being emerged. Blockers are defined when -two packages will clobber each others files, or otherwise cause some form -of breakage in your system. However, blockers usually do not need to be -simultaneously emerged because they usually provide the same functionality. -.TP -.B [ebuild N ] app\-games/qstat\-25c -Qstat is New to your system, and will be emerged for the first time. -.TP -.B [ebuild NS ] dev-libs/glib-2.4.7 -You already have a version of glib installed, but a 'new' version in -a different SLOT is available. -.TP -.B [ebuild R ] sys\-apps/sed\-4.0.5 -Sed 4.0.5 has already been emerged, but if you run the command, then -portage will Re\-emerge the specified package (sed in this case). -.TP -.B [ebuild F ] media\-video/realplayer\-8\-r6 -The realplayer package requires that you Fetch the sources manually. -When you attempt to emerge the package, if the sources are not found, -then portage will halt and you will be provided with instructions on how -to download the required files. -.TP -.B [ebuild f ] media\-video/realplayer\-8\-r6 -The realplayer package's files are already downloaded. -.TP -.B [ebuild U ] net\-fs/samba\-2.2.8_pre1 [2.2.7a] -Samba 2.2.7a has already been emerged and can be Updated to version -2.2.8_pre1. -.TP -.B [ebuild UD] media\-libs/libgd\-1.8.4 [2.0.11] -Libgd 2.0.11 is already emerged, but if you run the command, then -portage will Downgrade to version 1.8.4 for you. -.br -This may occur if a newer version of a package has been masked because it is -broken or it creates a security risk on your system and a fix has not been -released yet. -.br -Another reason this may occur is if a package you are trying to emerge requires -an older version of a package in order to emerge successfully. In this case, -libgd 2.x is incompatible with libgd 1.x. This means that packages that were -created with libgd 1.x will not compile with 2.x and must downgrade libgd first -before they can emerge. -.TP -.B [ebuild U\-] x11\-base/xfree\-4.3.0 [4.2.99.902] -The \- represents lack of \fBSLOT\fR information about Xfree. This will occur -when the previous version emerged was injected (see \fBinject\fR for more info) -or very outdated (so old that \fBSLOT\fR did not exist). Either way, a newer version -of Xfree is availabe for your updating delight. -.TP -.B [ebuild U ] sys\-devel/distcc\-2.16 [2.13\-r1] \-gtk +ipv6* (\-selinux) -The \-gtk reflects the status of \fBUSE\fR variables when emerging distcc. -Here we see that distcc can use the \fBUSE\fR variable gtk, but that your -current settings have gtk disabled. This means optional support for gtk will -not be enabled in distcc when you emerge it. An asterisk shows that the -\fBUSE\fR flags have changed since the package was last installed. In this -case, ipv6 is enabled but was previously disabled. A \fBUSE\fR flag in -pparenthesis, like (\-selinux), is always disabled and shows that the flag is -not available for the current system profile. -.br -\fB*Note:\fR The \fBUSE\fR status is only displayed when you use the -\fB\-\-pretend\fR and \fB\-\-verbose\fR options. -.SH "NOTES" -You should almost always precede any package install or update attempt with a -\fB\-\-pretend\fR install or update. This lets you see how much will be -done, and shows you any blocking packages that you will have to rectify. -This goes doubly so for the \fBsystem\fR and \fBworld\fR classes, which can -update a large number of packages if the portage tree has been particularly -active. -.LP -You also want to typically use \fB\-\-update\fR, which ignores packages that -are already fully updated but upgrades those that are not. -.LP -When you install a package with uninstalled dependencies and do -not explicitly state those dependencies in the list of parameters, -they will not be added to the world file. If you want them to be -detected for world updates, make sure to explicitly list them as -parameters to \fBemerge\fR. -.LP -\fBUSE variables\fR may be specified on the command line to -override those specified in the default locations, letting you -avoid using some dependencies you may not want to have. \fBUSE -flags specified on the command line are NOT remembered\fR. For -example, \fBUSE="\-X \-gnome" emerge mc\fR will emerge mc with -those USE settings. If you want those USE settings to be more -permanent, you can put them in /etc/portage/package.use instead. -.LP -If \fBemerge \-\-update system\fR or \fBemerge \-\-update world\fR -fails 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 "MASKED PACKAGES" -\fINOTE: Please use caution when using development packages. Problems -and bugs resulting from misusing masked packages drains Gentoo -developer time. Please be sure you are capable of handling any problems -that may ensue.\fR -.LP -Masks in \fBportage\fR provide three primary functions: they allow a -testing period where the packages can be used in live machines; they -prevent the use of a package when it will fail; and they mask existing -packages that are broken or could pose a security risk. Masking can be -done by two methods: \fBpackage.mask\fR and \fBKEYWORDS\fR. Read below -to find out how to unmask in either case. Also note that if you give -\fBemerge\fR an ebuild, then all forms of masking will be ignored and -\fBemerge\fR will attempt to emerge the package. -.TP -.BR package.mask -The \fBpackage.mask\fR file primarily blocks the use of packages that cause -problems or are known to have issues on different systems. It resides in -\fI/usr/portage/profiles\fR. -.TP -.BR KEYWORDS -The \fBKEYWORDS\fR variable in an \fBebuild\fR file is also used for masking -a package still in testing. There are architecture\-specific keywords for -each package that let \fBportage\fR know which systems are compatible with -the package. Packages which compile on an architecture, but have not been -proven to be "stable", are masked with a tilde (\fB~\fR) in front of the -architecture name. \fBemerge\fR examines the \fBACCEPT_KEYWORDS\fR environment -variable to allow or disallow the emerging of a package masked by \fBKEYWORDS\fR. -To inform \fBemerge\fR that it should build these 'testing' versions -of packages, you should update your \fI/etc/portage/package.keywords\fR file -to list the packages you want the 'testing' version. See \fBportage\fR(5) for -more information. -.SH "REPORTING BUGS" -Please report any bugs you encounter through our website: -.LP -\fBhttp://bugs.gentoo.org/\fR -.LP -Please include the output of \fBemerge \-\-info\fR when you submit your -bug report. -.SH "SEE ALSO" -.BR "emerge \-\-help", -.BR ebuild (1), -.BR ebuild (5), -.BR make.conf (5), -.BR portage (5) -.LP -A number of helper applications reside in \fI/usr/lib/portage/bin\fR. -.LP -The \fBapp\-admin/gentoolkit\fR package contains useful scripts such as \fBqpkg\fR -(a package query tool). -.SH "FILES" -.TP -\fB/var/lib/portage/world\fR -Contains a list of all user\-specified packages. You can safely edit -this file, adding packages that you want to be considered in \fBworld\fR -class updates and removing those that you do not want to be considered. -.TP -\fB/etc/make.conf\fR -Contains variables for the build process, overriding those in -\fBmake.globals\fR. \fBYou should edit this file instead of the ones -listed below\fR. -.TP -.B /etc/dispatch\-conf.conf -Contains settings to handle automatic updates/backups of configuration -files. -.TP -\fB/etc/make.profile/make.defaults\fR -Contains profile\-specific variables for the build process. \fBDo not -edit this file\fR. -.TP -\fB/etc/make.profile/use.defaults\fR -Contains a list of packages which, if installed, cause the respective USE -flag to be enabled by default. \fBDo not edit this file\fR. -.TP -\fB/usr/portage/profiles/use.desc\fR -Contains the master list of USE flags with descriptions of their -functions. \fBDo not edit this file\fR. -.TP -\fB/etc/make.profile/virtuals\fR -Contains a list of default packages used to resolve virtual dependencies. -\fBDo not edit this file\fR. -.TP -\fB/etc/make.profile/packages\fR -Contains a list of packages used for the base system. The \fBsystem\fR -and \fBworld\fR classes consult this file. \fBDo not edit this file\fR. -.TP -\fB/etc/make.globals\fR -Contains the default variables for the build process. \fBDo not edit -this file\fR. -.SH "AUTHORS" -Daniel Robbins <drobbins@gentoo.org> -.br -Geert Bevin <gbevin@gentoo.org> -.br -Achim Gottinger <achim@gentoo.org> -.br -Nicholas Jones <carpaski@gentoo.org> -.br -Phil Bordelon <phil@thenexusproject.org> -.br -Mike Frysinger <vapier@gentoo.org> -.br -Marius Mauch <genone@gentoo.org> -.br -.SH "CVS HEADER" -$Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/man/emerge.1,v 1.72 2005/02/10 01:37:36 vapier Exp $ diff --git a/man/env-update.1 b/man/env-update.1 deleted file mode 100644 index 2214014..0000000 --- a/man/env-update.1 +++ /dev/null @@ -1,28 +0,0 @@ -.TH "ENV-UPDATE" "1" "Feb 2003" "Portage 2.0.51" "Portage" -.SH NAME -env-update \- updates environment settings automatically -.SH SYNOPSIS -.B env-update -.SH DESCRIPTION -.B env-update -reads the files in \fI/etc/env.d\fR and automatically generates -\fI/etc/profile.env\fR and \fI/etc/ld.so.conf\fR. Then \fBldconfig\fR(8) -is run to update \fI/etc/ld.so.cache\fR. \fBenv-update\fR is run by -\fBemerge\fR(1) automatically after each package merge. Also, if you -make changes to \fI/etc/env.d\fR, you should run \fIenv-update\fR -yourself for changes to take effect immediately. Note that this would -only affect new processes. In order for the changes to affect your -active shell, you will probably have to run \fIsource /etc/profile\fR -first. -.SH OPTIONS -.TP -None. -.SH AUTHORS -Daniel Robbins <drobbins@gentoo.org> -.SH "REPORTING BUGS" -Please report bugs via http://bugs.gentoo.org/ -.SH "SEE ALSO" -.BR emerge (1), -.BR ldconfig (8) -.SH "CVS HEADER" -$Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/man/env-update.1,v 1.6 2004/09/17 00:17:10 vapier Exp $ diff --git a/man/etc-update.1 b/man/etc-update.1 deleted file mode 100644 index 991bbf3..0000000 --- a/man/etc-update.1 +++ /dev/null @@ -1,40 +0,0 @@ -.TH "ETC-UPDATE" "1" "Feb 2003" "Portage 2.0.51" "Portage" -.SH NAME -etc-update \- handle configuration 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. 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 the \fICONFIG_PROTECT\fR variable. All -config files found in \fICONFIG_PROTECT_MASK\fR will automatically be -updated for you by \fIetc-update\fR. See \fBmake.conf\fR(5) for more -information. -.SH OPTIONS -.TP -None. -.SH "REPORTING BUGS" -Please report bugs via http://bugs.gentoo.org/ -.SH "SEE ALSO" -.BR make.conf (5) -.SH "FILES" -.TP -.B /etc/etc-update.conf -Configuration settings for \fIetc-update\fR are stored here. -.TP -.B /etc/dispatch-conf.conf -Settings for dispatching configuration files right before they're merged. -.SH AUTHORS -Jochem Kossen and Leo Lipelis -.br -Karl Trygve Kalleberg <karltk@gentoo.org> -.br -Mike Frysinger <vapier@gentoo.org> -.SH "CVS HEADER" -$Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/man/etc-update.1,v 1.9 2004/09/17 00:17:10 vapier Exp $ diff --git a/man/eutils.eclass.5 b/man/eutils.eclass.5 deleted file mode 100644 index b9d0a62..0000000 --- a/man/eutils.eclass.5 +++ /dev/null @@ -1,176 +0,0 @@ -.TH "EUTILS.ECLASS" "5" "Jun 2003" "Portage 2.0.51" "portage" -.SH "NAME" -eutils.eclass \- many extra (but common) functions that are used in ebuilds -.SH "DESCRIPTION" -The \fBeutils\fR eclass contains a suite of functions that complement -the ones that ebuild.sh already contain. The idea is that the functions -are not required in all ebuilds but enough utilize them to have a common -home. -.SH "FUNCTIONS" -.TP -.BR "cdrom_get_cds " "\fI<cd1 file>\fR \fI[cd2 file]\fR \fI[cd n file]\fR" -Useful function to help ebuilds that need to read files off of a CD. This is -most commonly used with games. Just specify a list of files, one per cd, that -will be used to detect whether the cd is mounted or not. This function -handles all the messy details of interaction with the user. Once this -function returns, you will have access to the \fICDROM_ROOT\fR variable. If -you want the message to the user to name the CD in a particular way, then -export the variable \fICDROM_NAME\fR before calling this function. If you want -to name more than one cd, and you want them to each have a different name, then -export the variables \fICDROM_NAME_1\fR, \fICDROM_NAME_2\fR, etc... For more -information on multi-cd support, see \fBcdrom_load_next_cd\fR. -.TP -.BR "cdrom_load_next_cd" -Some packages are so big they come on multiple CDs. When you're done reading -files off a CD and want access to the next one, just call this function. Again, -all the messy details of user interaction are taken care of for you. Once this -returns, just read the variable \fICDROM_ROOT\fR for the location of the mounted -CD. Note that you can only go forward in the CD list, so make sure you only -call this function when you're done using the current CD. -.TP -.BR "draw_line" -Simple function to draw a line consisting of '=' the same length as $*. So -if you run `draw_line 1234 5678` you will get back 9 '=' characters in a line. -.TP -.BR "edos2unix " "\fI<files>\fR" -A handy replacement for dos2unix, recode, fixdos, etc... This allows you -to remove all of these text utilities from DEPEND variables because this -is a script based solution. Just give it a list of files to convert and -they will all be changed from the DOS CRLF format to the UNIX LF format. -.TP -.BR "enewgroup " "\fI<group>\fR \fI[gid]\fR" -This function does not require you to understand how to properly add a -group to the system. Just give it a \fIgroup name\fR to add and \fBenewgroup\fR will -do the rest. You may specify the \fIgid\fR for the group or allow the group to -allocate the next available one. -.TP -.BR "enewuser " "\fI<user>\fR \fI[uid]\fR \fI[shell]\fR \fI[homedir]\fR \fI[groups]\fR \fI[params]\fR" -Same as \fBenewgroup\fR, you are not required to understand how to properly add -a user to the system. The only required parameter is the \fIusername\fR. -.br -.BR "Default Values" -.br -\fIuid\fR: next available (pass -1 to get default behavior) -.br -\fIshell\fR: /bin/false -.br -\fIhomedir\fR: /dev/null -.br -\fIgroups\fR: no groups -.br -\fIparams\fR: any other parameters \fBuseradd\fR(8) accepts; see the manpage for more details -.TP -.BR "epatch" -See the section on \fBepatch\fR below. -.TP -.BR "gen_usr_ldscript" -Generate linker scripts in /usr/lib for dynamic libs in /lib. This is to fix linking -problems when you have the .so in /lib, and the .a in /usr/lib. What happens is that -in some cases when linking dynamic, the .a in /usr/lib is used instead of the .so in -/lib due to gcc/libtool tweaking ld's library search path. -.TP -.BR "get_number_of_jobs" -Checks how many cpu's are present in the system and then sets -j in MAKEOPTS accordingly. -.TP -.BR "have_NPTL" -This function return true if we are using the NPTL pthreads implementation of glibc. -.TP -.BR "make_desktop_entry " "\fI<binary>\fR \fI[name]\fR \fI[icon]\fR \fI[type]\fR \fI[path]\fR" -Make a little shortcut in GNOME/KDE menus for your application. Just pass the name -of the binary to execute and the rest will be done for you. If you want to change -the name that will show up in the menu, pass the function a \fIname\fR parameter. If you -want to specify an \fIicon\fR (default is \fB${PN}\fR.png) then pass a name of a graphic file -relative to /usr/share/pixmaps/ or the full path to a file. If you want to specify the -section of the menu that the icon will install to (rather than the default determined -by \fB${CATEGORY}\fR) then pass a \fItype\fR value (see http://www.freedesktop.org/standards/menu-spec/ -for valid values). Finally, if the application needs to start up in a special directory, -pass the last value as the full \fIpath\fR name. -.TP -.BR "unpack_makeself " "\fI[makeself archive]\fR \fI[byte offset]\fR" -Unpack a makeself archive rather than relying on the script to unpack itself. Useful for when -the scripts use old (POSIX) syntax that is no longer supported properly. If you don't specify -a file to unpack, then \fB${A}\fR is used instead. If you don't specify the offset, then the -proper value will be located by searching the makeself script. -For more information on makeself archives, please visit: http://www.megastep.org/makeself/ -.TP -.BR "unpack_pdv " "\fI<pdv archive>\fR \fI<sizeof(off_t)>\fR" -Unpack a pdv archive rather than relying on the binary to unpack itself. Useful for when -the static binary crashes randomly on systems and for when the binary doesn't provide a -non-interactive extraction process. You have to specify the off_t size since I (vapier@gentoo.org) -am unaware of a way to extract that information out of the binary executable automatically. -The value you pass is the size of the off_t type (in bytes) on the machine that built the -pdv archive. If you don't know the value yourself, try guessing the values 2, 4, or 8. -For more information on pdv archives, please visit: http://pdv.sourceforge.net/ -.SH "EPATCH" -.TP -.B "ABOUT" -\fBepatch\fR is designed to make patching easy. It does all the common checks that -a developer would do with the \fBpatch\fR(1) command and then some. It will attempt -to apply the patch for a range of offset values (-p0 to -p5, all relative to the working -directory when \fBepatch\fR was called). If the patch fails to apply (by testing via -dryruns), then \fBpatch\fR will stop the emerge process by calling \fBdie\fR. You will -be given a log file of the output of the patch attempt so as to ease debugging. The -output of a successful patch is a pretty formatted message showing what patches were -applied. \fBepatch\fR can be used for bulk patching or for just one or two patches. -Additionally, it can handle patches in bzip2, gzip, compress (Z), and zip formats. -.TP -.B "USAGE" -.RS -.TP -.B "epatch " "\fI<patch file>\fR" -The most common and easiest way to use \fBepatch\fR is by just giving it the full path -to a patch file. -.TP -.B "epatch " "\fI<directory>\fR" -A more powerful use is to fill a directory with patches and then let \fBepatch\fR apply -all the patches inside it. The patches must be in the format ??_${\fBARCH\fR}_foo.${\fBEPATCH_SUFFIX\fR}. -This ensures that there are a set order, and you can have \fBARCH\fR specific patches. - -.br -01_all_misc-fix.patch.bz2 -.br - apply the misc-fix patch first for all arches -.br -02_sparc_another-fix.patch.bz2 -.br - apply the another-fix patch second but only on sparc -.RE -.TP -.B VARIABLES -.RS -.TP -.B "EPATCH_SOURCE" = \fI"${WORKDIR}/patch"\fR -The patch or directory of patches for \fBepatch\fR to apply. This is set -automatically if you call \fBepatch\fR with a parameter. -.TP -.B "EPATCH_SUFFIX" = \fI"patch.bz2"\fR -When applying bulk patches this is the suffix that all patches will have. -.TP -.B "EPATCH_OPTS" = \fI""\fR -Any extra options you may want to pass to \fBpatch\fR(1). We can't think -of everything so why restrict you :). The default is "" of course. -.TP -.B "EPATCH_EXCLUDE" = \fI""\fR -A space delimited list (well, actually \fB$IFS\fR delimited ...) of patch -files to skip while bulk patching. Use only file names, not full paths. -.TP -.B "EPATCH_SINGLE_MSG" = \fI"Applying <patch name>"\fR -If you only apply a single patch, then instead of displaying the default -message you can change it to say anything you want, even 'Dont call me Radio Unit 51', -if you are so inclined of course. -.TP -.B "EPATCH_FORCE" = \fI"[yes|no]"\fR -This allows you to apply all patches in \fBEPATCH_SOURCE\fR even if they -dont match the ??_${\fBARCH\fR}_foo.${\fBEPATCH_SUFFIX\fR} file naming -convention. By default we want you to use the above convention. -.RE -.SH "REPORTING BUGS" -Please report bugs via http://bugs.gentoo.org/ -.SH "SEE ALSO" -.BR ebuild (5) -.SH "FILES" -.BR /usr/portage/eclass/eutils.eclass -.SH "AUTHORS" -Mike Frysinger <vapier@gentoo.org> -.SH "CVS HEADER" -$Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/man/eutils.eclass.5,v 1.6 2005/02/10 01:37:36 vapier Exp $ diff --git a/man/fixheadtails.eclass.5 b/man/fixheadtails.eclass.5 deleted file mode 100644 index 4c46c67..0000000 --- a/man/fixheadtails.eclass.5 +++ /dev/null @@ -1,32 +0,0 @@ -.TH "FIXHEADTAILS.ECLASS" "5" "Aug 2004" "Portage 2.0.51" "portage" -.SH "NAME" -fixheadtails.eclass \- functions for replacing obsolete head/tail invocations -with newer POSIX compliant ones. -.SH "DESCRIPTION" -The \fBfixheadtails\fR eclass contains functions for parsing file(s) and -replacing obsolete head/tail invocations in the form similar to: -.TP -head -# <file> -.TP -with the newer POSIX compliant form of: -.TP -head -n# <file> -.SH "FUNCTIONS" -\fBNOTE\fR: these functions are usually used in the \fIsrc_unpack\fR function. -.TP -.BR "ht_fix_file " "\fI<file1> [file2] [file3] [...]\fR" -Fixes head/tail invocations in specific files. -.TP -.BR "ht_fix_all" -Scans the current directory (recursively), calling \fBht_fix_file\fR for each -file that contains an obsolete head/tail invocation. -.SH "REPORTING BUGS" -Please report bugs via http://bugs.gentoo.org/ -.SH "SEE ALSO" -.BR ebuild (5) -.SH "FILES" -.BR /usr/portage/eclass/fixheadtails.eclass -.SH "AUTHORS" -Aaron Walker <ka0ttic@gentoo.org> -.SH "CVS HEADER" -$Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/man/fixheadtails.eclass.5,v 1.4 2005/02/10 01:37:36 vapier Exp $ diff --git a/man/flag-o-matic.eclass.5 b/man/flag-o-matic.eclass.5 deleted file mode 100644 index 1c0a6d7..0000000 --- a/man/flag-o-matic.eclass.5 +++ /dev/null @@ -1,84 +0,0 @@ -.TH "FLAG-O-MATIC.ECLASS" "5" "Jun 2003" "Portage 2.0.51" "portage" -.SH "NAME" -flag\-o\-matic.eclass \- manipulate CFLAGS/CXXFLAGS easily and reliably -.SH "DESCRIPTION" -The \fBflag\-o\-matic\fR eclass contains a suite of functions to -manipulate the CFLAGS/CXXFLAGS variables. -.SH "FUNCTIONS" -.TP -.BR "append-flags " "\fI<flags>\fR" -Add extra \fIflags\fR to the current CFLAGS/CXXFLAGS. -.TP -.BR "filter-flags " "\fI<flags>\fR" -Remove particular \fIflags\fR from CFLAGS/CXXFLAGS. This function -will only match complete flags. -.TP -.BR "replace-flags " "\fI<orig-flag>\fR \fI<new-flag>\fR" -Replace all occurences of \fIoriginal flag\fR with \fInew flag\fR. -.TP -.BR "replace-cpu-flags " "\fI<old cpus>\fR \fI<new cpu>\fR" -Replace all -march, -mcpu, and -mtune flags which contain \fIold cpus\fR -with -march, -mcpu, and -mtune flags which contain \fInew cpu\fR. -.TP -.BR "get-flag " "\fI<flag>\fR" -If \fIflag\fR is prefixed with -, then the whole flag will -be echoed. If just the flag name is specified, and the flag has -a setting, the value for the flag will be echoed instead. - -.I Examples: -.br -CFLAGS="-march=i586 -ffast-math" -.br -`get-flag -march` == "-march=i586" -.br -`get-flag march` == "i586" -.br -`get-flag -ffast-math` == "-ffast-math" -.br -`get-flag ffast-math` == "-ffast-math" -.TP -.BR "is-flag " "\fI<flag>\fR" -Returns true if \fIflag\fR is in CFLAGS or CXXFLAGS. -.TP -.BR "filter-mfpmath " "\fI<math types>\fR" -Remove specified \fImath types\fR from the selected fpmath units. -If the user has -mfpmath=sse,386, running `filter-mfpmath sse` -will leave the user with -mfpmath=386. -.TP -.BR "append-ldflags " "\fI<flags>\fR" -Add extra \fIflags\fR to the current LDFLAGS. -.TP -.BR "filter-ldflags " "\fI<flags>\fR" -Remove particular \fIflags\fR from LDFLAGS. This function -will only match complete flags. -.TP -.BR "filter-lfs-flags" -Remove flags that enable Large File Support. -.TP -.BR "append-lfs-flags" -Add flags that enable Large File Support. -.TP -.BR "strip-flags" -Strip CFLAGS/CXXFLAGS of everything except for flags known to -be good flags, or are flags that affect the ABI. Users of stable -profile are limited to these flags: -.br -.I "-O -O1 -O2 -mcpu -march -mtune -fstack-protector -pipe -g" -.br -Users of unstable profile are allowed the above flags and these flags: -.br -.I "-Os -O3 -freorder-blocks -fprefetch-loop-arrays" -.TP -.BR "test_flag " "\fI<flag>\fR" -Tests to see if \fIflag\fR is supported by the active toolchain. -.SH "REPORTING BUGS" -Please report bugs via http://bugs.gentoo.org/ -.SH "SEE ALSO" -.BR ebuild (5), -.BR make.conf (5) -.SH "FILES" -.BR /usr/portage/eclass/flag\-o\-matic.eclass -.SH "AUTHORS" -Mike Frysinger <vapier@gentoo.org> -.SH "CVS HEADER" -$Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/man/flag-o-matic.eclass.5,v 1.6 2005/02/10 01:37:36 vapier Exp $ diff --git a/man/font.eclass.5 b/man/font.eclass.5 deleted file mode 100644 index fd4892f..0000000 --- a/man/font.eclass.5 +++ /dev/null @@ -1,64 +0,0 @@ -.TH "FONT.ECLASS" "5" "Aug 2004" "Portage 2.0.51" "portage" -.SH "NAME" -font.eclass \- easy, uniform font installation -.SH "DESCRIPTION" -The \fBfont\fR eclass attempts to make font installation as easy as possible. -Everything that usually involves installing fonts (such as creating scalable -font indecis, updating the font cache, etc...) is transparently taken -care of by the \fBfont\fR eclass. -.SH "EXAMPLES" -Here's a simple example ebuild: -.nf -inherit font - -DESCRIPTION="a collection of fonts for Nepali users" -HOMEPAGE="http://www.mpp.org.np/" -SRC_URI="mirror://gentoo/${P}.tar.bz2" - -LICENSE="freedist" -SLOT="0" -KEYWORDS="alpha amd64 ppc x86" -IUSE="" - -DEPEND="" - -S="${WORKDIR}/${PN}" -FONT_S=${S} -FONT_SUFFIX="ttf" -.fi -.SH "VARIABLES" -.TP -.B "FONT_SUFFIX" -Space-delimited list of font suffixes to install. -.TP -.B "FONT_S" -Directory containing the fonts. If omitted, \fB${S}\fR will be used. -.TP -.B "DOCS" -Space-delimited list of documents to install. -.SH "FUNCTIONS" -.TP -.B "font_xfont_config" -Creates font indecis for X font files and also installs a fonts.alias file, -if it exists. This function is called by \fIfont_src_install\fR. -.TP -.B "font_xft_config" -Creates fontconfig cache. This function is also called by \fIfont_src_install\fR. -.TP -.B "font_src_install" -Installs all fonts ending with suffixes listed in \fB${FONT_SUFFIX}\fR as well -as any documents listed in \fB${DOCS}\fR. This function will be used as the -default \fIsrc_install\fR function in an ebuild that omits one. -.SH "REPORTING BUGS" -Please report bugs via http://bugs.gentoo.org/ -.SH "SEE ALSO -.BR ebuild (5) -.SH "FILES" -.BR /usr/portage/eclass/font.eclass -.SH "AUTHORS" -.nf -Aaron Walker <ka0ttic@gentoo.org> -Mike Frysinger <vapier@gentoo.org> -.fi -.SH "CVS HEADER" -$Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/man/font.eclass.5,v 1.3 2005/02/10 01:37:36 vapier Exp $ diff --git a/man/fortran.eclass.5 b/man/fortran.eclass.5 deleted file mode 100644 index 1e35be5..0000000 --- a/man/fortran.eclass.5 +++ /dev/null @@ -1,53 +0,0 @@ -.TH FORTRAN.ECLASS 5 "Nov 2004" "Portage 2.0.51" "portage" -.SH NAME -fortran.eclass \- functions for fortran packages -.SH DESCRIPTION -The \fBfortran\fR eclass provides an interface to ease the integration of the -various fortran compilers available. -.SH VARIABLES -\fBNOTE\fR: since the \fBfortran\fR eclass does not check to see if the -following variables are set prior to inheritance, you must ensure that if you -need to define any of them, that you do so after inheritance occurs. -.TP -.B FORTRAN -Defines a list of fortran compilers that can be used for the build. Defaults -to 'f77'. -.TP -.B f77_CONF -Defines configure option that enables the use of the f77 compiler. Defaults -to '--with-f77'. -.TP -.B f2c_CONF -Defines configure option that enables the use of the f2c compiler. Defaults -to '--with-f2c'. -.SH FUNCTIONS -.TP -.B fortran_conf -Displays the necessary configure options for the currently selected fortran -compiler. -.TP -.B need_fortran \fI[ profile1 ] < profile2 >\fR -Checks to see if at least one of the specified profiles is installed. Currently -supported profiles include \fBf77\fR, \fBf2c\fR, and \fBifc\fR. -.TP -.B patch_fortran -Applies any patches located in \fB${FILESDIR}\fR named "\fB${P}\fR-COMPILER*", -where COMPILER is the fortran compiler currently selected for use. -.TP -.B fortran_pkg_setup -Default pkg_setup which calls \fBneed_fortran\fR to ensure that a suitable -fortran compiler is installed. -.TP -.B fortran_src_unpack -Default src_unpack which besides unpacking the distfile(s), calls -\fBpatch_fortran\fR to apply any compiler-specific patches. -.SH REPORTING BUGS -Please report bugs via http://bugs.gentoo.org/ -.SH SEE ALSO -.BR ebuild (5) -.SH FILES -.BR /usr/portage/eclass/fortran.eclass -.SH AUTHORS -Aaron Walker <ka0ttic@gentoo.org> -.SH CVS HEADER -$Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/man/fortran.eclass.5,v 1.2 2005/02/10 01:37:36 vapier Exp $ diff --git a/man/games.eclass.5 b/man/games.eclass.5 deleted file mode 100644 index e66bd41..0000000 --- a/man/games.eclass.5 +++ /dev/null @@ -1,119 +0,0 @@ -.TH "GAMES.ECLASS" "5" "Jun 2003" "Portage 2.0.51" "portage" -.SH "NAME" -games.eclass \- standardize the install of all games -.SH "DESCRIPTION" -The \fBgames\fR eclass is used to centrally control how all games -will be emerged onto systems. Here we basically control the filesystem -locations and the ownership of all files. If you want to change an -aspect of how your games are installed, then just edit the \fBgames\fR -eclass ! :) -.SH "VARIABLES" -.TP -.B "GAMES_PREFIX" = \fI"/usr/games"\fR -The prefix that the game will be installed under. -.TP -.B "GAMES_PREFIX_OPT" = \fI"/opt"\fR -The prefix that the game will be installed under if it is a binary distribution. -.TP -.B "GAMES_DATADIR" = \fI"/usr/share/games"\fR -The prefix for installing shared data files. -.TP -.B "GAMES_DATADIR_BASE" = \fI"/usr/share"\fR -Same as above, but some games auto append '/games/' to the datadir path. -.TP -.B "GAMES_SYSCONFDIR" = \fI"/etc/games"\fR -The location where games will save their configuration files. -.TP -.B "GAMES_STATEDIR" = \fI"/var/games"\fR -The location where games will save their state in behind runs. This -includes things like highscore files. If a game creates more than -one file, have it save all files inside \fB${GAMES_STATEDIR}/${PN}\fR. -Otherwise, just create the single file in \fB${GAMES_STATEDIR}/\fR. -Again, try to use a package specific name for the file if you are -creating it directly in the statedir. -.TP -.B "GAMES_LIBDIR" = \fI"/usr/games/lib"\fR -The location where games will store their libraries. -.TP -.B "GAMES_BINDIR" = \fI"/usr/games/bin"\fR -The location where the games will store/link their executables. Putting -game binaries here helps to cut down on the $PATH bloat. -.TP -.B "GAMES_ENVD" = \fI"90games"\fR -The filename that the env.d entry will use. -.TP -.B "GAMES_USER" = \fI"games"\fR -The user that will own all game related files. -.TP -.B "GAMES_GROUP" = \fI"games"\fR -The group that will own all game related files. -.SH "FUNCTIONS: general" -.TP -.B "prepgamesdirs" \fI[directories]\fR -This will change ownership on all files/directories found inside of -the \fBGAMES_*\fR variables and any extra directories specified as -parameters. It will change the permissions on all directories to -750 (u+rwx,g+rx-w,u-rwx) and change the permissions of all files -with a mask of g+r,o-rwx. -.br -\fB*NOTE\fR: This should *always* be the last thing called in the -\fBsrc_install\fR function. If portage allowed for hookable calls then -this would be hooked to the end of \fBsrc_install\fR, but until that -happens, make sure to call! -.TP -.B games_pkg_setup -This will automagically add \fBGAMES_USER\fR and \fBGAMES_GROUP\fR to -your system. If you define \fBpkg_setup\fR in your ebuild, then make -sure to call this function at the end of the function. -.TP -.B games_pkg_postinst -This will automagically generate the \fBGAMES_ENVD\fR file and display -a little message about being in the \fBGAMES_GROUP\fR in order to play -a game. If you define \fBpkg_postinst\fR in your ebuild, then make -sure to call this function at the end of the function. -.SH "FUNCTIONS: compile" -.TP -.B egamesconf -The same as \fBeconf\fR except this passes all the game related variables -(see above). For more info on \fBeconf\fR see \fBebuild\fR(5). -.SH "FUNCTIONS: install" -.TP -.B egamesinstall -The same as \fBeinstall\fR except this passes all the game related variables -(see above). For more info on \fBeinstall\fR see \fBebuild\fR(5). -.TP -.B dogamesbin dogamessbin -The same as \fBdobin\fR and \fBdosbin\fR respectively except these will -install binaries into \fBGAMES_PREFIX\fR. For more info see \fBebuild\fR(5). -.TP -.B dogameslib dogameslib.a dogameslib.so -The same as \fBdolib\fR, \fBdolib.a\fR, and \fBdolib.so\fR respectively -except these will install binaries into \fBGAMES_PREFIX\fR. For more info -see \fBebuild\fR(5). -.TP -.B newgamesbin newgamessbin -The same as \fBnewbin\fR and \fBnewsbin\fR respectively except these will -install binaries into \fBGAMES_PREFIX\fR. For more info see \fBebuild\fR(5). -.TP -.B gamesowners \fI<files/directories>\fR -\fBgamesowners\fR will change the user and group ownership to \fBGAMES_USER\fR -and \fBGAMES_GROUP\fR respectively. -.TP -.B gamesperms \fI<files/directories>\fR -\fBgamesperms\fR will change the permissions with a mask of u+rw,g+r-w,o-rwx. -.TP -.B games_make_wrapper \fI<wrapper>\fR \fI<bin>\fR \fI<chdir>\fR -Create a small wrapper script. Useful when dealing with packages that need to -change directory to the base of their data tree before running. This will create -a wrapper script called \fIwrapper\fR that will chdir to \fIchdir\fR before -executing \fIbin\fR. The \fIwrapper\fR will be placed in \fBGAMES_BINDIR\fR. -.SH "REPORTING BUGS" -Please report bugs via http://bugs.gentoo.org/ -.SH "SEE ALSO" -.BR ebuild (5) -.SH "FILES" -.BR /usr/portage/eclass/games.eclass -.SH "AUTHORS" -Mike Frysinger <vapier@gentoo.org> -.SH "CVS HEADER" -$Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/man/games.eclass.5,v 1.8 2005/02/10 01:37:36 vapier Exp $ diff --git a/man/horde.eclass.5 b/man/horde.eclass.5 deleted file mode 100644 index 8239e87..0000000 --- a/man/horde.eclass.5 +++ /dev/null @@ -1,51 +0,0 @@ -.TH "HORDE.ECLASS" "5" "Aug 2004" "Portage 2.0.51" "portage" -.SH "NAME" -horde.eclass \- standardize the installation of horde packages -.SH "DESCRIPTION" -The \fBhorde\fR eclass provides generic functions to make the writing of -horde ebuilds trivial. The \fBhorde\fR eclass also provides transparent -support for live CVS ebuilds via the \fBcvs.eclass\fR(5) (when \fB${PN}\fR -contains "-cvs"). -.SH "VARIABLES" -.BR "HORDE_PHP_FEATURES" -A whitespace-delimited list of mod_php USE flags. If set, -\fIhorde_pkg_setup\fR will check to make sure that mod_php was compiled with -the specified USE flags. If not, the build will fail, notifying the user that -they must rebuild mod_php with the specified USE flags. -.SH "FUNCTIONS" -.TP -.BR "horde_pkg_setup" -Handles the nasty details of the \fBwebapp.eclass\fR(5) and checks -\fIHORDE_PHP_FEATURES\fR, if set. -.TP -.BR "horde_src_unpack" -In the case of a live CVS ebuild, this function calls \fIcvs_src_unpack\fR -from the \fBcvs\fR eclass. Otherwise, \fIunpack\fR is called. -.TP -.BR "horde_src_install" -Installs all files in \fB${S}\fR into the \fBwebapp\fR eclass' -\fB${MY_HTDOCSDIR}\fR directory. This will also installs documentation -(the README and all files in in \fB${S}/docs/\fR). Then the rest of the -nasty details of the \fBwebapp.eclass\fR(5) are taken care of. -.TP -.BR "horde_pkg_postinst" -Displays various informational and/or warning messages. -.SH "REPORTING BUGS" -Please report bugs via http://bugs.gentoo.org/ -.SH "SEE ALSO" -.BR ebuild (5), -.BR cvs.eclass (5), -.BR webapp.eclass (5) -.SH "FILES" -.nf -.BR /usr/portage/eclass/horde.eclass -.BR /usr/portage/eclass/webapp.eclass -.BR /usr/portage/eclass/cvs.eclass -.fi -.SH "AUTHORS" -.nf -Aaron Walker <ka0ttic@gentoo.org> -Mike Frysinger <vapier@gentoo.org> -.fi -.SH "CVS HEADER" -$Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/man/horde.eclass.5,v 1.4 2005/02/10 01:37:36 vapier Exp $ diff --git a/man/libtool.eclass.5 b/man/libtool.eclass.5 deleted file mode 100644 index 1564fa3..0000000 --- a/man/libtool.eclass.5 +++ /dev/null @@ -1,48 +0,0 @@ -.TH "LIBTOOL.ECLASS" "5" "Aug 2004" "Portage 2.0.51" "portage" -.SH "NAME" -libtool.eclass \- fixes the libtool files that are distributed with some -packages -.SH "DESCRIPTION" -The \fBlibtool\fR eclass provides an easy way to patch the libtool files -that come with some packages. Often times these files are outdated and -misbehave inside of the portage build environment. -.SH "VARIABLES" -.BR "ELT_APPLIED_PATCHES" -This variable is exported by the \fBlibtool\fR eclass. It contains a -whitespace-delimited list of patches that were successfully applied. -.SH "FUNCTIONS" -.TP -.B "elibtoolize " "\fI[--portage] [--reverse-deps] [--patch-only] [--remove-internal-dep=DEP_TO_REMOVE] [--shallow]\fR" -This function should be called from \fIsrc_unpack\fR. If called with no -arguments, it will apply a default set of patches to all occurrences of -ltmain.sh and then run libtoolize. The default set of patches are located -in \fB${PORTDIR}\fR/eclass/ELT-patches. -.RS -.TP -.BR "--portage" -Apply the portage patch. -.TP -.BR "--reverse-deps" -Apply the reverse dependencies patch. See http://bugzilla.gnome.org/show_bug.cgi?id=75635 -for more information. -.TP -.BR "--patch-only" -If specified, libtoolize will not be run if none of the patches apply. -.TP -.BR "--remove-internal-deps=DEP_TO_REMOVE" -Replaces @REM_INT_DEP@ with DEP_TO_REMOVE. -.TP -.BR "--shallow" -Instead of recursively patching all occurrences of ltmain.sh, only patch the -ltmain.sh in \fB${S}\fR. -.RE -.SH "REPORTING BUGS" -Please report bugs via http://bugs.gentoo.org/ -.SH "SEE ALSO" -.BR ebuild (5) -.SH "FILES" -.BR /usr/portage/eclass/libtool.eclass -.SH "AUTHORS" -Aaron Walker <ka0ttic@gentoo.org> -.SH "CVS HEADER" -$Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/man/libtool.eclass.5,v 1.4 2005/02/10 01:37:36 vapier Exp $ diff --git a/man/make.conf.5 b/man/make.conf.5 deleted file mode 100644 index 3c34861..0000000 --- a/man/make.conf.5 +++ /dev/null @@ -1,384 +0,0 @@ -.TH "MAKE.CONF" "5" "Feb 2003" "Portage 2.0.51" "portage" -.SH "NAME" -make.conf \- custom settings for Portage -.SH "SYNOPSIS" -.B /etc/make.conf -.SH "DESCRIPTION" -This file contains various variables that are used by Portage. -Portage will check the currently\-defined environment variables -first for any settings. If no environment settings are found, -Portage then checks /etc/make.conf. If no setting is found -in /etc/make.conf, Portage checks /etc/make.globals. If no -setting is found there, the profile's default setting is grabbed -from /etc/make.profile/make.defaults. Please note that all user -settings should be made in the environment or in /etc/make.conf, -which is intended to be customized by the user. -.br -Exceptions are incremental variables such as USE, CONFIG_PROTECT*, -and ACCEPT_KEYWORDS. Incremental variables are propagated down from -make.defaults to make.globals to make.conf to the environment -settings. Clearing these variables requires a clear\-all as in: -export USE="\-*" -.SH "VARIABLES" -.TP -\fBACCEPT_KEYWORDS\fR = \fI[space delimited list of KEYWORDS]\fR -Enable testing of ebuilds that have not yet been deemed 'stable'. Users -of the 'x86' architecture would set this to '~x86' while ppc users would -set this to '~ppc'. This is an incremental variable. Only define a -~arch. -.br -Defaults to the value of $ARCH. -.TP -\fBBUILD_PREFIX\fR = \fI[path]\fR -Defines the location of the package working directory. -.br -Defaults to ${PORTAGE_TMPDIR}/portage -.TP -\fBCBUILD\fR -This variable is passed by the \fIebuild scripts\fR to the \fIconfigure\fR -as \fI\-\-build=${CBUILD}\fR only if it is defined. Presently HPPA is the -only arch to require this. -.TP -\fBCCACHE_SIZE\fR = \fI"size"\fR -This controls the space use limitations for ccache. The default is 2 gigabytes -('2G'). Sizes are specified with 'G', 'M', or 'K'. -.TP -\fBCFLAGS CXXFLAGS\fR -Use these variables to set the desired optimization/CPU instruction settings -for applications that you compile. Nearly all ebuild files will take advantage -of your custom settings, resulting in a Gentoo Linux that is fully customized -to your specifications. Please use sane settings as some packages will fail to -compile/run if the optimizations are too extreme. - -For more information: -.br -http://gcc.gnu.org/onlinedocs/gcc\-3.2/gcc/Invoking\-GCC.html -.br -http://gcc.gnu.org/onlinedocs/gcc\-3.3/gcc/Invoking\-GCC.html -.br -http://gcc.gnu.org/onlinedocs/gcc\-2.95.3/gcc_2.html -.TP -.B CHOST -This variable is passed by the \fIebuild scripts\fR to the \fIconfigure\fR -step as \fI\-\-host=${CHOST}\fR. This way you can force the build\-host. - -For more information: -.br -http://gcc.gnu.org/onlinedocs/gcc\-3.2/gcc/Submodel\-Options.html -.br -http://gcc.gnu.org/onlinedocs/gcc\-3.3/gcc/Submodel\-Options.html -.br -http://gcc.gnu.org/onlinedocs/gcc\-2.95.3/gcc_2.html -.TP -\fBCLEAN_DELAY\fR = \fIinteger\fR -Determines how long the countdown delay will be after running `emerge clean`. -.br -Defaults to 5 seconds. -.TP -\fBCONFIG_PROTECT\fR = \fI[space delimited list of dirs]\fR -All directories that are defined here will have "config file protection" -enabled for them. For more information, please see `emerge \-\-help config`. -.TP -\fBCONFIG_PROTECT_MASK\fR = \fI[space delimited list of dirs]\fR -All directories that are defined here will have "config file protection" -disabled for them. For more information, please see `emerge \-\-help config`. -.TP -.B CTARGET -This variable is passed by the \fIebuild scripts\fR to the \fIconfigure\fR -as \fI\-\-target=${CTARGET}\fR only if it is defined. -.TP -\fBDISTDIR\fR = \fI[path]\fR -Defines the location of your local source file repository. -.br -Defaults to ${PORTDIR}/distfiles. -.TP -.B EBEEP_IGNORE -Defines whether or not to ignore audible beeps when displaying important -informational messages. This variable is unset by default. -.TP -.B EPAUSE_IGNORE -Defines whether or not to ignore short pauses that occur when displaying -important informational messages. This variable is unset by default. -.TP -\fBFEATURES\fR = \fI"sandbox ccache autoaddcvs"\fR -Defines actions portage takes by default. These options should -not be changed by anyone but developers and/or maintainers. 'sandbox' is an important -part of \fBFEATURES\fR and should not be disabled by default. This is -an incremental variable. -.RS -.TP -.B autoaddcvs -Causes portage to automatically try to add files to cvs that will have to be added -later. Done at generation times and only works when \fIcvs\fR is also in -\fBFEATURES\fR. -.TP -.B buildpkg -Binary packages will be created for all packages that are merged. -.TP -.B ccache -Enable portage support for the ccache package. If the ccache dir is not -present in the user's environment, then portage will default to -${PORTAGE_TMPDIR}/ccache (with \fIuserpriv\fR) and to /root/.ccache otherwise. -.TP -.B collision\-protect -A QA\-feature to ensure that a package doesn't overwrite files it doesn't own. -.TP -.B cvs -A feature for developers that causes portage to enable all USE flags in SRC_URI -when creating digests. -.TP -.B digest -Autogenerate a digest for packages. -.TP -.B distcc -Enable portage support for the distcc package. -.TP -.B distlocks -Portage uses lockfiles to ensure competing instances don't clobber -each other's files. This feature is enabled by default but may cause -heartache on less intelligent remote filesystems like NFSv2 and some -strangely configured Samba server (oplocks off, NFS re\-export). A tool -/usr/lib/portage/bin/clean_locks exists to help handle lock issues -when a problem arises (normally due to a crash or disconnect). -.TP -.B fixpackages -Runs the script that will fix the dependencies in all binary packages. This is -run whenever packages are moved around in the portage tree. Please note that this -can take a lot of time. -.TP -.B getbinpkg -Force emerges to always try to fetch files from the \fIPORTAGE_BINHOST\fR. See -\fBmake.conf\fR(5) for more information. -.TP -.B gpg -Check the signatures of Manifests and make sure they are correct. -.TP -.B keeptemp -Do not delete the ${T} directory after the merge process. -.TP -.B keepwork -Do not delete the ${WORKDIR} directory after the merge process. -.TP -.B mirror -This will cause \fBFETCHCOMMAND\fR to always be run even if -the file already exists in \fBDISTDIR\fR. -.TP -.B noauto -When utilizing \fBebuild\fR(1), only run the function requested. -.TP -.B noclean -Do not delete the the source and temporary files after the merge process. -.TP -.B nodoc -Do not install doc files (/usr/share/doc). -.TP -.B noinfo -Do not install info pages. -.TP -.B noman -Do not install manpages. -.TP -.B nostrip -Prevents the stripping of binaries that are merged to the live filesystem. -.TP -.B notitles -Disables xterm titlebar updates (which contains status info). -.TP -.B sandbox -Enable sandbox\-ing when running \fBemerge\fR(1) and \fBebuild(1)\fR. -.TP -.B severe -When checking Manifests, only accept ones that have been signed by a -key which you trust. -.TP -.B sfperms -Stands for Smart Filesystem Permissions. Before merging packages to the -live filesystem, automatically search for and set permissions on setuid -and setgid files. Files that are setuid have the group and other read -bits removed while files that are setgid have the other read bit removed. -See also \fIsuidctl\fR below. -.TP -.B sign -When commiting work to cvs with \fBrepoman\fR(1), sign the Manifest with -a GPG key. Read about the \fIPORTAGE_GPG_KEY\fR variable in \fBmake.conf\fR(5). -.TP -.B strict -Have portage react strongly to conditions that have the potential to be -dangerous (like missing or incorrect Manifests). -.TP -.B suidctl -Before merging packages to the live filesystem, automatically strip setuid -bits from any file that is not listed in \fI/etc/portage/suidctl.conf\fR. -.TP -.B test -Run package\-specific tests during each merge to help make sure -the package compiled properly. See \fItest\fR in \fBebuild\fR(1) -and \fIsrc_test()\fR in \fBebuild\fR(5). -.TP -.B userpriv -Allow portage to drop root privledges and compile packages as -portage:portage without a sandbox (unless \fIusersandbox\fR is also used). -.TP -.B usersandbox -Enable the sandbox in the compile phase, when running without root privs (\fIuserpriv\fR). -.RE -.TP -\fBFETCHCOMMAND\fR -This variable contains the command used for fetching package\-sources from -the internet. -.TP -\fBGENTOO_MIRRORS\fR = \fI[URLs]\fR -Insert your space\-seperated list of local mirrors here. These -locations are used to download files before the ones listed in -the \fIebuild scripts\fR. Merging 'mirrorselect' can help. -.TP -\fBhttp_proxy ftp_proxy\fR = \fI[host:port]\fR -These vars are used if the sources must be downloaded from the -internet by \fBwget\fR(1). They are only required if you use a -proxy server for internet access. -.TP -\fBMAKEOPTS\fR -Use this variable if you want to use parallel make. For example, if you -have a dual\-processor system, set this variable to "\-j2" or "\-j3" for -enhanced build performance with many packages. Suggested settings are -between \fICPUs+1\fR and \fI2*CPUs+1\fR. -For more information, see \fBmake\fR(1). -.TP -\fBNOCOLOR\fR = \fI["true" | "false"]\fR -Defines if color should be disabled by default. -.br -Defaults to false. -.TP -\fBPKGDIR\fR = \fI[path]\fR -Defines the location where created .tbz2 binary packages will be stored. -.br -Defaults to ${PORTDIR}/packages. -.TP -.B PORT_LOGDIR -This variable defines the directory in which per\-ebuild logs are kept. -Logs are created only when this is set and writable. -.TP -\fBPORTAGE_BINHOST\fR = \fI"ftp://login:pass@grp.mirror.site/pub/grp/i686/athlon\-xp"\fR -This is the host from which portage will grab prebuilt\-binary packages. -The list is a single entry specifying the full address of the directory -serving the tbz2's for your system. This is only used when running with -the get binary pkg options are given to \fBemerge\fR. Review \fBemerge\fR(1) -for more information. Note that it should point to the 'All' directory on -the host that creates the binary packages and not to the root of the \fBPKGDIR\fR. -.TP -\fBPORTAGE_NICENESS\fR = \fI[number]\fR -The value of this variable will be added to the current nice level that -emerge is running at. In other words, this will not set the nice level, -it will increment it. For more information about nice levels and what -are acceptable ranges, see \fBnice\fR(1). -.TP -\fBPORTAGE_TMPDIR\fR = \fI[path]\fR -Defines the location of the temporary build directories. -.br -Defaults to /var/tmp. -.TP -\fBPORTDIR\fR = \fI[path]\fR -Defines the location of your Portage tree. -.br -Defaults to /usr/portage. -.TP -\fBPORTDIR_OVERLAY\fR = \fI"[path] [different\-path] [etc...]"\fR -Defines the directories in which user made ebuilds may be stored and not -overwriten when `emerge \-\-sync` is run. This is a space delimited list of -directories. -.br -Defaults to no value. -.TP -\fBRESUMECOMMAND\fR -This variable contains the command used for resuming package\-sources that -have been partially downloaded by the \fBFETCHCOMMAND\fR. -.TP -\fBROOT\fR = \fI[path]\fR -Use \fBROOT\fR to specify the target root filesystem to be used for -merging packages or ebuilds. Typically, you should set this setting -in the environment rather than in \fI/etc/make.conf\fR itself. It's -typically used for creating new build images. -.br -Defaults to /. -.TP -\fBRSYNC_EXCLUDEFROM\fR = \fI"/etc/portage/rsync_excludes"\fR -This is a file that portage will pass to rsync when it updates the portage tree. -Specific chucks of the tree may be excluded from the sync process. This may cause -dependency failures if you are not careful. The file format is pattern per line, -blanks and ';' or '#' lines are comments. See \fBrsync\fR(1) for more details. -.TP -\fBRSYNC_RETRIES\fR = \fI[NUMBER]\fR -The number of times rsync should retry on failed connections before -giving up. -.br -Defaults to 3. -.TP -\fBRSYNC_TIMEOUT\fR = \fI[SECONDS]\fR -The number of seconds rsync should remain idle before it determines the -connection has timed out. Dialup users may need to set this value at or -above 300 seconds. -.br -Defaults to 180 seconds. -.TP -\fBRPMDIR\fR = \fI[path]\fR -Defines the location where created RPM packages will be stored. -.br -Defaults to ${PORTDIR}/rpm. -.TP -\fBSYNC\fR = \fI[RSYNC]\fR -Insert your preferred rsync mirror here. This rsync server -is used to sync the local portage tree when `emerge \-\-sync` is run. -.br -Defaults to rsync://rsync.gentoo.org/gentoo\-portage -.TP -\fBUSE\fR = \fI[space delimited list of USE items]\fR -This variable contains options that control the build behavior of several -packages. More information in \fBebuild\fR(5). Possible USE values -can be found in \fI/usr/portage/profiles/use.desc\fR. -.TP -\fBUSE_ORDER\fR = \fI"env:pkg:conf:auto:defaults"\fR -Determines precedence for incrementing the setting of the USE variable. -The above setting will cause the environment (env) to override per package (pkg) -settings to override make.conf (conf) to override auto generated values -from merged packages (auto) to override make.defaults (defaults). -.br -\fB***warning***\fR -.br -Do not modify this value unless you're a developer and you know what -you're doing. If you change this and something breaks, we will not help -you fix it. -.br -Defaults to "env:pkg:conf:auto:defaults". - -.SH "REPORTING BUGS" -Please report bugs via http://bugs.gentoo.org/ -.SH "SEE ALSO" -.BR emerge (1), -.BR portage (5), -.BR ebuild (1), -.BR ebuild (5) -.TP -The \fI/usr/sbin/ebuild.sh\fR script. -.TP -The helper apps in \fI/usr/lib/portage/bin\fR. -.SH "FILES" -.TP -\fB/etc/make.conf\fR -Contains variables for the build\-process and overwrites those in make.defaults. -.TP -\fB/etc/make.globals\fR -Contains the default variables for the build\-process, you should edit \fI/etc/make.conf\fR instead. -.TP -\fB/usr/portage/profiles/use.desc\fR -Contains a list of all global USE flags. -.TP -\fB/usr/portage/profiles/use.local.desc\fR -Contains a list of all local USE variables. -.SH "AUTHORS" -Daniel Robbins <drobbins@gentoo.org> -.br -Nicholas Jones <carpaski@gentoo.org> -.br -Mike Frysinger <vapier@gentoo.org> -.SH "CVS HEADER" -$Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/man/make.conf.5,v 1.46 2005/02/26 07:21:14 jstubbs Exp $ diff --git a/man/perl-module.eclass.5 b/man/perl-module.eclass.5 deleted file mode 100644 index d018bfe..0000000 --- a/man/perl-module.eclass.5 +++ /dev/null @@ -1,64 +0,0 @@ -.TH "PERL-MODULE.ECLASS" "5" "Jun 2003" "Portage 2.0.51" "portage" -.SH "NAME" -perl-module.eclass \- handles generic perl module ebuilds -.SH "DESCRIPTION" -The \fBperl-module\fR eclass is used for the compilation, testing, and -installation of perl modules within the portage system, following -vanilla procedure for modules using either \fBExtUtils::MakeMaker\fR(3pm) -or \fBModule::Builder\fR(3pm). -.SH "FUNCTIONS" -.TP -.B perl-module_src_prep -Create the initial Makefile. -.TP -.B perl-module_src_compile -Calls \fBperl-module_src_prep\fR if it hasn't been already. Runs -initial make. -.TP -.B perl-module_src_test -If invoked, runs all the tests distributed with the module. -.TP -.B perl-module_src_install -Runs `make install` (or the \fBModule::Builder\fR(3pm) equivelant if it -is a builder module). Also cleans build paths from pod files and -generated perllocal.pod. -.TP -.B perl-module_pkg_setup -Calls \fBperlinfo\fR. -.TP -.B perl-module_pkg_preinst -Calls \fBperlinfo\fR. -.TP -.B perl-module_pkg_postinst -Calls \fBupdatepod\fR. -.TP -.B perl-module_pkg_prerm -Calls \fBupdatepod\fR. -.TP -.B perl-module_pkg_postrm -Calls \fBupdatepod\fR. -.TP -.B fixlocalpod -Handles the building of the perllocal.pod files to avoid collisions with -an existing perllocal.pod. -.TP -.B perlinfo -Updates the gentoo-pods documentation. -.TP -.B updatepod -Cleans the perllocal.pods in ARCH_LIB and SITE_LIB. -.SH "REPORTING BUGS" -Please report bugs via http://bugs.gentoo.org/ -.SH "SEE ALSO" -.BR ebuild (5), -.BR ExtUtils::MakeMaker (3pm), -.BR Module::Build (3pm), -.BR perl (1) -.SH "FILES" -.BR /usr/portage/eclass/perl-module.eclass -.SH "AUTHORS" -Michael Cummings <mcummings@gentoo.org> -.br -Mike Frysinger <vapier@gentoo.org> -.SH "CVS HEADER" -$Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/man/perl-module.eclass.5,v 1.5 2005/03/14 19:24:26 mcummings Exp $ diff --git a/man/portage.5 b/man/portage.5 deleted file mode 100644 index b0c32e7..0000000 --- a/man/portage.5 +++ /dev/null @@ -1,555 +0,0 @@ -.TH "PORTAGE" "5" "Jan 2004" "Portage 2.0.51" "Portage" -.SH NAME -portage \- the heart of Gentoo -.SH "DESCRIPTION" -The current portage code uses many different configuration files, most of which -are unknown to users and normal developers. Here we will try to collect all -the odds and ends so as to help users more effectively utilize portage. This -is a reference only for files which do not already have a man page. -.IP Note: -If you are looking for information on how to emerge something, please see -.BR emerge (1). -.SH "SYNOPSIS" -.TP -.BR /etc/ -.nf -make.globals -.BR make.conf (5) -.fi -.TP -.BR /etc/make.profile/ -.nf -deprecated -make.defaults -packages -packages.build -package.provided -use.defaults -use.mask -virtuals -.fi -.TP -.BR /etc/portage/ -.nf -bashrc -package.mask -package.unmask -package.keywords -package.use -mirrors -categories -.fi -.TP -.BR /etc/portage/profile/ -site-specific overrides of \fB/etc/make.profile/\fR -.TP -.BR /usr/portage/profiles/ -.nf -arch.list -categories -package.mask -thirdpartymirrors -use.desc -use.local.desc -.fi -.TP -.BR /var/lib/portage/ -world -.SH "GLOSSARY" -In the following sections, some terminology may be foreign to you or used -with meaning specific to Portage. Please see the referenced manpages for -more detailed explanations. -.RS -.TP -.B DEPEND atom -A string which matches a package. It is of the form category/package. -It may also contain optional logical operators and versions. -.br -More reading: -.BR ebuild (5) -.TP -.B KEYWORD -Each architecture has a unique KEYWORD. -.br -More reading: -.BR ebuild (5) -.TP -.B virtual -A DEPEND atom that is part of the "virtual" category. They are used -when different packages can satisfy a dependency and only one of them is -needed. -.br -More reading: -.BR ebuild (5) -.RE -.SH "SPECIFIC FILE DESCRIPTIONS" -.TP -.BR /etc/ -.RS -.TP -.BR make.globals -The global default settings for Portage. This comes from the portage package -itself. Settings in \fBmake.conf\fR override values here. The format -is described extensivly in \fBmake.conf\fR(5). -.TP -.BR make.conf -The global custom settings for Portage. See \fBmake.conf\fR(5). -.RE -.TP -.BR /etc/make.profile/ -This is usually just a symlink to the correct profile in -\fB/usr/portage/profiles/\fR. Since it is part of the portage tree, it -may easily be updated/regenerated by running `emerge \-\-sync`. It defines -what a profile is (usually arch specific stuff). If you need a custom -profile, then you should make your own \fB/etc/make.profile/\fR -directory and populate it. However, if you just wish to override some -settings, do NOT edit these files because they WILL be lost with the -next `emerge \-\-sync`. See the section below on \fB/etc/portage/\fR for -overriding. -.RS -.TP -.BR deprecated -The existence of this file marks a profile as deprecated, meaning it is -not supported by Gentoo anymore. It contains the name of the profile -to which users are encouraged to upgrade. -.TP -.BR make.defaults -The profile default settings for Portage. The general format is described -in \fBmake.conf\fR(5). The \fImake.defaults\fR for your profile defines a -few specific variables too: - -.PD 0 -.RS -.TP -.BR ARCH -Architecture type (x86/ppc/hppa/etc...). -.TP -.B USERLAND = \fI"GNU"\fR -Support BSD/cygwin/etc... -.TP -.B PORTAGE_LIBC = \fI"glibc"\fR -Support uClibc/BSD libc/etc... -.TP -.BR PROFILE_ARCH -Distinguish machines classes that have the same \fBARCH\fR. All sparc -machines have ARCH=sparc but set this to either 'sparc32' or 'sparc64'. -.TP -.BR STAGE1_USE -Special USE flags which may be needed when bootstrapping from stage1 to stage2. -.TP -.BR GRP_STAGE23_USE -Special USE flags used by catalyst for building a stage3 and GRP sets. -.RE -.PD 1 -.TP -.BR packages -This file serves two purposes. The first is to mask out specific -packages/versions on a per\-profile basis. The second is to provide the -list of packages that compose the special \fIsystem\fR class. - -.I Format: -.nf -\- comments begin with # -\- one DEPEND atom per line of what to mask OUT -\- packages to be added to the system class begin with a * -.fi -.I Note: -In a cascading profile setup, you can remove packages in children -profiles which were added by parent profiles by prefixing the atom with -a '\-'. - -.I Example: -.nf -# i am a comment ! -# only allow versions of glibc less than 2.3 -<sys\-libs/glibc\-2.3 -# add any version of bash to the system class -*app\-shells/bash -# only allow versions of readline earlier than 4.2 -# and add it to the system class -*<sys\-libs/readline\-4.2 -.fi -.TP -.BR packages.build -A list of packages (one per line) that make up a stage1 tarball. Really only -useful for stage builders. -.TP -.BR package.provided -A list of packages (one per line) that portage should assume have been -provided. Useful for porting to non-Linux systems. Portage will not -attempt to update a package that is listed here unless another package -explicitly requires a version that is newer than what has been listed. -Basically, it's a list that replaces the \fBemerge \-\-inject\fR syntax. - -For example, if you manage your own copy of a 2.6 kernel, then you can -tell portage that 'sys-kernel/development-sources-2.6.7' is already taken -care of and it should get off your back about it. - -.I Format: -.nf -\- comments begin with # -\- one DEPEND atom per line -\- relational operators are not allowed -\- must include a version -.fi - -.I Example: -.nf -# you take care of the kernel -sys-kernel/development-sources-2.6.7 - -# you installed your own special copy of QT -x11-libs/qt-3.3.0 -.fi -.TP -.BR use.defaults -Here we DO NOT define the default USE flags, but the so\-called auto\-USE -flags. This rather unknown portage feature activates a USE flag if a -specific package is installed and the flag was not explicitly -deactivated. This file contains the associations between USE flags and -packages that trigger the auto\-USE feature. - -In other words, if we never put "sdl" or "\-sdl" into our USE, but we -have media\-libs/libsdl emerged, then portage automagically sticks "sdl" -into our USE for us. - -.I Format: -.nf -\- comments begin with # -\- one USE flag per line with a list of DEPEND atom bases -.fi - -.I Example: -.nf -# media\-libs/libsdl will activate "sdl" -sdl media\-libs/libsdl -# activate tcltk only if we have both -# dev\-lang/tcl and dev\-lang/tk -tcltk dev\-lang/tcl dev\-lang/tk -.fi -.TP -.BR use.mask -Some USE flags don't make sense on some archs (for example altivec on -non\-ppc or mmx on non\-x86). Here we list the masked ones. - -.I Format: -.nf -\- comments begin with # -\- one USE flag per line -.fi -.TP -.BR virtuals -This controls what packages will provide a virtual by default. For example, -if a package needs to send e\-mail, it will need virtual/mta. In the absence -of a package that provides virtual/mta (like qmail, sendmail, postfix, etc...), -portage will look here to see what package to use. In this case, Gentoo uses -net\-mail/ssmtp as the default (as defined in the virtuals file) because it's -the package that does the very bare minimum to send e\-mail. - -.I Format: -.nf -\- comments begin with # -\- one virtual and DEPEND atom base pair per line -.fi - -.I Example: -.nf -# use net\-mail/ssmtp as the default mta -virtual/mta net\-mail/ssmtp -# use app\-dicts/aspell\-en as the default dictionary -virtual/aspell\-dict app\-dicts/aspell\-en -.fi -.RE -.TP -.BR /etc/portage/ -.RS -.TP -.BR bashrc -If needed, this file can be used to set up a special environment for ebuilds, -different from the standard root environment. The syntax is the same as for -any other bash script. -.TP -.BR package.mask -A list of DEPEND atoms to mask. Useful if specific versions of packages do -not work well for you. For example, you swear by the Nvidia drivers, but only -versions earlier than 1.0.4496. No problem! - -.I Format: -.nf -\- comments begin with # -\- one DEPEND atom per line -.fi - -.I Example: -.nf -# mask out versions 1.0.4496 of the nvidia -# drivers and later ->=media\-video/nvidia\-kernel\-1.0.4496 ->=media\-video/nvidia\-glx\-1.0.4496 -.fi -.TP -.BR package.unmask -Just like package.mask above, except here you list packages you want to -unmask. Useful for overriding the global package.mask file (see -below). Note that this does not override packages that are masked via -KEYWORDS. -.TP -.BR package.keywords -Per\-package KEYWORDS. Useful for mixing unstable packages in with a normally -stable machine or vice versa. This will allow you to augment ACCEPT_KEYWORDS -for a single package. - -.I Format: -.nf -\- comments begin with # -\- one DEPEND atom per line followed by additional ACCEPT_KEYWORDS -.fi - -.I Example: -.nf -# always use unstable libgd -media\-libs/libgd ~x86 -# only use stable mplayer -media\-video/mplayer \-~x86 -.fi -.TP -.BR package.use -Per\-package USE flags. Useful for tracking local USE flags or for -enabling USE flags for certain packages only. Perhaps you develop GTK -and thus you want documentation for it, but you don't want -documentation for QT. Easy as pie my friend! - -.I Format: -.nf -\- comments begin with # -\- one DEPEND atom per line with space-separated row of USE flags -.fi - -.I Example: -.nf -# turn on docs for GTK 2.x -=x11\-libs/gtk+\-2* doc -# disable mysql support for QT -x11\-libs/qt \-mysql -.fi -.TP -.BR mirrors -Whenever portage encounters a mirror:// style URL it will look up the actual -hosts here. If the mirror set is not found here, it will check the global -mirrors file at /usr/portage/profiles/thirdpartymirrors. You may also set a -special mirror type called "local". This list of mirrors will be checked -before GENTOO_MIRRORS and will be used even if the package has -RESTRICT="nomirror". - -.I Format: -.nf -\- comments begin with # -\- mirror type followed by a list of hosts -.fi - -.I Example: -.nf -# local private mirrors used only by my company -local ftp://192.168.0.3/mirrors/gentoo http://192.168.0.4/distfiles - -# people in japan would want to use the japanese mirror first -sourceforge http://keihanna.dl.sourceforge.net/sourceforge - -# people in tawain would want to use the local gnu mirror first -gnu ftp://ftp.nctu.edu.tw/UNIX/gnu/ -.fi -.TP -.BR categories -A simple list of valid categories that may be used in /usr/portage, -PORTDIR_OVERLAY, and PKGDIR (see \fBmake.conf\fR(5)). This allows for custom -categories to be created. - -.I Format: -.nf -\- one category per line -.fi - -.I Example: -.nf -app\-hackers -media\-other -.fi -.TP -.BR virtuals -This controls what packages will provide a virtual by default. For example, -if a package needs to send e\-mail, it will need virtual/mta. In the absence -of a package that provides virtual/mta (like qmail, sendmail, postfix, etc...), -portage will look here to see what package to use. In this case, Gentoo uses -net\-mail/ssmtp as the default (as defined in the virtuals file) because it's -the package that does the very bare minimum to send e\-mail. - -.I Format: -.br -\- comments begin with # -.br -\- one virtual and DEPEND atom base pair per line - -.I Example: -.br -# use net\-mail/ssmtp as the default mta -.br -virtual/mta net\-mail/ssmtp -.br -# use app\-dicts/aspell\-en as the default dictionary -.br -virtual/aspell\-dict app\-dicts/aspell\-en -.RE -.TP -.BR /usr/portage/profiles/ -Global Gentoo settings that are controlled by the developers. To override -these settings, you can use the files in \fB/etc/portage/\fR. -.RS -.TP -.BR arch.list -A list of all valid KEYWORDS. This does not include modifiers. - -.I Format: -.nf -\- one KEYWORD per line -.fi - -.I Example: -.nf -x86 -ppc -sparc -.fi -.TP -.BR categories -A simple list of valid categories that may be used in /usr/portage, -PORTDIR_OVERLAY, and PKGDIR (see \fBmake.conf\fR(5)). - -.I Format: -.nf -\- one category per line -.fi - -.I Example: -.nf -app\-admin -dev\-lang -games\-strategy -sys\-kernel -.fi -.TP -.BR package.mask -This contains a list of DEPEND atoms for packages that should not be installed -in any profile. Useful for adding the latest KDE betas and making sure no -one accidentally upgrades to them. Also useful for quickly masking specific -versions due to security issues. ALWAYS include a comment explaining WHY the -package has been masked and WHO is doing the masking. - -.I Format: -.nf -\- comments begin with # -\- one DEPEND atom per line -.fi - -.I Example: -.nf -# masked for security reasons -<sys\-libs/zlib\-1.1.4 -# <caleb@gentoo.org> (10 Sep 2003) -# new kde betas -=kde\-base/kde\-3.2.0_beta1 -=kde\-base/kdeaccessibility\-3.2.0_beta1 -.fi -.TP -.BR thirdpartymirrors -Controls the mapping of mirror:// style URLs to actual lists of -mirrors. Keeps us from overloading a single server. - -.I Format: -.nf -\- comments begin with # -\- mirror type followed by a list of hosts -.fi - -.I Example: -.nf -sourceforge http://aleron.dl.sourceforge.net/sourceforge http://unc.dl.sourceforge.net/sourceforge - -gentoo http://distro.ibiblio.org/pub/linux/distributions/gentoo/distfiles/ ftp://ftp.gtlib.cc.gatech.edu/pub/gentoo/distfiles - -kernel http://www.kernel.org/pub http://www.us.kernel.org/pub -.fi -.TP -.BR use.desc -All global USE flags must be listed here with a description of what they do. - -.I Format: -.nf -\- comments begin with # -\- use flag \- some description -.fi - -.I Example: -.nf -3dfx \- Adds support for 3dfx video cards -acl \- Adds support for Access Control Lists -doc \- Adds extra documentation -.fi -.TP -.BR use.local.desc -All local USE flags must be listed here along with the package and a -description. - -.I Format: -.nf -\- comments begin with # -\- package:use flag \- description -.fi - -.I Example: -.nf -app\-editors/nano:justify \- Toggles the justify option -dev\-games/clanlib:clanJavaScript \- Enables javascript support -dev\-libs/DirectFB:fusion \- Adds Multi Application support -games\-emulation/xmess:net \- Adds network support -.fi -.RE -.TP -.BR /var/lib/portage/ -.RS -.TP -.BR world -Every time you emerge a package, the package that you requested is -recorded here. Then when you run `emerge world \-up`, the list of -packages is read from this file. Note that this does not mean that the -packages that were installed as dependencies are listed here. For -example, if you run `emerge mod_php` and you do not have apache -already, then "dev\-php/mod_php" is recorded in the world file but -"net\-www/apache" is not. For more information, review \fBemerge\fR(1). - -.I Format: -.nf -\- one DEPEND atom base per line -.fi - -.I Example: -.nf -games\-misc/fortune\-mod\-gentoo\-dev -dev\-libs/uclibc -app\-cdr/cdemu -.fi -.RE -.SH "AUTHORS" -.nf -Marius Mauch <genone@gentoo.org> -Mike Frysinger <vapier@gentoo.org> -Drake Wyrm <wyrm@haell.com> -.fi -.SH "REPORTING BUGS" -Please report bugs via http://bugs.gentoo.org/ -.SH "SEE ALSO" -.BR emerge (1), -.BR ebuild (1), -.BR ebuild (5), -.BR make.conf (5) -.SH "CVS HEADER" -$Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/man/portage.5,v 1.20 2005/06/14 14:53:05 genone Exp $ diff --git a/man/python.eclass.5 b/man/python.eclass.5 deleted file mode 100644 index 5addbf5..0000000 --- a/man/python.eclass.5 +++ /dev/null @@ -1,82 +0,0 @@ -.TH PYTHON.ECLASS 5 "Nov 2004" "Portage 2.0.51" portage -.SH NAME -python.eclass \- functions for Python-related ebuilds -.SH DESCRIPTION -The \fBpython\fR eclass provides general utility functions for Python-related -ebuilds. -.SH VARIABLES -.TP -.B PYVER -Defines major and minor Python version. This is a READ-ONLY variable, set by -the \fBpython_version\fR function. -.TP -.B PYVER_MAJOR -Defines major Python version. This is a READ-ONLY variable, set by the -\fBpython_version\fR function. -.TP -.B PYVER_MINOR -Defines minor Python version. This is a READ-ONLY variable, set by the -\fBpython_version\fR function. -.TP -.B PYVER_MICRO -Defines micro Python version. This is a READ-ONLY variable, set by the -\fBpython_version\fR function. -.TP -.B PYTHON_OVERRIDE_PYVER = \fI"2.2"\fR -When set, overrides the version of Python to use in the \fBpython_mod_compile\fR -and \fBpython_mod_optimize\fR functions. -.SH FUNCTIONS -.TP -.B python_version -Sets variables \fBPYVER\fR, \fBPYVER_MAJOR\fR, \fBPYVER_MINOR\fR, and -\fBPYVER_MICRO\fR to the version of Python currently available. -.TP -.B python_disable_pyc -Disables automatic recompilation of modules to .pyc/.pyo. This is supported by ->=dev-lang/python-2.2.3-r3 only. -.TP -.B python_enable_pyc -Enables automatic recompilation of modules to .pyc/.pyo. This is supported by ->=dev-lang/python-2.2.3-r2 only. -.TP -.B python_makesym -Creates the /usr/bin/python symbolic link to point to the latest installed -version of Python. -.TP -.B python_tkinter_exists -Checks to see if Python was compiled with Tkinter support (via USE=tcltk). -If not, this function will print an error message informing the user that -Tkinter support is required and then die. -.TP -.B python_mod_exists \fI[ module ]\fR -Checks to see if the specified module is installed and loadable. Returns true -(0) if so or false (1) if not. -.TP -.B python_mod_compile \fI[ file ]\fR -Precompiles the specified file, creating the module's pyc and pyo files. If -the variable, \fBPYTHON_OVERRIDE_PYVER\fR is set, this function will use the -specified version of Python to compile rather than the version detected by -\fBpython_version\fR. This function should only be run from \fBpkg_postinst\fR. -.TP -.B python_mod_optimize \fI< dir1 > < dir 2 >\fR -If called with no arguments, this function will recompile all modules under -sys.path without recursing into subdirectories. Called with arguments, this -function will recursively compile all modules in the specified directories. -If the variable, \fBPYTHON_OVERRIDE_PYVER\fR is set, this function will use -the specified version of Python rather than the version detected by -\fBpython_version\fR. -.TP -.B python_mod_cleanup \fI< dir1 > < dir2 >\fR -Recursively searches specified directories (or /usr/lib/python*/site-packages -if called with no arguments) removing orphaned bytecode (.pyc/.pyo files with -no corresponding .py file). -.SH REPORTING BUGS -Please report bugs via http://bugs.gentoo.org/ -.SH SEE ALSO -.BR ebuild (5) -.SH FILES -.BR /usr/portage/eclass/python.eclass -.SH AUTHORS -Aaron Walker <ka0ttic@gentoo.org> -.SH CVS HEADER -$Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/man/python.eclass.5,v 1.2 2005/02/10 01:37:36 vapier Exp $ diff --git a/man/quickpkg.1 b/man/quickpkg.1 deleted file mode 100644 index 0bcf61b..0000000 --- a/man/quickpkg.1 +++ /dev/null @@ -1,56 +0,0 @@ -.TH "QUICKPKG" "1" "Jul 2003" "Portage 2.0.51" "Portage" -.SH NAME -quickpkg \- creates portage packages -.SH SYNOPSIS -.B quickpkg <list of pkgs> -.SH DESCRIPTION -.I quickpkg -can be utilized to quickly create a package for portage by -utilizing the files already on your filesystem. This package -then can be emerged on any system. To review syntax for -emerging binary packages, review \fBemerge\fR(1). The upside -of this process is that you don't have to wait for the package -to unpack, configure, compile, and install before you can have -the package ready to go. The downside is that the package will -contain the files that exist on your filesystem even if they have -modified since they were first installed. -.br -The packages, after being created, will be placed in \fBPKGDIR\fR. -This variable is defined in \fBmake.conf\fR(5) and defaults to -/var/tmp/binpkgs. -.SH OPTIONS -.TP -.B <list of packages> -Each package in the list can be of two forms. First you can -give it the full path to the installed entry in the virtual -database. That is, /var/db/pkg/<CATEGORY>/<PKG-VERSION>/. -The second form is a portage depend atom. This atom is of -the same form that you would give \fBemerge\fR if you wanted -to emerge something. See \fBebuild\fR(5) for full definition. -.SH "EXAMPLES" -.B quickpkg -/var/db/pkg/dev-python/pyogg-1.1 -.br -.B quickpkg -planeshift -.br -.B quickpkg -=apache-1.3.27-r1 -.br -.B quickpkg -=net-www/apache-2* -.SH "REPORTING BUGS" -Please report bugs via http://bugs.gentoo.org/ -.SH "SEE ALSO" -.BR ebuild (5), -.BR make.conf (5) -.SH "FILES" -.TP -.B /etc/make.conf -The \fBPKGDIR\fR variable is defined here. -.SH AUTHORS -Terry Chan (original author) -.br -Mike Frysinger <vapier@gentoo.org> (revamped version) -.SH "CVS HEADER" -$Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/man/quickpkg.1,v 1.4 2005/04/12 22:37:12 vapier Exp $ diff --git a/man/repoman.1 b/man/repoman.1 deleted file mode 100644 index 8762947..0000000 --- a/man/repoman.1 +++ /dev/null @@ -1,127 +0,0 @@ -.TH "REPOMAN" "1" "Nov 2002" "Portage 2.0.51" "Portage" -.SH NAME -repoman \- Gentoo's program to enforce a minimal level of quality assurance in packages added to the portage tree -.SH SYNOPSIS -\fBrepoman\fR [\fIoption\fR] [\fImode\fR] -.SH DESCRIPTION -.BR "Quality is job zero." -.br -.BR repoman -is meant for Gentoo developers only due to the fact it does not work on a per-ebuild basis. -It checks the quality of CVS repositories. -.br -Note: \fBrepoman\fR only runs \fIinside local\fR CVS repositories. -.SH OPTIONS -.TP -.B --pretend -Don't actually perform commit or fix problems, just show what would be done. -.TP -.B --help -Show the help screen. -.SH MODES -.TP -.B scan -Scan current directory tree for QA issues (default). See \fBQA KEYWORDS\fR for more -information. -.TP -.B fix -Fix those issues that can be fixed (stray digests, missing digests). -.TP -.B full -Scan current directory tree for QA issues (full listing). See \fBQA KEYWORDS\fR for more -information. -.TP -.B help -Show the help screen. -.TP -.B commit -Scan current directory tree for QA issues. If OK, commit via cvs. -.SH QA KEYWORDS -.TP -.BR CVS/Entries.IO_error -While attempting to commit, a CVS/Entries directory wasn't found- either the cvs co is damaged, or permissions block repoman from reading the file. -.TP -.BR digest.assumed -Files listed in the digest were not found in your $DISTDIR so the existing -digest entries are assumed to be correct. -.TP -.BR digest.disjointed -The digests were not added to cvs when the matching ebuild had already been -added. -.TP -.BR digest.missing -Ebuild files were found that do not have a corresponding digest. -.TP -.BR digest.notadded -The digests were found but have not been added to cvs. -.TP -.BR digest.stray -Digest files were found that do not have a corresponding ebuild. -.TP -.BR ebuild.disjointed -The ebuilds were not added to cvs when the matching digest had already been -added. -.TP -.BR ebuild.invalidname -The ebuild has a filename that is not-parseable by portage. -.TP -.BR changelog.missing -The ChangeLog file was not found. -.TP -.BR ebuild.namenomatch -The euild has a filename that does not have the same name as the parent -directory. -.TP -.BR ebuild.notadded -The ebuilds were found but have not been added to cvs. -.TP -.BR file.executable -The file has the executable bit set, when it's not needed- check is limited to ebuilds, digests, Manifest, ChangeLog, and metadata.xml. -.TP -.BR file.size -The file's size exceeds 20k, current policy is no files over 20k in a packages files directory. -.TP -.BR filedir.missing -The package lacks a files directory. -.TP -.BR DEPEND.bad -User-visible ebuilds with bad DEPEND settings (matched against *visible* ebuilds). -In other words, user-visiable ebuilds could not be found to satisfy the DEPEND settings. -.TP -.BR RDEPEND.bad -User-visible ebuilds with bad RDEPEND settings (matched against *visible* ebuilds). -In other words, user-visiable ebuilds could not be found to satisfy the RDEPEND settings. -.TP -.BR DEPEND.badmasked -Masked ebuilds with bad DEPEND settings (matched against *all* ebuilds) -In other words, no ebuilds could not be found to satisfy the DEPEND settings. -.TP -.BR RDEPEND.badmasked -Masked ebuilds with RDEPEND settings (matched against *all* ebuilds) -In other words, no ebuilds could not be found to satisfy the RDEPEND settings. -.TP -.BR ebuild.syntax -An error occured while generating the cache entry. This typically means the ebuild contains syntax error(s). -.TP -.BR ebuild.output -A simple sourcing of the ebuild produces output. This breaks ebuild policy. -.TP -.BR KEYWORDS.missing -The ebuild does not have a KEYWORDS variable. -.TP -.BR LICENSE.missing -The ebuild does not have a LICENSE variable. -.TP -.BR DESCRIPTION.missing -The ebuild does not have a DESCRIPTION variable. -.TP -.BR SLOT.missing -The ebuild does not have a SLOT variable. -.SH AUTHORS -Daniel Robbins <drobbins@gentoo.org> -.SH "REPORTING BUGS" -Please report bugs via http://bugs.gentoo.org/ -.SH "SEE ALSO" -.BR emerge (1) -.SH "CVS HEADER" -$Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/man/repoman.1,v 1.8 2005/02/10 01:37:36 vapier Exp $ diff --git a/man/rpm.eclass.5 b/man/rpm.eclass.5 deleted file mode 100644 index 3a26ad4..0000000 --- a/man/rpm.eclass.5 +++ /dev/null @@ -1,37 +0,0 @@ -.TH "RPM.ECLASS" "5" "Jun 2003" "Portage 2.0.51" "portage" -.SH "NAME" -rpm.eclass \- convienence class for extracting RPM's -.SH "DESCRIPTION" -The \fBrpm\fR eclass exists in order to unpack RPM's for you. This -way developers dont have to keep employing their own tricks just to -extract the source archives from an RPM. The eclass will define the -\fBsrc_unpack\fR function and do all the unpacking for you. The -unpack function will utilize either \fBrpmoffset\fR or \fBrpm2cpio\fR to -unpack the RPM. If both exist on the system, then \fBrpm2cpio\fR -will be utilized. -.SH "VARIABLES" -.TP -.B USE_RPMOFFSET_ONLY = \fI"[0|1]"\fR -If you want to force the RPM extractor to utilize \fBrpmoffset\fR -even if \fBrpm2cpio\fR is detected, then just set this variable to 1. -.SH "FUNCTIONS" -.TP -.B rpm_unpack \fI"<file to unpack>"\fR -Unpack an RPM file in the same manner that \fBunpack\fR unpacks any -other archive. The contents of the RPM will be extracted to \fB${WORKDIR}\fR. -.TP -.B rpm_src_unpack -This replacement for \fBsrc_unpack\fR will go through \fB${A}\fR and -unpack all the files. If the file is an RPM, then \fBrpm_unpack\fR -will be called. Otherwise the default \fBunpack\fR function will be -utilized. -.SH "REPORTING BUGS" -Please report bugs via http://bugs.gentoo.org/ -.SH "SEE ALSO" -.BR ebuild (5) -.SH "FILES" -.BR /usr/portage/eclass/rpm.eclass -.SH "AUTHORS" -Mike Frysinger <vapier@gentoo.org> -.SH "CVS HEADER" -$Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/man/rpm.eclass.5,v 1.4 2005/02/10 01:37:36 vapier Exp $ diff --git a/man/ruby.eclass.5 b/man/ruby.eclass.5 deleted file mode 100644 index ae303ba..0000000 --- a/man/ruby.eclass.5 +++ /dev/null @@ -1,47 +0,0 @@ -.TH RUBY.ECLASS 5 "Nov 2004" "Portage 2.0.51" portage -.SH NAME -ruby.eclass \- functions to ease installation of Ruby software -.SH DESCRIPTION -The \fBruby\fR eclass provides an interface designed to ease the installation -and integration of Ruby software. -.SH VARIABLES -.TP -.B RUBY = \fI"/usr/bin/ruby"\fR -Defines the location of the Ruby binary. Defaults to '/usr/bin/ruby'. -.TP -.B USE_RUBY = \fI"ruby18"\fR -Defines a white-space delimited list of supported Ruby versions. This variable -can be set to "any" if the ebuild only installs version independant files. -Possible values for this variable include \fBany\fR, \fBruby16\fR, \fBruby18\fR, -and \fBruby19\fR. -.TP -.B RUBY_ECONF = \fI"--with-foo"\fR -Defines any extra arguments to pass to econf. -.TP -.B PATCHES = \fI"foo.patch *.diff"\fR -Defines a white-space delimited list of patches that should be applied. In -addition to literal filenames, globbing may also be used. -.SH FUNCTIONS -.TP -.B ruby_einstall -Default einstall that executes standard Ruby installation scripts in addition -to installing all .rb files into the local Ruby site directory. -.TP -.B erubydoc -Installs documentation, HTML, and examples into /usr/share/doc/\fB${PF}\fR. -.TP -.B ruby_src_compile -Default src_compile that simply executes \fBruby_econf\fR and \fBruby_emake\fR. -.TP -.B ruby_src_install -Default src_install that simply runs \fBruby_einstall\fR and \fBerubydoc\fR. -.SH REPORTING BUGS -Please report bugs via http://bugs.gentoo.org/ -.SH SEE ALSO -.BR ebuild (5) -.SH FILES -.BR /usr/portage/eclass/ruby.eclass -.SH AUTHORS -Aaron Walker <ka0ttic@gentoo.org> -.SH CVS HEADER -$Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/man/ruby.eclass.5,v 1.2 2005/02/10 01:37:36 vapier Exp $ diff --git a/man/ssl-cert.eclass.5 b/man/ssl-cert.eclass.5 deleted file mode 100644 index 6909d65..0000000 --- a/man/ssl-cert.eclass.5 +++ /dev/null @@ -1,54 +0,0 @@ -.TH "SSL-CERT.ECLASS" "5" "Oct 2003" "Portage 2.0.51" "portage" -.SH "NAME" -ssl-cert.eclass \- provides common SSL certificates installation routines -.SH "DESCRIPTION" -The \fBssl-cert\fR eclass contains a function used to generate and -install SSL certificates and related files for testing and initial -configuration purposes of TLS/SSL compatible services. -.SH "VARIABLES" -.TP -\fBSSL_DAYS =\fR \fI"730"\fR (2 years) -The generated certificate will be expired after this many days. -.TP -\fBSSL_BITS =\fR \fI"1024"\fR -The number of bits used for the certificate keys. -.TP -\fBSSL_COUNTRY =\fR \fI"US"\fR -The country (code only) for the generated certificate. -.TP -\fBSSL_STATE =\fR \fI"California"\fR -The state (no abbreviation) for the generated certificate. -.TP -\fBSSL_LOCALITY =\fR \fI"Santa Barbara"\fR -The locality (city) name for the generated certificate. -.TP -\fBSSL_ORGANIZATION =\fR \fI"SSL Server"\fR -The organization (business) name for the generated certificate. -.TP -\fBSSL_UNIT =\fR \fI"For Testing Purposes Only"\fR -The organizational unit (department) name for the generated certificate. -.TP -\fBSSL_COMMONNAME =\fR \fI"localhost"\fR -The hostname (FQDN) for the generated certificate. -.TP -\fBSSL_EMAIL =\fR \fI"root@localhost"\fR -The technical contact (email address) for the generated certificate. -.SH "FUNCTIONS" -.TP -.B docert \fI<cert1>\fR \fI[cert2 ...]\fR -This function will generate and install the requested certificates into -the current \fB${INSDESTTREE}\fR location. For example: -.br -\fBinsinto\fR \fI/etc/ssl/server\fR -.br -\fBdocert\fR \fImail\fR \fIimap\fR || die "Error creating certificates" -.SH "REPORTING BUGS" -Please report bugs via http://bugs.gentoo.org/ -.SH "SEE ALSO" -.BR ebuild (5) -.SH "FILES" -.BR /usr/portage/eclass/ssl-cert.eclass -.SH "AUTHORS" -Max Kalika <max@gentoo.org> -.SH "CVS HEADER" -$Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/man/ssl-cert.eclass.5,v 1.4 2005/02/10 01:37:36 vapier Exp $ diff --git a/man/stardict.eclass.5 b/man/stardict.eclass.5 deleted file mode 100644 index c5bbf2c..0000000 --- a/man/stardict.eclass.5 +++ /dev/null @@ -1,34 +0,0 @@ -.TH "STARDICT.ECLASS" "5" "Jun 2003" "Portage 2.0.51" "portage" -.SH "NAME" -startdict.eclass \- convienence class to do stardict dictionary installations -.SH "DESCRIPTION" -The \fBstartdict\fR eclass contains appropriate variables and functions -to quickly make ebuild's for stardictionaries. The eclass will define -\fBsrc_compile\fR and \fBsrc_install\fR functions for you. All you -need to do is to set the \fBDICT_SUFFIX\fR, \fBDICT_P\fR, \fBFROM_LANG\fR, -and \fBTO_LANG\fR variables before inheriting the eclass. -.SH "VARIABLES" -.TP -.B FROM_LANG = \fI"From this language"\fR -What language is the dictionary translating from? If you have an -English to German dictionary, this variable would be set to 'English'. -.TP -.B TO_LANG = \fI"To this language"\fR -What language is the dictionary translating to? If you have an -English to German dictionary, this variable would be set to 'German'. -.TP -.B DICT_PREFIX = \fI"SRC_URI prefix, like 'dictd_www.mova.org_'"\fR -SRC_URI prefix, like "dictd_www.mova.org_". -.TP -.B DICT_SUFFIX = \fI"SRC_URI after the prefix"\fR -SRC_URI after the prefix. -.SH "REPORTING BUGS" -Please report bugs via http://bugs.gentoo.org/ -.SH "SEE ALSO" -.BR ebuild (5) -.SH "FILES" -.BR /usr/portage/eclass/stardict.eclass -.SH "AUTHORS" -Mike Frysinger <vapier@gentoo.org> -.SH "CVS HEADER" -$Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/man/stardict.eclass.5,v 1.4 2005/02/10 01:37:36 vapier Exp $ diff --git a/man/subversion.eclass.5 b/man/subversion.eclass.5 deleted file mode 100644 index c9c2add..0000000 --- a/man/subversion.eclass.5 +++ /dev/null @@ -1,59 +0,0 @@ -.TH SUBVERSION.ECLASS 5 "Nov 2004" "Portage 2.0.51" portage -.SH NAME -subversion.eclass \- provides subversion fetching functions -.SH DESCRIPTION -The \fBsubversion\fR eclass provides functions that enable the ebuild author -to create 'live' ebuilds that fetch the program's sources from a subversion -repository. -.br - -\fBNOTE\fR: At the very minimum, the \fBsubversion\fR eclass requires the -\fBESVN_REPO_URI\fR variable to be set (see below). -.SH VARIABLES -.TP -.B "ESVN_REPO_URI" = \fI"svn://foo/bar/trunk"\fR -This variable sets the URI from which the sources will be fetched. The -\fBsubversion\fR eclass supports fetching from the following protocols: -\fIhttp\fR, \fIhttps\fR, and \fIsvn\fR. This variable is required to be set. -.TP -.B "ESVN_STORE_DIR" = \fI"${DISTDIR}/svn-src"\fB -This variable defines the location in which the fetched sources will be kept. -The default value is '${DISTDIR}/svn-src' and should be sufficient in most -cases. -.TP -.B "ESVN_FETCH_CMD" = \fI"svn checkout"\fB -This variable defines the command used for initial checkout and defaults to 'svn checkout'. -.TP -.B "ESVN_UPDATE_CMD" = \fI"svn update"\fB -This variable defines the command used for updating sources and defaults to 'svn update'. -.TP -.B "ESVN_PROJECT" = \fI"foobar"\fB -This variable defines the name of the project and defaults to '${PN/-svn}'. -.TP -.B "ESVN_BOOTSTRAP" = \fI"autogen.sh"\fB -This variable defines the name of the bootstrap script to execute in -preparation for the build process. This variable is empty by default. Note: -"./" is automatically prepended, so it is unnecessary for the ebuild author to -do so. -.TP -.B "ESVN_PATCHES" = \fI"foo.patch *.diff"\fB -This variable defines a list of patches to apply prior to fetching the sources. -In addition to literal filenames, you may also use globbing such as *.diff. -This variable is empty by default. -.SH FUNCTIONS -.TP -.B subversion_src_unpack -The default \fBsrc_unpack\fR provided by the \fBsubversion\fR eclass simply -fetches the program's sources from the URI specified by \fBESVN_REPO_URI\fR, -applies any patches specified by \fBESVN_PATCHES\fR, and then executes the -bootstrap script specified by \fBESVN_BOOTSTRAP\fR. -.SH REPORTING BUGS -Please report bugs via http://bugs.gentoo.org/ -.SH SEE ALSO -.BR ebuild (5) -.SH FILES -.BR /usr/portage/eclass/subversion.eclass -.SH AUTHORS -Aaron Walker <ka0ttic@gentoo.org> -.SH CVS HEADER -$Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/man/subversion.eclass.5,v 1.3 2005/05/10 11:13:07 swegener Exp $ diff --git a/man/tla.eclass.5 b/man/tla.eclass.5 deleted file mode 100644 index 53c1854..0000000 --- a/man/tla.eclass.5 +++ /dev/null @@ -1,52 +0,0 @@ -.TH TLA.ECLASS 5 "Nov 2004" "Portage 2.0.51" portage -.SH NAME -tla.eclass \- provides generic tla fetching functions -.SH DESCRIPTION -The \fBtla\fR eclass provides an interface to easily allow ebuild authors to -create 'live' tla ebuilds that fetch their sources from a tla repository. -.SH VARIABLES -.TP -.B ETLA_TLA_CMD = \fI"tla"\fR -Defines tla executable. Defaults to 'tla'. -.TP -.B ETLA_GET_CMD = \fI"get"\fR -Defines tla get option. Defaults to 'get'. -.TP -.B ETLA_UPDATE_CMD = \fI"replay"\fR -Defines tla update option. Defaults to 'replay'. -.TP -.B ETLA_TOP_DIR = \fI"${DISTDIR}/tla-src"\fR -Defines location where fetched sources will be kept. Defaults to '${DISTDIR}/tla-src'. -.TP -.B ETLA_VERSION = \fI"foo@bar.com--archive-name/category--branch--version"\fR -Defines tla version in the above format. This variable will be passed as the -argument to a tla subcommand such as get, replay, etc. -.TP -.B ETLA_CACHE_DIR = \fI"${ELTA_VERSION}"\fR -Defines the location where the version shall be cached. This location is -relative to \fBETLA_TOP_DIR\fR. Defaults to '\fBETLA_VERSION\fR'. -.TP -.B ETLA_ARCHIVES -Defines a whitespace-delimited list of significant archive URI's. This variable -should at least include the URI of the archive that the wanted version is stored -in. -.TP -.B ETLA_CLEAN -Defines whether or not to fetch a clean copy of sources if there is already a -working copy available. If set, the working copy will be removed and a fresh -copy will be fetched. Otherwise, the working copy will just be updated (via -\fBETLA_UPDATE_CMD\fR). This variable is unset by default. -.SH FUNCTIONS -.TP -.B tla_src_unpack -Default src_unpack that fetches the sources and places them in \fB${WORKDIR}\fR/\fB${P}\fR. -.SH REPORTING BUGS -Please report bugs via http://bugs.gentoo.org/ -.SH SEE ALSO -.BR ebuild (5) -.SH FILES -.BR /usr/portage/eclass/tla.eclass -.SH AUTHORS -Aaron Walker <ka0ttic@gentoo.org> -.SH CVS HEADER -$Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/man/tla.eclass.5,v 1.2 2005/02/10 01:37:36 vapier Exp $ diff --git a/man/toolchain-funcs.eclass.5 b/man/toolchain-funcs.eclass.5 deleted file mode 100644 index 0255e9a..0000000 --- a/man/toolchain-funcs.eclass.5 +++ /dev/null @@ -1,112 +0,0 @@ -.TH "TOOLCHAIN-FUNCS.ECLASS" "5" "Jun 2003" "Portage 2.0.51" "portage" -.SH "NAME" -toolchain-funcs.eclass \- functions to get commonly needed info about the -toolchain (binutils/gcc/glibc/etc...) -.SH "DESCRIPTION" -The \fBtoolchain-funcs\fR eclass contains a suite of functions that are -used to glean information about the toolchain that is used to compile. -This allows developers to worry about gcc specs rather than figuring -out how to find the specs in the first place. -.SH "TOOL FUNCTIONS" -.TP -.B tc-getAR -Returns the name of the binutils archiver. Usually 'ar'. -.TP -.B tc-getAS -Returns the name of the assembler. Usually 'as'. -.TP -.B tc-getBUILD_CC -Returns the name of the compiler for the build system. -Useful only when you have to compile and run a utility while -building the package. -.TP -.B tc-getCC -Returns the name of the C compiler binary. Usually 'gcc'. -.TP -.B tc-getCXX -Returns the name of the C++ compiler binary. Usually 'g++'. -.TP -.B tc-getF77 -Returns the name of the fortran compiler. -.TP -.B tc-getGCJ -Returns the name of the java compiler. Usually 'gcj'. -.TP -.B tc-getLD -Returns the name of the linker. Usually 'ld'. -.TP -.B tc-getNM -Returns the name of the symbol/object thingy. Usually 'nm'. -.TP -.B tc-getRANLIB -Returns the name of the archiver indexer. Usually 'ranlib'. -.SH "MISC FUNCTIONS" -.TP -\fBtc-arch\fR [\fITARGET\fR] -Echo the portage $ARCH that the current toolchain represents. -Basically this is a drop-in replacment for $ARCH usage. If no -\fITARGET\fR is specified, then CHOST will be used. -.TP -\fBtc-arch-kernel\fR [\fITARGET\fR] -Echo the kernel $ARCH that the current toolchain represents. If no -\fITARGET\fR is specified, then CHOST will be used. -.TP -\fBtc-endian\fR [\fITARGET\fR] -Echo 'little' or 'big' based upon what the current toolchain represents. -If no \fITARGET\fR is specified, then CHOST will be used. -.TP -\fBtc-export\fR <\fBlist of variables\fR> -Quickly export \fBlist of variables\fR to the environment. Much easier -than exporting each idividual variable at a time. - -For example: \fBtc-export\fR CC CXX AR RANLIB -.TP -.B tc-is-cross-compiler -Return shell true/false based upon whether the current building -setup is for a cross compiler. -.SH "VERSION FUNCTIONS" -.TP -.B gcc-fullversion -Returns the version as by `$CC -dumpversion`. -.br -GCC \fI2.95.3\fR will return \fI2.95.3\fR -.br -GCC \fI3.2.1\fR will return \fI3.2.1\fR -.TP -.B gcc-version -Returns the version, but only the <major>.<minor>. -.br -GCC \fI2.95\fR.3 will return \fI2.95\fR -.br -GCC \fI3.2\fR.1 will return \fI3.2\fR -.TP -.B gcc-major-version -Returns the Major version. -.br -GCC \fI2\fR.95.3 will return \fI2\fR -.br -GCC \fI3\fR.2.1 will return \fI3\fR -.TP -.B gcc-minor-version -Returns the Minor version. -.br -GCC 2.\fI95\fR.3 will return \fI95\fR -.br -GCC 3.\fI2\fR.1 will return \fI2\fR -.TP -.B gcc-micro-version -Returns the Micro version. -.br -GCC 2.95.\fI3\fR will return \fI3\fR -.br -GCC 3.2.\fI1\fR will return \fI1\fR -.SH "REPORTING BUGS" -Please report bugs via http://bugs.gentoo.org/ -.SH "SEE ALSO" -.BR ebuild (5) -.SH "FILES" -.BR /usr/portage/eclass/toolchain-funcs.eclass -.SH "AUTHORS" -Mike Frysinger <vapier@gentoo.org> -.SH "CVS HEADER" -$Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/man/toolchain-funcs.eclass.5,v 1.2 2005/02/10 01:37:36 vapier Exp $ diff --git a/man/versionator.eclass.5 b/man/versionator.eclass.5 deleted file mode 100644 index 7b75a24..0000000 --- a/man/versionator.eclass.5 +++ /dev/null @@ -1,53 +0,0 @@ -.TH VERSIONATOR.ECLASS 5 "Nov 2004" "Portage 2.0.51" portage -.SH NAME -versionator.eclass \- provides functions for easy manipulation of versions -.SH DESCRIPTION -The \fBversionator\fR eclass provides functions to ease manipulation of -software versions. The most common use of this eclass is for manipulation of -the \fB${PV}\fR variable (and saving the result in a variable such as -\fB${MY_PV}\fR). -.SH FUNCTIONS -\fBNOTE\fR: the following functions all operate on a version string (denoted -as \fIPV\fR in this manual page), which defaults to \fB${PV}\fR if omitted. -See the eclass for example version strings and their respective results. -.TP -.B get_all_version_components \fI< PV >\fR -Splits PV into its component parts. -.TP -.B get_version_components \fI< PV >\fR -Splits PV into its component parts, ignoring '.', '-', and '_'. -.TP -.B get_major_version \fI< PV >\fR -Retrieves major version from PV. -.TP -.B get_version_component_range \fI[ RANGE ] < PV >\fR -Retrieves a component or range of components, RANGE, from PV. RANGE may be -a single number for a particular component, a range such as 1-2 for a range -of components, or a range such as 2- for that component and everything after it. -.TP -.B get_after_major_version \fI< PV >\fR -Retrieves everything after the major version and its separator (if present). -.TP -.B replace_version_separator \fI[ N ] [ SEP ] < PV >\fR -Replaces the Nth separator of PV with separator, SEP. If N is a character -literal (eg. '-'), the first separator of this kind is replaced. -.TP -.B replace_all_version_separators \fI[ SEP ] < PV >\fR -Replaces all version separators in PV with separator, SEP. -.TP -.B delete_version_separator \fI[ N ] < PV >\fR -Deletes the Nth separator of PV. If N is a character literal (eg. '-'), the first -separator of this kind is deleted. -.TP -.B delete_all_version_separators \fI<PV>\fR -Deletes all version separators in PV. -.SH REPORTING BUGS -Please report bugs via http://bugs.gentoo.org/ -.SH SEE ALSO -.BR ebuild (5) -.SH FILES -.BR /usr/portage/eclass/versionator.eclass -.SH AUTHORS -Aaron Walker <ka0ttic@gentoo.org> -.SH CVS HEADER -$Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/man/versionator.eclass.5,v 1.2 2005/02/10 01:37:36 vapier Exp $ diff --git a/man/vim-plugin.eclass.5 b/man/vim-plugin.eclass.5 deleted file mode 100644 index 2f80258..0000000 --- a/man/vim-plugin.eclass.5 +++ /dev/null @@ -1,86 +0,0 @@ -.TH VIM-PLUGIN.ECLASS 5 "Dec 2004" "Portage 2.0.51" portage -.SH NAME -vim-plugin.eclass \- functions to ease installation of Vim plugins -.SH DESCRIPTION -The \fBvim-plugin\fR eclass provides functions meant to simplify the -installation of Vim plugins into a version-independent directory, -/usr/share/vim/vimfiles. -.SH VARIABLES -.TP -.B VIM_PLUGIN_HELPFILES -Defines a white-space delimited list of help files, used soley for informing -the user how to access them within Vim. -.TP -.B VIM_PLUGIN_HELPTEXT -Defines help text to display. Used only if \fBVIM_PLUGIN_HELPFILES\fR is unset. -.TP -.B VIM_PLUGIN_HELPURI -Defines a URI where on-line plugin documentation is available. This variable -is only used if \fBVIM_PLUGIN_HELPFILES\fR and \fBVIM_PLUGIN_HELPTEXT\fR are -unset. -.TP -.B VIM_PLUGIN_MESSAGES -Defines a white-space delimited list of settings that the Vim plugin makes use -of. Currently, only 'filetype' is supported; any other specified settings will -be ignored. -.SH FUNCTIONS -.TP -.B update_vim_afterscripts -Creates scripts in /usr/share/vim/vimfiles/after that are comprised of the -snippets located in /usr/share/vim/vimfiles/after/*/*.vim.d. In addition, -any stale scripts that were previously generated by this function are removed. -.TP -.B display_vim_plugin_help -Displays a message containing plugin help information. This function checks -the variables \fBVIM_PLUGIN_HELPFILES\fR, \fBVIM_PLUGIN_HELPTEXT\fR, and -\fBVIM_PLUGIN_HELPURI\fR (in that order) and displays the first one that is -defined. In addition, any setting-specific messages that correspond to -settings listed in \fBVIM_PLUGIN_MESSAGES\fR will be displayed. -.TP -.B vim-plugin_src_install -Default src_install. Installs plugin documentation prior to installing the -entire contents of \fB${S}\fR to /usr/share/vim/vimfiles. -.TP -.B vim-plugin_pkg_postinst -Default pkg_postinst that updates Vim helptags (see \fBupdate_vim_helptags\fR -in vim-doc.eclass), updates after scripts, and calls \fBdisplay_vim_plugin_help\fR. -.TP -.B vim-plugin_pkg_postrm -Default pkg_postrm that updates Vim helptags (see \fBupdate_vim_helptags\fR -in vim-doc.eclass), updates after scripts, and removes any empty directories -in /usr/share/vim/vimfiles. -.SH PACKAGING -In general, tarballs for plugins cannot be used directly because of vim.org's -idiosyncratic download system. Instead, a Gentoo-specific tarball must be made -with the following format for contents: - -.nf - packagename-version/ - packagename-version/doc/ - packagename-version/doc/whatever.txt - packagename-version/plugin/ - packagename-version/plugin/whatever.vim - packagename-version/syntax/ - packagename-version/syntax/whatever.vim -.fi -.SH PACKAGE NAMING CONVENTIONS -Where possible, the upstream script name should be used as the package name. -For packages which provide syntax or filetype files, the name should be suffixed -with "-syntax" (for example, "app-vim/gentoo-syntax", "app-vim/fluxbox-syntax", -"app-vim/selinux-syntax"). -.SH PACKAGE VARIABLE CONVENTIONS -The canonical form for the HOMEPAGE variable for vim.org scripts is -http://www.vim.org/scripts/script.php?script_id=123. -.SH REPORTING BUGS -Please report bugs via http://bugs.gentoo.org/ -.SH SEE ALSO -.BR ebuild (5) -.SH FILES -.nf -.B /usr/portage/eclass/vim-plugin.eclass -.B /usr/portage/eclass/vim-doc.eclass -.fi -.SH AUTHORS -Aaron Walker <ka0ttic@gentoo.org> -.SH CVS HEADER -$Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/man/vim-plugin.eclass.5,v 1.2 2005/02/10 01:37:36 vapier Exp $ diff --git a/man/vim.eclass.5 b/man/vim.eclass.5 deleted file mode 100644 index 3e4d143..0000000 --- a/man/vim.eclass.5 +++ /dev/null @@ -1,56 +0,0 @@ -.TH "VIM.ECLASS" "5" "Jun 2003" "Portage 2.0.51" "portage" -.SH "NAME" -vim.eclass \- common build routines for vim-core, vim and gvim -.SH "DESCRIPTION" -The \fBvim\fR eclass contains a suite of functions that are used to -build \fBvim-core\fR, \fBvim\fR and \fBgvim\fR. The vim-core ebuild -contains the common files installed in /usr/share/vim, /usr/share/doc -and /etc/vim, as well as the binaries xxd and vimtutor. The vim -ebuild contains the terminal-based version of vim. The gvim ebuild -contains the graphical version of vim. All three of these are built -from common source, common patches and using mostly-common configure -options. -.P -There are no functions to define in an ebuild using \fBvim.eclass\fR -because the eclass does all the unpacking, compilation and -installation. -.SH "VARIABLES" -.TP -.B VIM_VERSION = \fI"version string"\fR -This variable is important because the ebuild version (for example -6.2_pre5) corresponds to a vim version (for example 6.2e) but there is -no way to make that jump without help from the ebuild author. -Historically there was a method in the vim.eclass to calculate the vim -version from the ebuild version, but that meant that the ebuild author -had to make sure the ebuild was correctly versioned each time. To -avoid that headache, it became easier to simply specify -\fBVIM_VERSION\fR in the ebuild itself. -.TP -.B VIM_GENTOO_PATCHES = \fI"filename"\fR -The filename of the Gentoo patches to apply. It's not always -necessary to update the Gentoo patches for a new version of vim, -so this variable separates the ebuild and vim versions from the patch -tarball version. Take a look at -\fBvim-6.2.011-gentoo-patches.tar.bz2\fR -for an example of the patch directory layout. -.TP -.B VIM_ORG_PATCHES = \fI"filename"\fR -The filename of the vim patches to apply. This is a tarball of -patches from \fBftp://ftp.vim.org/pub/vim/patches/\fR which apply to -the current version. See \fBvim-6.2.011-patches.tar.bz2\fR for an -example of the vim.org patch tarballs. -.SH "REPORTING BUGS" -Please report bugs via http://bugs.gentoo.org/ -.SH "SEE ALSO" -.BR ebuild (5) -.BR vim (1) -.SH "FILES" -.BR /usr/portage/eclass/vim.eclass -.SH "AUTHORS" -Aron Griffis <agriffis@gentoo.org> -.br -Ryan Phillips <rphillips@gentoo.org> -.br -Seemant Kulleen <seemant@gentoo.org> -.SH "CVS HEADER" -$Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/man/vim.eclass.5,v 1.4 2005/02/10 01:37:36 vapier Exp $ diff --git a/missing b/missing deleted file mode 100755 index e7ef83a..0000000 --- a/missing +++ /dev/null @@ -1,360 +0,0 @@ -#! /bin/sh -# Common stub for a few missing GNU programs while installing. - -scriptversion=2003-09-02.23 - -# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003 -# Free Software Foundation, Inc. -# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -if test $# -eq 0; then - echo 1>&2 "Try \`$0 --help' for more information" - exit 1 -fi - -run=: - -# In the cases where this matters, `missing' is being run in the -# srcdir already. -if test -f configure.ac; then - configure_ac=configure.ac -else - configure_ac=configure.in -fi - -msg="missing on your system" - -case "$1" in ---run) - # Try to run requested program, and just exit if it succeeds. - run= - shift - "$@" && exit 0 - # Exit code 63 means version mismatch. This often happens - # when the user try to use an ancient version of a tool on - # a file that requires a minimum version. In this case we - # we should proceed has if the program had been absent, or - # if --run hadn't been passed. - if test $? = 63; then - run=: - msg="probably too old" - fi - ;; -esac - -# If it does not exist, or fails to run (possibly an outdated version), -# try to emulate it. -case "$1" in - - -h|--h|--he|--hel|--help) - echo "\ -$0 [OPTION]... PROGRAM [ARGUMENT]... - -Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an -error status if there is no known handling for PROGRAM. - -Options: - -h, --help display this help and exit - -v, --version output version information and exit - --run try to run the given command, and emulate it if it fails - -Supported PROGRAM values: - aclocal touch file \`aclocal.m4' - autoconf touch file \`configure' - autoheader touch file \`config.h.in' - automake touch all \`Makefile.in' files - bison create \`y.tab.[ch]', if possible, from existing .[ch] - flex create \`lex.yy.c', if possible, from existing .c - help2man touch the output file - lex create \`lex.yy.c', if possible, from existing .c - makeinfo touch the output file - tar try tar, gnutar, gtar, then tar without non-portable flags - yacc create \`y.tab.[ch]', if possible, from existing .[ch] - -Send bug reports to <bug-automake@gnu.org>." - ;; - - -v|--v|--ve|--ver|--vers|--versi|--versio|--version) - echo "missing $scriptversion (GNU Automake)" - ;; - - -*) - echo 1>&2 "$0: Unknown \`$1' option" - echo 1>&2 "Try \`$0 --help' for more information" - exit 1 - ;; - - aclocal*) - if test -z "$run" && ($1 --version) > /dev/null 2>&1; then - # We have it, but it failed. - exit 1 - fi - - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`acinclude.m4' or \`${configure_ac}'. You might want - to install the \`Automake' and \`Perl' packages. Grab them from - any GNU archive site." - touch aclocal.m4 - ;; - - autoconf) - if test -z "$run" && ($1 --version) > /dev/null 2>&1; then - # We have it, but it failed. - exit 1 - fi - - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`${configure_ac}'. You might want to install the - \`Autoconf' and \`GNU m4' packages. Grab them from any GNU - archive site." - touch configure - ;; - - autoheader) - if test -z "$run" && ($1 --version) > /dev/null 2>&1; then - # We have it, but it failed. - exit 1 - fi - - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`acconfig.h' or \`${configure_ac}'. You might want - to install the \`Autoconf' and \`GNU m4' packages. Grab them - from any GNU archive site." - files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` - test -z "$files" && files="config.h" - touch_files= - for f in $files; do - case "$f" in - *:*) touch_files="$touch_files "`echo "$f" | - sed -e 's/^[^:]*://' -e 's/:.*//'`;; - *) touch_files="$touch_files $f.in";; - esac - done - touch $touch_files - ;; - - automake*) - if test -z "$run" && ($1 --version) > /dev/null 2>&1; then - # We have it, but it failed. - exit 1 - fi - - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. - You might want to install the \`Automake' and \`Perl' packages. - Grab them from any GNU archive site." - find . -type f -name Makefile.am -print | - sed 's/\.am$/.in/' | - while read f; do touch "$f"; done - ;; - - autom4te) - if test -z "$run" && ($1 --version) > /dev/null 2>&1; then - # We have it, but it failed. - exit 1 - fi - - echo 1>&2 "\ -WARNING: \`$1' is needed, but is $msg. - You might have modified some files without having the - proper tools for further handling them. - You can get \`$1' as part of \`Autoconf' from any GNU - archive site." - - file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` - test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` - if test -f "$file"; then - touch $file - else - test -z "$file" || exec >$file - echo "#! /bin/sh" - echo "# Created by GNU Automake missing as a replacement of" - echo "# $ $@" - echo "exit 0" - chmod +x $file - exit 1 - fi - ;; - - bison|yacc) - echo 1>&2 "\ -WARNING: \`$1' $msg. You should only need it if - you modified a \`.y' file. You may need the \`Bison' package - in order for those modifications to take effect. You can get - \`Bison' from any GNU archive site." - rm -f y.tab.c y.tab.h - if [ $# -ne 1 ]; then - eval LASTARG="\${$#}" - case "$LASTARG" in - *.y) - SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` - if [ -f "$SRCFILE" ]; then - cp "$SRCFILE" y.tab.c - fi - SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` - if [ -f "$SRCFILE" ]; then - cp "$SRCFILE" y.tab.h - fi - ;; - esac - fi - if [ ! -f y.tab.h ]; then - echo >y.tab.h - fi - if [ ! -f y.tab.c ]; then - echo 'main() { return 0; }' >y.tab.c - fi - ;; - - lex|flex) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified a \`.l' file. You may need the \`Flex' package - in order for those modifications to take effect. You can get - \`Flex' from any GNU archive site." - rm -f lex.yy.c - if [ $# -ne 1 ]; then - eval LASTARG="\${$#}" - case "$LASTARG" in - *.l) - SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` - if [ -f "$SRCFILE" ]; then - cp "$SRCFILE" lex.yy.c - fi - ;; - esac - fi - if [ ! -f lex.yy.c ]; then - echo 'main() { return 0; }' >lex.yy.c - fi - ;; - - help2man) - if test -z "$run" && ($1 --version) > /dev/null 2>&1; then - # We have it, but it failed. - exit 1 - fi - - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified a dependency of a manual page. You may need the - \`Help2man' package in order for those modifications to take - effect. You can get \`Help2man' from any GNU archive site." - - file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` - if test -z "$file"; then - file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` - fi - if [ -f "$file" ]; then - touch $file - else - test -z "$file" || exec >$file - echo ".ab help2man is required to generate this page" - exit 1 - fi - ;; - - makeinfo) - if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then - # We have makeinfo, but it failed. - exit 1 - fi - - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified a \`.texi' or \`.texinfo' file, or any other file - indirectly affecting the aspect of the manual. The spurious - call might also be the consequence of using a buggy \`make' (AIX, - DU, IRIX). You might want to install the \`Texinfo' package or - the \`GNU make' package. Grab either from any GNU archive site." - file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` - if test -z "$file"; then - file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` - file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` - fi - touch $file - ;; - - tar) - shift - if test -n "$run"; then - echo 1>&2 "ERROR: \`tar' requires --run" - exit 1 - fi - - # We have already tried tar in the generic part. - # Look for gnutar/gtar before invocation to avoid ugly error - # messages. - if (gnutar --version > /dev/null 2>&1); then - gnutar "$@" && exit 0 - fi - if (gtar --version > /dev/null 2>&1); then - gtar "$@" && exit 0 - fi - firstarg="$1" - if shift; then - case "$firstarg" in - *o*) - firstarg=`echo "$firstarg" | sed s/o//` - tar "$firstarg" "$@" && exit 0 - ;; - esac - case "$firstarg" in - *h*) - firstarg=`echo "$firstarg" | sed s/h//` - tar "$firstarg" "$@" && exit 0 - ;; - esac - fi - - echo 1>&2 "\ -WARNING: I can't seem to be able to run \`tar' with the given arguments. - You may want to install GNU tar or Free paxutils, or check the - command line arguments." - exit 1 - ;; - - *) - echo 1>&2 "\ -WARNING: \`$1' is needed, and is $msg. - You might have modified some files without having the - proper tools for further handling them. Check the \`README' file, - it often tells you about the needed prerequisites for installing - this package. You may also peek at any GNU archive site, in case - some other package would contain this missing \`$1' program." - exit 1 - ;; -esac - -exit 0 - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-end: "$" -# End: diff --git a/mkinstalldirs b/mkinstalldirs deleted file mode 100755 index 6fbe5e1..0000000 --- a/mkinstalldirs +++ /dev/null @@ -1,150 +0,0 @@ -#! /bin/sh -# mkinstalldirs --- make directory hierarchy - -scriptversion=2004-02-15.20 - -# Original author: Noah Friedman <friedman@prep.ai.mit.edu> -# Created: 1993-05-16 -# Public domain. -# -# This file is maintained in Automake, please report -# bugs to <bug-automake@gnu.org> or send patches to -# <automake-patches@gnu.org>. - -errstatus=0 -dirmode="" - -usage="\ -Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ... - -Create each directory DIR (with mode MODE, if specified), including all -leading file name components. - -Report bugs to <bug-automake@gnu.org>." - -# process command line arguments -while test $# -gt 0 ; do - case $1 in - -h | --help | --h*) # -h for help - echo "$usage" - exit 0 - ;; - -m) # -m PERM arg - shift - test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } - dirmode=$1 - shift - ;; - --version) - echo "$0 $scriptversion" - exit 0 - ;; - --) # stop option processing - shift - break - ;; - -*) # unknown option - echo "$usage" 1>&2 - exit 1 - ;; - *) # first non-opt arg - break - ;; - esac -done - -for file -do - if test -d "$file"; then - shift - else - break - fi -done - -case $# in - 0) exit 0 ;; -esac - -# Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and -# mkdir -p a/c at the same time, both will detect that a is missing, -# one will create a, then the other will try to create a and die with -# a "File exists" error. This is a problem when calling mkinstalldirs -# from a parallel make. We use --version in the probe to restrict -# ourselves to GNU mkdir, which is thread-safe. -case $dirmode in - '') - if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then - echo "mkdir -p -- $*" - exec mkdir -p -- "$@" - else - # On NextStep and OpenStep, the `mkdir' command does not - # recognize any option. It will interpret all options as - # directories to create, and then abort because `.' already - # exists. - test -d ./-p && rmdir ./-p - test -d ./--version && rmdir ./--version - fi - ;; - *) - if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 && - test ! -d ./--version; then - echo "mkdir -m $dirmode -p -- $*" - exec mkdir -m "$dirmode" -p -- "$@" - else - # Clean up after NextStep and OpenStep mkdir. - for d in ./-m ./-p ./--version "./$dirmode"; - do - test -d $d && rmdir $d - done - fi - ;; -esac - -for file -do - set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` - shift - - pathcomp= - for d - do - pathcomp="$pathcomp$d" - case $pathcomp in - -*) pathcomp=./$pathcomp ;; - esac - - if test ! -d "$pathcomp"; then - echo "mkdir $pathcomp" - - mkdir "$pathcomp" || lasterr=$? - - if test ! -d "$pathcomp"; then - errstatus=$lasterr - else - if test ! -z "$dirmode"; then - echo "chmod $dirmode $pathcomp" - lasterr="" - chmod "$dirmode" "$pathcomp" || lasterr=$? - - if test ! -z "$lasterr"; then - errstatus=$lasterr - fi - fi - fi - fi - - pathcomp="$pathcomp/" - done -done - -exit $errstatus - -# Local Variables: -# mode: shell-script -# sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-end: "$" -# End: diff --git a/portage.txt b/portage.txt deleted file mode 100644 index 39ea8cd..0000000 --- a/portage.txt +++ /dev/null @@ -1,296 +0,0 @@ ------------------------------- -My poor Portage deconstruction ------------------------------- - -Here's what I have so far in my "walk" through the Portage code (specifically, -portage HEAD sometime around Feb. 2005). Right now I've enumerated ebuild_, -the effects of `importing portage`_, emerge_, the Portage -`portage.doebuild()`_ function, and the `ebuild.sh`_ script. - -ebuild ------- - -The ebuild script is a simple interface to portage.py. It's a rather simple -python script: - - * Import needed modules - * Add ``/usr/lib/portage/pym`` to the python path so that portage can be - found. - * Define the ``getroot()`` function to ensure that ``ROOT`` is set correctly. - * Set the ``PORTAGE_CALLER`` environment variable to ``ebuild``. - * Parse options using getopt: - * Look for ``--debug``, set ``debug=1`` if found - * Look for ``merge``, add ``-noauto`` to ``FEATURES`` if found. - * Import portage (and doing all of the setup that entails). - - -:: - - Example: ebuild --debug /path/to/foo.ebuild fetch unpack - - -Script loops over arguments after the ebuild name: - - store (clone) portage.config to be passed to doebuild - - Set ``cleanup=1`` if running either ``clean`` or ``config`` - - execute ``a=portage.doebuild(ebuild name, argument, ROOT, config, debug=debug,cleanup=cleanup)`` - - fail (exit) if ``a`` exists (or user interrupt or I/O error) - -importing portage ------------------ - -Quite a few things happen when portage is imported. Most of portage.py -goes about defining a boatload of classes and functions, but there's -also a fair amount of information that is assembled and made available -by the import process. Here's a (probably incomplete) list of those -items: - - * Define constants: portage version number, a list of variables that - are "incremental" (USE, FEATURES, etc.), and a list of variables that - are "sticky" (KEYWORDS_ACCEPT, USE, ...). - * Import a lot of python modules that will be used by portage. Core - python modules are imported first, followed by various portage modules. - Along the way, ``catpkgsplit``, ``pkgsplit``, and ``pkgcmp`` from - ``portage_versions`` are added to the portage namespace. - * Establish a signal handler to catch SIGCHLD, SIG_DFL, SIGINT, and - SIGTERM. - * Define a *lot* of functions and classes. - - * Define the "VDB" path (traditionally ``/var/db/pkg``) - * Identify ostype from uname, set some os-related defaults, - export USERLAND to the environment - * Check to make sure user is in the portage group (or root) - * List of "incrementals" and "stickies" keys - * List possible ebuild version suffixes ("pre", "alpha", ...) - * List ebuild keys ("DEPEND", "LICENSE", ...) - * Check environment for ROOT, use "/" if not found - * Create tmp and var/tmp directories (below ROOT) - * Set 022 umask - * Check to see if the current profile is deprecated - * Set some global settings (PID, bash env, cache dir) - * Read use.defaults and set variables appropriately - * Get OVERLAY - * Lock global settings - * Check for selinux - * Set up some cachedir stuff - * mtime db stuff??? - * Get FEATURES - * Set up porttree and bintree dbs - * Get thirdpartymirrors - * Perform PORTAGE_CACHEDIR and PORTAGE_TMPDIR sanity checks - * Get category list from file - * Get package.mask, /etc/portage/package.* - * Get packages file - * Get unmask list, mask list, "revmask"? - * Get ACCEPT_KEYWORDS - * Check that /etc/make.profile is a symlink - * Check for prelink - -emerge ------- - -This script is much more complicated than the ebuild script (portage.py -is just a bit more than 2x as many lines as this script). - - * Set environment variable ``PORTAGE_CALLER="emerge"`` - * Import portage <-- portage.settings and other vars now exposed - * Check if output should be colored (if not, call ``nocolor()`` ). - * Check portage.settings for ``PORTAGE_NICENESS``; if so, nice portage - * Freeze portdb api (don't know what this does just yet) - * Turn off "noauto" if set in ``FEATURES`` - * Set # of merged ebuilds = 0 - * Set up lists of valid emerge parameters (params), - actions, and options (all hard-coded lists); also - map short-form of options to long-form versions. - * Process command line (ugly!) - - process short-form to convert to long-form - - Process long-form arguments - - Create list of options (myopts), actions (myactions), & files (myfiles) - - minor fixes ( ``-U`` implies ``-u``, etcetera) - - handle ``--noconfmem`` and ``--debug`` flags - * Define log, exit, countdown, signal handling, help, and "emerge info" - helper functions. - * Check permissions; exit if invalid. - * Start logging (unless ``--pretend`` was set) - * Decide what type of dependencies to use - (self, selective, recurse, deep, or empty) - * Define spinner func - * Define the search class - * Build package digraph - - Define getlist function for world or system - - Define genericdict function - - Define depgraph class (huge) - * Define unmerge function - * Define post_emerge function (finish logging, handle info stuff, - config protection) - * If --debug set, edebug=1 (not sure why two different debug flags set) - * Handle ``emerge sync`` (big if, elif, else construction) - * Handle ``emerge regen`` - * Handle ``emerge config`` - * Handle ``emerge info`` - * Handle ``emerge search`` - * Handle ``emerge inject`` - * Handle ``emerge unmerge``, ``emerge prune``, and ``emerge clean`` - - Call ``unmerge(myaction, myfiles)`` - * Handle ``emerge depclean`` - * Else: Handle update, system, or just process files - - Do some setup stuff if ``--pretend`` set - - If ``--resume`` and portage.mtimedb has a "resume" key, then update opts, create a "resume" depgraph - - Else, create depgraph, error out if something is wrong - - If ``--pretend``, show depgraph - - Else - + If ``--buildpkgonly``, check that deps are satisfied - + If --resume, do merge using ``mydepgraph.merge(portage.mtimedb["resume"]["mergelist"])`` - + Else, handle ``--digest`` or perform merge, the latter with ``mydepgraph.merge(mydepgraph.altlist())`` - - Run autoclean - - Run ``post_emerge()`` - -portage.doebuild() ------------------- - -Much of what happens during the actual merge of a package happens -in portage's doebuild function. The interface is:: - - doebuild(myebuild, mydo, myroot, debug=0, listonly=0, fetchonly=0) - -where ``myebuild`` is the path to the ebuild to be merged, -``mydo`` is the action to be performed (one of the commands that -follows ``ebuild foo.ebuild ...``), and ``debug``, ``listonly``, -and ``fetchonly`` are flags that can be true (1) or false (0). - -Here's what happens: - - * Check to make sure the input is valid - * Set a boatload of keys in the ``settings`` instance of the config class - - PORTAGE_DEBUG, ROOT, STARTDIR, EBUILD, O, CATEGORY, FILESDIR, - PF, ECLASSDIR, SANDBOX_LOG, P, PN, PV, PR, PVR, SLOT, BUILD_PREFIX, - PKG_TMPDIR, PORTAGE_BUILDDIR, KV, KVERS - * If the action is ``depend``, then return dependency info (eclasses?). - If ``--debug`` was also set, then the deps are printed on the cmd line. - * If necessary (meaning not ``fetch``, ``digest``, or ``manifest``), - create the build directory (``/var/tmp/portage/whatever``) and the - temp directory (and add T to ``settings``). Also create a ccache - directory, if necessary, along with WORKDIR and D. - * If ``unmerge``, call ``unmerge()`` and return. - * Setup logging if requested - * If ``help``, ``clean``, ``setup``, ``prerm``, ``postrm``, ``preinst``, - ``postinst``, or ``config``, then pass the action to ``ebuild.sh`` - (using "``ebuild.sh mydo,debug,free=1``") and return. - * Generate A from SRC_URI - * Ensure that DISTDIR exists; change permissions for ${DISTDIR}/cvs-src - if necessary. - * Run fetch(); return error on failure. - * Generate digest if ``digest`` in FEATURES or called explicitly (return - in the latter case). - * If ``manifest`` then generate manifest and return. - * Check manifest and die on failure if ``strict`` in FEATURES - * If ``fetch``, return (since already done above, and it must have worked - if we're here) - * Set up an "``actionmap``" of dependencies (i.e., ``unpack`` requires - ``dep`` and ``setup``). - * If ``package``, ensure that PKGDIR is created, call - ``spawnebuild`` with the current action and the actionmap, and return. - * If ``qmerge``, call merge w/o checking for dependencies, and return. - * If ``merge``, call ``spawnebuild`` with "``install``" and the - ``actionmap``, and then call ``merge`` and return. - * Else, die because the action didn't match any of the above. Oops! - -ebuild.sh ---------- - -The ``ebuild.sh`` bash script predominantly gets called by the -``portage.doebuild`` function to handle the bash functions in an -ebuild. Following the bouncing ball.... - -The first block of code is initialization stuff: - - * If not ``depend`` or ``clean``, then - - clean the "successful" file from ${T} if it exists - - Set up logging if desired (including punching a hole in - sandbox for the log file) - - If ${T}/environment exists, source it - * unalias everything - * Set "expand_aliases" and set up ``die`` and ``assert`` aliaes - * Source ``/etc/profile`` on GNU userland systems - * Export proper CC and CXX variables. - * Set up the a hardcoded PATH, tack ${ROOTPATH} to the end of it, - and add ${PREROOTPATH} to the beginning of the PATH if it exists. - * Source helper functions files (``functions.sh`` and - ``extra_functions.sh``). - -Then a great number of functions are defined: - - * Define a do-nothing ``esyslog()`` override function. - * Define a variety of USE flag functions: - ``use``, ``has``, ``has_version``, ``best_version``, - ``use_with``, and ``use_enable`` functions. - * Define ``diefunc`` function. - * Set umask and a number of installation defaults. - * Define ``check_KV`` function. - * Define the ``keepdir`` function to put ".keep" files in directories - that portage should not automatically remove if empty. - * Define a series of sandbox helper functions. - * Define the ``unpack`` function. - * Define the ``econf`` convenience function. Notice that ``econf`` - automatically dies on error(s). - * Define the ``einstall`` convenience function. - * Define ``pkg_setup`` as a placebo function to be overridden. - * Define ``pkg_nofetch``. - * Define minimal, but functional, ``src_unpack`` and ``src_compile`` - functions. - * Define ``src_install``, ``pkg_preinst``, ``pkg_postinst``, - ``pkg_prerm``, and ``pkg_postrm`` skeleton functions that, when - needed, should be overridden. - * Define the deprecated ``try`` function. - * Define the ``gen_wrapper`` function to generate ``lib/cpp`` and - ``/usr/bin/cc`` wrappers. - * Define some of the ``dyn-*`` functions: ``dyn_setup``, ``dyn_unpack``, - ``dyn_clean``. - * Define some ``install`` helper functions: ``into``, ``insinto``, - ``exeinto``, ``docinto``, ``insopts``, ``diropts``, ``exeopts``, - and ``libopts``. Note that a number of additional helper - functions, such as the ``do*`` functions, are actual executable - scripts in ``/usr/lib/portage/bin``. - * Define a number of abort handler functions: ``abort_handler``, - ``abort_compile``, ``abort_unpack``, ``abort_package``, and - ``abort_install``. - * Define the rest of the ``dyn_*`` functions: ``dyn_compile``, - ``dyn_package``, ``dyn_install``, ``dyn_spec``, ``dyn_rpm``, - and ``dyn_help``. - * Define some eclass debugging functions: ``debug-print``, - ``debug-print-function``, and ``debug-print-section``. - * Define the eclass ``inherit`` function. - * Define some eclass helper functions: ``EXPORT_FUNCTIONS``, - ``newdepend``, ``newrdepend``, ``newcdepend``, ``newpdepend``, - and ``do_newdepend``. - -Finally, the main part of the script is reached: - - * If not ``depend`` or ``clean``, then - - cd into the ``/var/tmp/portage/whatever`` directory - - export USER=portage if the effective user ID is "portage" - - Set up distcc and ccache PATHs, environment variables, and - sandbox holes - * Turn on sandbox flag - * Set the S default and unset a handful of variables - * Source the ebuild - * Set the S default if S not defined in the ebuild. (redundant?) - * Set TMP and TMPDIR to be ${T} (otherwise sandbox might error out) - * Set RDEPEND is not set, set it to be DEPEND. - * Add eclass deps to {R,C,P,}DEPEND. - * Loop over arguments passed to ``ebuild.sh``, using a big case statement - - ``nofetch`` -- call ``pkg_nofetch`` - - ``prerm``, ``postrm``, ``preinst``, ``postinst``, ``config`` -- - turn off sandbox, handle debugging, and call the eponymous - ``pkg_*`` function. - - ``unpack``, ``compile``, ``clean``, ``install`` -- handle sandbox - and debugging, then call the eponymous ``dyn_*`` function. - - ``help``, ``clean``, ``setup`` -- Turn off sandbox, handle - debugging, and call the appropriate ``dyn_*`` function. - - ``package``, ``rpm`` -- Turn off sandbox, handle debugging, - and call the eponymous ``dyn_*`` function. - - ``depend`` -- Turn off sandbox and write dependency info - to ``/var/edb/cache/dep/CATEGORY/PF``. - - Else, error that the command wasn't valid. - * If ``clean``, clean that package's temp directory - * Finish by touching "successful" in the package's temp directory. - diff --git a/portage/__init__.py b/portage/__init__.py deleted file mode 100644 index e69de29..0000000 --- a/portage/__init__.py +++ /dev/null diff --git a/portage/binpkg/__init__.py b/portage/binpkg/__init__.py deleted file mode 100644 index e69de29..0000000 --- a/portage/binpkg/__init__.py +++ /dev/null diff --git a/portage/binpkg/repository.py b/portage/binpkg/repository.py deleted file mode 100644 index 6e521e4..0000000 --- a/portage/binpkg/repository.py +++ /dev/null @@ -1,76 +0,0 @@ -# Copyright: 2005 Gentoo Foundation -# Author(s): Brian Harring (ferringb@gentoo.org) -# License: GPL2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/portage/binpkg/repository.py,v 1.2 2005/07/13 05:51:35 ferringb Exp $ - - -#yoink when fixed -raise Exception("sorry bub, doesn't work atm do to changes in portage namespace. plsfix kthnx") - -import os,stat -import prototype, errors - -#needed to grab the PN -import portage_versions - -class tree(prototype.PrototypeTree): - def __init__(self, base): - super(tree,self).__init__() - self.base = base - try: - st = os.lstat(self.base) - if not stat.S_ISDIR(st.st_mode): - raise errors.InitializationError("base not a dir: %s" % self.base) - elif not st.st_mode & (os.X_OK|os.R_OK): - raise errors.InitializationError("base lacks read/executable: %s" % self.base) - - except OSError: - raise errors.InitializationError("lstat failed on base %s" % self.base) - - - def _get_categories(self, *optionalCategory): - # return if optionalCategory is passed... cause it's not yet supported - if len(optionalCategory): - return {} - - try: return tuple([x for x in os.listdir(self.base) \ - if stat.S_ISDIR(os.lstat(os.path.join(self.base,x)).st_mode) and x != "All"]) - - except (OSError, IOError), e: - raise KeyError("failed fetching categories: %s" % str(e)) - - def _get_packages(self, category): - cpath = os.path.join(self.base,category.lstrip(os.path.sep)) - #-5 == len(".tbz2") - l=[] - try: - for x in os.listdir(cpath): - if x.endswith(".tbz2"): - l.append(portage_versions.pkgsplit(x[:-5])[0]) - return tuple(l) - - except (OSError, IOError), e: - raise KeyError("failed fetching packages for category %s: %s" % \ - (os.path.join(self.base,category.lstrip(os.path.sep)), str(e))) - - def _get_versions(self, catpkg): - pkg = catpkg.split("/")[-1] - l=[] - try: - for x in os.listdir(os.path.join(self.base, os.path.dirname(catpkg.lstrip("/").rstrip("/")))): - if x.startswith(pkg): - ver=portage_versions.pkgsplit(x[:-5]) - - #pkgsplit returns -r0, when it's not always there - if ver[2] == "r0": - if x.endswith(ver[2]+".tbz2"): - l.append("%s-%s" % (ver[1], ver[2])) - else: - l.append(ver[1]) - else: - l.append("%s-%s" % (ver[1], ver[2])) - return tuple(l) - except (OSError, IOError), e: - raise KeyError("failed fetching packages for package %s: %s" % \ - (os.path.join(self.base,catpkg.lstrip(os.path.sep)), str(e))) - diff --git a/portage/cache/__init__.py b/portage/cache/__init__.py deleted file mode 100644 index 07478af..0000000 --- a/portage/cache/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -# Copyright: 2005 Gentoo Foundation -# Author(s): Brian Harring (ferringb@gentoo.org) -# License: GPL2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/portage/cache/__init__.py,v 1.2 2005/07/13 05:51:35 ferringb Exp $ - diff --git a/portage/cache/anydbm.py b/portage/cache/anydbm.py deleted file mode 100644 index c3ff03d..0000000 --- a/portage/cache/anydbm.py +++ /dev/null @@ -1,69 +0,0 @@ -# Copyright: 2005 Gentoo Foundation -# Author(s): Brian Harring (ferringb@gentoo.org) -# License: GPL2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/portage/cache/anydbm.py,v 1.2 2005/07/13 05:51:35 ferringb Exp $ - -anydbm_module = __import__("anydbm") -import cPickle, os -import fs_template -import cache_errors - - -class database(fs_template.FsBased): - - autocommits = True - - def __init__(self, *args, **config): - super(database,self).__init__(*args, **config) - - default_db = config.get("dbtype","anydbm") - if not default_db.startswith("."): - default_db = '.' + default_db - - self._db_path = os.path.join(self.location, fs_template.gen_label(self.location, self.label)+default_db) - print "opening self._db_path=",self._db_path - self.__db = None - try: - self.__db = anydbm_module.open(self._db_path, "w", self._perms) - try: - self._ensure_dirs() - self._ensure_dirs(self._db_path) - self._ensure_access(self._db_path) - - except (OSError, IOError), e: - raise cache_errors.InitializationError(self.__clas__, e) - # try again if failed - if self.__db == None: - self.__db = anydbm_module.open(self._db_path, "c", self._perms) - - - except anydbm_module.error, e: - # XXX handle this at some point - raise - - - def __getitem__(self, cpv): - # we override getitem because it's just a cpickling of the data handed in. - return cPickle.loads(self.__db[cpv]) - - - def _setitem(self, cpv, values): - self.__db[cpv] = cPickle.dumps(values,cPickle.HIGHEST_PROTOCOL) - - def _delitem(self, cpv): - del self.__db[cpv] - - - def iterkeys(self): - return iter(self.__db) - - - def has_key(self, cpv): - return cpv in self.__db - - def commit(self): pass - - def __del__(self): - print "keys=",self.__db.keys() - self.__db.sync() - self.__db.close() diff --git a/portage/cache/cache_errors.py b/portage/cache/cache_errors.py deleted file mode 100644 index 4f8976a..0000000 --- a/portage/cache/cache_errors.py +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright: 2005 Gentoo Foundation -# Author(s): Brian Harring (ferringb@gentoo.org) -# License: GPL2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/portage/cache/cache_errors.py,v 1.2 2005/07/13 05:51:35 ferringb Exp $ - -class CacheError(Exception): pass - -class InitializationError(CacheError): - def __init__(self, class_name, error): - self.error, self.class_name = error, class_name - def __str__(self): - return "Creation of instance %s failed due to %s" % \ - (self.class_name, str(self.error)) - - -class CacheCorruption(CacheError): - def __init__(self, key, ex): - self.key, self.ex = key, ex - def __str__(self): - return "%s is corrupt: %s" % (self.key, str(self.ex)) - - -class GeneralCacheCorruption(CacheError): - def __init__(self,ex): self.ex = ex - def __str__(self): return "corruption detected: %s" % str(self.ex) - - -class InvalidRestriction(CacheError): - def __init__(self, key, restriction, exception=None): - if exception == None: exception = '' - self.key, self.restriction, self.ex = key, restriction, ex - def __str__(self): - return "%s:%s is not valid: %s" % \ - (self.key, self.restriction, str(self.ex)) - - -class ReadOnlyRestriction(CacheError): - def __init__(self, info=''): - self.info = info - def __str__(self): - return "cache is non-modifiable"+str(self.info) diff --git a/portage/cache/flat_list.py b/portage/cache/flat_list.py deleted file mode 100644 index d9b23a8..0000000 --- a/portage/cache/flat_list.py +++ /dev/null @@ -1,114 +0,0 @@ -# Copyright: 2005 Gentoo Foundation -# Author(s): Brian Harring (ferringb@gentoo.org) -# License: GPL2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/portage/cache/flat_list.py,v 1.2 2005/07/13 05:51:35 ferringb Exp $ - -import fs_template -import cache_errors -import os, stat - -# store the current key order *here*. -class database(fs_template.FsBased): - - autocommits = True - - # do not screw with this ordering. _eclasses_ needs to be last - auxdbkey_order=('DEPEND', 'RDEPEND', 'SLOT', 'SRC_URI', - 'RESTRICT', 'HOMEPAGE', 'LICENSE', 'DESCRIPTION', - 'KEYWORDS', 'IUSE', 'CDEPEND', - 'PDEPEND', 'PROVIDE','_eclasses_') - - def __init__(self, *args, **config): - super(database,self).__init__(*args, **config) - self.location = os.path.join(self.location, - self.label.lstrip(os.path.sep).rstrip(os.path.sep)) - - if len(self._known_keys) > len(self.auxdbkey_order) + 2: - raise Exception("less ordered keys then auxdbkeys") - if not os.path.exists(self.location): - self._ensure_dirs() - - - def _getitem(self, cpv): - d = {} - try: - myf = open(os.path.join(self.location, cpv),"r") - for k,v in zip(self.auxdbkey_order, myf): - d[k] = v.rstrip("\n") - except (OSError, IOError),e: - if isinstance(e,IOError) and e.errno == 2: -# print "caught for %s" % cpv, e -# l=os.listdir(os.path.dirname(os.path.join(self.location,cpv))) -# l.sort() -# print l - raise KeyError(cpv) - raise cache_errors.CacheCorruption(cpv, e) - - try: d["_mtime_"] = os.fstat(myf.fileno()).st_mtime - except OSError, e: - myf.close() - raise cache_errors.CacheCorruption(cpv, e) - myf.close() - return d - - - def _setitem(self, cpv, values): - s = cpv.rfind("/") - fp=os.path.join(self.location,cpv[:s],".update.%i.%s" % (os.getpid(), cpv[s+1:])) - try: myf=open(fp, "w") - except (OSError, IOError), e: - if e.errno == 2: - try: - self._ensure_dirs(cpv) - myf=open(fp,"w") - except (OSError, IOError),e: - raise cache_errors.CacheCorruption(cpv, e) - else: - raise cache_errors.CacheCorruption(cpv, e) - - - for x in self.auxdbkey_order: - myf.write(values.get(x,"")+"\n") - - myf.close() - self._ensure_access(fp, mtime=values["_mtime_"]) - #update written. now we move it. - new_fp = os.path.join(self.location,cpv) - try: os.rename(fp, new_fp) - except (OSError, IOError), e: - os.remove(fp) - raise cache_errors.CacheCorruption(cpv, e) - - - def _delitem(self, cpv): - try: - os.remove(os.path.join(self.location,cpv)) - except OSError, e: - if e.errno == 2: - raise KeyError(cpv) - else: - raise cache_errors.CacheCorruption(cpv, e) - - - def has_key(self, cpv): - return os.path.exists(os.path.join(self.location, cpv)) - - - def iterkeys(self): - """generator for walking the dir struct""" - dirs = [self.location] - len_base = len(self.location) - while len(dirs): - for l in os.listdir(dirs[0]): - if l.endswith(".cpickle"): - continue - p = os.path.join(dirs[0],l) - st = os.lstat(p) - if stat.S_ISDIR(st.st_mode): - dirs.append(p) - continue - yield p[len_base+1:] - dirs.pop(0) - - - def commit(self): pass diff --git a/portage/cache/fs_template.py b/portage/cache/fs_template.py deleted file mode 100644 index de2ac13..0000000 --- a/portage/cache/fs_template.py +++ /dev/null @@ -1,74 +0,0 @@ -# Copyright: 2005 Gentoo Foundation -# Author(s): Brian Harring (ferringb@gentoo.org) -# License: GPL2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/portage/cache/fs_template.py,v 1.2 2005/07/13 05:51:35 ferringb Exp $ - -import os -import template, cache_errors -from portage.os_data import portage_gid - -class FsBased(template.database): - """template wrapping fs needed options, and providing _ensure_access as a way to - attempt to ensure files have the specified owners/perms""" - - def __init__(self, *args, **config): - """throws InitializationError if needs args aren't specified - gid and perms aren't listed do to an oddity python currying mechanism - gid=portage_gid - perms=0665""" - - for x,y in (("gid",portage_gid),("perms",0664)): - if x in config: - setattr(self, "_"+x, config[x]) - del config[x] - else: - setattr(self, "_"+x, y) - super(FsBased, self).__init__(*args, **config) - - if self.label.startswith(os.path.sep): - # normpath. - self.label = os.path.sep + os.path.normpath(self.label).lstrip(os.path.sep) - - - def _ensure_access(self, path, mtime=-1): - """returns true or false if it's able to ensure that path is properly chmod'd and chowned. - if mtime is specified, attempts to ensure that's correct also""" - try: - os.chown(path, -1, self._gid) - os.chmod(path, self._perms) - if mtime: - mtime=long(mtime) - os.utime(path, (mtime, mtime)) - except OSError, IOError: - return False - return True - - def _ensure_dirs(self, path=None): - """with path!=None, ensure beyond self.location. otherwise, ensure self.location""" - if path: - path = os.path.dirname(path) - base = self.location - else: - path = self.location - base='/' - - for dir in path.lstrip(os.path.sep).rstrip(os.path.sep).split(os.path.sep): - base = os.path.join(base,dir) - if not os.path.exists(base): - um=os.umask(0) - try: - os.mkdir(base, self._perms | 0111) - os.chown(base, -1, self._gid) - finally: - os.umask(um) - - -def gen_label(base, label): - """if supplied label is a path, generate a unique label based upon label, and supplied base path""" - if label.find(os.path.sep) == -1: - return label - label = label.strip("\"").strip("'") - label = os.path.join(*(label.rstrip(os.path.sep).split(os.path.sep))) - tail = os.path.split(label)[1] - return "%s-%X" % (tail, abs(label.__hash__())) - diff --git a/portage/cache/metadata.py b/portage/cache/metadata.py deleted file mode 100644 index dd376f6..0000000 --- a/portage/cache/metadata.py +++ /dev/null @@ -1,110 +0,0 @@ -# Copyright: 2005 Gentoo Foundation -# Author(s): Brian Harring (ferringb@gentoo.org) -# License: GPL2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/portage/cache/metadata.py,v 1.2 2005/07/13 05:51:35 ferringb Exp $ - -import os, stat -import fs_template -import cache_errors - -# store the current key order *here*. -class database(fs_template.FsBased): - complete_eclass_entries = False - auxdbkey_order=('DEPEND', 'RDEPEND', 'SLOT', 'SRC_URI', - 'RESTRICT', 'HOMEPAGE', 'LICENSE', 'DESCRIPTION', - 'KEYWORDS', 'INHERITED', 'IUSE', 'CDEPEND', - 'PDEPEND', 'PROVIDE') - - def __init__(self, *args, **config): - super(database,self).__init__(*args, **config) - self.location = os.path.join(self.location, - self.label.lstrip(os.path.sep).rstrip(os.path.sep)) - - if len(self._known_keys) > len(self.auxdbkey_order): - raise Exception("less ordered keys then auxdbkeys") - if not os.path.exists(self.location): - self._ensure_dirs() - - - def __getitem__(self, cpv): - d = {} - try: - myf = open(os.path.join(self.location, cpv),"r") - for k,v in zip(self.auxdbkey_order, myf): - d[k] = v.rstrip("\n") - except (OSError, IOError),e: - if isinstance(e,IOError) and e.errno == 2: - raise KeyError(cpv) - raise cache_errors.CacheCorruption(cpv, e) - - try: d["_mtime_"] = os.lstat(os.path.join(self.location, cpv)).st_mtime - except OSError, e:raise cache_errors.CacheCorruption(cpv, e) - return d - - - def _setitem(self, cpv, values): - s = cpv.rfind("/") - fp=os.path.join(self.location,cpv[:s],".update.%i.%s" % (os.getpid(), cpv[s+1:])) - try: myf=open(fp, "w") - except (OSError, IOError), e: - if e.errno == 2: - try: - self._ensure_dirs(cpv) - myf=open(fp,"w") - except (OSError, IOError),e: - raise cache_errors.CacheCorruption(cpv, e) - else: - raise cache_errors.CacheCorruption(cpv, e) - - -# try: -# s = os.path.split(cpv) -# if len(s[0]) == 0: -# s = s[1] -# else: -# s = s[0] -# os._ensure_dirs(s) -# -# except (OSError, IOError), e: - - myf.writelines( [ values.get(x,"")+"\n" for x in self.auxdbkey_order] ) - myf.close() - self._ensure_access(fp, mtime=values["_mtime_"]) - #update written. now we move it. - new_fp = os.path.join(self.location,cpv) - try: os.rename(fp, new_fp) - except (OSError, IOError), e: - os.remove(fp) - raise cache_errors.CacheCorruption(cpv, e) - - - def _delitem(self, cpv): - try: - os.remove(os.path.join(self.location,cpv)) - except OSError, e: - if e.errno == 2: - raise KeyError(cpv) - else: - raise cache_errors.CacheCorruption(cpv, e) - - - def has_key(self, cpv): - return os.path.exists(os.path.join(self.location, cpv)) - - - def iterkeys(self): - """generator for walking the dir struct""" - dirs = [self.location] - len_base = len(self.location) - while len(dirs): - for l in os.listdir(dirs[0]): - if l.endswith(".cpickle"): - continue - p = os.path.join(dirs[0],l) - st = os.lstat(p) - if stat.S_ISDIR(st.st_mode): - dirs.append(p) - continue - yield p[len_base+1:] - dirs.pop(0) - diff --git a/portage/cache/multiplex.py b/portage/cache/multiplex.py deleted file mode 100644 index 5f081fb..0000000 --- a/portage/cache/multiplex.py +++ /dev/null @@ -1,5 +0,0 @@ -# Copyright: 2005 Gentoo Foundation -# Author(s): Brian Harring (ferringb@gentoo.org) -# License: GPL2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/portage/cache/multiplex.py,v 1.2 2005/07/13 05:51:35 ferringb Exp $ - diff --git a/portage/cache/sql_template.py b/portage/cache/sql_template.py deleted file mode 100644 index f91b398..0000000 --- a/portage/cache/sql_template.py +++ /dev/null @@ -1,247 +0,0 @@ -# Copyright: 2005 Gentoo Foundation -# Author(s): Brian Harring (ferringb@gentoo.org) -# License: GPL2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/portage/cache/sql_template.py,v 1.2 2005/07/13 05:51:35 ferringb Exp $ - -import template, cache_errors - -class SQLDatabase(template.database): - """template class for RDBM based caches - - This class is designed such that derivatives don't have to change much code, mostly constant strings. - _BaseError must be an exception class that all Exceptions thrown from the derived RDBMS are derived - from. - - SCHEMA_INSERT_CPV_INTO_PACKAGE should be modified dependant on the RDBMS, as should SCHEMA_PACKAGE_CREATE- - basically you need to deal with creation of a unique pkgid. If the dbapi2 rdbms class has a method of - recovering that id, then modify _insert_cpv to remove the extra select. - - Creation of a derived class involves supplying _initdb_con, and table_exists. - Additionally, the default schemas may have to be modified. - """ - - SCHEMA_PACKAGE_NAME = "package_cache" - SCHEMA_PACKAGE_CREATE = "CREATE TABLE %s (\ - pkgid INTEGER PRIMARY KEY, label VARCHAR(255), cpv VARCHAR(255), UNIQUE(label, cpv))" % SCHEMA_PACKAGE_NAME - SCHEMA_PACKAGE_DROP = "DROP TABLE %s" % SCHEMA_PACKAGE_NAME - - SCHEMA_VALUES_NAME = "values_cache" - SCHEMA_VALUES_CREATE = "CREATE TABLE %s ( pkgid integer references %s (pkgid) on delete cascade, \ - key varchar(255), value text, UNIQUE(pkgid, key))" % (SCHEMA_VALUES_NAME, SCHEMA_PACKAGE_NAME) - SCHEMA_VALUES_DROP = "DROP TABLE %s" % SCHEMA_VALUES_NAME - SCHEMA_INSERT_CPV_INTO_PACKAGE = "INSERT INTO %s (label, cpv) VALUES(%%s, %%s)" % SCHEMA_PACKAGE_NAME - - _BaseError = () - _dbClass = None - - autocommits = False - - # boolean indicating if the derived RDBMS class supports replace syntax - _supports_replace = False - - def __init__(self, label, auxdbkeys, **config): - """initialize the instance. - derived classes shouldn't need to override this""" - - super(SQLDatabase, self).__init__(label, auxdbkeys, **config) - - config.setdefault("host","127.0.0.1") - config.setdefault("autocommit", self.autocommits) - self._initdb_con(config) - - self.label = self._sfilter(self.label) - - - def _dbconnect(self, config): - """should be overridden if the derived class needs special parameters for initializing - the db connection, or cursor""" - self.db = self._dbClass(**config) - self.con = self.db.cursor() - - - def _initdb_con(self,config): - """ensure needed tables are in place. - If the derived class needs a different set of table creation commands, overload the approriate - SCHEMA_ attributes. If it needs additional execution beyond, override""" - - self._dbconnect(config) - if not self._table_exists(self.SCHEMA_PACKAGE_NAME): - if self.readonly: - raise cache_errors.ReadOnlyRestriction("table %s doesn't exist" % \ - self.SCHEMA_PACKAGE_NAME) - try: self.con.execute(self.SCHEMA_PACKAGE_CREATE) - except self._BaseError, e: - raise cache_errors.InitializationError(self.__class__, e) - - if not self._table_exists(self.SCHEMA_VALUES_NAME): - if self.readonly: - raise cache_errors.ReadOnlyRestriction("table %s doesn't exist" % \ - self.SCHEMA_VALUES_NAME) - try: self.con.execute(self.SCHEMA_VALUES_CREATE) - except self._BaseError, e: - raise cache_errors.InitializationError(self.__class__, e) - - - def _table_exists(self, tbl): - """return true if a table exists - derived classes must override this""" - raise NotImplementedError - - - def _sfilter(self, s): - """meta escaping, returns quoted string for use in sql statements""" - return "\"%s\"" % s.replace("\\","\\\\").replace("\"","\\\"") - - - def _getitem(self, cpv): - try: self.con.execute("SELECT key, value FROM %s NATURAL JOIN %s " - "WHERE label=%s AND cpv=%s" % (self.SCHEMA_PACKAGE_NAME, self.SCHEMA_VALUES_NAME, - self.label, self._sfilter(cpv))) - except self._BaseError, e: - raise cache_errors.CacheCorruption(self, cpv, e) - - rows = self.con.fetchall() - - if len(rows) == 0: - raise KeyError(cpv) - - vals = dict([(k,"") for k in self._known_keys]) - vals.update(dict(rows)) - return vals - - - def _delitem(self, cpv): - """delete a cpv cache entry - derived RDBM classes for this *must* either support cascaded deletes, or - override this method""" - try: - try: - self.con.execute("DELETE FROM %s WHERE label=%s AND cpv=%s" % \ - (self.SCHEMA_PACKAGE_NAME, self.label, self._sfilter(cpv))) - if self.autocommits: - self.commit() - except self._BaseError, e: - raise cache_errors.CacheCorruption(self, cpv, e) - if self.con.rowcount <= 0: - raise KeyError(cpv) - except Exception: - if not self.autocommits: - self.db.rollback() - # yes, this can roll back a lot more then just the delete. deal. - raise - - def __del__(self): - # just to be safe. - self.commit() - self.db.close() - - def _setitem(self, cpv, values): - - try: - # insert. - try: pkgid = self._insert_cpv(cpv) - except self._BaseError, e: - raise cache_errors.CacheCorruption(cpv, e) - - # __getitem__ fills out missing values, - # so we store only what's handed to us and is a known key - db_values = [] - for key in self._known_keys: - if values.has_key(key): - db_values.append({"key":key, "value":values[key]}) - - if len(db_values) > 0: - try: self.con.executemany("INSERT INTO %s (pkgid, key, value) VALUES(\"%s\", %%(key)s, %%(value)s)" % \ - (self.SCHEMA_VALUES_NAME, str(pkgid)), db_values) - except self._BaseError, e: - raise cache_errors.CacheCorruption(cpv, e) - if self.autocommits: - self.commit() - - except Exception: - if not self.autocommits: - try: self.db.rollback() - except self._BaseError: pass - raise - - - def _insert_cpv(self, cpv): - """uses SCHEMA_INSERT_CPV_INTO_PACKAGE, which must be overloaded if the table definition - doesn't support auto-increment columns for pkgid. - returns the cpvs new pkgid - note this doesn't commit the transaction. The caller is expected to.""" - - cpv = self._sfilter(cpv) - if self._supports_replace: - query_str = self.SCHEMA_INSERT_CPV_INTO_PACKAGE.replace("INSERT","REPLACE",1) - else: - # just delete it. - try: del self[cpv] - except (cache_errors.CacheCorruption, KeyError): pass - query_str = self.SCHEMA_INSERT_CPV_INTO_PACKAGE - try: - self.con.execute(query_str % (self.label, cpv)) - except self._BaseError: - self.db.rollback() - raise - self.con.execute("SELECT pkgid FROM %s WHERE label=%s AND cpv=%s" % \ - (self.SCHEMA_PACKAGE_NAME, self.label, cpv)) - - if self.con.rowcount != 1: - raise cache_error.CacheCorruption(cpv, "Tried to insert the cpv, but found " - " %i matches upon the following select!" % len(rows)) - return self.con.fetchone()[0] - - - def has_key(self, cpv): - if not self.autocommits: - try: self.commit() - except self._BaseError, e: - raise cache_errors.GeneralCacheCorruption(e) - - try: self.con.execute("SELECT cpv FROM %s WHERE label=%s AND cpv=%s" % \ - (self.SCHEMA_PACKAGE_NAME, self.label, self._sfilter(cpv))) - except self._BaseError, e: - raise cache_errors.GeneralCacheCorruption(e) - return self.con.rowcount > 0 - - - def iterkeys(self): - if not self.autocommits: - try: self.commit() - except self._BaseError, e: - raise cache_errors.GeneralCacheCorruption(e) - - try: self.con.execute("SELECT cpv FROM %s WHERE label=%s" % - (self.SCHEMA_PACKAGE_NAME, self.label)) - except self._BaseError, e: - raise cache_errors.GeneralCacheCorruption(e) -# return [ row[0] for row in self.con.fetchall() ] - for x in self.con.fetchall(): - yield x[0] - - def commit(self): - self.db.commit() - - def get_matches(self,match_dict): - query_list = [] - for k,v in match_dict.items(): - if k not in self._known_keys: - raise cache_errors.InvalidRestriction(k, v, "key isn't known to this cache instance") - v = v.replace("%","\\%") - v = v.replace(".*","%") - query_list.append("(key=%s AND value LIKE %s)" % (self._sfilter(k), self._sfilter(v))) - - if len(query_list): - query = " AND "+" AND ".join(query_list) - else: - query = '' - - print "query = SELECT cpv from package_cache natural join values_cache WHERE label=%s %s" % (self.label, query) - try: self.con.execute("SELECT cpv from package_cache natural join values_cache WHERE label=%s %s" % \ - (self.label, query)) - except self._BaseError, e: - raise cache_errors.GeneralCacheCorruption(e) - - return [ row[0] for row in self.con.fetchall() ] - diff --git a/portage/cache/sqlite.py b/portage/cache/sqlite.py deleted file mode 100644 index a4448ab..0000000 --- a/portage/cache/sqlite.py +++ /dev/null @@ -1,67 +0,0 @@ -# Copyright: 2005 Gentoo Foundation -# Author(s): Brian Harring (ferringb@gentoo.org) -# License: GPL2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/portage/cache/sqlite.py,v 1.2 2005/07/13 05:51:35 ferringb Exp $ - -sqlite_module =__import__("sqlite") -import os -import sql_template, fs_template -import cache_errors - -class database(fs_template.FsBased, sql_template.SQLDatabase): - - SCHEMA_DELETE_NAME = "delete_package_values" - SCHEMA_DELETE_TRIGGER = """CREATE TRIGGER %s AFTER DELETE on %s - begin - DELETE FROM %s WHERE pkgid=old.pkgid; - end;""" % (SCHEMA_DELETE_NAME, sql_template.SQLDatabase.SCHEMA_PACKAGE_NAME, - sql_template.SQLDatabase.SCHEMA_VALUES_NAME) - - _BaseError = sqlite_module.Error - _dbClass = sqlite_module - _supports_replace = True - - def _dbconnect(self, config): - self._dbpath = os.path.join(self.location, fs_template.gen_label(self.location, self.label)+".sqldb") - try: - self.db = sqlite_module.connect(self._dbpath, mode=self._perms, autocommit=False) - if not self._ensure_access(self._dbpath): - raise cache_errors.InitializationError(self.__class__, "can't ensure perms on %s" % self._dbpath) - self.con = self.db.cursor() - except self._BaseError, e: - raise cache_errors.InitializationError(self.__class__, e) - - - def _initdb_con(self, config): - sql_template.SQLDatabase._initdb_con(self, config) - try: - self.con.execute("SELECT name FROM sqlite_master WHERE type=\"trigger\" AND name=%s" % \ - self._sfilter(self.SCHEMA_DELETE_NAME)) - if self.con.rowcount == 0: - self.con.execute(self.SCHEMA_DELETE_TRIGGER); - self.db.commit() - except self._BaseError, e: - raise cache_errors.InitializationError(self.__class__, e) - - def _table_exists(self, tbl): - """return true/false dependant on a tbl existing""" - try: self.con.execute("SELECT name FROM sqlite_master WHERE type=\"table\" AND name=%s" % - self._sfilter(tbl)) - except self._BaseError, e: - # XXX crappy. - return False - return len(self.con.fetchall()) == 1 - - # we can do it minus a query via rowid. - def _insert_cpv(self, cpv): - cpv = self._sfilter(cpv) - try: self.con.execute(self.SCHEMA_INSERT_CPV_INTO_PACKAGE.replace("INSERT","REPLACE",1) % \ - (self.label, cpv)) - except self._BaseError, e: - raise cache_errors.CacheCorruption(cpv, "tried to insert a cpv, but failed: %s" % str(e)) - - # sums the delete also - if self.con.rowcount <= 0 or self.con.rowcount > 2: - raise cache_errors.CacheCorruption(cpv, "tried to insert a cpv, but failed- %i rows modified" % self.rowcount) - return self.con.lastrowid - diff --git a/portage/cache/template.py b/portage/cache/template.py deleted file mode 100644 index 8b30e5f..0000000 --- a/portage/cache/template.py +++ /dev/null @@ -1,152 +0,0 @@ -# Copyright: 2005 Gentoo Foundation -# Author(s): Brian Harring (ferringb@gentoo.org) -# License: GPL2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/portage/cache/template.py,v 1.2 2005/07/13 05:51:35 ferringb Exp $ - -import cache_errors, copy - -class database(object): - # this is for metadata/cache transfer. - # basically flags the cache needs be updated when transfered cache to cache. - # leave this. - - complete_eclass_entries_ = True - autocommits = False - - def __init__(self, location, label, auxdbkeys, readonly=False): - """ initialize the derived class; specifically, store label/keys""" - self._known_keys = auxdbkeys - self.location = location - self.label = label - self.readonly = readonly - self.sync_rate = 0 - self.updates = 0 - - - def __getitem__(self, cpv): - """set a cpv to values - This shouldn't be overriden in derived classes since it handles the __eclasses__ conversion. - that said, if the class handles it, they can override it.""" - if self.updates > self.sync_rate: - self.commit() - self.updates = 0 - d=self._getitem(cpv) - if "_eclasses_" in d: - d["_eclasses_"] = reconstruct_eclasses(d["_eclasses_"]) - return d - - def _getitem(self, cpv): - """get cpv's values. - override this in derived classess""" - raise NotImplementedError - - - def __setitem__(self, cpv, values): - """set a cpv to values - This shouldn't be overriden in derived classes since it handles the readonly checks""" - if self.readonly: - raise cache_errors.ReadOnlyRestriction() - d=copy.copy(values) - if "_eclasses_" in d: - d["_eclasses_"] = serialize_eclasses(d["_eclasses_"]) - self._setitem(cpv, d) - if not self.autocommits: - self.updates += 1 - if self.updates > self.sync_rate: - self.commit() - self.updates = 0 - - - def _setitem(self, name, values): - """__setitem__ calls this after readonly checks. override it in derived classes - note _eclassees_ key *must* be handled""" - raise NotImplementedError - - - def __delitem__(self, cpv): - """delete a key from the cache. - This shouldn't be overriden in derived classes since it handles the readonly checks""" - if self.readonly: - raise cache_errors.ReadOnlyRestriction() - if not self.autocommits: - self.updates += 1 - self._delitem(cpv) - if self.updates > self.sync_rate: - self.commit() - self.updates = 0 - - - def _delitem(self,cpv): - """__delitem__ calls this after readonly checks. override it in derived classes""" - raise NotImplementedError - - - def has_key(self, cpv): - raise NotImplementedError - - - def keys(self): - return tuple(self.iterkeys()) - - def iterkeys(self): - raise NotImplementedError - - def sync(self, rate=0): - self.sync_rate = rate - if(rate == 0): - self.commit() - - def commit(self): - raise NotImplementedError - - def get_matches(self, match_dict): - """generic function for walking the entire cache db, matching restrictions to - filter what cpv's are returned. Derived classes should override this if they - can implement a faster method then pulling each cpv:values, and checking it. - - For example, RDBMS derived classes should push the matching logic down to the - actual RDBM.""" - - import re - restricts = {} - for key,match in match_dict.iteritems(): - # XXX this sucks. - try: - if isinstance(match, str): - restricts[key] = re.compile(match).match - else: - restricts[key] = re.compile(match[0],match[1]).match - except re.error, e: - raise InvalidRestriction(key, match, e) - if key not in self.__known_keys: - raise InvalidRestriction(key, match, "Key isn't valid") - - for cpv in self.keys(): - cont = True - vals = self[cpv] - for key, match in restricts.iteritems(): - if not match(vals[key]): - cont = False - break - if cont: -# yield cpv,vals - yield cpv - - -def serialize_eclasses(eclass_dict): - """takes a dict, returns a string representing said dict""" - return "\t".join(["%s\t%s\t%s" % (k, v[0], str(v[1])) for k,v in eclass_dict.items()]) - -def reconstruct_eclasses(eclass_string): - """returns a dict when handed a string generated by serialize_eclasses""" - eclasses = eclass_string.rstrip().lstrip().split("\t") - if eclasses == [""]: - # occasionally this occurs in the fs backends. they suck. - return {} - if len(eclasses) % 3 != 0: - raise cache_errors.CacheCorruption(cpv, "_eclasses_ was of invalid len %i" % len(eclasses)) - d={} - for x in range(0, len(eclasses), 3): - d[eclasses[x]] = (eclasses[x + 1], long(eclasses[x + 2])) - del eclasses - return d diff --git a/portage/cache/util.py b/portage/cache/util.py deleted file mode 100644 index 5d1ffec..0000000 --- a/portage/cache/util.py +++ /dev/null @@ -1,92 +0,0 @@ -# Copyright: 2005 Gentoo Foundation -# Author(s): Brian Harring (ferringb@gentoo.org) -# License: GPL2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/portage/cache/util.py,v 1.2 2005/07/13 05:51:35 ferringb Exp $ - -import cache_errors - -def mirror_cache(valid_nodes_iterable, src_cache, trg_cache, eclass_cache=None, verbose_instance=None): - - if not src_cache.complete_eclass_entries and not eclass_cache: - raise Exception("eclass_cache required for cache's of class %s!" % src_cache.__class__) - - if verbose_instance == None: - noise=quiet_mirroring() - else: - noise=verbose_instance - - dead_nodes = {} - dead_nodes.fromkeys(trg_cache.keys()) - count=0 - - if not trg_cache.autocommits: - trg_cache.sync(100) - - for x in valid_nodes_iterable: -# print "processing x=",x - count+=1 - if dead_nodes.has_key(x): - del dead_nodes[x] - try: entry = src_cache[x] - except KeyError, e: - noise.missing_entry(x) - del e - continue - if entry.get("INHERITED",""): - if src_cache.complete_eclass_entries: - if not "_eclasses_" in entry: - noise.corruption(x,"missing _eclasses_ field") - continue - if not eclass_cache.is_eclass_data_valid(entry["_eclasses_"]): - noise.eclass_stale(x) - continue - else: - entry["_eclasses_"] = eclass_cache.get_eclass_data(entry["INHERITED"].split(), \ - from_master_only=True) - if not entry["_eclasses_"]: - noise.eclass_stale(x) - continue - - # by this time, if it reaches here, the eclass has been validated, and the entry has - # been updated/translated (if needs be, for metadata/cache mainly) - try: trg_cache[x] = entry - except cache_errors.CacheError, ce: - noise.exception(x, ce) - del ce - continue - if count >= noise.call_update_min: - noise.update(x) - count = 0 - - if not trg_cache.autocommits: - trg_cache.commit() - - # ok. by this time, the trg_cache is up to date, and we have a dict - # with a crapload of cpv's. we now walk the target db, removing stuff if it's in the list. - for key in dead_nodes: - try: del trg_cache[key] - except cache_errors.CacheError, ce: - noise.exception(ce) - del ce - dead_nodes.clear() - del noise - - -class quiet_mirroring(object): - # call_update_every is used by mirror_cache to determine how often to call in. - # quiet defaults to 2^24 -1. Don't call update, 'cept once every 16 million or so :) - call_update_min = 0xffffff - def update(self,key,*arg): pass - def exception(self,key,*arg): pass - def eclass_stale(self,*arg): pass - def missing_entry(self, key): pass - def misc(self,key,*arg): pass - def corruption(self, key, s): pass - -class non_quiet_mirroring(quiet_mirroring): - call_update_min=1 - def update(self,key,*arg): print "processed",key - def exception(self, key, *arg): print "exec",key,arg - def missing(self,key): print "key %s is missing", key - def corruption(self,key,*arg): print "corrupt %s:" % key,arg - def eclass_stale(self,key,*arg):print "stale %s:"%key,arg diff --git a/portage/chksum/__init__.py b/portage/chksum/__init__.py deleted file mode 100644 index 81bfff9..0000000 --- a/portage/chksum/__init__.py +++ /dev/null @@ -1,47 +0,0 @@ -# Copyright: 2005 Gentoo Foundation -# Author(s): Brian Harring (ferringb@gentoo.org) -# License: GPL2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/portage/chksum/__init__.py,v 1.2 2005/07/13 05:51:35 ferringb Exp $ - -import os - -chksum_types = {} -__inited__ = False - -def init(additional_handlers={}): - """init the chksum subsystem. scan the dir, find what handlers are available, etc. - if desired to register additional, or override existing, pass in a dict of type:func""" - import sys, os, logging - - if not isinstance(additional_handlers, dict): - raise TypeError("additional handlers must be a dict!") - - chksum_types.clear() - __inited__ = False - loc = os.path.dirname(sys.modules[__name__].__file__) - for f in os.listdir(loc): - if not f.endswith(".py") or f.startswith("__init__."): - continue - try: - i = f.find(".") - if i != -1: f = f[:i] - del i - m = __import__(f) - except ImportError: - continue - try: - types = getattr(m, "chksum_types") - except AttributeError: - # no go. - continue - try: - for name, chf in types: - chksum_types[name] = chf - - except ValueError: - logging.warn("%s.%s invalid chksum_types, ValueError Exception" % (__name__, f)) - continue - - chksum_types.update(additional_handlers) - - __inited__ = True diff --git a/portage/chksum/md5hash.py b/portage/chksum/md5hash.py deleted file mode 100644 index 266eaa2..0000000 --- a/portage/chksum/md5hash.py +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright: 2004-2005 Gentoo Foundation -# License: GPL2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/portage/chksum/md5hash.py,v 1.2 2005/07/13 05:51:35 ferringb Exp $ - - -# We _try_ to load this module. If it fails we do the slow fallback. -try: - import fchksum - - def md5hash(filename, chksum): - return fchksum.fmd5t(filename)[0] == chksum - -except ImportError: - import md5 - def md5hash(filename, chksum): - f = open(filename, 'rb') - blocksize=32768 - data = f.read(blocksize) - size = 0L - sum = md5.new() - while data: - sum.update(data) - size = size + len(data) - data = f.read(blocksize) - f.close() - - return sum.hexdigest() == chksum - -chksum_types = (("md5", md5hash),) diff --git a/portage/chksum/sha1hash.py b/portage/chksum/sha1hash.py deleted file mode 100644 index 0283edb..0000000 --- a/portage/chksum/sha1hash.py +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright: 2004-2005 Gentoo Foundation -# License: GPL2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/portage/chksum/sha1hash.py,v 1.2 2005/07/13 05:51:35 ferringb Exp $ - -import sha - -def sha1hash(filename, chksum): - f = open(filename, 'rb') - blocksize=32768 - data = f.read(blocksize) - size = 0L - sum = sha.new() - while data: - sum.update(data) - size = size + len(data) - data = f.read(blocksize) - f.close() - - return sum.hexdigest() == chksum - -chksum_types = (("sha1", sha1hash),) diff --git a/portage/config/__init__.py b/portage/config/__init__.py deleted file mode 100644 index 5b31850..0000000 --- a/portage/config/__init__.py +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright: 2005 Gentoo Foundation -# Author(s): Brian Harring (ferringb@gentoo.org) -# License: GPL2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/portage/config/__init__.py,v 1.2 2005/07/13 05:51:35 ferringb Exp $ - -import ConfigParser -import central, os -from portage.const import DEFAULT_CONF_FILE - -def load_config(file=DEFAULT_CONF_FILE): - c = ConfigParser.ConfigParser() - if os.path.isfile(file): - c.read(file) - c = central.config(c) - else: - # make.conf... - raise Exception("sorry, default '%s' doesn't exist, and I don't like make.conf currently (I'm working out my issues however)" % - file) - return c diff --git a/portage/config/central.py b/portage/config/central.py deleted file mode 100644 index dc9e09c..0000000 --- a/portage/config/central.py +++ /dev/null @@ -1,285 +0,0 @@ -# Copyright: 2005 Gentoo Foundation -# Author(s): Brian Harring (ferringb@gentoo.org) -# License: GPL2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/portage/config/central.py,v 1.4 2005/07/13 07:18:46 ferringb Exp $ - -import errors, new -from portage.const import CONF_DEFAULTS -from portage.util.modules import load_attribute -from ConfigParser import ConfigParser -from portage.util.dicts import LazyValDict -from portage.util.currying import curry - -class config: - """Central configuration manager. - collapses configurations, instantiates objects dependant on section definitions (mislabled conf_defaults), and - a ConfigParser (or object with such an api) that is passed in. - - see conf_default_types for explanation of default sections and capabilities""" - def __init__(self, cparser, conf_defaults=CONF_DEFAULTS): - self._cparser = cparser - self.type_handler = load_conf_definitions(conf_defaults) - self.type_conversions = {} - # add auto exec shit - # weakref .instantiated? - self.instantiated = {} - for t in self.type_handler: - from string import lower - for x in ("required", "incrementals", "defaults", "section_ref", "positional"): - self.type_handler[t][x] = tuple(map(lower, list_parser(self.type_handler[t].get(x,"")))) - - conversions = {} - for x,f in (("list", list_parser), ("str", str_parser), ("bool", bool_parser)): - if x in self.type_handler[t]: - for y in list_parser(self.type_handler[t][x]): - conversions[y.lower()] = f - del self.type_handler[t][x] - - if "positional" in self.type_handler[t]: - for x in self.type_handler[t]["positional"]: - if x not in self.type_handler[t]["required"]: - raise errors.BrokenSectionDefinition(t, "position '%s' is not listed in required" % x) - - conversions["_default_"] = str_parser - self.type_conversions[t] = conversions - - # cleanup, covering ass of default conf definition author (same parsing rules applied to conf, applied to default) - # without this, it's possible for a section definitions conf to make errors appear via defaults in a config, if - # the section definition is fscked. - # work out an checkup of defaults + conversions for config definition, right now we allow that possibility - # to puke while inspecting user config (the passed in cparser) -# for k,v in self.type_handler[t].items(): -# try: -# self.type_handler[t][k] = str_parser(v) -# except errors.QuoteInterpretationError, qe: -# qe.var = v -# raise qe - setattr(self, t, LazyValDict(curry(self.sections, t), self.instantiate_section)) - - def collapse_config(self, section, verify=True): - """collapse a section's config down to a dict for use in instantiating that section. - verify controls whether sanity checks specified by the section type are enforced. - required and section_ref fex, are *not* verified if this is False.""" - - if not self._cparser.has_section(section): - raise KeyError("%s not a valid section" % section) - if not self._cparser.has_option(section, "type"): - raise errors.UnknownTypeRequired("Not set") - type = str_parser(self._cparser.get(section, "type")) - if not self.type_handler.has_key(type): - raise errors.UnknownTypeRequired(type) - - slist = [section] - - # first map out inherits. - i=0; - while i < len(slist): - if self._cparser.has_option(slist[i], "inherit"): - slist.extend(list_parser(self._cparser.get(slist[i], "inherit"))) - if not self._cparser.has_section(slist[i]): - raise errors.InheritError(slist[i-1], slist[i]) - i+=1 - # collapse, honoring incrementals. - # remember that inherit's are l->r. So the slist above works with incrementals, - # and default overrides (doesn't look it, but it does. tree isn't needed, list suffices) - incrementals = self.type_handler[type]["incrementals"] - conversions = self.type_conversions[type] - - cleanse_inherit = len(slist) > 1 - - d={} - default_conversion = conversions["_default_"] - while len(slist): - d2 = dict(self._cparser.items(slist[-1])) - # conversions, baby. - for x in d2.keys(): - try: - # note get ain't a tertiary op. so, this is the same as the equivalent contains/exec else - # find default/exec struct. - d2[x] = conversions.get(x, default_conversion)(d2[x]) - except errors.QuoteInterpretationError, qe: - qe.var = v; - raise qe - for x in incrementals: - if x in d2 and x in d: - d2[x] = d[x] + d2[x] - - d.update(d2) - slist.pop(-1) - - if cleanse_inherit: - del d["inherit"] - - d["type"] = type - default_conversion = conversions["_default_"] - for x in self.type_handler[type]["defaults"]: - if x not in d: - if x == "label": - d[x] = section - continue - # XXX yank the checks later, see __init__ for explanation of default + conversions + section conf possibility - try: - d[x] = conversions.get(x, default_conversion)(self.type_handler[type][x]) - except errors.QuoteInterpretationError, qe: - qe.var = v; - raise qe - - if verify: - for var in self.type_handler[type]["required"]: - if var not in d: - raise errors.RequiredSetting(type, section, var) - for var in self.type_handler[type]["section_ref"]: - if var in d: - if isinstance(d[var], list): - for sect_label in d[var]: - if not self._cparser.has_section(sect_label): - raise errors.SectionNotFound(section, var, sect_label) - elif not self._cparser.has_section(d[var]): - raise errors.SectionNotFound(section, var, sect_label) - - return d - - def instantiate_section(self, section, conf=None, allow_reuse=True): - """make a section config into an actual object. - if conf is specified, allow_reuse is forced to false. - if conf isn't specified, it's pulled via collapse_config - allow_reuse is used for controlling whether existing instantiations of that section can be reused or not.""" - if not self._cparser.has_section(section): - raise KeyError("%s not a valid section" % section) - if conf == None: - if section in self.instantiated: - return self.instantiated[section] - conf = self.collapse_config(section) - else: - allow_reuse = False - - if "type" not in conf: - raise errors.UnknownTypeRequired(section) - type = conf["type"] - del conf["type"] - - if "class" not in conf: - raise errors.ClassRequired(section, type) - cls_name = conf["class"] - del conf["class"] - - callable = load_attribute(cls_name) - from inspect import isclass, isroutine - if not (isclass(callable) or isroutine(callable)): - raise errors.InstantiationError(cls_name, [], conf, - TypeError("%s is not a class/callable" % type(callable))) - - if "instantiate" in self.type_handler[type]: - inst = load_attribute(self.type_handler[type]["instantiate"]) - if not (isclass(inst) or isroutine(inst)): - raise errors.InstantiationError(self.type_handler[type]["instantiate"], [], conf, - TypeError("%s is not a class/callable" % type(inst))) - else: - inst = None - # instantiate all section refs. - for var in self.type_handler[type]["section_ref"]: - if var in conf: - if isinstance(conf[var], list): - for x in range(0, len(conf[var])): - conf[var][x] = self.instantiate_section(conf[var][x]) - else: - conf[var] = self.instantiate_section(conf[var]) - pargs = [] - for var in self.type_handler[type]["positional"]: - pargs.append(conf[var]) - del conf[var] - try: - if inst != None: - obj=inst(self, callable, section, conf) - else: - obj=callable(*pargs, **conf) - except Exception, e: - if isinstance(e, RuntimeError) or isinstance(e, SystemExit) or isinstance(e, errors.InstantiationError): - raise - #else wrap and chuck. - raise errors.InstantiationError(cls_name, [], conf, e) - - if obj == None: - raise errors.InstantiationError(cls_name, [], conf, errors.NoObjectReturned(cls_name)) - - if allow_reuse: - self.instantiated[section] = obj - - return obj - - def sections(self, type=None): - if type==None: - return self._cparser.sections() - l=[] - for x in self.sections(): - if self._cparser.has_option(x, "type") and self._cparser.get(x,"type") == type: - l.append(x) - return l - -def load_conf_definitions(loc): - c = ConfigParser() - c.read(loc) - d = {} - for x in c.sections(): - d[x] = dict(c.items(x)) - del c - return d - - -def list_parser(s): - """split on whitespace honoring quoting for new tokens""" - l=[] - i = 0 - e = len(s) - while i < e: - if not s[i].isspace(): - if s[i] in ("'", '"'): - q = i - i += 1 - while i < e and s[i] != s[q]: - if s[i] == '\\': - i+=2 - else: - i+=1 - if i >= e: - raise errors.QuoteInterpretationError(s) - l.append(s[q+1:i]) - else: - start = i - while i < e and not (s[i].isspace() or s[i] in ("'", '"')): - if s[i] == '\\': - i+=2 - else: - i+=1 - if i < e and s[i] in ("'", '"'): - raise errors.QuoteInterpretationError(s) - l.append(s[start:i]) - i+=1 - return l - -def str_parser(s): - """yank leading/trailing whitespace and quotation, along with newlines""" - i=0 - l = len(s) - while i < l and s[i].isspace(): - i+=1 - if i < l and s[i] in ("'",'"'): - i+=1 - e=l - while e > i and s[e - 1].isspace(): - e-=1 - if e > i and s[e - 1] in ("'", '"'): - e-=1 - if e > i: - s=s[i:e] - i = 0; e = len(s) - 1 - while i < e: - if s[i] in ("\n", "\t"): - s[i] = ' ' - i+=1 - return s - else: - return '' - -def bool_parser(s): - return bool(str_parser(s)) diff --git a/portage/config/domain.py b/portage/config/domain.py deleted file mode 100644 index a1ef200..0000000 --- a/portage/config/domain.py +++ /dev/null @@ -1,12 +0,0 @@ -# Copyright: 2005 Gentoo Foundation -# Author(s): Brian Harring (ferringb@gentoo.org) -# License: GPL2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/portage/config/domain.py,v 1.2 2005/07/13 05:51:35 ferringb Exp $ - - -class domain: - def __init__(self, config): - self.__master = config - - def load_all_repositories(self): - diff --git a/portage/config/errors.py b/portage/config/errors.py deleted file mode 100644 index 9ddc0bc..0000000 --- a/portage/config/errors.py +++ /dev/null @@ -1,72 +0,0 @@ -# Copyright: 2005 Gentoo Foundation -# Author(s): Brian Harring (ferringb@gentoo.org) -# License: GPL2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/portage/config/errors.py,v 1.2 2005/07/13 05:51:35 ferringb Exp $ - -# potentially use an intermediate base for user config errors, seperate base for instantiation? -class BaseException(Exception): - pass - -class InheritError(BaseException): - """Inherit target was not found""" - def __init__(self, baseSect, trgSect): - self.base, self.trg = baseSect, trgSect - def __str__(self): - return "Section %s inherits %s, but %s wasn't found" % (self.file, self.base, self.trg) - -class ClassRequired(BaseException): - """Section type requires a class, but one wasn't specified""" - def __init__(self, sectname, type): - self.name, type = sectname, type - def __str__(self): - return "Section %s doesn't define a class setting, but type '%s' requires it" % (self.name, self.type) - -class UnknownTypeRequired(BaseException): - """Section was requested it be instantiated, but lacked a known type (type required for everything but conf grouppings)""" - def __init__(self, sectname): - self.name = sectname - def __str__(self): - return "Section %s cannot be instantiated, since it lacks a type setting" % self.name - -class InstantiationError(BaseException): - """Exception occured during instantiation. Actual exception is stored in instance.exc""" - def __init__(self, callablename, pargs, kwargs, exception): - self.callable, self.pargs, self.kwargs, self.exc = callablename, pargs, kwargs, exception - def __str__(self): - return "Caught exception '%s' instantiating %s" % (str(self.exc), self.callable) - -class NoObjectReturned(BaseException): - """instantiating a callable, but either None or nothing was returned""" - def __init__(self, callable): - self.callable = callable - def __str__(self): - return "No object was returned from callable '%s'" % self.callable - -class QuoteInterpretationError(BaseException): - """Quoting of a var was screwed up.""" - def __init__(self, s, v=None): - self.str, self.var = s, v - def __str__(self): - return "Parsing of var '%s' \n%s\n failed" % (str(self.var), s) - -class RequiredSetting(BaseException): - """A setting is required for this type, but not set in the config""" - def __init__(self, type, section, setting): - self.type, self.section, self.setting = type, section, setting - def __str__(self): - return "Type %s requires '%s' to be defined, but no setting found in '%s'" % (self.type, self.setting, self.section) - -class SectionNotFound(BaseException): - """A specified section label was not found""" - def __init__(self, section, var, requested): - self.section, self.var, self.requested = section, var, requested - def __str__(self): - return "Section %s references section '%s' in setting '%s', but it doesn't (yet?) exist" % \ - (self.section, self.requested, self.var) - -class BrokenSectionDefinition(BaseException): - """The conf that defines sections is invalid in some respect""" - def __init__(self, section, errormsg): - self.section, self.errmsg = section, errormsg - def __str__(self): - return "Section '%s' definition: error %s" % (self.section, self.errmsg) diff --git a/portage/const.py b/portage/const.py deleted file mode 100644 index 29525f5..0000000 --- a/portage/const.py +++ /dev/null @@ -1,77 +0,0 @@ -# portage: Constants -# Copyright 1998-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/portage/const.py,v 1.1 2005/07/12 02:02:37 ferringb Exp $ -cvs_id_string="$Id: const.py,v 1.1 2005/07/12 02:02:37 ferringb Exp $"[5:-2] - -# =========================================================================== -# START OF CONSTANTS -- START OF CONSTANTS -- START OF CONSTANTS -- START OF -# =========================================================================== - -#VDB_PATH = "var/db/pkg" - -PRIVATE_PATH = "/var/lib/portage" - -USER_CONFIG_PATH = "/etc/portage" -#CUSTOM_PROFILE_PATH = USER_CONFIG_PATH+"/profile" - -#PORTAGE_BASE_PATH = "/usr/lib/portage" -PORTAGE_BASE_PATH = "/home/bharring/new" -PORTAGE_BIN_PATH = PORTAGE_BASE_PATH+"/bin" -#PORTAGE_PYM_PATH = PORTAGE_BASE_PATH+"/pym" -#PROFILE_PATH = "/etc/make.profile" -LOCALE_DATA_PATH = PORTAGE_BASE_PATH+"/locale" - -EBUILD_DAEMON_PATH = PORTAGE_BIN_PATH+"/ebuild-daemon.sh" - -SANDBOX_BINARY = "/usr/bin/sandbox" - -# XXX compatibility hack. this shouldn't ever hit a stable release. -import os -if not os.path.exists(SANDBOX_BINARY): - if os.path.exists(PORTAGE_BIN_PATH+"/sandbox"): - SANDBOX_BINARY=PORTAGE_BIN_PATH+"/sandbox" - -DEPSCAN_SH_BINARY = "/sbin/depscan.sh" -BASH_BINARY = "/bin/bash" -MOVE_BINARY = "/bin/mv" -PRELINK_BINARY = "/usr/sbin/prelink" - -WORLD_FILE = PRIVATE_PATH+"/world" -#MAKE_CONF_FILE = "/etc/make.conf" -#MAKE_DEFAULTS_FILE = PROFILE_PATH + "/make.defaults" - -#DEPRECATED_PROFILE_FILE = PROFILE_PATH+"/deprecated" -#USER_VIRTUALS_FILE = USER_CONFIG_PATH+"/virtuals" -#EBUILD_SH_ENV_FILE = USER_CONFIG_PATH+"/bashrc" -INVALID_ENV_FILE = "/etc/spork/is/not/valid/profile.env" -CUSTOM_MIRRORS_FILE = USER_CONFIG_PATH+"/mirrors" -SANDBOX_PIDS_FILE = "/tmp/sandboxpids.tmp" - -# since I didn't know wtf this was, it's used for knowing when CONFIG_PROTECT* can be ignored. -CONFIG_MEMORY_FILE = PRIVATE_PATH + "/config" - -# wtf is this actually used for!? -#STICKIES=["KEYWORDS_ACCEPT","USE","CFLAGS","CXXFLAGS","MAKEOPTS","EXTRA_ECONF","EXTRA_EINSTALL","EXTRA_EMAKE"] - -#CONFCACHE_FILE = CACHE_PATH+"/confcache" -#CONFCACHE_LIST = CACHE_PATH+"/confcache_files.anydbm" - -LIBFAKEROOT_PATH = "/usr/lib/libfakeroot.so" -FAKEROOT_PATH = "/usr/bin/fakeroot" - -RSYNC_BIN = "/usr/bin/rsync" -RSYNC_HOST = "rsync.gentoo.org/gentoo-portage" - -CVS_BIN = "/usr/bin/cvs" - -# find a better place for this... -EBUILD_PHASES = "setup unpack compile test install preinst postinst prerm postrm" - -# harring hack -#DEFAULT_CONF_FILE = USER_CONFIG_PATH+"/config" -DEFAULT_CONF_FILE = PORTAGE_BASE_PATH+"/config" - -#harring setting. have this bound by autoconf to install location, -# /usr/share/portage-*/... -CONF_DEFAULTS = "/home/bharring/new/conf_default_types" diff --git a/portage/ebuild/__init__.py b/portage/ebuild/__init__.py deleted file mode 100644 index e527a65..0000000 --- a/portage/ebuild/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -import ebuild_package -import ebuild_repository -repository = ebuild_repository.tree -package = ebuild_package.ebuild_package -package_factory = ebuild_package.ebuild_factory diff --git a/portage/ebuild/conditionals.py b/portage/ebuild/conditionals.py deleted file mode 100644 index cd32d5e..0000000 --- a/portage/ebuild/conditionals.py +++ /dev/null @@ -1,70 +0,0 @@ -# Copyright: 2005 Gentoo Foundation -# Author(s): Jason Stubbs (jstubbs@gentoo.org), Brian Harring (ferringb@gentoo.org) -# License: GPL2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/portage/ebuild/conditionals.py,v 1.1 2005/07/13 05:51:34 ferringb Exp $ - -# TODO: move exceptions elsewhere, bind them to a base exception for portage - -from portage.package.cpv import Atom -import logging - -class Conditional(object): - def __init__(self, node, payload): - self.node, self.payload = node, payload - - def __str__(self): return "%s? ( %s )" % (self.node, self.payload) - -class DepSet(object): - def __init__(self, dep_str, element_func, cleanse_string=True, collapse=True): - """dep_str is a dep style syntax, element_func is a callable returning the obj for each element, and - cleanse_string controls whether or translation of tabs/newlines is required""" - pos = 0 - if cleanse_string: - dep_str = ' '.join(dep_str.split()) - strlen = len(dep_str) - self.elements = [] - last_parsed = 0 - - while pos < strlen: - while pos < strlen and dep_str[pos].isspace(): - pos+=1 - next_pos = dep_str.find(" ", pos) -# import pdb;pdb.set_trace() - if next_pos < 0: - self.elements.append(element_func(dep_str[pos:])) - pos = strlen - elif dep_str[next_pos - 1] == '?': - # use conditional. - block_start = next_pos - while dep_str[block_start].isspace() and block_start < strlen: - block_start += 1 - if block_start == strlen or dep_str[block_start] != '(': - raise ParseError(dep_str) - # point of optimization. rather then reparsing every level, collapse it so single parsing. - levels=1 - block_end = block_start = block_start + 1 - while levels: - block_end += 1 - while block_end < strlen and dep_str[block_end] not in ('(',')'): - block_end += 1 - if block_end == strlen: - raise ParseError(dep_str) - elif dep_str[block_end] == '(': - levels += 1 - elif dep_str[block_end] == ')': - levels -= 1 - d = self.__class__(dep_str[block_start:block_end].strip(), element_func, cleanse_string=False) - self.elements.append(Conditional(dep_str[pos:next_pos - 1], d)) - pos = block_end + 1 - else: - # node/element. - self.elements.append(element_func(dep_str[pos:next_pos].strip())) - pos = next_pos - - - def __str__(self): return ' '.join(map(str,self.elements)) - - -class ParseError(Exception): - def __init__(self, s): self.dep_str = s - def __str__(self): return "%s is unparseable" % self.s diff --git a/portage/ebuild/ebuild_buildable.py b/portage/ebuild/ebuild_buildable.py deleted file mode 100644 index cb9331f..0000000 --- a/portage/ebuild/ebuild_buildable.py +++ /dev/null @@ -1,57 +0,0 @@ -import package.buildable -import os - -import portage_dep, portage_util - -from ebuild_internal import ebuild_handler - -class ebuild_buildable(package.buildable.package): - _metadata_pulls=("DEPEND",) - - def __init__(self, *args, **kwargs): - super(ebuild_buildable, self).__init__(*args, **kwargs) - dir(self) - self.root = self._config["ROOT"] - self._build_env = { - "ROOT":self._config["ROOT"], "EBUILD":self.path, - "CATEGORY":self.category, "PF":self.cpvstr, - "P":"%s-%s" % (self.package, self.version), - "PN":self.package, "PV":self.version, - "PR":"-r%i" % self.revision, "PVR":self.fullver, - "FILESDIR":os.path.dirname(os.path.join(self.path,"files")), - "BUILD_PREFIX":os.path.join(self._config["PORTAGE_TMPDIR"],"portage"), - "ROOT":self._config["ROOT"], - } - - self._build_env["BUILDDIR"] = os.path.join(self._build_env["BUILD_PREFIX"], self._build_env["PF"]) - for x,y in (("T","temp"),("WORKDIR","work"), ("D","image")): - self._build_env[x] = os.path.join(self._build_env["BUILDDIR"], y) - - self.URI = portage_dep.paren_reduce(self.SRC_URI) - uf = self._config["USE"].split() - self.ALL_URI = portage_util.flatten(portage_dep.use_reduce(self.URI,uselist=uf,matchall=True)) - self.URI = portage_util.flatten(portage_dep.use_reduce(self.URI,uselist=uf,matchall=False)) - - - def _setup(self): - self.ebd = ebuild_handler(self._config) - return self.ebd.process_phase("setup", self.path, self.root, self) - - def _fetch(self): - return self.ebd.process_phase("fetch", self.path, self.root, self) - - def _unpack(self): - return self.ebd.process_phase("unpack", self.path, self.root, self) - - def _configure(self): - return True - - def _compile(self): - return self.ebd.process_phase("compile", self.path, self.root, self) - - def _install(self): - return self.ebd.process_phase("install", self.path, self.root, self) - - def _clean(self): - return self.ebd.process_phase("clean", self.path, self.root, self) - diff --git a/portage/ebuild/ebuild_internal.py b/portage/ebuild/ebuild_internal.py deleted file mode 100644 index 7a7e393..0000000 --- a/portage/ebuild/ebuild_internal.py +++ /dev/null @@ -1,1265 +0,0 @@ -#!/usr/bin/python -# ebuild.py; Ebuild classes/abstraction of phase processing, and communicating with a ebuild-daemon.sh instance -# Copyright 2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -#$Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/portage/ebuild/ebuild_internal.py,v 1.2 2005/07/13 05:51:34 ferringb Exp $ - - -import os,sys,traceback -import portage_const,types -#still needed? -from portage_const import * -import portage_locks, portage_util -import portage_exec -import portage_versions -import shutil, anydbm -import stat -import string - -def shutdown_all_processors(): - """kill off all known processors""" - global active_ebp_list, inactive_ebp_list - if type(active_ebp_list) != types.ListType: - print "warning, ebuild.active_ebp_list wasn't a list." - active_ebp_list = [] - if type(inactive_ebp_list) != types.ListType: - print "warning, ebuild.inactive_ebp_list wasn't a list." - inactive_ebp_list = [] - while len(active_ebp_list) > 0: - try: active_ebp_list[0].shutdown_processor() - except (IOError,OSError): - active_ebp_list.pop(0) - continue - try: active_ebp_list.pop(0) - except IndexError: pass - while len(inactive_ebp_list) > 0: - try: - inactive_ebp_list[0].shutdown_processor() - except (IOError,OSError): - inactive_ebp_list.pop(0) - continue - try: inactive_ebp_list.pop(0) - except IndexError: pass - - -inactive_ebp_list = [] -active_ebp_list = [] - -def request_ebuild_processor(config,ebuild_daemon_path=portage_const.EBUILD_DAEMON_PATH,userpriv=False, \ - sandbox=None,fakeroot=False,save_file=None): - """request an ebuild_processor instance from the pool, or create a new one - this walks through the requirements, matching a inactive processor if one exists - note fakerooted processors are never reused, do to the nature of fakeroot""" - - if sandbox == None: - sandbox = portage_exec.sandbox_capable - - global inactive_ebp_list, active_ebp_list - if not fakeroot: - for x in inactive_ebp_list: - if not x.locked() and x.ebd == ebuild_daemon_path and \ - x.userprived() == userpriv and (x.sandboxed() or not sandbox): - inactive_ebp_list.remove(x) - active_ebp_list.append(x) - return x - active_ebp_list.append(ebuild_processor(config, userpriv=userpriv,sandbox=sandbox,fakeroot=fakeroot,save_file=save_file)) - return active_ebp_list[-1] - -def release_ebuild_processor(ebp): - """the inverse of request_ebuild_processor. Any processor requested via request_ebuild_processor - _must_ be released via this function once it's no longer in use. - this includes fakerooted processors. - Returns True exempting when the processor requested to be released isn't marked as active""" - - global inactive_ebp_list, active_ebp_list - try: active_ebp_list.remove(ebp) - except ValueError: return False - - try: inactive_ebp_list.index(ebp) - except ValueError: - # if it's a fakeroot'd process, we throw it away. it's not useful outside of a chain of calls - if not ebp.onetime(): - inactive_ebp_list.append(ebp) - else: - del ebp - return True - - # if it makes it this far, that means ebp was already in the inactive list. - # which is indicative of an internal fsck up. - import traceback - print "ebp was requested to be free'd, yet it already is claimed inactive _and_ was in the active list" - print "this means somethings horked, badly" - traceback.print_stack() - return False - - - -class ebuild_processor: - """abstraction of a running ebuild.sh instance- the env, functions, etc that ebuilds expect.""" - def __init__(self, config, ebuild_daemon_path=portage_const.EBUILD_DAEMON_PATH,userpriv=False, sandbox=True, \ - fakeroot=False,save_file=None): - """ebuild_daemon_path shouldn't be fooled with unless the caller knows what they're doing. - sandbox enables a sandboxed processor - userpriv enables a userpriv'd processor - fakeroot enables a fakeroot'd processor- this is a mutually exclusive option to sandbox, and - requires userpriv to be enabled. Violating this will result in nastyness""" - - self._config = config - self.ebd = ebuild_daemon_path - from portage_data import portage_uid, portage_gid - spawn_opts = {} - - if fakeroot and (sandbox or not userpriv): - import traceback - traceback.print_stack() - print "warning, was asking to enable fakeroot but-" - print "sandbox",sandbox,"userpriv",userpriv - print "this isn't valid. bailing" - raise Exception,"cannot initialize with sandbox and fakeroot" - - if userpriv: - self.__userpriv = True - spawn_opts.update({"uid":portage_uid,"gid":portage_gid,"groups":[portage_gid],"umask":002}) - else: - if portage_exec.userpriv_capable: - spawn_opts.update({"gid":portage_gid,"groups":[0,portage_gid]}) - self.__userpriv = False - - # open the pipes to be used for chatting with the new daemon - cread, cwrite = os.pipe() - dread, dwrite = os.pipe() - self.__sandbox = False - self.__fakeroot = False - - # since it's questionable which spawn method we'll use (if sandbox or fakeroot fex), - # we ensure the bashrc is invalid. - env={"BASHRC":"/etc/portage/spork/not/valid/ha/ha"} - args = [] - if sandbox: - if fakeroot: - print "!!! ERROR: fakeroot was on, but sandbox was also on" - sys.exit(1) - self.__sandbox = True - spawn_func = portage_exec.spawn_sandbox - env.update({"SANDBOX_DEBUG":"1","SANDBOX_DEBUG_LOG":"/var/tmp/test"}) - - elif fakeroot: - self.__fakeroot = True - spawn_func = portage_exec.spawn_fakeroot - args.append(save_file) - else: - spawn_func = portage_exec.spawn - - self.pid = spawn_func(self.ebd+" daemonize", fd_pipes={0:0, 1:1, 2:2, 3:cread, 4:dwrite}, - returnpid=True,env=env, *args, **spawn_opts)[0] - - os.close(cread) - os.close(dwrite) - self.ebd_write = os.fdopen(cwrite,"w") - self.ebd_read = os.fdopen(dread,"r") - - # basically a quick "yo" to the daemon - self.write("dude?") - if not self.expect("dude!"): - print "error in server coms, bailing." - raise Exception("expected 'dude!' response from ebd, which wasn't received. likely a bug") - if self.__sandbox: - self.write("sandbox_log?") - self.__sandbox_log = self.read().split()[0] - self.dont_export_vars=self.read().split() - # locking isn't used much, but w/ threading this will matter - self.unlock() - - def sandboxed(self): - """is this instance sandboxed?""" - return self.__sandbox - - def userprived(self): - """is this instance userprived?""" - return self.__userpriv - - def fakerooted(self): - """is this instance fakerooted?""" - return self.__fakeroot - - def onetime(self): - """is this instance going to be discarded after usage; eg is it fakerooted?""" - return self.__fakeroot - - def write(self, string,flush=True): - """talk to running daemon. Disabling flush is useful when dumping large amounts of data - all strings written are automatically \\n terminated""" - if string[-1] == "\n": - self.ebd_write.write(string) - else: - self.ebd_write.write(string +"\n") - if flush: - self.ebd_write.flush() - - def expect(self, want): - """read from the daemon, and return true or false if the returned string is what is expected""" - got=self.ebd_read.readline() - return want==got[:-1] - - def read(self,lines=1): - """read data from the daemon. Shouldn't be called except internally""" - mydata='' - while lines > 0: - mydata += self.ebd_read.readline() - lines -= 1 - return mydata - - def sandbox_summary(self, move_log=False): - """if the instance is sandboxed, print the sandbox access summary""" - if not os.path.exists(self.__sandbox_log): - self.write("end_sandbox_summary") - return 0 - violations=portage_util.grabfile(self.__sandbox_log) - if len(violations)==0: - self.write("end_sandbox_summary") - return 0 - if not move_log: - move_log=self.__sandbox_log - elif move_log != self.__sandbox_log: - myf=open(move_log) - for x in violations: - myf.write(x+"\n") - myf.close() - from output import red - self.ebd_write.write(red("--------------------------- ACCESS VIOLATION SUMMARY ---------------------------")+"\n") - self.ebd_write.write(red("LOG FILE = \"%s\"" % move_log)+"\n\n") - for x in violations: - self.ebd_write.write(x+"\n") - self.write(red("--------------------------------------------------------------------------------")+"\n") - self.write("end_sandbox_summary") - try: - os.remove(self.__sandbox_log) - except (IOError, OSError), e: - print "exception caught when cleansing sandbox_log=%s" % str(e) - return 1 - - def preload_eclasses(self, ec_file): - """this preloades eclasses into a function, thus avoiding the cost of going to disk. - preloading eutils (which is heaviliy inherited) speeds up regen times fex""" - if not os.path.exists(ec_file): - return 1 - self.write("preload_eclass %s" % ec_file) - if self.expect("preload_eclass succeeded"): - self.preloaded_eclasses=True - return True - return False - - def lock(self): - """lock the processor. Currently doesn't block any access, but will""" - self.processing_lock = True - - def unlock(self): - """unlock the processor""" - self.processing_lock = False - - def locked(self): - """is the processor locked?""" - return self.processing_lock - - def is_alive(self): - """returns if it's known if the processor has been shutdown. - Currently doesn't check to ensure the pid is still running, yet it should""" - return self.pid != None - - def shutdown_processor(self): - """tell the daemon to shut itself down, and mark this instance as dead""" - try: - if self.is_alive(): - self.write("shutdown_daemon") - self.ebd_write.close() - self.ebd_read.close() - - # now we wait. - os.waitpid(self.pid,0) - except (IOError,OSError,ValueError): - pass - - # we *really* ought to modify portageatexit so that we can set limits for waitpid. - # currently, this assumes all went well. - # which isn't always true. - self.pid = None - - def set_sandbox_state(self,state): - """tell the daemon whether to enable the sandbox, or disable it""" - if state: - self.write("set_sandbox_state 1") - else: - self.write("set_sandbox_state 0") - - def send_env(self): - """essentially transfer the ebuild's desired env to the running daemon - accepts a portage.config instance, although it will accept dicts at some point""" - be=self._config.bash_environ() - self.write("start_receiving_env\n") - exported_keys = '' - for x in be.keys(): - if x not in self.dont_export_vars: - self.write("%s=%s\n" % (x,be[x]), flush=False) - exported_keys += x+' ' - self.write("export "+exported_keys,flush=False) - self.write("end_receiving_env") - return self.expect("env_received") - - def set_logfile(self,logfile=''): - """relevant only when the daemon is sandbox'd, set the logfile""" - self.write("logging %s" % logfile) - return self.expect("logging_ack") - - - def __del__(self): - """simply attempts to notify the daemon to die""" - # for this to be reached means we ain't in a list no more. - if self.pid: - self.shutdown_processor() - - -class ebuild_handler: - """abstraction of ebuild phases, fetching exported keys, fetching srcs, etc""" - import portageq - def __init__(self, config, process_limit=5): - """process_limit is currently ignored""" - self.processed = 0 - self.__process_limit = process_limit - self.preloaded_eclasses = False - self._config = config - self.__ebp = None - - def __del__(self): - """only ensures any processors this handler has claimed are released""" - if self.__ebp: - release_ebuild_processor(self.__ebp) - - # this is an implementation of stuart's confcache/sandbox trickery, basically the file/md5 stuff implemented in - # python with a basic bash wrapper that calls back to this. - # all credit for the approach goes to him, as stated, this is just an implementation of it. - # bugs should be thrown at ferringb. - def load_confcache(self,transfer_to,confcache=portage_const.CONFCACHE_FILE, - confcache_list=portage_const.CONFCACHE_LIST): - """verifys a requested conf cache, removing the global cache if it's stale. - The handler should be the only one to call this""" - from portage_checksum import perform_md5 - from output import red - if not self.__ebp: - import traceback - traceback.print_stack() - print "err... no ebp, yet load_confcache called. invalid" - raise Exception,"load_confcache called yet no running processor. bug?" - - valid=True - lock=None - if not os.path.exists(confcache_list): - print "confcache file listing doesn't exist" - valid=False - elif not os.path.exists(confcache): - print "confcache doesn't exist" - valid=False - else: - lock=portage_locks.lockfile(confcache_list,wantnewlockfile=1) - try: - myf=anydbm.open(confcache_list, "r", 0664) - for l in myf.keys(): - # file, md5 - if perform_md5(l,calc_prelink=1) != myf[l]: - print red("***")+" confcache is stale: %s: recorded md5: %s: actual: %s:" % (l,myf[l],perform_md5(l,calc_prelink=1)) - raise Exception("md5 didn't match") - myf.close() - # verify env now. - new_cache=[] - env_vars=[] - - # guessing on THOST. I'm sure it's wrong... - - env_translate={"build_alias":"CBUILD","host_alias":"CHOST","target_alias":"THOST"} - cache=portage_util.grabfile(confcache) - - x=0 - while x < len(cache): - #ac_cv_env - if cache[x][0:10] == "ac_cv_env_": - f=cache[x][10:].find("_set") - if f == -1 or f==11: - cache.pop(x) - continue - env_vars.append(cache[x][10:10 + cache[x][10:].find("_set")]) - x += 1 - else: - new_cache.append(cache[x]) - x += 1 - - for x in env_vars: - self.__ebp.write("request %s" % env_translate.get(x,x)) - line=self.__ebp.read() - if line[-1] == "\n": - line=line[:-1] - new_cache.append("ac_cv_env_%s_set=%s" % (x, line)) - if line == "unset": - new_cache.append("ac_cv_env_%s_value=" % x) - else: - line=self.__ebp.read() - if line[-1] == "\n": - line=line[:-1] - if line.split()[0] != line: - #quoting... XXX - new_cache.append("ac_cv_env_%s_value='%s'" % (x,line)) - else: - new_cache.append("ac_cv_env_%s_value=%s" % (x,line)) - - myf=open(confcache,"w") - for x in new_cache: - myf.write(x+"\n") - myf.close() - - except SystemExit, e: - raise - except Exception,e: - print "caught exception: %s" % str(e) - try: myf.close() - except (IOError, OSError): pass - valid=False - - if not valid: - print "\nconfcache is invalid\n" - try: os.remove(confcache_list) - except OSError: pass - try: os.remove(confcache) - except OSError: pass - self.__ebp.write("empty") - valid=0 - else: - self.__ebp.write("location: %s" % confcache) - valid=1 - if lock: - portage_locks.unlockfile(lock) - return valid - - def update_confcache(self,settings,logfile,new_confcache, confcache=portage_const.CONFCACHE_FILE, \ - confcache_list=portage_const.CONFCACHE_LIST): - """internal function called when a processor has finished a configure, and wishes its cache - be transferred to the global cache - This runs through the sandbox log, storing the md5 of files along with the list of files to check. - Finally, it transfers the cache to the global location.""" - - if not self.__ebp: - import traceback - traceback.print_stack() - print "err... no ebp, yet load_confcache called. invalid" - sys.exit(1) - - import re - from portage_checksum import perform_md5 - if not (os.path.exists(logfile) and os.path.exists(new_confcache)) : - # eh? wth? - self.__ebp.write("failed") - return 0 - myfiles=portage_util.grabfile(logfile) - filter=re.compile('^(%s|/tmp|/dev|.*/\.ccache)/' % os.path.normpath(settings["PORTAGE_TMPDIR"])) - l=[] - for x in myfiles: - # get only read syscalls... - if x[0:8] == "open_rd:": - l.append(x.split()[1]) - - myfiles = portage_util.unique_array(l) - l=[] - for x in myfiles: - if not os.path.exists(x): - continue - if not filter.match(x): - l.append(x) - del myfiles - - if not len(l): - self.__ebp.write("updated") - return 0 - - lock=portage_locks.lockfile(confcache_list,wantnewlockfile=1) - # update phase. - if not os.path.exists(confcache_list): - prevmask=os.umask(0) - myf=anydbm.open(confcache_list,"n",0664) - os.umask(prevmask) - else: - myf=anydbm.open(confcache_list,"w",0664) - - for x in l: - try: - if not stat.S_ISDIR(os.stat(x).st_mode) and not myf.has_key(x): - myf[x]=str(perform_md5(x,calc_prelink=1)) - except (IOError, OSError): - # exceptions are only possibly (ignoring anydbm horkage) from os.stat - pass - myf.close() - from portage_data import portage_gid - os.chown(confcache_list, -1, portage_gid) - shutil.move(new_confcache, confcache) - os.chown(confcache, -1, portage_gid) - m=os.umask(0) - os.chmod(confcache, 0664) - os.chmod(confcache_list, 0664) - os.umask(m) - portage_locks.unlockfile(lock) - self.__ebp.write("updated") - return 0 - - def get_keys(self,myebuild,myroot="/"): - """request the auxdbkeys from an ebuild - returns a dict when successful, None when failed""" -# print "getting keys for %s" % myebuild - # normally, - # userpriv'd, minus sandbox. which is odd. - # I say both, personally (and I'm writing it, so live with it) - if self.__ebp: - import traceback - traceback.print_stack() - print "self.__ebp exists. it shouldn't. this indicates a handler w/ an active ebp never" - print "released it, or a bug in the calls" - sys.exit(1) - - - self.__ebp = request_ebuild_processor(self._config, userpriv=portage_exec.userpriv_capable) - - if self.__adjust_env("depend",myebuild,myroot): - return {} - - self.__ebp.write("process_ebuild depend") - self.__ebp.send_env() - self.__ebp.set_sandbox_state(True) - self.__ebp.write("start_processing") - line=self.__generic_phase(["sending_keys"], interpret_results=False) - if line != "sending_keys": - return None - mykeys={} - while line != "end_keys": - line=self.__ebp.read() - line=line[:-1] - if line == "failed": - self.__ebp.unlock() - return {} - if line == "end_keys" or not len(line): - continue - pair = line.split('=',1) - mykeys[pair[0]]=pair[1] - self.__ebp.expect("phases succeeded") - if not release_ebuild_processor(self.__ebp): - self.__ebp = None - raise Exception,"crud" - self.__ebp = None - return mykeys - - def __adjust_env(self,mydo,myebuild,myroot,debug=0,listonly=0,fetchonly=0,cleanup=0,dbkey=None,\ - use_cache=1,fetchall=0,tree="porttree",use_info_env=True,verbosity=0): - """formerly portage.doebuild, since it's specific to ebuilds, it's now a method of ebuild handling. - severely gutted, and in need of cleansing/exorcism""" - from portage import db,ExtractKernelVersion,fetch,features, \ - digestgen,digestcheck,root,flatten, digestParseFile - from portage_data import portage_uid,portage_gid,secpass - import portage_dep - from portage_util import writemsg - - ebuild_path = os.path.abspath(myebuild) - pkg_dir = os.path.dirname(ebuild_path) - - if self._config.configdict["pkg"].has_key("CATEGORY"): - cat = self._config.configdict["pkg"]["CATEGORY"] - else: - cat = os.path.basename(os.path.normpath(pkg_dir+"/..")) - mypv = os.path.basename(ebuild_path)[:-7] - mycpv = cat+"/"+mypv - - mysplit=portage_versions.pkgsplit(mypv,silent=0) - if mysplit==None: - writemsg("!!! Error: PF is null '%s'; exiting.\n" % mypv) - return 1 - - if mydo == "clean": - cleanup=True - - if mydo != "depend": - # XXX: We're doing a little hack here to curtain the gvisible locking - # XXX: that creates a deadlock... Really need to isolate that. - self._config.reset(use_cache=use_cache) - - self._config.setcpv(mycpv,use_cache=use_cache) - - if not os.path.exists(myebuild): - writemsg("!!! doebuild: "+str(myebuild)+" not found for "+str(mydo)+"\n") - return 1 - - if debug: # Otherwise it overrides emerge's settings. - # We have no other way to set debug... debug can't be passed in - # due to how it's coded... Don't overwrite this so we can use it. - self._config["PORTAGE_DEBUG"]=str(debug) - - self._config["ROOT"] = myroot - - self._config["EBUILD"] = ebuild_path - self._config["O"] = pkg_dir - self._config["CATEGORY"] = cat - self._config["FILESDIR"] = pkg_dir+"/files" - self._config["PF"] = mypv - - self._config["ECLASSDIR"] = self._config["PORTDIR"]+"/eclass" - - self._config["PROFILE_PATHS"] = PROFILE_PATH+"\n"+CUSTOM_PROFILE_PATH - self._config["P"] = mysplit[0]+"-"+mysplit[1] - self._config["PN"] = mysplit[0] - self._config["PV"] = mysplit[1] - self._config["PR"] = mysplit[2] - - # ensure this is set for all phases, setup included. - # Should be ok again to set $T, as sandbox does not depend on it - self._config["BUILD_PREFIX"] = self._config["PORTAGE_TMPDIR"]+"/portage" - self._config["BUILDDIR"] = self._config["BUILD_PREFIX"]+"/"+self._config["PF"] - self._config["T"] = self._config["BUILDDIR"]+"/temp" - self._config["WORKDIR"] = self._config["BUILDDIR"]+"/work" - self._config["D"] = self._config["BUILDDIR"]+"/image/" - - - # bailing now, probably horks a few things up, but neh. - # got to break a few eggs to make an omelot after all (spelling is wrong, too) :) - if mydo=="unmerge": - return 0 - - if mydo!="depend": - try: - self._config["INHERITED"],self._config["RESTRICT"] = db[root][tree].dbapi.aux_get( - mycpv,["INHERITED","RESTRICT"]) - - self._config["PORTAGE_RESTRICT"]=string.join(flatten(portage_dep.use_reduce( - portage_dep.paren_reduce(self._config["RESTRICT"]), - uselist=self._config["USE"].split() )),' ') - - except SystemExit, e: - raise - except Exception, e: - print "caught exception %s in ebd_proc:doebuild" % str(e) - self._config["RESTRICT"] = self._config["PORTAGE_RESTRICT"] = "" - pass - - - if mysplit[2] == "r0": - self._config["PVR"]=mysplit[1] - else: - self._config["PVR"]=mysplit[1]+"-"+mysplit[2] - - self._config["SLOT"]="" - - if self._config.has_key("PATH"): - mysplit=string.split(self._config["PATH"],":") - else: - mysplit=[] - - if PORTAGE_BIN_PATH not in mysplit: - self._config["PATH"]=PORTAGE_BIN_PATH+":"+self._config["PATH"] - - if tree=="bintree": - self._config["BUILD_PREFIX"] += "-pkg" - - self._config["HOME"] = self._config["BUILD_PREFIX"]+"/homedir" - self._config["PKG_TMPDIR"] = self._config["PORTAGE_TMPDIR"]+"/portage-pkg" - - if cleanup and os.path.exists(self._config["BUILDDIR"]): - print "cleansing builddir"+self._config["BUILDDIR"] - shutil.rmtree(self._config["BUILDDIR"]) - - if mydo=="clean": - # if clean, just flat out skip the rest of this crap. - return 0 - - self._config["PORTAGE_BASHRC"] = EBUILD_SH_ENV_FILE - - #set up KV variable -- DEP SPEEDUP :: Don't waste time. Keep var persistent. - - if mydo not in ["depend","fetch","digest","manifest"]: - if not self._config.has_key("KV"): - mykv,err1=ExtractKernelVersion(root+"usr/src/linux") - if mykv: - # Regular source tree - self._config["KV"]=mykv - else: - self._config["KV"]="" - - if (mydo!="depend") or not self._config.has_key("KVERS"): - myso=os.uname()[2] - self._config["KVERS"]=myso[1] - - - # get possible slot information from the deps file - if mydo=="depend": - if self._config.has_key("PORTAGE_DEBUG") and self._config["PORTAGE_DEBUG"]=="1": - # XXX: This needs to use a FD for saving the output into a file. - # XXX: Set this up through spawn - pass - writemsg("!!! DEBUG: dbkey: %s\n" % str(dbkey),2) - if dbkey: - self._config["dbkey"] = dbkey - else: - self._config["dbkey"] = self._config.depcachedir+"/aux_db_key_temp" - - return 0 - - self._config["PORTAGE_LOGFILE"]='' - logfile=None - - - #fetch/digest crap - if mydo not in ["prerm","postrm","preinst","postinst","config","help","setup","unmerge"]: - - newuris, alist = db["/"]["porttree"].dbapi.getfetchlist(mycpv,mysetting=self._config) - alluris, aalist = db["/"]["porttree"].dbapi.getfetchlist(mycpv,mysettings=self._config,all=1) - self._config["A"]=string.join(alist," ") - self._config["AA"]=string.join(aalist," ") - if ("mirror" in features) or fetchall: - fetchme=alluris[:] - checkme=aalist[:] - elif mydo=="digest": - fetchme=alluris[:] - checkme=aalist[:] - digestfn=self._config["FILESDIR"]+"/digest-"+self._config["PF"] - if os.path.exists(digestfn): - mydigests=digestParseFile(digestfn) - if mydigests: - for x in mydigests: - while x in checkme: - i = checkme.index(x) - del fetchme[i] - del checkme[i] - else: - fetchme=newuris[:] - checkme=alist[:] - - try: - if not os.path.exists(self._config["DISTDIR"]): - os.makedirs(self._config["DISTDIR"]) - if not os.path.exists(self._config["DISTDIR"]+"/cvs-src"): - os.makedirs(self._config["DISTDIR"]+"/cvs-src") - except OSError, e: - print "!!! File system problem. (Bad Symlink?)" - print "!!! Fetching may fail:",str(e) - - try: - mystat=os.stat(self._config["DISTDIR"]+"/cvs-src") - if ((mystat[stat.ST_GID]!=portage_gid) or ((mystat[stat.ST_MODE]&00775)!=00775)) and not listonly: - print "*** Adjusting cvs-src permissions for portage user..." - os.chown(self._config["DISTDIR"]+"/cvs-src",0,portage_gid) - os.chmod(self._config["DISTDIR"]+"/cvs-src",00775) - portage_exec.spawn("chgrp -R "+str(portage_gid)+" "+self._config["DISTDIR"]+"/cvs-src") - portage_exec.spawn("chmod -R g+rw "+self._config["DISTDIR"]+"/cvs-src") - except (IOError, OSError): - pass - - if not fetch(fetchme, self._config, listonly=listonly, fetchonly=fetchonly,verbosity=verbosity): - return 1 - - if mydo=="fetch" and listonly: - return 0 - - if "digest" in features: - #generate digest if it doesn't exist. - if mydo=="digest": - # exemption to the return rule - return (not digestgen(aalist,self._config,overwrite=1,verbosity=verbosity)) - else: - digestgen(aalist,self._config,overwrite=0,verbosity=verbosity) - - elif mydo=="digest": - #since we are calling "digest" directly, recreate the digest even if it already exists - return (not digestgen(checkme,self._config,overwrite=1,verbosity=verbosity)) - if mydo=="manifest": - return (not digestgen(checkme,self._config,overwrite=1,manifestonly=1,verbosity=verbosity)) - - if not digestcheck(checkme, self._config, ("strict" in features),verbosity=verbosity): - return 1 - - if mydo=="fetch": - return 0 - - if not os.path.exists(self._config["BUILD_PREFIX"]): - os.makedirs(self._config["BUILD_PREFIX"]) - os.chown(self._config["BUILD_PREFIX"],portage_uid,portage_gid) - os.chmod(self._config["BUILD_PREFIX"],00775) - - if not os.path.exists(self._config["T"]): - print "creating temp dir" - os.makedirs(self._config["T"]) - os.chown(self._config["T"],portage_uid,portage_gid) - os.chmod(self._config["T"],0770) - - logdir = self._config["T"]+"/logging" - if not os.path.exists(logdir): - os.makedirs(logdir) - os.chown(logdir, portage_uid, portage_gid) - os.chmod(logdir, 0770) - - try: - #XXX: negative restrict - myrestrict = self._config["PORTAGE_RESTRICT"].split() - if ("nouserpriv" not in myrestrict and "userpriv" not in myrestrict): - if ("userpriv" in self._config.features) and (portage_uid and portage_gid): - if (secpass==2): - if os.path.exists(self._config["HOME"]): - # XXX: Potentially bad, but held down by HOME replacement above. - portage_exec.spawn("rm -Rf "+self._config["HOME"]) - if not os.path.exists(self._config["HOME"]): - os.makedirs(self._config["HOME"]) - elif ("userpriv" in features): - print "!!! Disabling userpriv from features... Portage UID/GID not valid." - del features[features.index("userpriv")] - except (IOError, OSError), e: - print "!!! Couldn't empty HOME:",self._config["HOME"] - print "!!!",e - - - try: - # no reason to check for depend since depend returns above. - if not os.path.exists(self._config["BUILD_PREFIX"]): - os.makedirs(self._config["BUILD_PREFIX"]) - os.chown(self._config["BUILD_PREFIX"],portage_uid,portage_gid) - if not os.path.exists(self._config["BUILDDIR"]): - os.makedirs(self._config["BUILDDIR"]) - os.chown(self._config["BUILDDIR"],portage_uid,portage_gid) - - - except OSError, e: - print "!!! File system problem. (ReadOnly? Out of space?)" - print "!!! Perhaps: rm -Rf",self._config["BUILD_PREFIX"] - print "!!!",str(e) - return 1 - - try: - if not os.path.exists(self._config["HOME"]): - os.makedirs(self._config["HOME"]) - os.chown(self._config["HOME"],portage_uid,portage_gid) - os.chmod(self._config["HOME"],02770) - - except OSError, e: - print "!!! File system problem. (ReadOnly? Out of space?)" - print "!!! Failed to create fake home directory in BUILDDIR" - print "!!!",str(e) - return 1 - - try: - if ("userpriv" in features) and ("ccache" in features): - if (not self._config.has_key("CCACHE_DIR")) or (self._config["CCACHE_DIR"]==""): - self._config["CCACHE_DIR"]=self._config["PORTAGE_TMPDIR"]+"/ccache" - if not os.path.exists(self._config["CCACHE_DIR"]): - os.makedirs(self._config["CCACHE_DIR"]) - os.chown(self._config["CCACHE_DIR"],portage_uid,portage_gid) - os.chmod(self._config["CCACHE_DIR"],0775) - except OSError, e: - print "!!! File system problem. (ReadOnly? Out of space?)" - print "!!! Perhaps: rm -Rf",self._config["BUILD_PREFIX"] - print "!!!",str(e) - return 1 - - try: - mystat=os.stat(self._config["CCACHE_DIR"]) - if (mystat[stat.ST_GID]!=portage_gid) or ((mystat[stat.ST_MODE]&02070)!=02070): - print "*** Adjusting ccache permissions for portage user..." - os.chown(self._config["CCACHE_DIR"],portage_uid,portage_gid) - os.chmod(self._config["CCACHE_DIR"],02770) - portage_exec.spawn("chown -R "+str(portage_uid)+":"+str(portage_gid)+" "+self._config["CCACHE_DIR"]) - portage_exec.spawn("chmod -R g+rw "+self._config["CCACHE_DIR"]) - except (OSError, IOError): - pass - - if "distcc" in features: - try: - if (not self._config.has_key("DISTCC_DIR")) or (self._config["DISTCC_DIR"]==""): - self._config["DISTCC_DIR"]=self._config["PORTAGE_TMPDIR"]+"/portage/.distcc" - if not os.path.exists(self._config["DISTCC_DIR"]): - os.makedirs(self._config["DISTCC_DIR"]) - os.chown(self._config["DISTCC_DIR"],portage_uid,portage_gid) - os.chmod(self._config["DISTCC_DIR"],02775) - for x in ("/lock", "/state"): - if not os.path.exists(self._config["DISTCC_DIR"]+x): - os.mkdir(self._config["DISTCC_DIR"]+x) - os.chown(self._config["DISTCC_DIR"]+x,portage_uid,portage_gid) - os.chmod(self._config["DISTCC_DIR"]+x,02775) - except OSError, e: - writemsg("\n!!! File system problem when setting DISTCC_DIR directory permissions.\n") - writemsg( "!!! DISTCC_DIR="+str(self._config["DISTCC_DIR"]+"\n")) - writemsg( "!!! "+str(e)+"\n\n") - time.sleep(5) - features.remove("distcc") - self._config["DISTCC_DIR"]="" - - # break off into process_phase - if self._config.has_key("PORT_LOGDIR"): - try: - st=os.stat(self._config["PORT_LOGDIR"]) - if not st.st_gid == portage_gid: - os.chown(self._config["PORT_LOGDIR"], -1, portage_gid) - if not st.st_mode & (os.W_OK << 3): - os.chmod(self._config["PORT_LOGDIR"], st.st_mode | (os.W_OK << 3)) - # by this time, we have write access to the logdir. or it's bailed. - try: - os.chown(self._config["BUILD_PREFIX"],portage_uid,portage_gid) - os.chmod(self._config["PORT_LOGDIR"],00770) - if not self._config.has_key("LOG_PF") or (self._config["LOG_PF"] != self._config["PF"]): - self._config["LOG_PF"]=self._config["PF"] - self._config["LOG_COUNTER"]=str(db[myroot]["vartree"].dbapi.get_counter_tick_core("/")) - self._config["PORTAGE_LOGFILE"]="%s/%s-%s.log" % (self._config["PORT_LOGDIR"],self._config["LOG_COUNTER"],self._config["LOG_PF"]) - if os.path.exists(self._config["PORTAGE_LOGFILE"]): - os.chmod(self._config["PORTAGE_LOGFILE"], 0664) - os.chown(self._config["PORTAGE_LOGFILE"], -1,portage_gid) - except ValueError, e: - self._config["PORT_LOGDIR"]="" - print "!!! Unable to chown/chmod PORT_LOGDIR. Disabling logging." - print "!!!",e - except (OSError, IOError): - print "!!! Cannot create log... No write access / Does not exist" - print "!!! PORT_LOGDIR:",self._config["PORT_LOGDIR"] - self._config["PORT_LOGDIR"]="" - - # if any of these are being called, handle them -- running them out of the sandbox -- and stop now. - if mydo in ["help","setup"]: - return 0 -# return spawn(EBUILD_SH_BINARY+" "+mydo,self._config,debug=debug,free=1,logfile=logfile) - elif mydo in ["prerm","postrm","preinst","postinst","config"]: - self._config.load_infodir(pkg_dir) - if not use_info_env: - print "overloading port_env_file setting to %s" % self._config["T"]+"/environment" - self._config["PORT_ENV_FILE"] = self._config["T"] + "/environment" - if not os.path.exists(self._config["PORT_ENV_FILE"]): - from output import red - print red("!!!")+" err.. it doesn't exist. that's bad." - sys.exit(1) - return 0 -# return spawn(EBUILD_SH_BINARY+" "+mydo,self._config,debug=debug,free=1,logfile=logfile) - - try: - self._config["SLOT"], self._config["RESTRICT"] = db["/"]["porttree"].dbapi.aux_get(mycpv,["SLOT","RESTRICT"]) - except (IOError,KeyError): - print red("doebuild():")+" aux_get() error reading "+mycpv+"; aborting." - sys.exit(1) - - #initial dep checks complete; time to process main commands - - nosandbox=(("userpriv" in features) and ("usersandbox" not in features)) - actionmap={ - "depend": { "args":(0,1)}, # sandbox / portage - "setup": { "args":(1,0)}, # without / root - "unpack": {"dep":"setup", "args":(0,1)}, # sandbox / portage - "compile": {"dep":"unpack", "args":(nosandbox,1)}, # optional / portage - "test": {"dep":"compile", "args":(nosandbox,1)}, # optional / portage - "install": {"dep":"test", "args":(0,0)}, # sandbox / root - "rpm": {"dep":"install", "args":(0,0)}, # sandbox / root - "package": {"dep":"install", "args":(0,0)}, # sandbox / root - } - - if mydo in actionmap.keys(): - if mydo=="package": - for x in ["","/"+self._config["CATEGORY"],"/All"]: - if not os.path.exists(self._config["PKGDIR"]+x): - os.makedirs(self._config["PKGDIR"]+x) - # REBUILD CODE FOR TBZ2 --- XXXX - return 0 -# return spawnebuild(mydo,actionmap,self._config,debug,logfile=logfile) - elif mydo=="qmerge": - #check to ensure install was run. this *only* pops up when users forget it and are using ebuild - bail=False - if not os.path.exists(self._config["BUILDDIR"]+"/.completed_stages"): - bail=True - else: - myf=open(self._config["BUILDDIR"]+"/.completed_stages") - myd=myf.readlines() - myf.close() - if len(myd) == 0: - bail = True - else: - bail = ("install" not in myd[0].split()) - if bail: - print "!!! mydo=qmerge, but install phase hasn't been ran" - sys.exit(1) - - #qmerge is specifically not supposed to do a runtime dep check - return 0 -# return merge(self._config["CATEGORY"],self._config["PF"],self._config["D"],self._config["BUILDDIR"]+"/build-info",myroot,self._config) - elif mydo=="merge": - return 0 -# retval=spawnebuild("install",actionmap,self._config,debug,alwaysdep=1,logfile=logfile) - if retval: - return retval - -# return merge(self._config["CATEGORY"],self._config["PF"],self._config["D"],self._config["BUILDDIR"]+"/build-info",myroot,self._config,myebuild=self._config["EBUILD"]) - else: - print "!!! Unknown mydo:",mydo - sys.exit(1) - - # phases - # my... god... this... is... ugly. - # we're talking red headed step child of medusa ugly here. - - def process_phase(self,phase,myebuild,myroot,allstages=False,**keywords): - """the public 'doebuild' interface- all phases are called here, along w/ a valid config - allstages is the equivalent of 'do merge, and all needed phases to get to it' - **keywords is options passed on to __adjust_env. It will be removed as __adjust_env is digested""" - from portage import merge,unmerge,features - - validcommands = ["help","clean","prerm","postrm","preinst","postinst", - "config","setup","depend","fetch","digest", - "unpack","compile","test","install","rpm","qmerge","merge", - "package","unmerge", "manifest"] - - if phase not in validcommands: - validcommands.sort() - writemsg("!!! doebuild: '%s' is not one of the following valid commands:" % phase) - for vcount in range(len(validcommands)): - if vcount%6 == 0: - writemsg("\n!!! ") - writemsg(string.ljust(validcommands[vcount], 11)) - writemsg("\n") - return 1 - - retval=self.__adjust_env(phase,myebuild,myroot,**keywords) - if retval: - return retval - - if "userpriv" in features: - sandbox = ("usersandbox" in features) - else: - sandbox = ("sandbox" in features) - - droppriv=(("userpriv" in features) and \ - ("nouserpriv" not in string.split(self._config["PORTAGE_RESTRICT"])) and portage_exec.userpriv_capable) - use_fakeroot=(("userpriv_fakeroot" in features) and droppriv and portage_exec.fakeroot_capable) - - # basically a nasty graph of 'w/ this phase, have it userprived/sandboxed/fakeroot', and run - # these phases prior - actionmap={ - "depend": { "sandbox":False, "userpriv":True, "fakeroot":False}, - "setup": { "sandbox":True, "userpriv":False, "fakeroot":False}, - "unpack": {"dep":"setup", "sandbox":sandbox, "userpriv":True, "fakeroot":False}, - "compile": {"dep":"unpack", "sandbox":sandbox,"userpriv":True, "fakeroot":False}, - "test": {"dep":"compile","sandbox":sandbox,"userpriv":True, "fakeroot":False}, - "install": {"dep":"test", "sandbox":(not use_fakeroot or (not use_fakeroot and sandbox)), - "userpriv":use_fakeroot,"fakeroot":use_fakeroot}, - "rpm": {"dep":"install","sandbox":False, "userpriv":use_fakeroot, "fakeroot":use_fakeroot}, - "package": {"dep":"install", "sandbox":False, "userpriv":use_fakeroot, "fakeroot":use_fakeroot}, - "merge" : {"dep":"install", "sandbox":True, "userpriv":False, "fakeroot":False} - } - - merging=False - # this shouldn't technically ever be called, get_keys exists for this. - # left in for compatability while portage.doebuild still exists - if phase=="depend": - return retval - elif phase=="unmerge": - return unmerge(self._config["CATEGORY"],self._config["PF"],myroot,self._config) - elif phase in ["fetch","digest","manifest","clean"]: - return retval - elif phase=="merge": - merging=True - elif phase=="qmerge": - #no phases ran. - phase="merge" - merging=True -# return merge(self._config["CATEGORY"],self._config["PF"],self._config["D"],self._config["BUILDDIR"]+"/build-info",myroot,\ -# self._config) - - elif phase in ["help","clean","prerm","postrm","preinst","postinst","config"]: - self.__ebp = request_ebuild_processor(self._config, userpriv=False) - self.__ebp.write("process_ebuild %s" % phase) - self.__ebp.send_env(self._config) - self.__ebp.set_sandbox_state(phase in ["help","clean"]) - self.__ebp.write("start_processing") - retval = self.__generic_phase([],self._config) - release_ebuild_processor(self.__ebp) - self.__ebp = None - return not retval - - k=phase - # represent the phases to run, grouping each phase based upon if it's sandboxed, fakerooted, and userpriv'd - # ugly at a glance, but remember a processor can run multiple phases now. - # best to not be wasteful in terms of env saving/restoring, and just run all applicable phases in one shot - phases=[[[phase]]] - sandboxed=[[actionmap[phase]["sandbox"]]] - privs=[(actionmap[phase]["userpriv"],actionmap[phase]["fakeroot"])] - - if allstages: - while actionmap[k].has_key("dep"): - k=actionmap[k]["dep"] - if actionmap[k]["userpriv"] != privs[-1][0] or actionmap[k]["fakeroot"] != privs[-1][1]: - phases.append([[k]]) - sandboxed.append([actionmap[k]["sandbox"]]) - privs.append((actionmap[k]["userpriv"],actionmap[k]["fakeroot"])) - elif actionmap[k]["sandbox"] != sandboxed[-1][-1]: - phases[-1].append([k]) - sandboxed[-1].extend([actionmap[k]["sandbox"]]) - else: - phases[-1][-1].append(k) - privs.reverse() - phases.reverse() - sandboxed.reverse() - for x in phases: - for y in x: - y.reverse() - x.reverse() - # and now we have our phases grouped in parallel to the sandbox/userpriv/fakeroot state. - - all_phases = portage_util.flatten(phases) - -# print "all_phases=",all_phases -# print "phases=",phases -# print "sandbox=",sandboxed -# print "privs=",privs -# sys.exit(1) -# print "\n\ndroppriv=",droppriv,"use_fakeroot=",use_fakeroot,"\n\n" - - #temporary hack until sandbox + fakeroot (if ever) play nice. - while privs: - if self.__ebp == None or (droppriv and self.__ebp.userprived() != privs[0][0]) or \ - (use_fakeroot and self.__ebp.fakerooted() != privs[0][1]): - if self.__ebp != None: - print "swapping processors for",phases[0][0] - release_ebuild_processor(self.__ebp) - self.__ebp = None - opts={} - - #only engage fakeroot when userpriv'd - if use_fakeroot and privs[0][1]: - opts["save_file"] = self._config["T"]+"/fakeroot_db" - - self.__ebp = request_ebuild_processor(self._config, userpriv=(privs[0][0] and droppriv), \ - fakeroot=(privs[0][1] and use_fakeroot), \ - - sandbox=(not (privs[0][1] and use_fakeroot) and portage_exec.sandbox_capable),**opts) - - #loop through the instances where the processor must have the same sandboxed state- - #note a sandbox'd process can have it's sandbox disabled. - #this seperation is needed since you can't mix sandbox and fakeroot atm. - for sandbox in sandboxed[0]: - if "merge" in phases[0][0]: - if len(phases[0][0]) == 1: - print "skipping this phase, it's just merge" - continue - phases[0][0].remove("merge") - - self.__ebp.write("process_ebuild %s" % string.join(phases[0][0]," ")) - self.__ebp.send_env(self._config) - self.__ebp.set_sandbox_state(sandbox) - self.__ebp.write("start_processing") - phases[0].pop(0) - retval = not self.__generic_phase([],self._config) - if retval: - release_ebuild_processor(self.__ebp) - self.__ebp = None - return retval - sandboxed.pop(0) - privs.pop(0) - phases.pop(0) - # hey hey. we're done. Now give it back. - release_ebuild_processor(self.__ebp) - self.__ebp = None - - # packaging moved out of ebuild.sh, and into this code. - # makes it so ebuild.sh no longer must run as root for the package phase. - if "package" in all_phases: - print "processing package" - #mv "${PF}.tbz2" "${PKGDIR}/All" - if not os.path.exists(self._config["PKGDIR"]+"/All"): - os.makedirs(self._config["PKGDIR"]+"/All") - if not os.path.exists(self._config["PKGDIR"]+"/"+self._config["CATEGORY"]): - os.makedirs(self._config["PKGDIR"]+"/"+self._config["CATEGORY"]) - if os.path.exists("%s/All/%s.tbz2" % (self._config["PKGDIR"],self._config["PF"])): - os.remove("%s/All/%s.tbz2" % (self._config["PKGDIR"],self._config["PF"])) - retval = not portage_util.movefile("%s/%s.tbz2" % (self._config["BUILDDIR"],self._config["PF"]), - self._config["PKGDIR"]+"/All/"+self._config["PF"]+".tbz2") > 0 - if retval: return False - if os.path.exists("%s/%s/%s.tbz2" % (self._config["PKGDIR"],self._config["CATEGORY"],self._config["PF"])): - os.remove("%s/%s/%s.tbz2" % (self._config["PKGDIR"],self._config["CATEGORY"],self._config["PF"])) - os.symlink("%s/All/%s.tbz2" % (self._config["PKGDIR"],self._config["PF"]), - "%s/%s/%s.tbz2" % (self._config["PKGDIR"],self._config["CATEGORY"],self._config["PF"])) - - #same as the package phase above, removes the root requirement for the rpm phase. - if "rpm" in all_phases: - rpm_name="%s-%s-%s" % (self._config["PN"],self._config["PV"],self._config["PR"]) - - retval = not portage_util.movefile("%s/%s.tar.gz" % (self._config["T"],self._config["PF"]), - "/usr/src/redhat/SOURCES/%s.tar.gz" % self._config["PF"]) > 0 - if retval: - print "moving src for rpm failed, retval=",retval - return False - - retval=portage_exec.spawn(("rpmbuild","-bb","%s/%s.spec" % \ - (self._config["BUILDDIR"],self._config["PF"]))) - if retval: - print "Failed to integrate rpm spec file" - return retval - - if not os.path.exists(self._config["RPMDIR"]+"/"+self._config["CATEGORY"]): - os.makedirs(self._config["RPMDIR"]+"/"+self._config["CATEGORY"]) - - retval = not portage_util.movefile("/usr/src/redhat/RPMS/i386/%s.i386.rpm" % rpm_name, - "%s/%s/%s.rpm" % (self._config["RPMDIR"],self._config["CATEGORY"],rpm_name)) > 0 - if retval: - print "rpm failed" - return retval - - - # not great check, but it works. - # basically, if FEATURES="-buildpkg" emerge package was called, the files in the current - # image directory don't have their actual perms. so we use an ugly bit of bash - # to make the fakeroot (claimed) permissions/owners a reality. - if use_fakeroot and os.path.exists(self._config["T"]+"/fakeroot_db") and merging: - print "correcting fakeroot privs" - retval=portage_exec.spawn(("/usr/lib/portage/bin/affect-fakeroot-perms.sh", \ - self._config["T"]+"/fakeroot_db", \ - self._config["D"]),env={"BASHRC":portage_const.INVALID_ENV_FILE}) - if retval or retval == None: - print red("!!!")+"affecting fakeroot perms after the fact failed" - return retval - - if merging: - print "processing merge" - retval = merge(self._config["CATEGORY"],self._config["PF"],self._config["D"],self._config["BUILDDIR"]+"/build-info",myroot,\ - self._config,myebuild=self._config["EBUILD"]) - return retval - - # this basically handles all hijacks from the daemon, whether confcache or portageq. - def __generic_phase(self,breakers,interpret_results=True): - """internal function that responds to the running ebuild processor's requests - this enables portageq hijack, sandbox summaries, confcache among other things - interpret_results controls whether this returns true/false, or the string the - processor spoke that caused this to release control - breaks is list of strings that cause this loop/interpretter to relinquish control""" - b = breakers[:] - b.extend(["prob","phases failed","phases succeeded","env_receiving_failed"]) - line='' - while line not in b: - line=self.__ebp.read() - line=line[:-1] - - if line[0:23] == "request_sandbox_summary": - self.__ebp.sandbox_summary(line[24:]) - elif line[0:17] == "request_confcache": - self.load_confcache(line[18:]) - elif line[0:16] == "update_confcache": - k=line[17:].split() - # sandbox_debug_log, local_cache - self.update_confcache(self._config,k[0],k[1]) - elif line[0:8] == "portageq": - keys=line[8:].split() - try: - e,s=getattr(self.portageq,keys[0])(keys[1:]) - except SystemExit, e: - raise - except Exception, ex: - sys.stderr.write("caught exception %s\n" % str(ex)) - e=2 - s="ERROR: insufficient paramters!" - self.__ebp.write("return_code="+str(e)) - if len(s): - self.__ebp.write(s) - self.__ebp.write("stop_text") - self.processed += 1 - if interpret_results: - return (line=="phases succeeded") - return line - diff --git a/portage/ebuild/ebuild_package.py b/portage/ebuild/ebuild_package.py deleted file mode 100644 index afbec74..0000000 --- a/portage/ebuild/ebuild_package.py +++ /dev/null @@ -1,89 +0,0 @@ -# Copyright: 2005 Gentoo Foundation -# Author(s): Brian Harring (ferringb@gentoo.org) -# License: GPL2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/portage/ebuild/ebuild_package.py,v 1.2 2005/07/13 05:51:34 ferringb Exp $ - -import os -from portage import package - -class ebuild_package(package.metadata.package): - - def __getattr__(self, key): - if key == "path": - return self.__dict__.setdefault("path", os.path.join(self.__dict__["_parent"].base, \ - self.category, self.package, "%s-%s.ebuild" % (self.package, self.fullver))) - - if key == "_mtime_": - #XXX wrap this. - return self.__dict__.setdefault("_mtime_",long(os.stat(self.path).st_mtime)) - elif key == "P": - return self.__dict__.setdefault("P", self.package + "-" + self.version) - elif key == "PN": - return self.__dict__.setdefault("PN", self.package) - elif key == "PR": - return self.__dict__.setdefault("PR", "-r"+str(self.revision)) - - return super(ebuild_package, self).__getattr__(key) - - - def _fetch_metadata(self): -# import pdb;pdb.set_trace() - data = self._parent._get_metadata(self) - doregen = False - if data == None: - doregen = True - - # got us a dict. yay. - if not doregen: - if self._mtime_ != data.get("_mtime_"): - doregen = True - elif data.get("_eclasses_") != None and not self._parent._ecache.is_eclass_data_valid(data["_eclasses_"]): - doregen = True - - if doregen: - # ah hell. - data = self._parent._update_metadata(self) - -# for k,v in data.items(): -# self.__dict__[k] = v - -# self.__dict__["_finalized"] = True - return data - - -class ebuild_factory(package.metadata.factory): - child_class = ebuild_package - - def __init__(self, parent, cachedb, eclass_cache, *args,**kwargs): - super(ebuild_factory, self).__init__(parent, *args,**kwargs) - self._cache = cachedb - self._ecache = eclass_cache - self.base = self._parent_repo.base - - def _get_metadata(self, pkg): - if self._cache != None: - try: - return self._cache[pkg.cpvstr] - except KeyError: - pass - return None - - def _update_metadata(self, pkg): - - import processor - ebp=processor.request_ebuild_processor() - mydata = ebp.get_keys(pkg, self._ecache) - processor.release_ebuild_processor(ebp) - - mydata["_mtime_"] = pkg._mtime_ - if mydata.get("INHERITED", False): - mydata["_eclasses_"] = self.eclassdb.get_eclass_data(mydata["INHERITED"].split() ) - del mydata["INHERITED"] - else: - mydata["_eclasses_"] = {} - - if self._cache != None: - self._cache[pkg.cpvstr] = mydata - - return mydata - diff --git a/portage/ebuild/ebuild_repository.py b/portage/ebuild/ebuild_repository.py deleted file mode 100644 index ba4f864..0000000 --- a/portage/ebuild/ebuild_repository.py +++ /dev/null @@ -1,68 +0,0 @@ -# Copyright: 2005 Gentoo Foundation -# Author(s): Brian Harring (ferringb@gentoo.org) -# License: GPL2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/portage/ebuild/ebuild_repository.py,v 1.2 2005/07/13 05:51:34 ferringb Exp $ - -import os, stat -from portage.repository import prototype, errors -#import ebuild_internal -import ebuild_package - -class tree(prototype.tree): - false_categories = ("eclass","profiles","packages","distfiles","licenses","scripts") - - def __init__(self, location, cache=None, eclass_cache=None): - super(tree, self).__init__() - self.base = location - try: - st = os.lstat(self.base) - if not stat.S_ISDIR(st.st_mode): - raise errors.InitializationError("base not a dir: %s" % self.base) - elif not st.st_mode & (os.X_OK|os.R_OK): - raise errors.InitializationError("base lacks read/executable: %s" % self.base) - - except OSError: - raise errors.InitializationError("lstat failed on base %s" % self.base) - if eclass_cache == None: - import eclass_cache - eclass_cache = eclass_cache.cache(self.base) - self.package_class = ebuild_package.ebuild_factory(self, cache, eclass_cache).new_package - - - def _get_categories(self, *optionalCategory): - # why the auto return? current porttrees don't allow/support categories deeper then one dir. - if len(optionalCategory): - #raise KeyError - return () - - try: return tuple([x for x in os.listdir(self.base) \ - if stat.S_ISDIR(os.lstat(os.path.join(self.base,x)).st_mode) and x not in self.false_categories]) - - except (OSError, IOError), e: - raise KeyError("failed fetching categories: %s" % str(e)) - - - def _get_packages(self, category): - - cpath = os.path.join(self.base,category.lstrip(os.path.sep)) - try: return tuple([x for x in os.listdir(cpath) \ - if stat.S_ISDIR(os.lstat(os.path.join(cpath,x)).st_mode)]) - - except (OSError, IOError), e: - raise KeyError("failed fetching packages for category %s: %s" % \ - (os.path.join(self.base,category.lstrip(os.path.sep)), str(e))) - - - def _get_versions(self, catpkg): - - pkg = catpkg.split("/")[-1] - cppath = os.path.join(self.base, catpkg.lstrip(os.path.sep)) - # 7 == len(".ebuild") - try: return tuple([x[len(pkg):-7].lstrip("-") for x in os.listdir(cppath) \ - if x.endswith(".ebuild") and x.startswith(pkg) and \ - stat.S_ISREG(os.lstat(os.path.join(cppath,x)).st_mode)]) - - except (OSError, IOError), e: - raise KeyError("failed fetching versions for package %s: %s" % \ - (os.path.join(self.base,catpkg.lstrip(os.path.sep)), str(e))) - diff --git a/portage/ebuild/eclass_cache.py b/portage/ebuild/eclass_cache.py deleted file mode 100644 index 1aa821c..0000000 --- a/portage/ebuild/eclass_cache.py +++ /dev/null @@ -1,77 +0,0 @@ -# Copyright: 2005 Gentoo Foundation -# Author(s): Brian Harring (ferringb@gentoo.org) -# License: GPL2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/portage/ebuild/eclass_cache.py,v 1.2 2005/07/13 05:51:34 ferringb Exp $ - -from portage.util.fs import normpath -import os, sys - -class cache: - """ - Maintains the cache information about eclasses used in ebuild. - get_eclass_path and get_eclass_data are special- one (and only one) can be set to None. - Any code trying to get eclass data/path will choose which method it prefers, falling back to what's available if only one option - exists. - - get_eclass_path should be defined when local path is possible/preferable. - get_eclass_data should be defined when dumping the eclass down the pipe is preferable/required (think remote tree) - - Base defaults to having both set (it's local, and i. Override as needed. - """ - def __init__(self, porttree, *additional_porttrees): - self.eclasses = {} # {"Name": ("location","_mtime_")} - - self.porttrees = tuple(map(normpath, [porttree] + list(additional_porttrees))) - self._master_eclass_root = os.path.join(self.porttrees[0],"eclass") - self.update_eclasses() - - - def update_eclasses(self): - self.eclasses = {} - eclass_len = len(".eclass") - for x in [normpath(os.path.join(y,"eclass")) for y in self.porttrees]: - if not os.path.isdir(x): - continue - for y in [y for y in os.listdir(x) if y.endswith(".eclass")]: - try: - mtime=os.stat(x+"/"+y).st_mtime - except OSError: - continue - ys=y[:-eclass_len] - self.eclasses[ys] = (x, long(mtime)) - - - def is_eclass_data_valid(self, ec_dict): - if not isinstance(ec_dict, dict): - return False - for eclass, tup in ec_dict.iteritems(): - if eclass not in self.eclasses or tuple(tup) != self.eclasses[eclass]: - return False - - return True - - - def get_eclass_data(self, inherits, from_master_only=False): - ec_dict = {} - for x in inherits: - try: - ec_dict[x] = self.eclasses[x] - except: - print "ec=",ec_dict - print "inherits=",inherits - raise - if from_master_only and self.eclasses[x][0] != self._master_eclass_root: - return None - - return ec_dict - - def get_eclass_path(self, eclass): - """get on disk eclass path. remote implementations need a way to say 'piss off tool' if this is called...""" - return os.path.join(self.eclasses[eclass][0],eclass+".eclass") - - def get_eclass_contents(self, eclass): - """Get the actual contents of the eclass. This should be overridden for remote implementations""" - f=file(os.path.join(self.eclasses[eclass][0], eclass+".eclass"),"r") - l=f.read() - f.close() - return l diff --git a/portage/ebuild/processor.py b/portage/ebuild/processor.py deleted file mode 100644 index 0f1e29d..0000000 --- a/portage/ebuild/processor.py +++ /dev/null @@ -1,455 +0,0 @@ -# Copyright: 2004-2005 Gentoo Foundation -# Author(s): Brian Harring (ferringb@gentoo.org) -# License: GPL2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/portage/ebuild/processor.py,v 1.2 2005/07/13 05:51:34 ferringb Exp $ - -inactive_ebp_list = [] -active_ebp_list = [] - -import portage.spawn, os, logging -from inspect import isroutine, isclass - -def shutdown_all_processors(): - """kill off all known processors""" - global active_ebp_list, inactive_ebp_list - if type(active_ebp_list) != types.ListType: - print "warning, ebuild.active_ebp_list wasn't a list." - active_ebp_list = [] - - if type(inactive_ebp_list) != types.ListType: - print "warning, ebuild.inactive_ebp_list wasn't a list." - inactive_ebp_list = [] - - while len(active_ebp_list) > 0: - try: active_ebp_list[0].shutdown_processor() - except (IOError,OSError): - active_ebp_list.pop(0) - continue - try: active_ebp_list.pop(0) - except IndexError: pass - - while len(inactive_ebp_list) > 0: - try: - inactive_ebp_list[0].shutdown_processor() - except (IOError,OSError): - inactive_ebp_list.pop(0) - continue - try: inactive_ebp_list.pop(0) - except IndexError: pass - - -def request_ebuild_processor(userpriv=False, sandbox=None, fakeroot=False, save_file=None): - """request an ebuild_processor instance from the pool, or create a new one - this walks through the requirements, matching a inactive processor if one exists - note fakerooted processors are never reused, do to the nature of fakeroot""" - - if sandbox == None: - sandbox = portage.spawn.sandbox_capable - - global inactive_ebp_list, active_ebp_list - if not fakeroot: - for x in inactive_ebp_list: - if x.userprived() == userpriv and (x.sandboxed() or not sandbox): - inactive_ebp_list.remove(x) - active_ebp_list.append(x) - return x - e=ebuild_processor(userpriv, sandbox, fakeroot, save_file) - active_ebp_list.append(e) - return e - - -def release_ebuild_processor(ebp): - """the inverse of request_ebuild_processor. Any processor requested via request_ebuild_processor - _must_ be released via this function once it's no longer in use. - this includes fakerooted processors. - Returns True exempting when the processor requested to be released isn't marked as active""" - - global inactive_ebp_list, active_ebp_list - try: active_ebp_list.remove(ebp) - except ValueError: return False - - try: inactive_ebp_list.index(ebp) - except ValueError: - # if it's a fakeroot'd process, we throw it away. it's not useful outside of a chain of calls - if not ebp.onetime(): - inactive_ebp_list.append(ebp) - else: - del ebp - return True - - # if it makes it this far, that means ebp was already in the inactive list. - # which is indicative of an internal fsck up. - import traceback - print "ebp was requested to be free'd, yet it already is claimed inactive _and_ was in the active list" - print "this means somethings horked, badly" - traceback.print_stack() - return False - - -class ebuild_processor: - """abstraction of a running ebuild.sh instance- the env, functions, etc that ebuilds expect.""" - def __init__(self, userpriv, sandbox, fakeroot, save_file): - """ebuild_daemon_path shouldn't be fooled with unless the caller knows what they're doing. - sandbox enables a sandboxed processor - userpriv enables a userpriv'd processor - fakeroot enables a fakeroot'd processor- this is a mutually exclusive option to sandbox, and - requires userpriv to be enabled. Violating this will result in nastyness""" - - from portage.const import EBUILD_DAEMON_PATH, PORTAGE_BIN_PATH - - self.ebd = EBUILD_DAEMON_PATH - self.ebd_libs = PORTAGE_BIN_PATH - from portage_data import portage_uid, portage_gid - spawn_opts = {} - - if fakeroot and (sandbox or not userpriv): - import traceback - traceback.print_stack() - print "warning, was asking to enable fakeroot but-" - print "sandbox",sandbox,"userpriv",userpriv - print "this isn't valid. bailing" - raise Exception,"cannot initialize with sandbox and fakeroot" - - if userpriv: - self.__userpriv = True - spawn_opts.update({"uid":portage_uid,"gid":portage_gid,"groups":[portage_gid],"umask":002}) - else: - if portage.spawn.userpriv_capable: - spawn_opts.update({"gid":portage_gid,"groups":[0,portage_gid]}) - self.__userpriv = False - - # open the pipes to be used for chatting with the new daemon - cread, cwrite = os.pipe() - dread, dwrite = os.pipe() - self.__sandbox = False - self.__fakeroot = False - - # since it's questionable which spawn method we'll use (if sandbox or fakeroot fex), - # we ensure the bashrc is invalid. - env={"BASHRC":"/etc/portage/spork/not/valid/ha/ha", PORTAGE_BIN_PATH:PORTAGE_BIN_PATH} - args = [] - if sandbox: - if fakeroot: - print "!!! ERROR: fakeroot was on, but sandbox was also on" - sys.exit(1) - self.__sandbox = True - spawn_func = portage.spawn.spawn_sandbox - env.update({"SANDBOX_DEBUG":"1","SANDBOX_DEBUG_LOG":"/var/tmp/test"}) - - elif fakeroot: - self.__fakeroot = True - spawn_func = portage.spawn.spawn_fakeroot - args.append(save_file) - else: - spawn_func = portage.spawn.spawn - - self.pid = spawn_func(self.ebd+" daemonize", fd_pipes={0:0, 1:1, 2:2, 3:cread, 4:dwrite}, - returnpid=True, env=env, *args, **spawn_opts)[0] - - os.close(cread) - os.close(dwrite) - self.ebd_write = os.fdopen(cwrite,"w") - self.ebd_read = os.fdopen(dread,"r") - - # basically a quick "yo" to the daemon - self.write("dude?") - if not self.expect("dude!"): - print "error in server coms, bailing." - raise Exception("expected 'dude!' response from ebd, which wasn't received. likely a bug") - self.write(PORTAGE_BIN_PATH) - if self.__sandbox: - self.write("sandbox_log?") - self.__sandbox_log = self.read().split()[0] - self.dont_export_vars=self.read().split() - # locking isn't used much, but w/ threading this will matter - - - def sandboxed(self): - """is this instance sandboxed?""" - return self.__sandbox - - - def userprived(self): - """is this instance userprived?""" - return self.__userpriv - - - def fakerooted(self): - """is this instance fakerooted?""" - return self.__fakeroot - - - def onetime(self): - """is this instance going to be discarded after usage; eg is it fakerooted?""" - return self.__fakeroot - - - def write(self, string,flush=True): - """talk to running daemon. Disabling flush is useful when dumping large amounts of data - all strings written are automatically \\n terminated""" - if string[-1] == "\n": - self.ebd_write.write(string) - else: - self.ebd_write.write(string +"\n") - if flush: - self.ebd_write.flush() - - - def expect(self, want): - """read from the daemon, and return true or false if the returned string is what is expected""" - got=self.ebd_read.readline() - return want==got[:-1] - - - def read(self,lines=1): - """read data from the daemon. Shouldn't be called except internally""" - mydata='' - while lines > 0: - mydata += self.ebd_read.readline() - lines -= 1 - return mydata - - - def sandbox_summary(self, move_log=False): - """if the instance is sandboxed, print the sandbox access summary""" - if not os.path.exists(self.__sandbox_log): - self.write("end_sandbox_summary") - return 0 - violations=portage_util.grabfile(self.__sandbox_log) - if len(violations)==0: - self.write("end_sandbox_summary") - return 0 - if not move_log: - move_log=self.__sandbox_log - elif move_log != self.__sandbox_log: - myf=open(move_log) - for x in violations: - myf.write(x+"\n") - myf.close() - from output import red - self.ebd_write.write(red("--------------------------- ACCESS VIOLATION SUMMARY ---------------------------")+"\n") - self.ebd_write.write(red("LOG FILE = \"%s\"" % move_log)+"\n\n") - for x in violations: - self.ebd_write.write(x+"\n") - self.write(red("--------------------------------------------------------------------------------")+"\n") - self.write("end_sandbox_summary") - try: - os.remove(self.__sandbox_log) - except (IOError, OSError), e: - print "exception caught when cleansing sandbox_log=%s" % str(e) - return 1 - - - def preload_eclasses(self, ec_file): - """this preloades eclasses into a function, thus avoiding the cost of going to disk. - preloading eutils (which is heaviliy inherited) speeds up regen times fex""" - if not os.path.exists(ec_file): - return 1 - self.write("preload_eclass %s" % ec_file) - if self.expect("preload_eclass succeeded"): - self.preloaded_eclasses=True - return True - return False - - - def lock(self): - """lock the processor. Currently doesn't block any access, but will""" - self.processing_lock = True - - - def unlock(self): - """unlock the processor""" - self.processing_lock = False - - - def locked(self): - """is the processor locked?""" - return self.processing_lock - - - def is_alive(self): - """returns if it's known if the processor has been shutdown. - Currently doesn't check to ensure the pid is still running, yet it should""" - return self.pid != None - - - def shutdown_processor(self): - """tell the daemon to shut itself down, and mark this instance as dead""" - try: - if self.is_alive(): - self.write("shutdown_daemon") - self.ebd_write.close() - self.ebd_read.close() - - # now we wait. - os.waitpid(self.pid,0) - except (IOError,OSError,ValueError): - pass - - # currently, this assumes all went well. - # which isn't always true. - self.pid = None - - - def set_sandbox_state(self,state): - """tell the daemon whether to enable the sandbox, or disable it""" - if state: - self.write("set_sandbox_state 1") - else: - self.write("set_sandbox_state 0") - - - def send_env(self, env_dict): - """transfer the ebuild's desired env (env_dict) to the running daemon""" - - self.write("start_receiving_env\n") - exported_keys = '' - for x in env_dict.keys(): - if x not in self.dont_export_vars: - self.write("%s=%s\n" % (x, env_dict[x]), flush=False) - exported_keys += x+' ' - self.write("export "+exported_keys,flush=False) - self.write("end_receiving_env") - return self.expect("env_received") - - - def set_logfile(self,logfile=''): - """relevant only when the daemon is sandbox'd, set the logfile""" - self.write("logging %s" % logfile) - return self.expect("logging_ack") - - - def __del__(self): - """simply attempts to notify the daemon to die""" - # for this to be reached means we ain't in a list no more. - if self.pid: - self.shutdown_processor() - - - def get_keys(self, package_inst, eclass_cache): - """request the auxdbkeys from an ebuild - returns a dict when successful, None when failed""" - - env={} - for x in ("P", "PN", "PR"): - env[x] = getattr(package_inst, x) - - env["EBUILD"] = package_inst.path - env["CATEGORY"] = package_inst.category - self.write("process_ebuild depend") - self.send_env(env) - self.set_sandbox_state(True) - self.write("start_processing") - - self.expect("starting depend") - metadata_keys = {} - val=self.generic_handler(additional_commands={ \ - "inherit":(self.__class__._inherit, [eclass_cache],{}), \ - "key":(self.__class__._receive_key, [metadata_keys], {})} ) - - if not val: - logging.error("returned val from get_keys was '%s'" % str(val)) - raise Exception(val) - - return metadata_keys - - def _receive_key(self, line, keys_dict): - line=line.split("=",1) - l=len(line) - if l != 2: - raise FinishedProcessing(True) - else: - keys_dict[line[0]] = line[1] - - - def _inherit(self, line, ecache): - """callback for implementing inherit digging into eclass_cache. not for normal consumption.""" - if line == None: - self.write("failed") - raise UnhandledCommand("inherit requires an eclass specified, none specified") - - line=line.strip() - if ecache.get_eclass_path != None: - value = ecache.get_eclass_path(line) - self.write("path") - self.write(value) - elif ecache.get_eclass_data != None: - value = ecache.get_eclass_data(line) - self.write("transfer") - self.write(value) - else: - raise AttributeError("neither get_eclass_data nor get_eclass_path is usable on ecache!") - - - # this basically handles all hijacks from the daemon, whether confcache or portageq. - def generic_handler(self, additional_commands={}): - """internal function that responds to the running ebuild processor's requests - - additional_commands is a dict of command:callable, or command:(callable,args,kwargs) - Note that the processor still is inserted as the first arg for positional, with line as second. - - commands cannot have spaces. the callable is called with the processor as first arg, and - remaining string (None if no remaining fragment) as second arg - (if you need to split the args to command, whitespace splitting falls to your func.) - - Chucks an UnhandledCommand exception when an unknown command is encountered. - """ - - # note that self is passed in. so... we just pass in the unbound instance. Specifically, via digging through __class__ - # if you don't do it, sandbox_summary (fex) cannot be overriden, this func will just use this classes version. - # so dig through self.__class__ for it. :P - - handlers = {"request_sandbox_summary":(self.__class__.sandbox_summary,[],{})} - for x in ("prob", "env_receiving_failed"): - handlers[x] = (chuck_UnhandledCommand, [False], {}) - handlers["phases"] = (chuck_StoppingCommand, [lambda f: f.lower().strip()=="succeeded"], {}) - - handlers.update(additional_commands) - - for x in handlers.keys(): - if isroutine(handlers[x]): - handlers[x] = (handlers[x], [], {}) - # if it's a list, must be len 3 and isroutine==true for [0] - elif not (isinstance(handlers[x], list) or isinstance(handlers[x], tuple)) or \ - not (len(handlers[x]) == 3 and isroutine(handlers[x][0])): - raise TypeError(handlers[x]) - - try: - while True: - line=self.read().rstrip() - # split on first whitespace. - - s=line.split(None,1) - if s[0] in handlers: - if len(s) == 1: - s.append(None) - # looks nasty, but isn't. just inserts self + line for positional expansion - handlers[s[0]][0](self, s[1], *handlers[s[0]][1], **handlers[s[0]][2]) - else: - print "chucking unhandled here, baby.s=",s - raise UnhandledCommand(s[0]) - - except FinishedProcessing, fp: - v = fp.val; del fp - return v - -def chuck_UnhandledCommand(processor, line): - print "chucking unhandled" - raise UnhandledCommand(line) - -def chuck_StoppingCommand(processor, val, *args): - if isroutine(val) or isclass(val): - raise FinishedProcessing(val, args[0]) - raise FinishedProcessing(val) - -class ProcessingInterruption(Exception): - pass - -class FinishedProcessing(ProcessingInterruption): - def __init__(self, val, msg=None): self.val, self.msg = val, msg - def __str__(self): return "Finished processing with val, %s" % str(self.val) - -class UnhandledCommand(ProcessingInterruption): - def __init__(self, line=None): self.line=line - def __str__(self): return "unhandled command, %s" % self.line - diff --git a/portage/os_data.py b/portage/os_data.py deleted file mode 100644 index 22d8795..0000000 --- a/portage/os_data.py +++ /dev/null @@ -1,76 +0,0 @@ -# portage_data.py -- Calculated/Discovered Data Values -# Copyright 1998-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/portage/os_data.py,v 1.1 2005/07/12 02:02:37 ferringb Exp $ -cvs_id_string="$Id: os_data.py,v 1.1 2005/07/12 02:02:37 ferringb Exp $"[5:-2] - -import os,pwd,grp - -ostype=os.uname()[0] - -lchown = None -if ostype=="Linux": - userland="GNU" - os.environ["XARGS"]="xargs -r" -elif ostype in ["Darwin","FreeBSD","OpenBSD"]: - if ostype == "Darwin": - lchown=os.chown - userland="BSD" - os.environ["XARGS"]="xargs" -else: - raise Exception("Operating system unsupported, '%s'" % ostype) - -if not lchown: - if "lchown" in dir(os): - # Included in python-2.3 - lchown = os.lchown - else: - import missingos - lchown = missingos.lchown - - - -#os.environ["USERLAND"]=userland - -#Secpass will be set to 1 if the user is root or in the portage group. -secpass=0 - -uid=os.getuid() -wheelgid=0 - -if uid==0: - secpass=2 -try: - wheelgid=grp.getgrnam("wheel")[2] - if (not secpass) and (wheelgid in os.getgroups()): - secpass=1 -except KeyError: - print "portage initialization: your system doesn't have a 'wheel' group." - print "Please fix this as it is a normal system requirement. 'wheel' is GID 10" - print "'emerge baselayout' and an 'etc-update' should remedy this problem." - -#Discover the uid and gid of the portage user/group -try: - portage_uid=pwd.getpwnam("portage")[2] - portage_gid=grp.getgrnam("portage")[2] - if (secpass==0): - secpass=1 -except KeyError: - portage_uid=0 - portage_gid=wheelgid - print - print "portage: 'portage' user or group missing. Please update baselayout" - print " and merge portage user(250) and group(250) into your passwd" - print " and group files. Non-root compilation is disabled until then." - print " Also note that non-root/wheel users will need to be added to" - print " the portage group to do portage commands.\n" - print " For the defaults, line 1 goes into passwd, and 2 into group." - print " portage:x:250:250:portage:/var/tmp/portage:/bin/false" - print " portage::250:portage" - -if (uid!=0) and (portage_gid not in os.getgroups()): - if not os.environ.has_key("PORTAGE_SCRIPT"): - print "*** You are not in the portage group. You may experience cache problems" - print "*** due to permissions preventing the creation of the on-disk cache." - print "*** Please add this user to the portage group if you wish to use portage." - diff --git a/portage/package/__init__.py b/portage/package/__init__.py deleted file mode 100644 index 1ce9d08..0000000 --- a/portage/package/__init__.py +++ /dev/null @@ -1,8 +0,0 @@ -# Copyright: 2005 Gentoo Foundation -# Author(s): Brian Harring (ferringb@gentoo.org) -# License: GPL2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/portage/package/__init__.py,v 1.3 2005/07/13 05:55:39 ferringb Exp $ - -import metadata -import cpv -import atom diff --git a/portage/package/atom.py b/portage/package/atom.py deleted file mode 100644 index b62c704..0000000 --- a/portage/package/atom.py +++ /dev/null @@ -1,75 +0,0 @@ -# Copyright: 2005 Gentoo Foundation -# Author(s): Jason Stubbs (jstubbs@gentoo.org), Brian Harring (ferringb@gentoo.org) -# License: GPL2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/portage/package/atom.py,v 1.1 2005/07/13 05:51:35 ferringb Exp $ - -from portage.restrictions import restriction -from cpv import ver_cmp, CPV -from portage.restrictions.restrictionSet import AndRestrictionSet - -class VersionMatch(restriction.base): - __slots__ = tuple(["ver","rev", "vals"] + restriction.StrMatch.__slots__) - def __init__(self, operator, ver, rev=None, **kwd): - super(self.__class__, self).__init__(**kwd) - self.ver, self.rev = ver, rev - l=[] - if ">" in operator: l.append(1) - if "<" in operator: l.append(-1) - if "=" in operator: l.append(0) - self.vals = tuple(l) - - def match(self, pkginst): - return (ver_cmp(self.ver, self.rev, pkginst.version, pkginst.revision) in self.vals) ^ self.negate - - -class atom(AndRestrictionSet): - def __init__(self, atom, slot=None, use=[]): - - super(self.__class__, self).__init__() - - pos=0 - while atom[pos] in ("<",">","=","~","!"): - pos+=1 - if atom.startswith("!"): - self.blocks = True - self.op = atom[1:pos] - else: - self.blocks = False - self.op = atom[:pos] - if atom.endswith("*"): - self.glob = True - self.atom = atom[pos:-1] - else: - self.glob = False - self.atom = atom[pos:] - - self.cpv = CPV(self.atom) - self.use, self.slot = use, slot - # force jitting of it. - del self.restrictions - - def __getattr__(self, attr): - if attr in ("category", "package", "version", "revision", "cpvstr", "fullver", "key"): - g = getattr(self.cpv, attr) - self.__dict__[attr] = g - return g - - elif attr == "restrictions": - r = [] - try: - cat = self.category - r.append(restriction.PackageRestriction("category", restriction.StrExactMatch(cat))) - except AttributeError: - pass - r.append(restriction.PackageRestriction("package", restriction.StrExactMatch(self.package))) - if self.version: - if self.glob: - r.append(restriction.PackageRestriction("fullver", restriction.StrGlobMatch(self.fullver))) - else: - r.append(VersionMatch(self.op, self.version, self.revision)) - if self.use or self.slot: - raise Exception("yo. I don't support use or slot yet, fix me pls kthnx") - self.__dict__["restrictions"] = r - return r - - raise AttributeError(attr) diff --git a/portage/package/cpv.py b/portage/package/cpv.py deleted file mode 100644 index eac55a9..0000000 --- a/portage/package/cpv.py +++ /dev/null @@ -1,205 +0,0 @@ -# Copyright: 2005 Gentoo Foundation -# Author(s): Jason Stubbs (jstubbs@gentoo.org) -# License: GPL2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/portage/package/cpv.py,v 1.2 2005/07/13 05:51:35 ferringb Exp $ - -import re - - -pkg_regexp = re.compile("^[a-zA-Z0-9]([-_+a-zA-Z0-9]*[+a-zA-Z0-9])?$") -ver_regexp = re.compile("^(cvs\\.)?(\\d+)((\\.\\d+)*)([a-z]?)((_(pre|p|beta|alpha|rc)\\d*)*)(-r(\\d+))?$") -suffix_regexp = re.compile("^(alpha|beta|rc|pre|p)(\\d*)$") -suffix_value = {"pre": -2, "p": 0, "alpha": -4, "beta": -3, "rc": -1} - -class CPV(object): - - """ - Attributes - - str category - str package - str key (cat/pkg) - str version - int revision - - Methods - - int __hash__() - str __repr__() - int __cmp__(CPV) - """ - - def __init__(self, cpvstr): - if not isinstance(cpvstr, str): - raise ValueError(cpvstr) - self.__dict__["cpvstr"] = cpvstr - self.__dict__["hash"] = hash(cpvstr) - - def __hash__(self): - return self.hash - - def __repr__(self): - return self.cpvstr - - def __setattr__(self, name, value): - raise Exception() - - def __getattr__(self, name): - - if name == "category": - myparts = self.cpvstr.split("/") - if len(myparts) >= 2: - if not pkg_regexp.match(myparts[0]): - raise ValueError(self.cpvstr) - self.__dict__["category"] = myparts[0] - else: - self.__dict__["category"] = None - - if name == "package": - if self.category: - myparts = self.cpvstr[len(self.category)+1:].split("-") - else: - myparts = self.cpvstr.split("-") - if ver_regexp.match(myparts[0]): - raise ValueError(self.cpvstr) - pos = 1 - while pos < len(myparts) and not ver_regexp.match(myparts[pos]): - pos += 1 - pkgname = "-".join(myparts[:pos]) - if not pkg_regexp.match(pkgname): - raise ValueError(self.cpvstr) - self.__dict__["package"] = pkgname - - if name == "key": - if self.category: - self.__dict__["key"] = self.category +"/"+ self.package - else: - self.__dict__["key"] = self.package - - if name in ("version","revision","fullver"): - if self.category: - myparts = self.cpvstr[len(self.category+self.package)+2:].split("-") - else: - myparts = self.cpvstr[len(self.package)+1:].split("-") - - if not myparts[0]: - self.__dict__["version"] = None - self.__dict__["revision"] = None - - else: - if myparts[-1][0] == "r" and myparts[-1][1:].isdigit(): - self.__dict__["revision"] = int(myparts[-1][1:]) - myparts = myparts[:-1] - else: -# self.__dict__["revision"] = 0 # harring changed this - self.__dict__["revision"] = None - - for x in myparts: - if not ver_regexp.match(x): - raise ValueError(self.mycpv) - - self.__dict__["version"] = "-".join(myparts) - if name == "fullver": - if self.version == None: - self.__dict__["fullver"] = None - elif self.revision == None: - self.__dict__["fullver"] = self.version - else: - self.__dict__["fullver"] = "%s-r%i" % (self.version,self.revision) - - if name in self.__dict__: - return self.__dict__[name] - raise AttributeError,name - - def __cmp__(self, other): - - if self.cpvstr == other.cpvstr: - return 0 - - if self.category and other.category and self.category != other.category: - return cmp(self.category, other.category) - - if self.package and other.package and self.package != other.package: - return cmp(self.package, other.package) - - # note I chucked out valueerror, none checks on versions passed in. I suck, I know. - # ~harring - return ver_cmp(self.version, self.revision, other.version, other.revision) - - -def ver_cmp(ver1, rev1, ver2, rev2): - if ver1 == ver2: - return 0 - - match1 = ver_regexp.match(ver1) - match2 = ver_regexp.match(ver2) - - # shortcut for cvs ebuilds (new style) - if match1.group(1) and not match2.group(1): - return 1 - elif match2.group(1) and not match1.group(1): - return -1 - - # building lists of the version parts before the suffix - # first part is simple - list1 = [int(match1.group(2))] - list2 = [int(match2.group(2))] - - # this part would greatly benefit from a fixed-length version pattern - if len(match1.group(3)) or len(match2.group(3)): - vlist1 = match1.group(3)[1:].split(".") - vlist2 = match2.group(3)[1:].split(".") - for i in range(0, max(len(vlist1), len(vlist2))): - if len(vlist1) <= i or len(vlist1[i]) == 0: - list1.append(0) - list2.append(int(vlist2[i])) - elif len(vlist2) <= i or len(vlist2[i]) == 0: - list1.append(int(vlist1[i])) - list2.append(0) - # Let's make life easy and use integers unless we're forced to use floats - elif (vlist1[i][0] != "0" and vlist2[i][0] != "0"): - list1.append(int(vlist1[i])) - list2.append(int(vlist2[i])) - # now we have to use floats so 1.02 compares correctly against 1.1 - else: - list1.append(float("0."+vlist1[i])) - list2.append(float("0."+vlist2[i])) - - # and now the final letter - if len(match1.group(5)): - list1.append(ord(match1.group(5))) - if len(match2.group(5)): - list2.append(ord(match2.group(5))) - - for i in range(0, max(len(list1), len(list2))): - if len(list1) <= i: - return -1 - elif len(list2) <= i: - return 1 - elif list1[i] != list2[i]: - return list1[i] - list2[i] - - # main version is equal, so now compare the _suffix part - list1 = match1.group(6).split("_")[1:] - list2 = match2.group(6).split("_")[1:] - - for i in range(0, max(len(list1), len(list2))): - if len(list1) <= i: - s1 = ("p","0") - else: - s1 = suffix_regexp.match(list1[i]).groups() - if len(list2) <= i: - s2 = ("p","0") - else: - s2 = suffix_regexp.match(list2[i]).groups() - if s1[0] != s2[0]: - return suffix_value[s1[0]] - suffix_value[s2[0]] - if s1[1] != s2[1]: - # it's possible that the s(1|2)[1] == '' - # in such a case, fudge it. - try: r1 = int(s1[1]) - except ValueError: r1 = 0 - try: r2 = int(s2[1]) - except ValueError: r2 = 0 - return r1 - r2 - return cmp(rev1, rev2) diff --git a/portage/package/metadata.py b/portage/package/metadata.py deleted file mode 100644 index 14fd4fd..0000000 --- a/portage/package/metadata.py +++ /dev/null @@ -1,93 +0,0 @@ -# Copyright: 2005 Gentoo Foundation -# Author(s): Brian Harring (ferringb@gentoo.org) -# License: GPL2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/portage/package/metadata.py,v 1.2 2005/07/13 05:51:35 ferringb Exp $ - -import weakref -from cpv import CPV - -class package(CPV): - def __init__(self, cpv, parent_repository): - super(package,self).__init__(cpv) - self.__dict__["_cpv_finalized"] = False -# self.__dict__["_finalized"] = False - self.__dict__["_parent"] = parent_repository - - - def __setattr__(self, *args, **kwargs): - raise AttributeError - - - def __delattr__(self, *args, **kwargs): - raise AttributeError - - - def __getitem__(self, key): - try: return getattr(self,key) - except AttributeError: - raise KeyError(key) - - - def __getattr__(self, attr): - if not self._cpv_finalized: - try: return super(package,self).__getattr__(attr) - except AttributeError: - #enable this when CPV does it. - #self.__cpv_finalized = True - pass - - # assuming they're doing super, if it ain't data it's an error (no other jit attr) - if attr != "data": - raise AttributeError, attr -# if self._finalized: -# raise AttributeError, attr - - # if we've made it here, then more is needed. - data = self._fetch_metadata() - self.__dict__["data"] = data - return data - -# self.__dict__["_finalized"] = True -# if attr in self.__dict__: -# return self.__dict__[attr] -# raise AttributeError,attr - - - def _fetch_metadata(self): - raise NotImplementedError - - -class factory(object): - child_class = package - def __init__(self, parent_repo): - self._parent_repo = parent_repo - self._cached_instances = weakref.WeakValueDictionary() - - def new_package(self, cpv): - if cpv in self._cached_instances: - return self._cached_instances[cpv] - d = self._get_new_child_data(cpv) - m = self.child_class(cpv, self, *d[0], **d[1]) - self._cached_instances[cpv] = m - return m - - def clear(self): - self._cached_instances.clear() - - def _load_package_metadata(self, inst): - raise NotImplementedError - - def __del__(self): - self.clear() - - def _get_metadata(self, *args): - raise NotImplementedError - - def _update_metadata(self, *args): - raise NotImplementedError - - def _get_new_child_data(self, cpv): - """return pargs,kwargs for any new children generated by this factory. - defaults to [], {} - Probably will be rolled into a class/instance attribute whenever someone cleans this up""" - return ([],{}) diff --git a/portage/repository/__init__.py b/portage/repository/__init__.py deleted file mode 100644 index 14e25c8..0000000 --- a/portage/repository/__init__.py +++ /dev/null @@ -1,6 +0,0 @@ -# Copyright: 2005 Gentoo Foundation -# Author(s): Brian Harring (ferringb@gentoo.org) -# License: GPL2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/portage/repository/__init__.py,v 1.2 2005/07/13 05:51:35 ferringb Exp $ - -import prototype diff --git a/portage/repository/errors.py b/portage/repository/errors.py deleted file mode 100644 index 049095d..0000000 --- a/portage/repository/errors.py +++ /dev/null @@ -1,14 +0,0 @@ -# Copyright: 2005 Gentoo Foundation -# Author(s): Brian Harring (ferringb@gentoo.org) -# License: GPL2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/portage/repository/errors.py,v 1.2 2005/07/13 05:51:35 ferringb Exp $ - -class TreeCorruption(Exception): - def __init__(self, err): - self.err = err - def __str__(self): - return "unexpected tree corruption: %s" % str(self.err) - -class InitializationError(TreeCorruption): - def __str__(self): - return "initialization failed: %s" % str(self.err) diff --git a/portage/repository/multiplex.py b/portage/repository/multiplex.py deleted file mode 100644 index b4c1480..0000000 --- a/portage/repository/multiplex.py +++ /dev/null @@ -1,72 +0,0 @@ -# Copyright: 2005 Gentoo Foundation -# Author(s): Brian Harring (ferringb@gentoo.org) -# License: GPL2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/portage/repository/multiplex.py,v 1.2 2005/07/13 05:51:35 ferringb Exp $ - -import prototype, errors - -class tree(prototype.tree): - def __init__(self, *trees): - super(tree,self).__init__() - for x in trees: - if not isinstance(x, prototype.tree): - raise errors.InitializationError("%s is not a repository tree derivative" % str(x)) - self.trees=trees - - def _get_categories(self, *optionalCategory): - d={} - failures=0 - if len(optionalCategory): - optionalCategory=optionalCategory[0] - for x in self.trees: - try: - for y in x.categories[optionalCategory]: - d[y] = None - except KeyError: - failures+=1 - else: - for x in self.trees: - try: - for y in x.categories: - d[y] = None - except (errors.TreeCorruption, KeyError): - failures+=1 - if failures == len(self.trees): - if optionalCategory: - raise KeyError("category base '%s' not found" % str(optionalCategory)) - raise KeyError("failed getting categories") - return tuple(d.keys()) - - def _get_packages(self, category): - d={} - failures=0 - for x in self.trees: - try: - for y in x.packages[category]: - d[y] = None - except (errors.TreeCorruption, KeyError): - failures+=1 - if failures == len(self.trees): - raise KeyError("category '%s' not found" % category) - return tuple(d.keys()) - - def _get_versions(self,package): - d={} - failures=0 - for x in self.trees: - try: - for y in x.versions[package]: - d[y] = None - except (errors.TreeCorruption, KeyError): - failures+=1 - - if failures == len(self.trees): - raise KeyError("category '%s' not found" % package) - return tuple(d.keys()) - - def itermatch(self, atom): - d={} - for t in self.trees: - for m in t.match(atom): - d[m] = None - return d.keys() diff --git a/portage/repository/prototype.py b/portage/repository/prototype.py deleted file mode 100644 index ee96483..0000000 --- a/portage/repository/prototype.py +++ /dev/null @@ -1,109 +0,0 @@ -# Copyright: 2005 Gentoo Foundation -# Author(s): Brian Harring (ferringb@gentoo.org) -# License: GPL2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/portage/repository/prototype.py,v 1.2 2005/07/13 05:51:35 ferringb Exp $ - -from portage.util.dicts import IndexableSequence -from weakref import proxy - -def ix_cat_callable(*cat): - return "/".join(cat) - -class tree(object): - package_class = None - - def __init__(self, frozen=True): - self.categories = IndexableSequence(self._get_categories, self._get_categories, - returnIterFunc=ix_cat_callable, returnEmpty=True, modifiable=(not frozen)) - self.packages = IndexableSequence(self.categories.iterkeys, self._get_packages, \ - returnIterFunc=lambda x,y: str(x)+"/"+str(y), modifiable=(not frozen)) - self.versions = IndexableSequence(self.packages.__iter__, self._get_versions, \ - returnIterFunc=lambda x,y: str(x)+"-"+str(y), modifiable=(not frozen)) - self.raw_repo = proxy(self) - self.frozen = frozen - - - def _get_categories(self, *arg): - raise NotImplementedError - - - def _get_packages(self, category): - raise NotImplementedError - - - def _get_versions(self, package): - raise NotImplementedError - - - def __getitem__(self, cpv): - cpv_inst = self.package_class(cpv) - if cpv_inst.fullver not in self.versions[cpv_inst.key]: - del cpv_inst - raise KeyError(cpv) - return cpv_inst - - - def __setitem__(self, *values): - raise AttributeError - - - def __delitem__(self, cpv): - raise AttributeError - - - def __iter__(self): - for cpv in self.versions: - yield self.package_class(cpv) - return - - - def match(self, atom): - return list(self.itermatch(atom)) - - - def itermatch(self, atom): - if atom.category == None: - candidates = self.packages - else: - if atom.package == None: - try: candidates = self.packages[atom.category] - except KeyError: - # just stop now. no category matches == no yielded cpvs. - return - else: - try: - if atom.package not in self.packages[atom.category]: - # no matches possible - return - candidates = [atom.key] - - except KeyError: - # atom.category wasn't valid. no matches possible. - return - - #actual matching. - for catpkg in candidates: - for ver in self.versions[catpkg]: - if atom.match(self.package_class(catpkg+"-"+ver)): - yield self[catpkg+"-"+ver] - return - - - def add_package(self, pkg): - if self.frozen: - raise AttributeError,"repo is frozen" - return self._add_new_package(self, pkg) - - - def _add_new_package(self, pkg): - raise NotImplementedError - - - def del_package(self, key): - if self.frozen: - raise AttributeError,"repo is frozen" - return self._del_package(self,key) - - - def _del_package(self,pkg): - raise NotImplementedError diff --git a/portage/repository/visibility.py b/portage/repository/visibility.py deleted file mode 100644 index ea4529c..0000000 --- a/portage/repository/visibility.py +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright: 2005 Gentoo Foundation -# Author(s): Brian Harring (ferringb@gentoo.org) -# License: GPL2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/portage/repository/visibility.py,v 1.2 2005/07/13 05:51:35 ferringb Exp $ - -# icky. -# ~harring -import prototype, errors - -class filterTreee(prototype.tree): - """wrap an existing repository filtering results based upon passed in restrictions.""" - def __init__(self, repo, restrictions): - self.raw_repo = repo - if not isinstance(self.raw_repo, prototype.tree): - raise errors.InitializationError("%s is not a repository tree derivative" % str(self.raw_repo)) - if not isinstance(restrictions, list): - restrictions = [restrictions] - self._restrictions = restrictions - - def itermatch(self, atom): - for cpv in self.raw_repo.itermatch(atom): - for r in self._restrictions: - if not r.match(cpv): - yield cpv diff --git a/portage/restrictions/__init__.py b/portage/restrictions/__init__.py deleted file mode 100644 index 153c87b..0000000 --- a/portage/restrictions/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -# Copyright: 2005 Gentoo Foundation -# Author(s): Brian Harring (ferringb@gentoo.org) -# License: GPL2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/portage/restrictions/__init__.py,v 1.2 2005/07/13 05:51:35 ferringb Exp $ - diff --git a/portage/restrictions/restriction.py b/portage/restrictions/restriction.py deleted file mode 100644 index 7a08083..0000000 --- a/portage/restrictions/restriction.py +++ /dev/null @@ -1,129 +0,0 @@ -# Copyright: 2005 Gentoo Foundation -# Author(s): Brian Harring (ferringb@gentoo.org) -# License: GPL2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/portage/restrictions/restriction.py,v 1.2 2005/07/13 05:51:35 ferringb Exp $ - -import re, logging - -class base(object): - """base restriction matching object; overrides setattr to provide the usual write once trickery - all derivatives *must* be __slot__ based""" - - __slots__ = ["negate"] - - def __init__(self, negate=False): - self.negate = negate - - def __setattr__(self, name, value): - try: getattr(self, name) - - except AttributeError: - object.__setattr__(self, name, value) - else: raise AttributeError - - def match(self, *arg, **kwargs): - raise NotImplementedError - - -class VersionRestriction(base): - """use this as base for version restrictions, gives a clue to what the restriction does""" - pass - - -class StrMatch(base): - """ Base string matching restriction. all derivatives must be __slot__ based classes""" - __slots__ = base.__slots__ - pass - - -class StrRegexMatch(StrMatch): - #potentially redesign this to jit the compiled_re object - __slots__ = tuple(["regex", "compiled_re", "flags"] + StrMatch.__slots__) - - def __init__(self, regex, CaseSensitive=True, **kwds): - super(StrRegexMatch, self).__init__(**kwds) - self.regex = regex - flags = 0 - if not CaseSensitive: - flags = re.I - self.flags = flags - self.compiled_re = re.compile(regex, flags) - - - def match(self, value): - return (self.compiled_re.match(str(value)) != None) ^ self.negate - - -class StrExactMatch(StrMatch): - __slots__ = tuple(["exact", "flags"] + StrMatch.__slots__) - - def __init__(self, exact, CaseSensitive=True, **kwds): - super(StrExactMatch, self).__init__(**kwds) - if not CaseSensitive: - self.flags = re.I - self.exact = str(exact).lower() - else: - self.flags = 0 - self.exact = str(exact) - - - def match(self, value): - if self.flags & re.I: return (self.exact == str(value).lower()) ^ self.negate - else: return (self.exact == str(value)) ^ self.negate - - -class StrSubstringMatch(StrMatch): - __slots__ = tuple(["substr"] + StrMatch.__slots__) - - def __init__(self, substr, CaseSensitive=True, **kwds): - super(StrSubString, self).__init__(**kwds) - if not CaseSensitive: - self.flags = re.I - self.substr = str(substr).lower() - else: - self.flags = 0 - self.substr = str(substr) - - - def match(self, value): - if self.flags & re.I: value = str(value).lower() - else: value = str(value) - return (value.find(self.substr) != -1) ^ self.negate - - -class StrGlobMatch(StrMatch): - __slots__ = tuple(["glob"] + StrMatch.__slots__) - def __init__(self, glob, CaseSensitive=True, **kwds): - super(StrGlobMatch, self).__init__(**kwds) - if not CaseSensitive: - self.flags = re.I - self.glob = str(glob).lower() - else: - self.glags = 0 - self.glob = str(glob) - def match(self, value): - value = str(value) - if self.flags & re.I: value = value.lower() - return value.startswith(self.glob) ^ self.negate - -class PackageRestriction(base): - """cpv data restriction. Inherit for anything that's more then cpv mangling please""" - - __slots__ = tuple(["attr", "strmatch"] + base.__slots__) - - def __init__(self, attr, StrMatchInstance, **kwds): - super(PackageRestriction, self).__init__(**kwds) - self.attr = attr.split(".") - self.strmatch = StrMatchInstance - - def match(self, packageinstance): - try: - o = packageinstance - for x in self.attr: - o = getattr(o, x) - return self.strmatch.match(o) ^ self.negate - - except AttributeError,ae: - logging.debug("failed getting attribute %s from %s, exception %s" % \ - (".".join(self.attr), str(packageinstance), str(ae))) - return self.negate diff --git a/portage/restrictions/restrictionSet.py b/portage/restrictions/restrictionSet.py deleted file mode 100644 index 71c2e3c..0000000 --- a/portage/restrictions/restrictionSet.py +++ /dev/null @@ -1,54 +0,0 @@ -# Copyright: 2005 Gentoo Foundation -# Author(s): Brian Harring (ferringb@gentoo.org) -# License: GPL2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/portage/restrictions/Attic/restrictionSet.py,v 1.2 2005/07/13 05:51:35 ferringb Exp $ - -import restriction - -class RestrictionSet(restriction.base): - __slots__ = tuple(["restrictions"] + restriction.base.__slots__) - - def __init__(self, *restrictions, **kwds): - super(RestrictionSet, self).__init__(**kwds) - for x in restrictions: - if not isinstance(x, restriction.base): - #bad monkey. - raise TypeError, x - self.restrictions = restrictions - - - def addRestriction(self, NewRestriction): - if not isinstance(NewRestriction, restriction.base): - raise TypeError, NewRestriction - - self.restrictions.append(NewRestriction) - - - def pmatch(self, packagedataInstance): - raise NotImplementedError - - - def finalize(self): - self.restrictions = tuple(self.restrictions) - - -class AndRestrictionSet(RestrictionSet): - __slots__ = tuple(RestrictionSet.__slots__) - - def match(self, packagedataInstance): - for rest in self.restrictions: - if not rest.match(packagedataInstance): - return self.negate - return not self.negate - - -class OrRestrictionSet(RestrictionSet): - __slots__ = tuple(RestrictionSet.__slots__) - - def match(self, packagedataInstance): - for rest in self.restrictions: - if rest.match(packagedataInstance): - return self.negate - return not self.negate - - diff --git a/portage/spawn.py b/portage/spawn.py deleted file mode 100644 index f1a341b..0000000 --- a/portage/spawn.py +++ /dev/null @@ -1,385 +0,0 @@ -# portage.py -- core Portage functionality -# Copyright 2004-2005 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/portage/spawn.py,v 1.1 2005/07/12 02:02:37 ferringb Exp $ -cvs_id_string="$Id: spawn.py,v 1.1 2005/07/12 02:02:37 ferringb Exp $"[5:-2] - -import os,types,string,sys -import signal -from const import SANDBOX_BINARY, BASH_BINARY, SANDBOX_BINARY, SANDBOX_PIDS_FILE, FAKEROOT_PATH -from os_data import portage_gid - -selinux_capable = False -sandbox_capable = os.path.exists(SANDBOX_BINARY) -userpriv_capable = (os.getuid() == 0) -fakeroot_capable = False - - -try: - import resource - max_fd_limit=resource.getrlimit(RLIMIT_NOFILE) -except SystemExit, e: - raise -except: - # hokay, no resource module. - max_fd_limit=256 - -# pids this process knows of. -spawned_pids = [] - -def cleanup(pids,block_exceptions=True): - """function to go through and reap the list of pids passed to it""" - global spawned_pids - if type(pids) == int: - pids = [pids] - for x in pids: - try: - os.kill(x,signal.SIGTERM) - if os.waitpid(x,os.WNOHANG)[1] == 0: - # feisty bugger, still alive. - os.kill(x,signal.SIGKILL) - os.waitpid(x,0) - - except OSError, oe: - if block_exceptions: - pass - if oe.errno not in (10,3): - raise oe - except SystemExit: - raise - except Exception: - if block_exceptions: - pass - try: spawned_pids.remove(x) - except IndexError: pass - - -def spawn_bash(mycommand,env={},debug=False,opt_name=None,**keywords): - """spawn mycommand as an arguement to bash""" - args=[BASH_BINARY] - if not opt_name: - opt_name=mycommand.split()[0] - if not env.has_key("BASH_ENV"): - env["BASH_ENV"] = "/etc/spork/is/not/valid/profile.env" - if debug: - args.append("-x") - args.append("-c") - args.append(mycommand) - return spawn(args,env=env,opt_name=opt_name,**keywords) - -def spawn_sandbox(mycommand,uid=None,opt_name=None,**keywords): - """spawn mycommand as an arguement to the sandbox binary. - basically, LD_PRELOAD="libsandbox.so" mycommand""" - args=[SANDBOX_BINARY] - if not opt_name: - opt_name=mycommand.split()[0] - args.append(mycommand) - if not uid: - uid=os.getuid() - try: - os.chown(SANDBOX_PIDS_FILE,uid, portage_gid) - os.chmod(SANDBOX_PIDS_FILE,0664) - except SystemExit, e: - raise - except: - pass - return spawn(args,uid=uid,opt_name=opt_name,**keywords) - -def find_binary(myc): - """look through the environmental path for an executable file named whatever myc is""" - # this sucks. badly. - p=os.getenv("PATH") - if p == None: - return None - for x in p.split(":"): - #if it exists, and is executable - if os.path.exists("%s/%s" % (x,myc)) and os.stat("%s/%s" % (x,myc))[0] & 0x0248: - return "%s/%s" % (x,myc) - return None - - -def spawn_func(func,args=[],kwargs={},exit_func=None,**keywords): - """spawn a python function in a fork - func: python function - args: positional args to positionally expand for the function - kwargs: optional args to expand for the function call - exit_func: optional function for parsing the return of func, and - returning the desired exit code - note exit_func should handle applicable exceptions. Unhandled exemptions are caught, - and the process exits with a code of 1.""" - if exit_func: - return spawn((func,args,kwargs,exit_func), func_call=True,**keywords) - return spawn((func,args,kwargs), func_call=True,**keywords) - -# base spawn function -def spawn(mycommand,env={},raw_exit_code=False,opt_name=None,fd_pipes=None,returnpid=False,\ - uid=None,gid=None,groups=None,umask=None,logfile=None,path_lookup=True, selinux_context=None, - raise_signals=False, func_call=False): - """base fork/execve function. - mycommand is the desired command- if you need a command to execute in a bash/sandbox/fakeroot - environment, use the appropriate spawn call. This is a straight fork/exec code path. - Can either have a tuple, or a string passed in. If uid/gid/groups/umask specified, it changes - the forked process to said value. If path_lookup is on, a non-absolute command will be converted - to an absolute command, otherwise it returns None. - - selinux_context is the desired context, dependant on selinux being available. - opt_name controls the name the processor goes by. - fd_pipes controls which file descriptor numbers are left open in the forked process- it's a dict of - current fd's raw fd #, desired #. - - func_call is a boolean for specifying to execute a python function- use spawn_func instead. - raise_signals is questionable. Basically throw an exception if signal'd. No exception is thrown - if raw_input is on. - - logfile overloads the specified fd's to write to a tee process which logs to logfile - returnpid returns the relevant pids (a list, including the logging process if logfile is on). - - non-returnpid calls to spawn will block till the process has exited, returning the exitcode/signal - raw_exit_code controls whether the actual waitpid result is returned, or intrepretted.""" - myc='' - if not func_call: - if type(mycommand)==types.StringType: - mycommand=mycommand.split() - myc = mycommand[0] - if not os.access(myc, os.X_OK): - if not path_lookup: - return None - myc = find_binary(myc) - if myc == None: - return None - mypid=[] - if logfile: - pr,pw=os.pipe() - mypid.extend(spawn(('tee','-i','-a',logfile),returnpid=True,fd_pipes={0:pr,1:1,2:2})) - retval=os.waitpid(mypid[-1],os.WNOHANG)[1] - if retval != 0: - # he's dead jim. - if raw_exit_code: - return retval - return process_exit_code(retval) - - if fd_pipes == None: - fd_pipes={} - fd_pipes[0] = 0 - fd_pipes[1]=pw - fd_pipes[2]=pw - - if not opt_name: - opt_name = mycommand[0] - myargs=[opt_name] - myargs.extend(mycommand[1:]) - global spawned_pids - mypid.append(os.fork()) - if mypid[-1] != 0: - #log the bugger. - spawned_pids.extend(mypid) - - if mypid[-1] == 0: - if func_call: - spawned_pids = [] - - # this may look ugly, but basically it moves file descriptors around to ensure no - # handles that are needed are accidentally closed during the final dup2 calls. - trg_fd=[] - if type(fd_pipes)==types.DictType: - src_fd=[] - k=fd_pipes.keys() - k.sort() - - #build list of which fds will be where, and where they are at currently - for x in k: - trg_fd.append(x) - src_fd.append(fd_pipes[x]) - - # run through said list dup'ing descriptors so that they won't be waxed - # by other dup calls. - for x in range(0,len(trg_fd)): - if trg_fd[x] == src_fd[x]: - continue - if trg_fd[x] in src_fd[x+1:]: - new=os.dup2(trg_fd[x],max(src_fd) + 1) - os.close(trg_fd[x]) - try: - while True: - src_fd[s.index(trg_fd[x])]=new - except SystemExit, e: - raise - except: - pass - - # transfer the fds to their final pre-exec position. - for x in range(0,len(trg_fd)): - if trg_fd[x] != src_fd[x]: - os.dup2(src_fd[x], trg_fd[x]) - else: - trg_fd=[0,1,2] - - # wax all open descriptors that weren't requested be left open. - for x in range(0,max_fd_limit): - if x not in trg_fd: - try: - os.close(x) - except SystemExit, e: - raise - except: - pass - - # note this order must be preserved- can't change gid/groups if you change uid first. - if selinux_capable and selinux_context: - import selinux - selinux.setexec(selinux_context) - if gid: - os.setgid(gid) - if groups: - os.setgroups(groups) - if uid: - os.setuid(uid) - if umask: - os.umask(umask) - - try: - #print "execing", myc, myargs - if func_call: - # either use a passed in func for interpretting the results, or return if no exception. - # note the passed in list, and dict are expanded. - if len(mycommand) == 4: - os._exit(mycommand[3](mycommand[0](*mycommand[1],**mycommand[2]))) - try: - mycommand[0](*mycommand[1],**mycommand[2]) - except Exception,e: - print "caught exception",e," in forked func",mycommand[0] - sys.exit(0) - - os.execve(myc,myargs,env) - except SystemExit, e: - raise - except Exception, e: - if not func_call: - raise str(e)+":\n "+myc+" "+string.join(myargs) - print "func call failed" - - # If the execve fails, we need to report it, and exit - # *carefully* --- report error here - os._exit(1) - sys.exit(1) - return # should never get reached - - # if we were logging, kill the pipes. - if logfile: - os.close(pr) - os.close(pw) - - if returnpid: - return mypid - - # loop through pids (typically one, unless logging), either waiting on their death, or waxing them - # if the main pid (mycommand) returned badly. - while len(mypid): - retval=os.waitpid(mypid[-1],0)[1] - if retval != 0: - cleanup(mypid[0:-1],block_exceptions=False) - # at this point we've killed all other kid pids generated via this call. - # return now. - if raw_exit_code: - return retval - return process_exit_code(retval,throw_signals=raise_signals) - else: - mypid.pop(-1) - cleanup(mypid) - return 0 - -def process_exit_code(retval,throw_signals=False): - """process a waitpid returned exit code, returning exit code if it exit'd, or the - signal if it died from signalling - if throw_signals is on, it raises a SystemExit if the process was signaled. - This is intended for usage with threads, although at the moment you can't signal individual - threads in python, only the master thread, so it's a questionable option.""" - if (retval & 0xff)==0: - return retval >> 8 # return exit code - else: - if throw_signals: - #use systemexit, since portage is stupid about exception catching. - raise SystemExit() - return (retval & 0xff) << 8 # interrupted by signal - -def spawn_get_output(mycommand,spawn_type=spawn,raw_exit_code=False,emulate_gso=True, \ - collect_fds=[1],fd_pipes=None,**keywords): - """call spawn, collecting the output to fd's specified in collect_fds list - emulate_gso is a compatability hack to emulate commands.getstatusoutput's return, minus the - requirement it always be a bash call (spawn_type controls the actual spawn call), and minus the - 'lets let log only stdin and let stderr slide by'. - - emulate_gso was deprecated from the day it was added, so convert your code over. - spawn_type is the passed in function to call- typically spawn_bash, spawn, spawn_sandbox, or spawn_fakeroot""" - global selinux_capable - pr,pw=os.pipe() - - if type(spawn_type) not in [types.FunctionType, types.MethodType]: - s="spawn_type must be passed a function, not",type(spawn_type),spawn_type - raise Exception,s - - if fd_pipes==None: - fd_pipes={} - fd_pipes[0] = 0 - - for x in collect_fds: - fd_pipes[x] = pw - keywords["returnpid"]=True - - mypid=spawn_type(mycommand,fd_pipes=fd_pipes,**keywords) - os.close(pw) - if type(mypid) != types.ListType: - os.close(pr) - return [mypid, "%s: No such file or directory" % mycommand.split()[0]] - - fd=os.fdopen(pr,"r") - mydata=fd.readlines() - fd.close() - if emulate_gso: - mydata=string.join(mydata) - if len(mydata) and mydata[-1] == "\n": - mydata=mydata[:-1] - retval=os.waitpid(mypid[0],0)[1] - cleanup(mypid) - if raw_exit_code: - return [retval,mydata] - retval=process_exit_code(retval) - return [retval, mydata] - -def spawn_fakeroot(mycommand, save_file, env={}, opt_name=None,**keywords): - """spawn a fakerooted process, saving/loading from save_file""" - if opt_name == None: - opt_name = "fakeroot %s" % mycommand - myc=[FAKEROOT_PATH,"-u","-b","20","-s","%s" % save_file] - if not save_file: - import traceback - traceback.print_stack() - print "save_file=",save_file - print "this is invalid" - sys.exit(1) - - if os.path.exists(save_file): - myc.extend(["-i","%s" % save_file]) - myc.extend(["--"]) - mycl = mycommand.split() - if not os.path.exists(mycl[0]): - mycl[0] = find_binary(mycl[0]) - if mycl[0] == None: - return None - myc.extend(mycl) - return spawn(myc,env=env,opt_name=opt_name,**keywords) - -if os.path.exists(FAKEROOT_PATH): - r,s=spawn_get_output((FAKEROOT_PATH, "--version"),emulate_gso=False, - fd_pipes={1:1,2:2}) - if r == 0: - if len(s) == 1 and "version 1." in s[0]: - fakeroot_capable = True - else: - print "fakeroot not available, need at least version 1.0" - -class CommandNotFound(Exception): - def __init__(self, command): - self.command=command - def __str__(self): - return "CommandNotFound Exception: Couldn't find '%s'" % str(self.command) diff --git a/portage/sync/__init__.py b/portage/sync/__init__.py deleted file mode 100644 index 157bed3..0000000 --- a/portage/sync/__init__.py +++ /dev/null @@ -1,10 +0,0 @@ -# sync/__init__.py; sync module namespace initialization -# Copyright 2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -#$Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/portage/sync/__init__.py,v 1.2 2005/07/13 05:51:35 ferringb Exp $ - -import rsync -import cvs -import snapshot -from parseuri import parseSyncUri - diff --git a/portage/sync/cvs.py b/portage/sync/cvs.py deleted file mode 100644 index 7431133..0000000 --- a/portage/sync/cvs.py +++ /dev/null @@ -1,95 +0,0 @@ -# cvs.py; provides cvs sync capabilities, encapsulates the necessary cvs binary calls -# Copyright 2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -#$Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/portage/sync/cvs.py,v 1.2 2005/07/13 05:51:35 ferringb Exp $ - -import os, stat -from portage.spawn import spawn, spawn_bash, CommandNotFound -#import sync -from portage.const import CVS_BIN - -import sync.syncexceptions -class CVSIOError(sync.syncexceptions.SyncException): - def __init__(self,errmsg,command): - self.errmsg=errmsg - self.command=command - def __str__(self): - return "cvs error: command %s, %s" % (self.command, self.errmsg) - -class CvsHost: - def __init__(self,host_uri,cvs_binary=CVS_BIN): - if not os.access(cvs_binary, os.X_OK): - raise CommandNotFound(cvs_binary) - self.__binary=cvs_binary - #parse the bugger. - #new format. - #cvs://[CVS_RSH binary:]user@host:cvs_root:module - #example - #cvs://ssh:ferringb@dev.gentoo.org:/var/cvsroot:gentoo-x86 - #old format - #cvs://user@host:cvsroot - #implicit gentoo-x86 module, and ext w/ ssh. - #here we go. :/ - - if host_uri.count(":") >= 2: - self.__init_new_host_uri(host_uri) - else: - self.__init_deprecated_uri(host_uri) - - def __init_new_host_uri(self,host): - #cvs://ssh:ferringb@dev.gentoo.org:/var/cvsroot:gentoo-x86 - s=host.split(":") - if len(s) == 4: - self.__ext=s.pop(0) - s[0] = ":ext:" + s[0] - else: - self.__ext=None - self.__cvsroot=s[0]+":"+s[1] - self.__cvsmodule=s[2] - - def __init_deprecated_uri(self,host): - self.__ext="ssh" - self.__cvsmodule="gentoo-x86" - self.__cvsroot=host - - def sync(self,local_path,verbosity=1,compress=False): - while local_path[-1] == "/": - local_path = local_path[:-1] - if compress: - c_arg='-z9' - else: - c_arg='' - - env={} - if self.__ext: - env = {"CVS_RSH":self.__ext} - - l=len(self.__cvsmodule) - if not os.path.exists(local_path): - newdir=os.path.basename(local_path) - basedir=local_path[:-len(newdir)] - if os.path.exists(basedir+"/"+self.__cvsmodule): - raise Exception("unable to checkout to %s, module directory %s exists already" % \ - (basedir, self.__cvsmodule)) - elif os.path.exists(basedir+"/CVS"): - raise Exception("unable to checkout to %s, a CVS directory exists w/in already" % basedir) - command="cd '%s' ; %s %s -d %s co -P %s" % \ - (basedir, self.__binary, c_arg, self.__cvsroot, self.__cvsmodule) - - ret=spawn_bash(command,env=env,opt_name="cvs co") - if ret: - raise CVSIOError("failed checkout",command) - if newdir != self.__cvsmodule: - ret = spawn(('mv','%s/%s' % (basedir,self.__cvsmodule),local_path)) - if ret: - raise Exception("failed moving %s/%s to %s" % (basedir,self.__cvsmodule,local_path)) - elif stat.S_ISDIR(os.stat(local_path).st_mode): - - command="cd '%s'; %s %s -d %s up" % (local_path, self.__binary, c_arg,self.__cvsroot) - ret = spawn_bash(command, env=env,opt_name="cvs up") - if ret: - raise CVSIOError("failed updated", command) - else: - raise Exception("%s exists, and is not a directory. rectify please" % local_path) - return True - diff --git a/portage/sync/parseuri.py b/portage/sync/parseuri.py deleted file mode 100644 index 4537a82..0000000 --- a/portage/sync/parseuri.py +++ /dev/null @@ -1,28 +0,0 @@ -# parseuri.py; parses a SYNC uri, returning protocol/host_uri -# Copyright 2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -#$Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/portage/sync/parseuri.py,v 1.2 2005/07/13 05:51:35 ferringb Exp $ - - -#sanitize this to use listdir -#~harring - -import portage_const - -def parseSyncUri(uri): - """parse a SYNC uri, returning a tuple of protocol,host_uri""" - u=uri.lower() - if u.startswith("rsync") or len(u) == 0: - if len(u) <= 5: - return ('rsync',portage_const.RSYNC_HOST) - return ('rsync',u[8:]) - elif u.startswith("cvs://"): - u=u[6:] - return ('cvs',u) - elif u.startswith("snapshot"): - if len(u)==8: - # the caller gets to randomly crapshoot a mirror for it. - return ('snapshot',None) - return ('snapshot',u[9:]) - else: - return (None,None) diff --git a/portage/sync/rsync.py b/portage/sync/rsync.py deleted file mode 100644 index b1b4d56..0000000 --- a/portage/sync/rsync.py +++ /dev/null @@ -1,161 +0,0 @@ -# rsync.py; module providing an abstraction over the rsync binary -# Copyright 2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -#$Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/portage/sync/rsync.py,v 1.2 2005/07/13 05:51:35 ferringb Exp $ - -from portage_const import RSYNC_BIN, RSYNC_HOST -import os, portage_exec -import portage_exception,socket - -import sync.syncexceptions - -class RSyncSyntaxError(sync.syncexceptions.SyncException): - """Exception thrown when generated rsync syntax is invalid""" - def __init__(self,command): - self.command=command - def __str__(self): - return "Invalid rsync syntax: %s" % str(self.command) - -class RsyncHost: - """abstraction over the rsync binary""" - - def __init__(self,host_uri,local_host=False,rsync_binary=RSYNC_BIN): - """self explanatory""" - if not os.access(rsync_binary,os.X_OK): - raise portage_exceptions.CommandNotFound(rsync_binary) - - self.__binary = rsync_binary - self.__host = host_uri - self.__ips = [] - - self.__local = local_host - if self.__local: - self.__host_name='' - self.__remote_path = host_uri - self.__host_uri='' - return - - f=host_uri.split("/",1) - if len(f) == 1: - #deprecated, assume /gentoo-portage - self.__remote_path = "/gentoo-portage" - else: - self.__remote_path = "/"+f[1] - host_uri = f[0] - - f=host_uri.find("@") - if f != -1: - host_uri=host_uri[f+1:] - f=host_uri.find(":") - if f != -1: - host_uri=host_uri[:f] - - self.__host_name = host_uri - - def get_remote_path(self): - return self.__remote_path - - def get_ips(self): - if self.__local: - return None - try: - self.__ips = socket.gethostbyname_ex(self.__host_name)[2] - except socket.error,e: - print "caught exception for %s" % self.__host_name,e - return None - return self.__ips - - def sync(self,settings, local_path,remote_path=None,verbosity=1,excludes=[],compress=True, \ - timeout=180,ip=None,cleanup=True): - """sync up local_path with remote_path on host - settings is a portage.config, at some point hopefully removed and specific options - passed in instead. - verbosity ranges 0-4 - 0 is absolutely quiet, 1 is quiet, 2 is normal, 3 is noisy. - ip is used to control which ip of the host is used. - cleanup controls deletion.""" - - args=[self.__binary, - "--recursive", # Recurse directories - "--links", # Consider symlinks - "--safe-links", # Ignore links outside of tree - "--perms", # Preserve permissions - "--times", # Preserive mod times - "--force", # Force deletion on non-empty dirs - "--whole-file", # Don't do block transfers, only entire files - "--stats", # Show final statistics about what was transfered - "--timeout="+str(timeout), # IO timeout if not done in X seconds - ] - - if cleanup: - args.append("--delete")# # Delete files that aren't in the master tree - args.append("--delete-after") # Delete only after everything else is done - - if compress: - args.append("--compress") - for x in excludes: - args.append("--exclude=%s" % str(x)) - if verbosity >=3: - args.append("--progress") - args.append("--verbose") - elif verbosity == 2: - args.append("--progress") - elif verbosity == 1: - args.append("--quiet") - else: - args.append("--quiet") - args.remove("--stats") - - if verbosity: - fd_pipes={1:1,2:2} - else: - fd_pipes={} - - #why do this if has_key crap? cause portage.config lacks a get function - #this allows dicts to be passed in and used. - if settings.has_key("RSYNC_INCLUDE"): - for x in settings["RSYNC_INCLUDE"].split(): - args.append("--include=%s" % x) - if settings.has_key("RSYNC_INCLUDEFROM"): - for x in settings["RSYNC_INCLUDEFROM"].split(): - args.append("--include-from=%s" % x) - if settings.has_key("RSYNC_EXCLUDE"): - for x in settings["RSYNC_EXCLUDE"].split(): - args.append("--exclude=%s" % x) - if settings.has_key("RSYNC_EXCLUDEFROM"): - for x in settings["RSYNC_EXCLUDEFROM"].split(): - args.append("--exclude-from=%s" % x) - - if settings.has_key("RSYNC_RATELIMIT"): - args.append("--bwlimit=%s" % settings["RSYNC_RATELIMIT"]) - - prefix="rsync://" - if remote_path == None: - if self.__local: - host=self.__remote_path - prefix='' - else: - host=self.__host - else: - if remote_path[0] != "/": - host = self.__host_name + '/' + remote_path - else: - host = self.__host_name + remote_path - - if ip: - args.append("%s%s" % (prefix,host.replace(self.__host_name,ip))) - else: - args.append("%s%s" % (prefix,host)) - args.append(local_path) - - # tie a debug option into this - #print "options are",args - - ret=portage_exec.spawn(args,fd_pipes=fd_pipes) - if ret == 0: - return True - elif ret == 1: - raise RSyncSyntaxError(args) - elif ret == 11: - raise IOError("Rsync returned exit code 11; disk space remaining?") - return ret diff --git a/portage/sync/snapshot.py b/portage/sync/snapshot.py deleted file mode 100644 index 8934e27..0000000 --- a/portage/sync/snapshot.py +++ /dev/null @@ -1,147 +0,0 @@ -# snapshot.py; provides the capability of fetching a portage tree snapshot, and syncing a tree with it. -# Copyright 2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -#$Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/portage/sync/snapshot.py,v 1.2 2005/07/13 05:51:35 ferringb Exp $ - - -raise Exception("won't work. portage_checksum clean ups needed") - -import os -import time -import portage_checksum -from portage.spawn import spawn -import shutil -import sync.rsync - -"""snapshot-http://gentoo.chem.wisc.edu/gentoo""" -class SnapshotHost: - def __init__(self,host_uri,snapshots_dir,tmp_dir,fetcher=None,use_md5=True): - if fetcher==None: - import transports.bundled_lib - fetcher=transports.bundled_lib.BundledConnection() - self.__fetcher=fetcher - self.__host_uri=host_uri - self.__tmpdir = tmp_dir - self.__snapshots_dir = snapshots_dir - self.__use_md5 = use_md5 - - def sync(self, local_path,verbosity=1): - attempts=0 - downloaded=False - while attempts < 40 and not downloaded: - file="portage-%s.tar.bz2" % time.strftime("%Y%m%d", - time.localtime(time.time() - (attempts*24*60*60))) - loc=self.__snapshots_dir+"/"+file - rem=self.__host_uri+"/"+file - downloaded=self.__fetch_snapshot(file,loc,rem,verbosity) - attempts += 1 - - if not downloaded: - # no snapshot, no syncy-poo. - return False - - return self.__apply_snapshot(loc,local_path,verbosity) - - def __apply_snapshot(self,snapshot,local_tree,verbosity): - """apply the actual snapshot. for different methods of this, inherit this class - and overload this function - current it untars to a temp location, and rsync's it over to local_path.""" - - #this should be checked - spawn(("tar","-jxf",snapshot,"-C",self.__tmpdir)) - syncer=sync.rsync.RsyncHost("%s/portage/" % self.__tmpdir,local_host=True) - try: - ret = syncer.sync({},local_tree,excludes=("/distfiles","/local","/packages"),verbosity=verbosity) - except sync.rsync.RSyncSyntaxError,e: - print "caught rsync syntax exception:",e - return False - except IOError, ie: - print "issue: ",ie - return False - if verbosity: - print "cleaning tempoary snapshot directory- %s/portage" % self.__tmpdir - shutil.rmtree(self.__tmpdir+"/portage") - - #nuke all other return codes. - if ret != True: - return False - return ret - - def __fetch_snapshot(self,file,loc,rem,verbosity): - grab_md5=True - hash=None - md5=None - md5_existed=False - ret=False - if self.__use_md5 and os.path.exists(loc+".md5sum"): - hash=self.__read_md5sum(loc+".md5sum") - if hash==None: - os.remove(loc+".md5sum") - else: - md5_existed=True - grab_md5=False - - if self.__use_md5 and grab_md5: - ret=self.__fetcher.fetch(rem+".md5sum",file_name=loc+".md5sum",verbose=(verbosity==1)) - if not ret: - hash=self.__read_md5sum(loc+".md5sum") - - if ret: - if verbosity: - print "!!! failed to fetch md5 for %s" % file - return False - - # at this point we have the md5, and know the image *should* exist. - ret = False - if os.path.exists(loc): - if self.__use_md5: - md5=portage_checksum.perform_md5(loc) - if hash == md5 or not self.__use_md5: - if verbosity: - print ">>> reusing %s" % loc - return True - else: - if verbosity: - print ">>> resuming %s" % rem - ret=self.__fetcher.resume(rem,file_name=loc,verbose=(verbosity==1)) - else: - if verbosity: - print ">>> fetching %s" % rem - ret=self.__fetcher.fetch(rem,file_name=loc,verbose=(verbosity==1)) - - if ret: - if verbosity: - print "!!! failed %s" % file - return False - - if self.__use_md5 and md5==None: - md5=portage_checksum.perform_md5(loc) - - if self.__use_md5 and md5_existed and md5!= hash: - print ">>> re-grabbing the hash" - # grab the md5 anew to be safe. - os.remove(loc+".md5sum") - if not self.__fetcher.fetch(rem+".md5sum",file_name=loc+".md5sum",verbose=True): - hash=self.__read_md5sum(loc+".md5sum") - - if md5!=hash and self.__use_md5: - if verbosity: - print "!!! snapshots correct md5: %s" % hash - print "!!! snapshots actual md5 : %s" % md5 - print "!!! cycling to next candidate." - print - return False - # if this point has been reached, things are sane. - return True - - - def __read_md5sum(self,file): - try: - myf=open(file,"r") - hash=myf.readline().split()[0] - if len(hash)!=32: - return None - return hash - except (OSError,IOError,IndexError),e: - print e - return None diff --git a/portage/sync/syncexceptions.py b/portage/sync/syncexceptions.py deleted file mode 100644 index 2c679e9..0000000 --- a/portage/sync/syncexceptions.py +++ /dev/null @@ -1,11 +0,0 @@ -# syncexceptions.py: base sync exception class. not used currently (should be though) -# Copyright 2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -#$Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/portage/sync/syncexceptions.py,v 1.2 2005/07/13 05:51:35 ferringb Exp $ - -class SyncException(Exception): - """base sync exception""" - def __init__(self,value): - self.value=value - def __str__(self): - return value diff --git a/portage/transports/__init__.py b/portage/transports/__init__.py deleted file mode 100644 index 22cac43..0000000 --- a/portage/transports/__init__.py +++ /dev/null @@ -1,9 +0,0 @@ -# transports/__init__.py; worthless file to keep python happy. -# Copyright 2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -#$Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/portage/transports/__init__.py,v 1.2 2005/07/13 05:51:35 ferringb Exp $ - -# worthless comment so diff creates this file. -# yay. -# this will ultimately hold the 'preferred fetcher' in the transport namespace, -# along with default options for fetchers (chunk size fex) diff --git a/portage/transports/bundled_lib.py b/portage/transports/bundled_lib.py deleted file mode 100644 index 04e7544..0000000 --- a/portage/transports/bundled_lib.py +++ /dev/null @@ -1,363 +0,0 @@ -# bundled_lib.py; implementation of a fetcher class useing httplib and ftplib. -# Copyright 2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -#$Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/portage/transports/bundled_lib.py,v 1.2 2005/07/13 05:51:35 ferringb Exp $ - -import httplib, ftplib, urlparse, base64, re, sys, os - -class BundledConnection: - """a fetcher abstraction using httplib and ftplib. - offers api access to specify the specific window/chunk of a uri you want""" - def __init__(self, persistant=False,chunk_size=8192,verbose=True): - self.__persistant = persistant - self.__chunk_size = chunk_size - self.__verbose = verbose - - # lifting the connection caching from check_src_uri's code- combine them if possible - self._http_conn = {} - self._https_conn = {} - self._ftp_conn = {} - - def __get_connection(self, uri): - """internal function to raid from the instances cache of connections, or return a new one""" - proto,host,con_dict,url,hash = self.__process_uri(uri) - cons = getattr(self,"_%s_conn" % proto) - if not self.__persistant or not cons.has_key(hash): - if proto in ('http','https'): - con = httpConnection(host,**con_dict) - else: - con = ftpConnection(host,chunk_size=self.__chunk_size,**con_dict) - if self.__persistant: - cons[hash] = con - else: - con = cons[hash] - return proto, con, url - - def fetch(self,uri, file_name=None,verbose=None): - """fetch uri, storing it in file_name""" - if verbose==None: - verbose=self.__verbose - proto, con, url = self.__get_connection(uri) - if not file_name: - x= url.find("/") - if x == -1: - raise Exception,"Unable to deterimine file_name from %s" % uri - file_name = url[x+1:] - try: - myf=open(file_name,"w",0) - - except (IOError, OSError), e: - sys.stderr.write("Failed opening file %s for saving:\n%s\n" % (file_name,str(e))) - return True - if verbose: - print "fetching '%s' -> '%s'" % (uri, file_name) - if proto in ('http','https'): - try: - ret= self.__execute_transfer(con, url, myf, 0) - except UnableToAccess,ua: - if verbose: - print ua - myf.close() - os.remove(file_name) - return True - else: - ret = con.request(url, callback=myf.write) - myf.close() - return not ret - - def resume(self, uri, file_name=None,verbose=None): - """resume uri into file_name""" - if verbose==None: - verbose=self.__verbose - proto, con, url = self.__get_connection(uri) - if not file_name: - x= url.find("/") - if x == -1: - raise Exception,"Unable to deterimine file_name from %s" % uri - file_name = url[x+1:] - try: - pos = os.stat(file_name).st_size - - # open it manually, since open(file_name,"a") has the lovely feature of - # ignoring _all_ previous seek requests the minute a write is issued. - fd=os.open(file_name, os.O_WRONLY) - myf = os.fdopen(fd,"w",0) - if pos > self.__chunk_size: - pos -= self.__chunk_size - myf.seek(pos, 0) - else: - pos=0 - - except OSError, e: - if e.errno == 2: - # file not found - pos = 0 - myf = open(file_name, "w",0) - else: - sys.stderr.write("Failed opening file %s for saving:\n%s\n" % (file_name,str(e))) - return True - - if verbose: - print "resuming '%s' -> '%s'" % (uri, file_name) - if proto in ('http','https'): - try: - ret = self.__execute_transfer(con, url, myf, pos) - except UnableToAccess,ua: - if verbose: - print ua - myf.close() - return True - else: - ret = con.request(url, callback=myf.write, start=pos) - myf.close() - return not ret - - def __execute_transfer(self, con, url, fd, pos): - """internal http(|s) function for looping over requests storing to fd""" - rc=1 - redirect_max = 10 - while rc: -# print "fetching %i-%i" % (pos, pos + (self.__chunk_size *8) -1) - try: - data,rc=con.request(url,start=pos, end=(pos+(self.__chunk_size*8) -1)) - except MovedLocation, ml: - sys.stderr.write(str(ml)+"\n") - url = ml.location - redirect_max -= 1 - if redirect_max <= 0: - print "we've been redirected too many times- bailing" - return False - else: - continue - except UnhandledError, ue: - print ue - return False - fd.write(data) - pos += len(data) - return True - - default_ports = {'http':80, 'https':443, 'ftp':21} - - def __process_uri(self, uri): - """internal function to determine the proto, host, uri, options for - __get_connection, and a hash representing this host's specific options. - username, password, port, ssl, etc""" - con_dict = {} - proto,parts,url = urlparse.urlparse(uri)[0:3] - if not self.default_ports.has_key(proto): -# port = self.default_ports[proto] -# else: - raise Exception, "unknown protocol %s for uri %s" % (proto,uri) - - parts = parts.split("@") - if len(parts) > 1: - con_dict["user"] = parts.pop(0) - - r=re.compile(":\d+$").search(parts[0]) - if r: - # found a port - con_dict["port"] = parts[0][r.start() + 1:] - parts[0] = parts[0][0:r.start()] - del r - - #grab the pass. - parts = parts[0].split(":") - if len(parts) > 1: - con_dict["passwd"] = parts.pop(0) - - hash='' - k=con_dict.keys() - k.sort() - for x in k: - hash += '%s:%s\n' % (x, str(con_dict[x])) - hash += "host:%s" % parts[0] - return [proto, parts[0], con_dict, url,hash] - -class ftpConnection: - """higher level interface over ftplib""" - def __init__(self,host,ssl=False,port=21,user=None,passwd=None,passive=True, chunk_size=8192,debug=0): - """ssl is currently not supported - debug flips on a bit of extra info - chunk_size controls the size of chunks transferred per callback- useful for performance tweaking - - note a ftpConnection instance *must not* be called in a threaded/parallel manner- - the connection can handle one, and only one request, and is currently not smart - enough to lock itself for protection""" - self.__chunk = chunk_size - self.__pos = 0 - self.__end = 0 - self.__endlimit = False - if ssl: - raise Exception, "sftp isn't support atm" - args=[] - self.__con = ftplib.FTP() - self.__con.set_debuglevel(debug) - self.__con.connect(host,port) - if user and passwd: - self.__con.login(user,passwd) - else: - self.__con.login() - self.__con.set_pasv(passive) - - def request(self, file, start=0, end=0, callback=None): - """make a request of file, with optional start/end - callback is used for processing data- if callback, then callback is called, and the return - is true/false depending on success - - if no callback, then the requested window is returned, eg string. - - technical note: do to the way the protocol works, the remote host may send more then what - was specified via start/end. Despite this, only that window is processed/returned. - Just worth noting since it means if you're requested 3 bytes from a file, depending on how - quickly the server disconnects, 13k may've been sent by that point (still, only the 3 bytes - are actually processed by callback/returned).""" - - self.__pos = start - self.__end = end - self.__callback = callback - self.__data = '' - self.__aborted = False - - if end: - self.__endlimit = True - if end: - block = end - start - else: - block = self.__chunk - if block > self.__chunk: - block = self.__chunk - - try: - d=self.__con.retrbinary("retr %s" % file, self.__transfer_callback, block, start) - except ftplib.all_errors: - self.__data = '' - return False - - if callback == None: - d = self.__data - self.__data = '' - return d - - - def __transfer_callback(self, data): - """internal callback function used with ftplib. This either appends the returned data, - or passes it off to the requested callback function""" - if self.__aborted: - return - - l=len(data) - - if self.__endlimit and self.__pos + l >= self.__end: - data = data[:self.__end - l] - l = self.__end - self.__pos - self.__aborted = True - self.__con.abort() - - self.__pos += l - if self.__callback: - self.__callback(data) - else: - self.__data += data - return - -class httpConnection: - """higher level abstraction over httplib allowing window level access to a remote uri""" - def __init__(self,host,ssl=False,port=None,user=None,passwd=None): - """options for this host connection, sent to the server via the headers - note you cannot just specify the port as 443 and assume it'll do ssl- - you must flip on ssl to enable descryption/encryption of the protocol - - just like with ftpConnection, instances *must not* be called in a parallel/threaded - manner without external locking. - This class isn't smart enough to protect itself, although it will be made so at - some point.""" - - self.__headers = {} - self.__host = host - if user and passwd: - self.__headers.extend({"Authorization": "Basic %s" % - base64.encodestring("%s:%s" % (user,passwd)).replace("\012","") - }) - - if port == None: - if ssl: - self.__port = httplib.HTTPS_PORT - else: - self.__port = httplib.HTTP_PORT - else: - self.__port = port - if ssl: - self.__conn = httplib.HTTPSConnection(self.__host, self.__port) - else: - self.__conn = httplib.HTTPConnection(self.__host, self.__port) - - def request(self,uri,start=None,end=None): - """returns httpconnection.response, our chucks an exception.""" - if end==None and start: - end += 3000 - size = None - if not (start == None or end == None): - size = end - start - self.__headers["Range"]="bytes=%i-%i" % (start, end) - try: - self.__conn.request("GET",uri,{},self.__headers) - except httplib.HTTPException, e: - print "caught exception %s" % str(e) - if start and end: - del self.__headers["Range"] - return None,False - if start and end: - del self.__headers["Range"] - response = self.__conn.getresponse() - rc = response.status - if rc in (301,302): - response.read() - for x in str(response.msg).split("\n"): - p = x.split(":") - # assume the remote server is dumb, and ignore case. - if x[0].lower() == "location": - raise MovedLocation(rc, x[1]) - - # if we hit this point, the server is stupid. - raise Exception,"received %i, but no location" % rc - - if rc in (404,403): - response.read() - raise UnableToAccess(rc,response.reason) - elif rc not in (200,206): - response.read() - raise UnhandledError(rc,response.reason) - data=response.read() - if size != None: - return data,(rc==206 and len(data) -1 == size) - return data,(rc==206) - - -class UnhandledError(Exception): - """basically an unknown state/condition was encountered, so control is being relinquished""" - def __init__(self, status, reason): - self.status = status - self.reason = str(reason) - def __str__(self): - return "Unhandled Status code: %i: %s" % (self.status, self.reason) - -class UnableToAccess(Exception): - """404's and 403's""" - def __init__(self,status,reason): - self.status = status - self.reason = str(reason) - def __str__(self): - return "%s code: %s" % (self.status,self.reason) - -class MovedLocation(Exception): - """http 301/302 exception""" - def __init__(self,status,new_loc): - self.status=status - self.location = str(new_loc) - - def __str__(self): - if self.status == 301: - return "301: Location has moved: %s" % self.location - else: - return "302: Location has temporarily moved: %s" % self.location - diff --git a/portage/transports/fetchcommand.py b/portage/transports/fetchcommand.py deleted file mode 100644 index f18249b..0000000 --- a/portage/transports/fetchcommand.py +++ /dev/null @@ -1,72 +0,0 @@ -# fetchcommand.py; fetcher class encapsulating make.conf FETCHCOMMAND/RESUMECOMMAND, and the ensueing spawn calls -# Copyright 2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -#$Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/portage/transports/fetchcommand.py,v 1.2 2005/07/13 05:51:35 ferringb Exp $ - -import urlparse,types -from portage.exec import spawn_bash - -class CustomConnection: - """abstraction representing a portage.config instances FETCHCOMMAND and RESUMECOMMAND""" - def __init__(self,mysettings,selinux_context=None, verbose=True): - """selinux_context should always be passed in, actual control of whether or not - the context is switched is based upon if it's a selinux capable system - verbose controls whether this instance makes noise or not""" - self.__fc = mysettings["FETCHCOMMAND"] - self.__rc = mysettings["RESUMECOMMAND"] - self.__verbose = verbose - self.__cfc = {} - self.__crc = {} - self.__selinux_context = selinux_context - self.__distdir=mysettings["DISTDIR"] - for k in mysettings.environ().keys(): - if k.startswith("FETCHCOMMAND_"): - self.__cfc[k[13:]] = mysettings[k] - elif k.startswith("RESUMECOMMAND_"): - self.__crc[k[14:]] = mysettings[k] - - - def fetch(self, uri, file_name=None, verbose=None): - """fetch uri, storing it to file_name""" - return self.__execute(uri,file_name,False,verbose) - - def resume(self, uri, file_name=None,verbose=None): - """resume uri into file_name""" - return self.__execute(uri,file_name,True,verbose) - - def __execute(self, uri, file_name, resume,verbose): - """internal function doing the actual work of fetch/resume""" - if verbose==None: - verbose=self.__verbose - - proto = urlparse.urlparse(uri)[0].upper() - - if not file_name: - x = uri.rfind("/") - distdir=self.__distdir - if x == -1: - raise Exception,"Unable to deterimine file_name from %s" % uri - file_name = uri[x+1:] - else: - x = file_name.rfind("/") - if x == -1: - distdir=self.__distdir - else: - distdir=file_name[:x] - file_name=file_name[x+1:] - - if resume: - f = self.__crc.get(proto, self.__rc) - else: - f = self.__cfc.get(proto, self.__fc) - - - f=f.replace("${DISTDIR}", distdir) - f=f.replace("${URI}",uri) - f=f.replace("${FILE}",file_name) - if verbose: - fd_pipes={1:1,2:2} - else: - fd_pipes={} - return spawn_bash(f,fd_pipes=fd_pipes,selinux_context=self.__selinux_context) - diff --git a/portage/util/__init__.py b/portage/util/__init__.py deleted file mode 100644 index bcffcd1..0000000 --- a/portage/util/__init__.py +++ /dev/null @@ -1 +0,0 @@ -#import modules, fs, misc diff --git a/portage/util/currying.py b/portage/util/currying.py deleted file mode 100644 index 84e5140..0000000 --- a/portage/util/currying.py +++ /dev/null @@ -1,11 +0,0 @@ -# Copyright: 2005 Gentoo Foundation -# Author(s): Lifted from python cookbook, Scott David Daniels, Ben Wolfson, Nick Perkins, Alex Martelli for curry routine. -# License: GPL2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/portage/util/currying.py,v 1.2 2005/07/13 07:22:08 ferringb Exp $ - -def curry(*args, **kargs): - def callit(*moreargs, **morekargs): - kw = kargs.copy() - kw.update(morekargs) - return args[0](*(args[1:]+moreargs), **kw) - return callit diff --git a/portage/util/dicts.py b/portage/util/dicts.py deleted file mode 100644 index f6ca08d..0000000 --- a/portage/util/dicts.py +++ /dev/null @@ -1,158 +0,0 @@ -# Copyright: 2005 Gentoo Foundation -# Author(s): Brian Harring (ferringb@gentoo.org) -# License: GPL2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/portage/util/Attic/dicts.py,v 1.2 2005/07/13 05:51:35 ferringb Exp $ - -class IndexableSequence(object): - def __init__(self, get_keys, get_values, recursive=False, returnEmpty=False, - returnIterFunc=None, modifiable=False, delfunc=None, updatefunc=None): - self.__get_keys = get_keys - self.__get_values = get_values - self.__cache = {} - self.__cache_complete = False - self.__cache_can_be_complete = not recursive and not modifiable - self.__return_empty = returnEmpty - self.__returnFunc = returnIterFunc - self._frozen = not modifiable - if not self._frozen: - self.__del_func = delfunc - self.__update_func = updatefunc - - def __getitem__(self, key): - if not (self.__cache_complete or self.__cache.has_key(key)): - self.__cache[key] = self.__get_values(key) - return self.__cache[key] - - def keys(self): - return list(self.iterkeys()) - - def __delitem__(self, key): - if self._frozen: - raise AttributeError - if not key in self: - raise KeyError(key) - return self.__del_func(key) - - def __setitem__(self, key, value): - if self._frozen: - raise AttributeError - if not key in self: - raise KeyError(key) - return self.__update_func(key, value) - - def __contains__(self, key): - try: - self[key] - return True - except KeyError: - return False - - def iterkeys(self): -# print "iterkeys called, cache-complete=",self.__cache_complete - if self.__cache_complete: - return self.__cache.keys() - return self.__gen_keys() - - def __gen_keys(self): - for key in self.__get_keys(): - if not self.__cache.has_key(key): - self.__cache[key] = self.__get_values(key) -# print "adding %s:%s" % (str(key), str(self.__cache[key])) - yield key - self.__cache_complete = self.__cache_can_be_complete - return - - def __iter__(self): - if self.__returnFunc: - for key, value in self.iteritems(): - if len(value) == 0: - if self.__return_empty: - yield key - else: - for x in value: - yield self.__returnFunc(key, x) - else: - for key, value in self.iteritems(): - if len(value) == 0: - if self.__return_empty: - yield key - else: - for x in value: - yield key+'/'+x - return - - def items(self): - return list(self.iteritems()) - - def iteritems(self): -# print "iteritems called, cache-complete=",self.__cache_complete - if self.__cache_complete: - return self.__cache.items() - return self.__gen_items() - - def __gen_items(self): - for key in self.iterkeys(): - yield key, self[key] - return - - -class LazyValDict(object): - - def __init__(self, get_keys_func, get_val_func): - self.__val_func = get_val_func - self.__keys_func = get_keys_func - self.__vals = {} - self.__keys = {} - - - def __setitem__(self): - raise AttributeError - - - def __delitem__(self): - raise AttributeError - - - def __getitem__(self, key): - if self.__keys_func != None: - map(self.__keys.setdefault, self.__keys_func()) - self.__keys_func = None - if key in self.__vals: - return self.__vals[key] - if key in self.__keys: - v = self.__vals[key] = self.__val_func(key) - del self.__keys[key] - return v - raise KeyError(key) - - - def iterkeys(self): - if self.__keys_func != None: - map(self.__keys.setdefault, self.__keys_func()) - self.__keys_func = None - for k in self.__keys.keys(): - yield k - for k in self.__vals.keys(): - yield k - - def keys(self): - return list(self.iterkeys()) - - def __contains__(self, key): - if self.__keys_func != None: - map(self.__keys.setdefault, self.__keys_func()) - self.__keys_func = None - return key in self.__keys or key in self.__vals - - __iter__ = iterkeys - has_key = __contains__ - - - def iteritems(self): - for k in self.iterkeys(): - yield k, self[k] - - - def items(self): - return list(self.iteritems()) - diff --git a/portage/util/fs.py b/portage/util/fs.py deleted file mode 100644 index 848c73a..0000000 --- a/portage/util/fs.py +++ /dev/null @@ -1,519 +0,0 @@ -# Copyright 2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/portage/util/fs.py,v 1.2 2005/07/13 05:51:35 ferringb Exp $ -cvs_id_string="$Id: fs.py,v 1.2 2005/07/13 05:51:35 ferringb Exp $"[5:-2] - -import os - -try: - #XXX: This should get renamed to bsd_chflags, I think. - import chflags - bsd_chflags = chflags -except SystemExit, e: - raise -except: - # XXX: This should get renamed to bsd_chflags, I think. - bsd_chflags = None - - -def grabfile(myfilename, compat_level=0): - """This function grabs the lines in a file, normalizes whitespace and returns lines in a list; if a line - begins with a #, it is ignored, as are empty lines""" - - try: - myfile=open(myfilename,"r") - except IOError: - return [] - mylines=myfile.readlines() - myfile.close() - newlines=[] - for x in mylines: - #the split/join thing removes leading and trailing whitespace, and converts any whitespace in the line - #into single spaces. - myline = ' '.join(x.split()) - if not len(myline): - continue - if myline[0]=="#": - # Check if we have a compat-level string. BC-integration data. - # '##COMPAT==>N<==' 'some string attached to it' - mylinetest = myline.split("<==", 1) - if len(mylinetest) == 2: - myline_potential = mylinetest[1] - mylinetest = mylinetest[0].split("##COMPAT==>") - if len(mylinetest) == 2: - if compat_level >= int(mylinetest[1]): - # It's a compat line, and the key matches. - newlines.append(myline_potential) - continue - else: - continue - newlines.append(myline) - return newlines - - -def grab_multiple(basename, locations, handler, all_must_exist=0): - mylist = [] - for x in locations: - mylist.append(handler(x+"/"+basename)) - return mylist - - -def grabdict(myfilename,juststrings=0,empty=0): - """This function grabs the lines in a file, normalizes whitespace and returns lines in a dictionary""" - newdict={} - try: - myfile=open(myfilename,"r") - except IOError,e: - return newdict - mylines=myfile.readlines() - myfile.close() - for x in mylines: - #the split/join thing removes leading and trailing whitespace, and converts any whitespace in the line - #into single spaces. - if x[0] == "#": - continue - myline = x.split() - if len(myline)<2 and empty==0: - continue - if len(myline)<1 and empty==1: - continue - if juststrings: - newdict[myline[0]]=" ".join( myline[1:] ) - else: - newdict[myline[0]]=myline[1:] - return newdict - - -def grabints(myfilename): - newdict={} - try: - myfile=open(myfilename,"r") - except IOError: - return newdict - mylines=myfile.readlines() - myfile.close() - for x in mylines: - #the split/join thing removes leading and trailing whitespace, and converts any whitespace in the line - #into single spaces. - myline=x.split() - if len(myline)!=2: - continue - newdict[myline[0]]=int(myline[1]) - return newdict - - -def writeints(mydict,myfilename): - try: - myfile=open(myfilename,"w") - except IOError: - return 0 - for x in mydict.keys(): - myfile.write(x+" "+`mydict[x]`+"\n") - myfile.close() - return 1 - - -def writedict(mydict,myfilename,writekey=1): - """Writes out a dict to a file; writekey=0 mode doesn't write out - the key and assumes all values are strings, not lists.""" - try: - myfile=open(myfilename,"w") - except IOError: - writemsg("Failed to open file for writedict(): "+str(myfilename)+"\n") - return 0 - if not writekey: - for x in mydict.values(): - myfile.write(x+"\n") - else: - for x in mydict.keys(): - myfile.write(x+" ") - for y in mydict[x]: - myfile.write(y+" ") - myfile.write("\n") - myfile.close() - return 1 - - -def getconfig(mycfg,tolerant=0,allow_sourcing=False): - import shlex, string - mykeys={} - try: - f=open(mycfg,'r') - except IOError: - return None - try: - lex=shlex.shlex(f) - lex.wordchars=string.digits+string.letters+"~!@#$%*_\:;?,./-+{}" - lex.quotes="\"'" - if allow_sourcing: - lex.source="source" - while 1: - key=lex.get_token() - if (key==''): - #normal end of file - break; - equ=lex.get_token() - if (equ==''): - #unexpected end of file - #lex.error_leader(self.filename,lex.lineno) - if not tolerant: - writemsg("!!! Unexpected end of config file: variable "+str(key)+"\n") - raise Exception("ParseError: Unexpected EOF: "+str(mycfg)+": on/before line "+str(lex.lineno)) - else: - return mykeys - elif (equ!='='): - #invalid token - #lex.error_leader(self.filename,lex.lineno) - if not tolerant: - writemsg("!!! Invalid token (not \"=\") "+str(equ)+"\n") - raise Exception("ParseError: Invalid token (not '='): "+str(mycfg)+": line "+str(lex.lineno)) - else: - return mykeys - val=lex.get_token() - if (val==''): - #unexpected end of file - #lex.error_leader(self.filename,lex.lineno) - if not tolerant: - writemsg("!!! Unexpected end of config file: variable "+str(key)+"\n") - raise portage_exception.CorruptionError("ParseError: Unexpected EOF: "+str(mycfg)+": line "+str(lex.lineno)) - else: - return mykeys - mykeys[key]=varexpand(val,mykeys) - except SystemExit, e: - raise - except Exception, e: - raise e.__class__, str(e)+" in "+mycfg - return mykeys - - -#cache expansions of constant strings -cexpand={} -def varexpand(mystring,mydict={}): - """ - new variable expansion code. Removes quotes, handles \n, etc. - This code is used by the configfile code, as well as others (parser) - This would be a good bunch of code to port to C. - """ - mystring=" "+mystring - if mystring in cexpand: - return cexpand[mystring] - numvars=0 - #in single, double quotes - insing=0 - indoub=0 - pos=1 - newstring=" " - while (pos<len(mystring)): - if (mystring[pos]=="'") and (mystring[pos-1]!="\\"): - if (indoub): - newstring=newstring+"'" - else: - insing=not insing - pos=pos+1 - continue - elif (mystring[pos]=='"') and (mystring[pos-1]!="\\"): - if (insing): - newstring=newstring+'"' - else: - indoub=not indoub - pos=pos+1 - continue - if (not insing): - #expansion time - if (mystring[pos]=="\n"): - #convert newlines to spaces - newstring=newstring+" " - pos=pos+1 - elif (mystring[pos]=="\\"): - #backslash expansion time - if (pos+1>=len(mystring)): - newstring=newstring+mystring[pos] - break - else: - a=mystring[pos+1] - pos=pos+2 - if a=='a': - newstring=newstring+chr(007) - elif a=='b': - newstring=newstring+chr(010) - elif a=='e': - newstring=newstring+chr(033) - elif (a=='f') or (a=='n'): - newstring=newstring+chr(012) - elif a=='r': - newstring=newstring+chr(015) - elif a=='t': - newstring=newstring+chr(011) - elif a=='v': - newstring=newstring+chr(013) - elif a!='\n': - #remove backslash only, as bash does: this takes care of \\ and \' and \" as well - newstring=newstring+mystring[pos-1:pos] - continue - elif (mystring[pos]=="$") and (mystring[pos-1]!="\\"): - pos=pos+1 - if mystring[pos]=="{": - pos=pos+1 - braced=True - else: - braced=False - myvstart=pos - validchars=string.ascii_letters+string.digits+"_" - while mystring[pos] in validchars: - if (pos+1)>=len(mystring): - if braced: - cexpand[mystring]="" - return "" - else: - pos=pos+1 - break - pos=pos+1 - myvarname=mystring[myvstart:pos] - if braced: - if mystring[pos]!="}": - cexpand[mystring]="" - return "" - else: - pos=pos+1 - if len(myvarname)==0: - cexpand[mystring]="" - return "" - numvars=numvars+1 - if mydict.has_key(myvarname): - newstring=newstring+mydict[myvarname] - else: - newstring=newstring+mystring[pos] - pos=pos+1 - else: - newstring=newstring+mystring[pos] - pos=pos+1 - if numvars==0: - cexpand[mystring]=newstring[1:] - return newstring[1:] - - -def pickle_write(data,filename,debug=0): - import cPickle,os - try: - myf=open(filename,"w") - cPickle.dump(data,myf,cPickle.HIGHEST_PROTOCOL) - myf.close() - writemsg("Wrote pickle: "+str(filename)+"\n",1) - os.chown(myefn,uid,portage_gid) - os.chmod(myefn,0664) - except SystemExit, e: - raise - except Exception, e: - return 0 - return 1 - - -def pickle_read(filename,default=None,debug=0): - import cPickle,os - if not os.access(filename, os.R_OK): - writemsg("pickle_read(): File not readable. '"+filename+"'\n",1) - return default - data = None - try: - myf = open(filename) - mypickle = cPickle.Unpickler(myf) - mypickle.find_global = None - data = mypickle.load() - myf.close() - del mypickle,myf - writemsg("pickle_read(): Loaded pickle. '"+filename+"'\n",1) - except SystemExit, e: - raise - except Exception, e: - writemsg("!!! Failed to load pickle: "+str(e)+"\n",1) - data = default - return data - -# throw this out. -def movefile(src,dest,newmtime=None,sstat=None,mysettings=None): - """moves a file from src to dest, preserving all permissions and attributes; mtime will - be preserved even when moving across filesystems. Returns true on success and false on - failure. Move is atomic.""" - #print "movefile("+str(src)+","+str(dest)+","+str(newmtime)+","+str(sstat)+")" - from portage.spawn import selinux_capable - import stat, shutil, os.path - if selinux_capable: - import selinux - from portage.os_data import lchown - try: - if not sstat: - sstat=os.lstat(src) - if bsd_chflags: - sflags=bsd_chflags.lgetflags(src) - if sflags < 0: - # Problem getting flags... - print "!!! Couldn't get flags for "+dest+"\n" - return None - - except SystemExit, e: - raise - except Exception, e: - print "!!! Stating source file failed... movefile()" - print "!!!",e - return None - - destexists=1 - try: - dstat=os.lstat(dest) - except SystemExit, e: - raise - except: - dstat=os.lstat(os.path.dirname(dest)) - destexists=0 - - if bsd_chflags: - # Check that we can actually unset schg etc flags... - # Clear the flags on source and destination; we'll reinstate them after merging - if(destexists): - if bsd_chflags.lchflags(dest, 0) < 0: - print "!!! Couldn't clear flags on file being merged: \n" - # We might have an immutable flag on the parent dir; save and clear. - pflags=bsd_chflags.lgetflags(os.path.dirname(dest)) - bsd_chflags.lchflags(os.path.dirname(dest), 0) - - # Don't bother checking the return value here; if it fails then the next line will catch it. - bsd_chflags.lchflags(src, 0) - - if bsd_chflags.lhasproblems(src)>0 or (destexists and bsd_chflags.lhasproblems(dest)>0) or bsd_chflags.lhasproblems(os.path.dirname(dest))>0: - # This is bad: we can't merge the file with these flags set. - print "!!! Can't merge file "+dest+" because of flags set\n" - return None - - if destexists: - if stat.S_ISLNK(dstat.st_mode): - try: - os.unlink(dest) - destexists=0 - except SystemExit, e: - raise - except Exception, e: - pass - - if stat.S_ISLNK(sstat.st_mode): - try: - target=os.readlink(src) - if mysettings and mysettings["D"]: - if target.find(mysettings["D"])==0: - target=target[len(mysettings["D"]):] - if destexists and not stat.S_ISDIR(dstat.st_mode): - os.unlink(dest) - if selinux_capable: - sid = selinux.get_lsid(src) - selinux.secure_symlink(target,dest,sid) - else: - os.symlink(target,dest) - lchown(dest,sstat.st_uid, sstat.st_gid) - if bsd_chflags: - # Restore the flags we saved before moving - if bsd_chflags.lchflags(dest, sflags) < 0 or bsd_chflags.lchflags(os.path.dirname(dest), pflags) < 0: - writemsg("!!! Couldn't restore flags ("+str(flags)+") on " + dest+":\n") - writemsg("!!! %s\n" % str(e)) - return None - return os.lstat(dest).st_mtime - except SystemExit, e: - raise - except Exception, e: - print "!!! failed to properly create symlink:" - print "!!!",dest,"->",target - print "!!!",e - return None - - renamefailed=1 - if sstat.st_dev == dstat.st_dev or selinux_capable: - try: - if selinux_capable: - ret=selinux.secure_rename(src,dest) - else: - ret=os.rename(src,dest) - renamefailed=0 - except SystemExit, e: - raise - except Exception, e: - import errno - if e[0]!=errno.EXDEV: - # Some random error. - print "!!! Failed to move",src,"to",dest - print "!!!",e - return None - # Invalid cross-device-link 'bind' mounted or actually Cross-Device - if renamefailed: - didcopy=0 - if stat.S_ISREG(sstat.st_mode): - try: # For safety copy then move it over. - if selinux_capable: - selinux.secure_copy(src,dest+"#new") - selinux.secure_rename(dest+"#new",dest) - else: - shutil.copyfile(src,dest+"#new") - os.rename(dest+"#new",dest) - didcopy=1 - except SystemExit, e: - raise - except Exception, e: - print '!!! copy',src,'->',dest,'failed.' - print "!!!",e - return None - else: - #we don't yet handle special, so we need to fall back to /bin/mv - if selinux_capable: - a=portage_exec.spawn_get_output(MOVE_BINARY+" -c -f '%s' '%s'" % (src,dest)) - else: - a=portage_exec.spawn_get_output(MOVE_BINARY+" -f '%s' '%s'" % (src,dest)) - if a[0]!=0: - print "!!! Failed to move special file:" - print "!!! '"+src+"' to '"+dest+"'" - print "!!!",a - return None # failure - try: - if didcopy: - lchown(dest,sstat.st_uid, sstat.st_gid) - os.chmod(dest, stat.S_IMODE(sstat.st_mode)) # Sticky is reset on chown - os.unlink(src) - except SystemExit, e: - os.unlink(src) - except SystemExit, e: - raise - except Exception, e: - print "!!! Failed to chown/chmod/unlink in movefile()" - print "!!!",dest - print "!!!",e - return None - - if newmtime: - os.utime(dest,(newmtime,newmtime)) - else: - os.utime(dest, (sstat.st_atime, sstat.st_mtime)) - newmtime=sstat.st_mtime - - if bsd_chflags: - # Restore the flags we saved before moving - if bsd_chflags.lchflags(dest, sflags) < 0 or bsd_chflags.lchflags(os.path.dirname(dest), pflags) < 0: - writemsg("!!! Couldn't restore flags ("+str(sflags)+") on " + dest+":\n") - return None - - return newmtime - - -def abssymlink(symlink): - """ - This reads symlinks, resolving the relative symlinks, and returning the absolute. - """ - import os.path - mylink=os.readlink(symlink) - if mylink[0] != '/': - mydir=os.path.dirname(symlink) - mylink=mydir+"/"+mylink - return os.path.normpath(mylink) - - -def normpath(mypath): - newpath = os.path.normpath(mypath) - if len(newpath) > 1: - if newpath[:2] == "//": - return newpath[1:] - return newpath diff --git a/portage/util/misc.py b/portage/util/misc.py deleted file mode 100644 index 1969e55..0000000 --- a/portage/util/misc.py +++ /dev/null @@ -1,99 +0,0 @@ -# Copyright 1998-2005 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/portage/util/misc.py,v 1.2 2005/07/13 05:51:35 ferringb Exp $ -cvs_id_string="$Id: misc.py,v 1.2 2005/07/13 05:51:35 ferringb Exp $"[5:-2] - -#clean this up. -import sys,string,shlex,os.path,stat,types -import shutil - - -def stack_dictlist(original_dicts, incremental=0, incrementals=[], ignore_none=0): - """Stacks an array of dict-types into one array. Optionally merging or - overwriting matching key/value pairs for the dict[key]->list. - Returns a single dict. Higher index in lists is preferenced.""" - final_dict = None - kill_list = {} - for mydict in original_dicts: - if mydict == None: - continue - if final_dict == None: - final_dict = {} - for y in mydict.keys(): - if not final_dict.has_key(y): - final_dict[y] = [] - if not kill_list.has_key(y): - kill_list[y] = [] - - mydict[y].reverse() - for thing in mydict[y]: - if thing and (thing not in kill_list[y]) and ("*" not in kill_list[y]): - if (incremental or (y in incrementals)) and thing[0] == '-': - if thing[1:] not in kill_list[y]: - kill_list[y] += [thing[1:]] - else: - if thing not in final_dict[y]: - final_dict[y].append(thing[:]) - mydict[y].reverse() - if final_dict.has_key(y) and not final_dict[y]: - del final_dict[y] - return final_dict - - -def stack_dicts(dicts, incremental=0, incrementals=[], ignore_none=0): - """Stacks an array of dict-types into one array. Optionally merging or - overwriting matching key/value pairs for the dict[key]->string. - Returns a single dict.""" - final_dict = None - for mydict in dicts: - if mydict == None: - if ignore_none: - continue - else: - return None - if final_dict == None: - final_dict = {} - for y in mydict.keys(): - if mydict[y]: - if final_dict.has_key(y) and (incremental or (y in incrementals)): - final_dict[y] += " "+mydict[y][:] - else: - final_dict[y] = mydict[y][:] - mydict[y] = string.join(mydict[y].split()) # Remove extra spaces. - return final_dict - -def stack_lists(lists, incremental=1): - """Stacks an array of list-types into one array. Optionally removing - distinct values using '-value' notation. Higher index is preferenced.""" - new_list = [] - for x in lists: - for y in x: - if y: - if incremental and y[0]=='-': - while y[1:] in new_list: - del new_list[new_list.index(y[1:])] - else: - if y not in new_list: - new_list.append(y[:]) - return new_list - - -def unique_array(array): - """Takes an array and makes sure each element is unique.""" - newarray = [] - for x in array: - if x not in newarray: - newarray.append(x) - return newarray - - -def flatten(mytokens): - """this function now turns a [1,[2,3]] list into - a [1,2,3] list and returns it.""" - newlist=[] - for x in mytokens: - if type(x)==list: - newlist.extend(flatten(x)) - else: - newlist.append(x) - return newlist diff --git a/portage/util/modules.py b/portage/util/modules.py deleted file mode 100644 index 81f5200..0000000 --- a/portage/util/modules.py +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright: 2005 Gentoo Foundation -# Author(s): Brian Harring (ferringb@gentoo.org) -# License: GPL2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/portage/util/modules.py,v 1.2 2005/07/13 05:51:35 ferringb Exp $ - -def load_module(name): - m = __import__(name) - nl = name.split('.') - # __import__ returns nl[0]... so. - nl.pop(0) - while len(nl): - m = getattr(m, nl[0]) - nl.pop(0) - return m - -def load_attribute(name): - i = name.rfind(".") - if i == -1: - raise ValueError("name isn't an attribute, it's a module... : %s" % name) - m = load_module(name[:i]) - m = getattr(m, name[i+1:]) - return m diff --git a/portage/vdb/__init__.py b/portage/vdb/__init__.py deleted file mode 100644 index efcbd88..0000000 --- a/portage/vdb/__init__.py +++ /dev/null @@ -1 +0,0 @@ -import repository diff --git a/portage/vdb/repository.py b/portage/vdb/repository.py deleted file mode 100644 index 2b1803e..0000000 --- a/portage/vdb/repository.py +++ /dev/null @@ -1,76 +0,0 @@ -# Copyright: 2005 Gentoo Foundation -# Author(s): Brian Harring (ferringb@gentoo.org) -# License: GPL2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/portage/vdb/repository.py,v 1.2 2005/07/13 05:51:35 ferringb Exp $ - -# hack, remove when it's fixed -raise Exception("sorry, this won't work with current portage namespace layout. plsfix, kthnx") - -import os,stat -import prototype, errors - -#needed to grab the PN -import portage_versions - -class tree(prototype.tree): - def __init__(self, base): - super(tree,self).__init__() - self.base = base - try: - st = os.lstat(self.base) - if not stat.S_ISDIR(st.st_mode): - raise errors.InitializationError("base not a dir: %s" % self.base) - elif not st.st_mode & (os.X_OK|os.R_OK): - raise errors.InitializationError("base lacks read/executable: %s" % self.base) - - except OSError: - raise errors.InitializationError("lstat failed on base %s" % self.base) - - - def _get_categories(self, *optionalCategory): - # return if optionalCategory is passed... cause it's not yet supported - if len(optionalCategory): - return {} - - try: return tuple([x for x in os.listdir(self.base) \ - if stat.S_ISDIR(os.lstat(os.path.join(self.base,x)).st_mode) and x != "All"]) - - except (OSError, IOError), e: - raise KeyError("failed fetching categories: %s" % str(e)) - - def _get_packages(self, category): - cpath = os.path.join(self.base,category.lstrip(os.path.sep)) - l=[] - try: - for x in os.listdir(cpath): - if stat.S_ISDIR(os.stat(os.path.join(cpath,x)).st_mode) and not x.endswith(".lockfile"): - l.append(portage_versions.pkgsplit(x)[0]) - return tuple(l) - - except (OSError, IOError), e: - raise KeyError("failed fetching packages for category %s: %s" % \ - (os.path.join(self.base,category.lstrip(os.path.sep)), str(e))) - - - def _get_versions(self, catpkg): - pkg = catpkg.split("/")[-1] - l=[] - try: - cpath=os.path.join(self.base, os.path.dirname(catpkg.lstrip("/").rstrip("/"))) - for x in os.listdir(cpath): - if x.startswith(pkg) and stat.S_ISDIR(os.stat(os.path.join(cpath,x)).st_mode) and not x.endswith(".lockfile"): - ver=portage_versions.pkgsplit(x) - - #pkgsplit returns -r0, when it's not always there - if ver[2] == "r0": - if x.endswith(ver[2]): - l.append("%s-%s" % (ver[1], ver[2])) - else: - l.append(ver[1]) - else: - l.append("%s-%s" % (ver[1], ver[2])) - return tuple(l) - except (OSError, IOError), e: - raise KeyError("failed fetching packages for package %s: %s" % \ - (os.path.join(self.base,catpkg.lstrip(os.path.sep)), str(e))) - diff --git a/pym/.gitignore b/pym/.gitignore deleted file mode 100644 index 52e4e61..0000000 --- a/pym/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -*.pyc -*.pyo diff --git a/pym/Makefile.in b/pym/Makefile.in deleted file mode 100644 index 4875465..0000000 --- a/pym/Makefile.in +++ /dev/null @@ -1,24 +0,0 @@ -INSTALL = @INSTALL@ -INSTALL_PY = @INSTALL_DATA@ -D -g portage -o 0 -PORTAGE_PYM = @PORTAGE_BASE@/pym -DESTDIR = @DESTDIR@ -INSTALL_PYTHON_SOURCES = @INSTALL_PYTHON_SOURCES@ - -compile: - python -c 'import compileall; compileall.compile_dir(".")' || exit 1 -clean: - find . -type f -name '*.pyc' -exec rm {} \; - -install: compile - $(INSTALL) -d -m755 -o 0 -g portage $(DESTDIR)/$(PORTAGE_PYM) || exit 1 - if test -n "$(INSTALL_PYTHON_SOURCES)"; then \ - find . -type f -name '*.py' -exec $(INSTALL_PY) {} $(DESTDIR)/$(PORTAGE_PYM)/{} \; || exit 1; \ - fi - find . -type f -name '*.pyc' -exec $(INSTALL_PY) {} $(DESTDIR)/$(PORTAGE_PYM)/{} \; || exit 1 - -all: compile - -distdir: - find -type f -name '*.py' -exec $(INSTALL) -D {} $(distdir)/{} \; - -.PHONY: distdir install clean diff --git a/pym/cache/.gitignore b/pym/cache/.gitignore deleted file mode 100644 index 52e4e61..0000000 --- a/pym/cache/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -*.pyc -*.pyo diff --git a/pym/cache/__init__.py b/pym/cache/__init__.py deleted file mode 100644 index e69de29..0000000 --- a/pym/cache/__init__.py +++ /dev/null diff --git a/pym/cache/anydbm.py b/pym/cache/anydbm.py deleted file mode 100644 index 26251d5..0000000 --- a/pym/cache/anydbm.py +++ /dev/null @@ -1,64 +0,0 @@ -anydbm_module = __import__("anydbm") -import cPickle, os -import fs_template -import cache_errors - - -class database(fs_template.FsBased): - - autocommits = True - - def __init__(self, label, auxdbkeys, **config): - super(database,self).__init__(label, auxdbkeys, **config) - - default_db = config.get("dbtype","anydbm") - if not default_db.startswith("."): - default_db = '.' + default_db - - self._db_path = os.path.join(self._base, fs_template.gen_label(self._base, self.label)+default_db) - print "opening self._db_path=",self._db_path - self.__db = None - try: - self.__db = anydbm_module.open(self._db_path, "w", self._perms) - try: - self._ensure_dirs() - self._ensure_dirs(self._db_path) - self._ensure_access(self._db_path) - - except (OSError, IOError), e: - raise cache_errors.InitializationError(self.__clas__, e) - # try again if failed - if self.__db == None: - self.__db = anydbm_module.open(self._db_path, "c", self._perms) - - - except anydbm_module.error, e: - # XXX handle this at some point - raise - - - def __getitem__(self, cpv): - # we override getitem because it's just a cpickling of the data handed in. - return cPickle.loads(self.__db[cpv]) - - - def _setitem(self, cpv, values): - self.__db[cpv] = cPickle.dumps(values,cPickle.HIGHEST_PROTOCOL) - - def _delitem(self, cpv): - del self.__db[cpv] - - - def iterkeys(self): - return iter(self.__db) - - - def has_key(self, cpv): - return cpv in self.__db - - def commit(self): pass - - def __del__(self): - print "keys=",self.__db.keys() - self.__db.sync() - self.__db.close() diff --git a/pym/cache/cache_errors.py b/pym/cache/cache_errors.py deleted file mode 100644 index dc0f355..0000000 --- a/pym/cache/cache_errors.py +++ /dev/null @@ -1,36 +0,0 @@ -class CacheError(Exception): pass - -class InitializationError(CacheError): - def __init__(self, class_name, error): - self.error, self.class_name = error, class_name - def __str__(self): - return "Creation of instance %s failed due to %s" % \ - (self.class_name, str(self.error)) - - -class CacheCorruption(CacheError): - def __init__(self, key, ex): - self.key, self.ex = key, ex - def __str__(self): - return "%s is corrupt: %s" % (self.key, str(self.ex)) - - -class GeneralCacheCorruption(CacheError): - def __init__(self,ex): self.ex = ex - def __str__(self): return "corruption detected: %s" % str(self.ex) - - -class InvalidRestriction(CacheError): - def __init__(self, key, restriction, exception=None): - if exception == None: exception = '' - self.key, self.restriction, self.ex = key, restriction, ex - def __str__(self): - return "%s:%s is not valid: %s" % \ - (self.key, self.restriction, str(self.ex)) - - -class ReadOnlyRestriction(CacheError): - def __init__(self, info=''): - self.info = info - def __str__(self): - return "cache is non-modifiable"+str(self.info) diff --git a/pym/cache/flat_list.py b/pym/cache/flat_list.py deleted file mode 100644 index 944f740..0000000 --- a/pym/cache/flat_list.py +++ /dev/null @@ -1,109 +0,0 @@ -import fs_template -import cache_errors -import os, stat - -# store the current key order *here*. -class database(fs_template.FsBased): - - autocommits = True - - # do not screw with this ordering. _eclasses_ needs to be last - auxdbkey_order=('DEPEND', 'RDEPEND', 'SLOT', 'SRC_URI', - 'RESTRICT', 'HOMEPAGE', 'LICENSE', 'DESCRIPTION', - 'KEYWORDS', 'IUSE', 'CDEPEND', - 'PDEPEND', 'PROVIDE','_eclasses_') - - def __init__(self, label, auxdbkeys, **config): - super(database,self).__init__(label, auxdbkeys, **config) - self._base = os.path.join(self._base, - self.label.lstrip(os.path.sep).rstrip(os.path.sep)) - - if len(self._known_keys) > len(self.auxdbkey_order) + 2: - raise Exception("less ordered keys then auxdbkeys") - if not os.path.exists(self._base): - self._ensure_dirs() - - - def _getitem(self, cpv): - d = {} - try: - myf = open(os.path.join(self._base, cpv),"r") - for k,v in zip(self.auxdbkey_order, myf): - d[k] = v.rstrip("\n") - except (OSError, IOError),e: - if isinstance(e,IOError) and e.errno == 2: -# print "caught for %s" % cpv, e -# l=os.listdir(os.path.dirname(os.path.join(self._base,cpv))) -# l.sort() -# print l - raise KeyError(cpv) - raise cache_errors.CacheCorruption(cpv, e) - - try: d["_mtime_"] = os.fstat(myf.fileno()).st_mtime - except OSError, e: - myf.close() - raise cache_errors.CacheCorruption(cpv, e) - myf.close() - return d - - - def _setitem(self, cpv, values): - s = cpv.rfind("/") - fp=os.path.join(self._base,cpv[:s],".update.%i.%s" % (os.getpid(), cpv[s+1:])) - try: myf=open(fp, "w") - except (OSError, IOError), e: - if e.errno == 2: - try: - self._ensure_dirs(cpv) - myf=open(fp,"w") - except (OSError, IOError),e: - raise cache_errors.CacheCorruption(cpv, e) - else: - raise cache_errors.CacheCorruption(cpv, e) - - - for x in self.auxdbkey_order: - myf.write(values.get(x,"")+"\n") - - myf.close() - self._ensure_access(fp, mtime=values["_mtime_"]) - #update written. now we move it. - new_fp = os.path.join(self._base,cpv) - try: os.rename(fp, new_fp) - except (OSError, IOError), e: - os.remove(fp) - raise cache_errors.CacheCorruption(cpv, e) - - - def _delitem(self, cpv): - try: - os.remove(os.path.join(self._base,cpv)) - except OSError, e: - if e.errno == 2: - raise KeyError(cpv) - else: - raise cache_errors.CacheCorruption(cpv, e) - - - def has_key(self, cpv): - return os.path.exists(os.path.join(self._base, cpv)) - - - def iterkeys(self): - """generator for walking the dir struct""" - dirs = [self._base] - len_base = len(self._base) - while len(dirs): - for l in os.listdir(dirs[0]): - if l.endswith(".cpickle"): - continue - p = os.path.join(dirs[0],l) - st = os.lstat(p) - if stat.S_ISDIR(st.st_mode): - dirs.append(p) - continue - yield p[len_base+1:] - dirs.pop(0) - - - def commit(self): pass diff --git a/pym/cache/fs_template.py b/pym/cache/fs_template.py deleted file mode 100644 index ca7d62a..0000000 --- a/pym/cache/fs_template.py +++ /dev/null @@ -1,66 +0,0 @@ -import os -import template, cache_errors - -class FsBased(template.database): - """template wrapping fs needed options, and providing _ensure_access as a way to - attempt to ensure files have the specified owners/perms""" - - def __init__(self, label, auxdbkeys, basepath=None, gid=-1, perms=0664, **config): - """throws InitializationError if needs args aren't specified""" - if not gid: - raise cache_errors.InitializationError(self.__class__, "must specify gid!") - if not basepath: - raise cache_errors.InitializationError(self.__class__, "must specify basepath!") - - self._gid = gid - self._base = basepath - self._perms = perms - super(FsBased, self).__init__(label, auxdbkeys, **config) - - if self.label.startswith(os.path.sep): - # normpath. - self.label = os.path.sep + os.path.normpath(self.label).lstrip(os.path.sep) - - - def _ensure_access(self, path, mtime=-1): - """returns true or false if it's able to ensure that path is properly chmod'd and chowned. - if mtime is specified, attempts to ensure that's correct also""" - try: - os.chown(path, -1, self._gid) - os.chmod(path, self._perms) - if mtime: - mtime=long(mtime) - os.utime(path, (mtime, mtime)) - except OSError, IOError: - return False - return True - - def _ensure_dirs(self, path=None): - """with path!=None, ensure beyond self._base. otherwise, ensure self._base""" - if path: - path = os.path.dirname(path) - base = self._base - else: - path = self._base - base='/' - - for dir in path.lstrip(os.path.sep).rstrip(os.path.sep).split(os.path.sep): - base = os.path.join(base,dir) - if not os.path.exists(base): - um=os.umask(0) - try: - os.mkdir(base, self._perms | 0111) - os.chown(base, -1, self._gid) - finally: - os.umask(um) - - -def gen_label(base, label): - """if supplied label is a path, generate a unique label based upon label, and supplied base path""" - if label.find(os.path.sep) == -1: - return label - label = label.strip("\"").strip("'") - label = os.path.join(*(label.rstrip(os.path.sep).split(os.path.sep))) - tail = os.path.split(label)[1] - return "%s-%X" % (tail, abs(label.__hash__())) - diff --git a/pym/cache/metadata.py b/pym/cache/metadata.py deleted file mode 100644 index e252bdf..0000000 --- a/pym/cache/metadata.py +++ /dev/null @@ -1,105 +0,0 @@ -import os, stat -import fs_template -import cache_errors - -# store the current key order *here*. -class database(fs_template.FsBased): - complete_eclass_entries = False - auxdbkey_order=('DEPEND', 'RDEPEND', 'SLOT', 'SRC_URI', - 'RESTRICT', 'HOMEPAGE', 'LICENSE', 'DESCRIPTION', - 'KEYWORDS', 'INHERITED', 'IUSE', 'CDEPEND', - 'PDEPEND', 'PROVIDE') - - def __init__(self, label, auxdbkeys, **config): - super(database,self).__init__(label, auxdbkeys, **config) - self._base = os.path.join(self._base, - self.label.lstrip(os.path.sep).rstrip(os.path.sep)) - - if len(self._known_keys) > len(self.auxdbkey_order): - raise Exception("less ordered keys then auxdbkeys") - if not os.path.exists(self._base): - self._ensure_dirs() - - - def __getitem__(self, cpv): - d = {} - try: - myf = open(os.path.join(self._base, cpv),"r") - for k,v in zip(self.auxdbkey_order, myf): - d[k] = v.rstrip("\n") - except (OSError, IOError),e: - if isinstance(e,IOError) and e.errno == 2: - raise KeyError(cpv) - raise cache_errors.CacheCorruption(cpv, e) - - try: d["_mtime_"] = os.lstat(os.path.join(self._base, cpv)).st_mtime - except OSError, e:raise cache_errors.CacheCorruption(cpv, e) - return d - - - def _setitem(self, cpv, values): - s = cpv.rfind("/") - fp=os.path.join(self._base,cpv[:s],".update.%i.%s" % (os.getpid(), cpv[s+1:])) - try: myf=open(fp, "w") - except (OSError, IOError), e: - if e.errno == 2: - try: - self._ensure_dirs(cpv) - myf=open(fp,"w") - except (OSError, IOError),e: - raise cache_errors.CacheCorruption(cpv, e) - else: - raise cache_errors.CacheCorruption(cpv, e) - - -# try: -# s = os.path.split(cpv) -# if len(s[0]) == 0: -# s = s[1] -# else: -# s = s[0] -# os._ensure_dirs(s) -# -# except (OSError, IOError), e: - - myf.writelines( [ values.get(x,"")+"\n" for x in self.auxdbkey_order] ) - myf.close() - self._ensure_access(fp, mtime=values["_mtime_"]) - #update written. now we move it. - new_fp = os.path.join(self._base,cpv) - try: os.rename(fp, new_fp) - except (OSError, IOError), e: - os.remove(fp) - raise cache_errors.CacheCorruption(cpv, e) - - - def _delitem(self, cpv): - try: - os.remove(os.path.join(self._base,cpv)) - except OSError, e: - if e.errno == 2: - raise KeyError(cpv) - else: - raise cache_errors.CacheCorruption(cpv, e) - - - def has_key(self, cpv): - return os.path.exists(os.path.join(self._base, cpv)) - - - def iterkeys(self): - """generator for walking the dir struct""" - dirs = [self._base] - len_base = len(self._base) - while len(dirs): - for l in os.listdir(dirs[0]): - if l.endswith(".cpickle"): - continue - p = os.path.join(dirs[0],l) - st = os.lstat(p) - if stat.S_ISDIR(st.st_mode): - dirs.append(p) - continue - yield p[len_base+1:] - dirs.pop(0) - diff --git a/pym/cache/sql_template.py b/pym/cache/sql_template.py deleted file mode 100644 index 628b481..0000000 --- a/pym/cache/sql_template.py +++ /dev/null @@ -1,242 +0,0 @@ -import template, cache_errors - -class SQLDatabase(template.database): - """template class for RDBM based caches - - This class is designed such that derivatives don't have to change much code, mostly constant strings. - _BaseError must be an exception class that all Exceptions thrown from the derived RDBMS are derived - from. - - SCHEMA_INSERT_CPV_INTO_PACKAGE should be modified dependant on the RDBMS, as should SCHEMA_PACKAGE_CREATE- - basically you need to deal with creation of a unique pkgid. If the dbapi2 rdbms class has a method of - recovering that id, then modify _insert_cpv to remove the extra select. - - Creation of a derived class involves supplying _initdb_con, and table_exists. - Additionally, the default schemas may have to be modified. - """ - - SCHEMA_PACKAGE_NAME = "package_cache" - SCHEMA_PACKAGE_CREATE = "CREATE TABLE %s (\ - pkgid INTEGER PRIMARY KEY, label VARCHAR(255), cpv VARCHAR(255), UNIQUE(label, cpv))" % SCHEMA_PACKAGE_NAME - SCHEMA_PACKAGE_DROP = "DROP TABLE %s" % SCHEMA_PACKAGE_NAME - - SCHEMA_VALUES_NAME = "values_cache" - SCHEMA_VALUES_CREATE = "CREATE TABLE %s ( pkgid integer references %s (pkgid) on delete cascade, \ - key varchar(255), value text, UNIQUE(pkgid, key))" % (SCHEMA_VALUES_NAME, SCHEMA_PACKAGE_NAME) - SCHEMA_VALUES_DROP = "DROP TABLE %s" % SCHEMA_VALUES_NAME - SCHEMA_INSERT_CPV_INTO_PACKAGE = "INSERT INTO %s (label, cpv) VALUES(%%s, %%s)" % SCHEMA_PACKAGE_NAME - - _BaseError = () - _dbClass = None - - autocommits = False - - # boolean indicating if the derived RDBMS class supports replace syntax - _supports_replace = False - - def __init__(self, label, auxdbkeys, **config): - """initialize the instance. - derived classes shouldn't need to override this""" - - super(SQLDatabase, self).__init__(label, auxdbkeys, **config) - - config.setdefault("host","127.0.0.1") - config.setdefault("autocommit", self.autocommits) - self._initdb_con(config) - - self.label = self._sfilter(self.label) - - - def _dbconnect(self, config): - """should be overridden if the derived class needs special parameters for initializing - the db connection, or cursor""" - self.db = self._dbClass(**config) - self.con = self.db.cursor() - - - def _initdb_con(self,config): - """ensure needed tables are in place. - If the derived class needs a different set of table creation commands, overload the approriate - SCHEMA_ attributes. If it needs additional execution beyond, override""" - - self._dbconnect(config) - if not self._table_exists(self.SCHEMA_PACKAGE_NAME): - if self.readonly: - raise cache_errors.ReadOnlyRestriction("table %s doesn't exist" % \ - self.SCHEMA_PACKAGE_NAME) - try: self.con.execute(self.SCHEMA_PACKAGE_CREATE) - except self._BaseError, e: - raise cache_errors.InitializationError(self.__class__, e) - - if not self._table_exists(self.SCHEMA_VALUES_NAME): - if self.readonly: - raise cache_errors.ReadOnlyRestriction("table %s doesn't exist" % \ - self.SCHEMA_VALUES_NAME) - try: self.con.execute(self.SCHEMA_VALUES_CREATE) - except self._BaseError, e: - raise cache_errors.InitializationError(self.__class__, e) - - - def _table_exists(self, tbl): - """return true if a table exists - derived classes must override this""" - raise NotImplementedError - - - def _sfilter(self, s): - """meta escaping, returns quoted string for use in sql statements""" - return "\"%s\"" % s.replace("\\","\\\\").replace("\"","\\\"") - - - def _getitem(self, cpv): - try: self.con.execute("SELECT key, value FROM %s NATURAL JOIN %s " - "WHERE label=%s AND cpv=%s" % (self.SCHEMA_PACKAGE_NAME, self.SCHEMA_VALUES_NAME, - self.label, self._sfilter(cpv))) - except self._BaseError, e: - raise cache_errors.CacheCorruption(self, cpv, e) - - rows = self.con.fetchall() - - if len(rows) == 0: - raise KeyError(cpv) - - vals = dict([(k,"") for k in self._known_keys]) - vals.update(dict(rows)) - return vals - - - def _delitem(self, cpv): - """delete a cpv cache entry - derived RDBM classes for this *must* either support cascaded deletes, or - override this method""" - try: - try: - self.con.execute("DELETE FROM %s WHERE label=%s AND cpv=%s" % \ - (self.SCHEMA_PACKAGE_NAME, self.label, self._sfilter(cpv))) - if self.autocommits: - self.commit() - except self._BaseError, e: - raise cache_errors.CacheCorruption(self, cpv, e) - if self.con.rowcount <= 0: - raise KeyError(cpv) - except Exception: - if not self.autocommits: - self.db.rollback() - # yes, this can roll back a lot more then just the delete. deal. - raise - - def __del__(self): - # just to be safe. - self.commit() - self.db.close() - - def _setitem(self, cpv, values): - - try: - # insert. - try: pkgid = self._insert_cpv(cpv) - except self._BaseError, e: - raise cache_errors.CacheCorruption(cpv, e) - - # __getitem__ fills out missing values, - # so we store only what's handed to us and is a known key - db_values = [] - for key in self._known_keys: - if values.has_key(key): - db_values.append({"key":key, "value":values[key]}) - - if len(db_values) > 0: - try: self.con.executemany("INSERT INTO %s (pkgid, key, value) VALUES(\"%s\", %%(key)s, %%(value)s)" % \ - (self.SCHEMA_VALUES_NAME, str(pkgid)), db_values) - except self._BaseError, e: - raise cache_errors.CacheCorruption(cpv, e) - if self.autocommits: - self.commit() - - except Exception: - if not self.autocommits: - try: self.db.rollback() - except self._BaseError: pass - raise - - - def _insert_cpv(self, cpv): - """uses SCHEMA_INSERT_CPV_INTO_PACKAGE, which must be overloaded if the table definition - doesn't support auto-increment columns for pkgid. - returns the cpvs new pkgid - note this doesn't commit the transaction. The caller is expected to.""" - - cpv = self._sfilter(cpv) - if self._supports_replace: - query_str = self.SCHEMA_INSERT_CPV_INTO_PACKAGE.replace("INSERT","REPLACE",1) - else: - # just delete it. - try: del self[cpv] - except (cache_errors.CacheCorruption, KeyError): pass - query_str = self.SCHEMA_INSERT_CPV_INTO_PACKAGE - try: - self.con.execute(query_str % (self.label, cpv)) - except self._BaseError: - self.db.rollback() - raise - self.con.execute("SELECT pkgid FROM %s WHERE label=%s AND cpv=%s" % \ - (self.SCHEMA_PACKAGE_NAME, self.label, cpv)) - - if self.con.rowcount != 1: - raise cache_error.CacheCorruption(cpv, "Tried to insert the cpv, but found " - " %i matches upon the following select!" % len(rows)) - return self.con.fetchone()[0] - - - def has_key(self, cpv): - if not self.autocommits: - try: self.commit() - except self._BaseError, e: - raise cache_errors.GeneralCacheCorruption(e) - - try: self.con.execute("SELECT cpv FROM %s WHERE label=%s AND cpv=%s" % \ - (self.SCHEMA_PACKAGE_NAME, self.label, self._sfilter(cpv))) - except self._BaseError, e: - raise cache_errors.GeneralCacheCorruption(e) - return self.con.rowcount > 0 - - - def iterkeys(self): - if not self.autocommits: - try: self.commit() - except self._BaseError, e: - raise cache_errors.GeneralCacheCorruption(e) - - try: self.con.execute("SELECT cpv FROM %s WHERE label=%s" % - (self.SCHEMA_PACKAGE_NAME, self.label)) - except self._BaseError, e: - raise cache_errors.GeneralCacheCorruption(e) -# return [ row[0] for row in self.con.fetchall() ] - for x in self.con.fetchall(): - yield x[0] - - def commit(self): - self.db.commit() - - def get_matches(self,match_dict): - query_list = [] - for k,v in match_dict.items(): - if k not in self._known_keys: - raise cache_errors.InvalidRestriction(k, v, "key isn't known to this cache instance") - v = v.replace("%","\\%") - v = v.replace(".*","%") - query_list.append("(key=%s AND value LIKE %s)" % (self._sfilter(k), self._sfilter(v))) - - if len(query_list): - query = " AND "+" AND ".join(query_list) - else: - query = '' - - print "query = SELECT cpv from package_cache natural join values_cache WHERE label=%s %s" % (self.label, query) - try: self.con.execute("SELECT cpv from package_cache natural join values_cache WHERE label=%s %s" % \ - (self.label, query)) - except self._BaseError, e: - raise cache_errors.GeneralCacheCorruption(e) - - return [ row[0] for row in self.con.fetchall() ] - diff --git a/pym/cache/sqlite.py b/pym/cache/sqlite.py deleted file mode 100644 index e7f9be2..0000000 --- a/pym/cache/sqlite.py +++ /dev/null @@ -1,62 +0,0 @@ -sqlite_module =__import__("sqlite") -import os -import sql_template, fs_template -import cache_errors - -class database(fs_template.FsBased, sql_template.SQLDatabase): - - SCHEMA_DELETE_NAME = "delete_package_values" - SCHEMA_DELETE_TRIGGER = """CREATE TRIGGER %s AFTER DELETE on %s - begin - DELETE FROM %s WHERE pkgid=old.pkgid; - end;""" % (SCHEMA_DELETE_NAME, sql_template.SQLDatabase.SCHEMA_PACKAGE_NAME, - sql_template.SQLDatabase.SCHEMA_VALUES_NAME) - - _BaseError = sqlite_module.Error - _dbClass = sqlite_module - _supports_replace = True - - def _dbconnect(self, config): - self._dbpath = os.path.join(self._base, fs_template.gen_label(self._base, self.label)+".sqldb") - try: - self.db = sqlite_module.connect(self._dbpath, mode=self._perms, autocommit=False) - if not self._ensure_access(self._dbpath): - raise cache_errors.InitializationError(self.__class__, "can't ensure perms on %s" % self._dbpath) - self.con = self.db.cursor() - except self._BaseError, e: - raise cache_errors.InitializationError(self.__class__, e) - - - def _initdb_con(self, config): - sql_template.SQLDatabase._initdb_con(self, config) - try: - self.con.execute("SELECT name FROM sqlite_master WHERE type=\"trigger\" AND name=%s" % \ - self._sfilter(self.SCHEMA_DELETE_NAME)) - if self.con.rowcount == 0: - self.con.execute(self.SCHEMA_DELETE_TRIGGER); - self.db.commit() - except self._BaseError, e: - raise cache_errors.InitializationError(self.__class__, e) - - def _table_exists(self, tbl): - """return true/false dependant on a tbl existing""" - try: self.con.execute("SELECT name FROM sqlite_master WHERE type=\"table\" AND name=%s" % - self._sfilter(tbl)) - except self._BaseError, e: - # XXX crappy. - return False - return len(self.con.fetchall()) == 1 - - # we can do it minus a query via rowid. - def _insert_cpv(self, cpv): - cpv = self._sfilter(cpv) - try: self.con.execute(self.SCHEMA_INSERT_CPV_INTO_PACKAGE.replace("INSERT","REPLACE",1) % \ - (self.label, cpv)) - except self._BaseError, e: - raise cache_errors.CacheCorruption(cpv, "tried to insert a cpv, but failed: %s" % str(e)) - - # sums the delete also - if self.con.rowcount <= 0 or self.con.rowcount > 2: - raise cache_errors.CacheCorruption(cpv, "tried to insert a cpv, but failed- %i rows modified" % self.rowcount) - return self.con.lastrowid - diff --git a/pym/cache/template.py b/pym/cache/template.py deleted file mode 100644 index 37d40ec..0000000 --- a/pym/cache/template.py +++ /dev/null @@ -1,146 +0,0 @@ -import cache_errors, copy - -class database(object): - # this is for metadata/cache transfer. - # basically flags the cache needs be updated when transfered cache to cache. - # leave this. - - complete_eclass_entries_ = True - autocommits = False - - def __init__(self, label, auxdbkeys, readonly=False, **config): - """ initialize the derived class; specifically, store label/keys""" - self._known_keys = auxdbkeys - self.label = label - self.readonly = readonly - self.sync_rate = 0 - self.updates = 0 - - - def __getitem__(self, cpv): - """set a cpv to values - This shouldn't be overriden in derived classes since it handles the __eclasses__ conversion. - that said, if the class handles it, they can override it.""" - if self.updates > self.sync_rate: - self.commit() - self.updates = 0 - d=self._getitem(cpv) - if "_eclasses_" in d: - d["_eclasses_"] = reconstruct_eclasses(d["_eclasses_"]) - return d - - def _getitem(self, cpv): - """get cpv's values. - override this in derived classess""" - raise NotImplementedError - - - def __setitem__(self, cpv, values): - """set a cpv to values - This shouldn't be overriden in derived classes since it handles the readonly checks""" - if self.readonly: - raise cache_errors.ReadOnlyRestriction() - d=copy.copy(values) - if "_eclasses_" in d: - d["_eclasses_"] = serialize_eclasses(d["_eclasses_"]) - self._setitem(cpv, d) - if not self.autocommits: - self.updates += 1 - if self.updates > self.sync_rate: - self.commit() - self.updates = 0 - - - def _setitem(self, name, values): - """__setitem__ calls this after readonly checks. override it in derived classes - note _eclassees_ key *must* be handled""" - raise NotImplementedError - - - def __delitem__(self, cpv): - """delete a key from the cache. - This shouldn't be overriden in derived classes since it handles the readonly checks""" - if self.readonly: - raise cache_errors.ReadOnlyRestriction() - if not self.autocommits: - self.updates += 1 - self._delitem(cpv) - if self.updates > self.sync_rate: - self.commit() - self.updates = 0 - - - def _delitem(self,cpv): - """__delitem__ calls this after readonly checks. override it in derived classes""" - raise NotImplementedError - - - def has_key(self, cpv): - raise NotImplementedError - - - def keys(self): - return tuple(self.iterkeys()) - - def iterkeys(self): - raise NotImplementedError - - def sync(self, rate=0): - self.sync_rate = rate - if(rate == 0): - self.commit() - - def commit(self): - raise NotImplementedError - - def get_matches(self, match_dict): - """generic function for walking the entire cache db, matching restrictions to - filter what cpv's are returned. Derived classes should override this if they - can implement a faster method then pulling each cpv:values, and checking it. - - For example, RDBMS derived classes should push the matching logic down to the - actual RDBM.""" - - import re - restricts = {} - for key,match in match_dict.iteritems(): - # XXX this sucks. - try: - if isinstance(match, str): - restricts[key] = re.compile(match).match - else: - restricts[key] = re.compile(match[0],match[1]).match - except re.error, e: - raise InvalidRestriction(key, match, e) - if key not in self.__known_keys: - raise InvalidRestriction(key, match, "Key isn't valid") - - for cpv in self.keys(): - cont = True - vals = self[cpv] - for key, match in restricts.iteritems(): - if not match(vals[key]): - cont = False - break - if cont: -# yield cpv,vals - yield cpv - - -def serialize_eclasses(eclass_dict): - """takes a dict, returns a string representing said dict""" - return "\t".join(["%s\t%s\t%s" % (k, v[0], str(v[1])) for k,v in eclass_dict.items()]) - -def reconstruct_eclasses(eclass_string): - """returns a dict when handed a string generated by serialize_eclasses""" - eclasses = eclass_string.rstrip().lstrip().split("\t") - if eclasses == [""]: - # occasionally this occurs in the fs backends. they suck. - return {} - if len(eclasses) % 3 != 0: - raise cache_errors.CacheCorruption(cpv, "_eclasses_ was of invalid len %i" % len(eclasses)) - d={} - for x in range(0, len(eclasses), 3): - d[eclasses[x]] = (eclasses[x + 1], long(eclasses[x + 2])) - del eclasses - return d diff --git a/pym/cache/util.py b/pym/cache/util.py deleted file mode 100644 index c571e66..0000000 --- a/pym/cache/util.py +++ /dev/null @@ -1,87 +0,0 @@ -import cache_errors - -def mirror_cache(valid_nodes_iterable, src_cache, trg_cache, eclass_cache=None, verbose_instance=None): - - if not src_cache.complete_eclass_entries and not eclass_cache: - raise Exception("eclass_cache required for cache's of class %s!" % src_cache.__class__) - - if verbose_instance == None: - noise=quiet_mirroring() - else: - noise=verbose_instance - - dead_nodes = {} - dead_nodes.fromkeys(trg_cache.keys()) - count=0 - - if not trg_cache.autocommits: - trg_cache.sync(100) - - for x in valid_nodes_iterable: -# print "processing x=",x - count+=1 - if dead_nodes.has_key(x): - del dead_nodes[x] - try: entry = src_cache[x] - except KeyError, e: - noise.missing_entry(x) - del e - continue - if entry.get("INHERITED",""): - if src_cache.complete_eclass_entries: - if not "_eclasses_" in entry: - noise.corruption(x,"missing _eclasses_ field") - continue - if not eclass_cache.is_eclass_data_valid(entry["_eclasses_"]): - noise.eclass_stale(x) - continue - else: - entry["_eclasses_"] = eclass_cache.get_eclass_data(entry["INHERITED"].split(), \ - from_master_only=True) - if not entry["_eclasses_"]: - noise.eclass_stale(x) - continue - - # by this time, if it reaches here, the eclass has been validated, and the entry has - # been updated/translated (if needs be, for metadata/cache mainly) - try: trg_cache[x] = entry - except cache_errors.CacheError, ce: - noise.exception(x, ce) - del ce - continue - if count >= noise.call_update_min: - noise.update(x) - count = 0 - - if not trg_cache.autocommits: - trg_cache.commit() - - # ok. by this time, the trg_cache is up to date, and we have a dict - # with a crapload of cpv's. we now walk the target db, removing stuff if it's in the list. - for key in dead_nodes: - try: del trg_cache[key] - except cache_errors.CacheError, ce: - noise.exception(ce) - del ce - dead_nodes.clear() - del noise - - -class quiet_mirroring(object): - # call_update_every is used by mirror_cache to determine how often to call in. - # quiet defaults to 2^24 -1. Don't call update, 'cept once every 16 million or so :) - call_update_min = 0xffffff - def update(self,key,*arg): pass - def exception(self,key,*arg): pass - def eclass_stale(self,*arg): pass - def missing_entry(self, key): pass - def misc(self,key,*arg): pass - def corruption(self, key, s): pass - -class non_quiet_mirroring(quiet_mirroring): - call_update_min=1 - def update(self,key,*arg): print "processed",key - def exception(self, key, *arg): print "exec",key,arg - def missing(self,key): print "key %s is missing", key - def corruption(self,key,*arg): print "corrupt %s:" % key,arg - def eclass_stale(self,key,*arg):print "stale %s:"%key,arg diff --git a/pym/config.py b/pym/config.py deleted file mode 100644 index 3707f3a..0000000 --- a/pym/config.py +++ /dev/null @@ -1,811 +0,0 @@ -import os, copy, re -import portage_const -import sys #has a few daft sys.exit - -import portage_util, portage_versions, portage_dep -from portage_util import getconfig, grabfile, grab_multiple, grabfile_package, grabdict, writemsg, grabdict_package, \ - abssymlink, flatten - - -from portage_file import listdir -from portage_data import portage_gid - -class config: - def clone(self, clone): - self.incrementals = copy.deepcopy(clone.incrementals) - self.profile_path = copy.deepcopy(clone.profile_path) - - self.module_priority = copy.deepcopy(clone.module_priority) - self.modules = copy.deepcopy(clone.modules) - - self.depcachedir = copy.deepcopy(clone.depcachedir) - - self.packages = copy.deepcopy(clone.packages) - self.virtuals = copy.deepcopy(clone.virtuals) - - self.use_defs = copy.deepcopy(clone.use_defs) - self.usemask = copy.deepcopy(clone.usemask) - - self.configlist = copy.deepcopy(clone.configlist) - self.configlist[-1] = os.environ.copy() - self.configdict = { "globals": self.configlist[0], - "defaults": self.configlist[1], - "conf": self.configlist[2], - "pkg": self.configlist[3], - "auto": self.configlist[4], - "backupenv": self.configlist[5], - "env": self.configlist[6] } - self.backupenv = copy.deepcopy(clone.backupenv) - self.pusedict = copy.deepcopy(clone.pusedict) - self.categories = copy.deepcopy(clone.categories) - self.pkeywordsdict = copy.deepcopy(clone.pkeywordsdict) - self.pmaskdict = copy.deepcopy(clone.pmaskdict) - self.punmaskdict = copy.deepcopy(clone.punmaskdict) - self.prevmaskdict = copy.deepcopy(clone.prevmaskdict) - self.pprovideddict = copy.deepcopy(clone.pprovideddict) - self.lookuplist = copy.deepcopy(clone.lookuplist) - self.uvlist = copy.deepcopy(clone.uvlist) - self.dirVirtuals = copy.deepcopy(clone.dirVirtuals) - self.treeVirtuals = copy.deepcopy(clone.treeVirtuals) - self.userVirtuals = copy.deepcopy(clone.userVirtuals) - - def __init__(self, clone=None, mycpv=None, config_profile_path=portage_const.PROFILE_PATH, config_incrementals=None): - - self.already_in_regenerate = 0 - - self.locked = 0 - self.mycpv = None - self.puse = [] - self.modifiedkeys = [] - - self.virtuals = {} - self.v_count = 0 - - if clone: - self.clone( clone ) - else: - self.depcachedir = portage_const.DEPCACHE_PATH - - if not os.path.exists(config_profile_path): - writemsg("config_profile_path not specified to class config\n") - sys.exit(1) - self.profile_path = config_profile_path - - if not config_incrementals: - import traceback - traceback.print_stack() - writemsg("incrementals not specified to class config\n") - writemsg("sayonara, sucker.\n") - sys.exit(1) - self.incrementals = copy.deepcopy(config_incrementals) - - self.module_priority = ["user","default"] - self.modules = {} - self.modules["user"] = getconfig(portage_const.MODULES_FILE_PATH) - if self.modules["user"] == None: - self.modules["user"] = {} - self.modules["default"] = { - "portdbapi.metadbmodule": "cache.metadata.database", - "portdbapi.auxdbmodule": "cache.flat_list.database", - } - - self.usemask=[] - self.configlist=[] - self.backupenv={} - # back up our incremental variables: - self.configdict={} - # configlist will contain: [ globals, defaults, conf, pkg, auto, backupenv (incrementals), origenv ] - - # The symlink might not exist or might not be a symlink. - try: - self.profiles=[abssymlink(self.profile_path)] - except (OSError, IOError): - self.profiles=[self.profile_path] - - mypath = self.profiles[0] - while os.path.exists(mypath+"/parent"): - mypath = os.path.normpath(mypath+"///"+grabfile(mypath+"/parent")[0]) - if os.path.exists(mypath): - self.profiles.insert(0,mypath) - - if os.environ.get("PORTAGE_CALLER",'') == "repoman": - pass - else: - # XXX: This should depend on ROOT? - if os.path.exists("/"+portage_const.CUSTOM_PROFILE_PATH): - self.profiles.append("/"+portage_const.CUSTOM_PROFILE_PATH) - - self.packages_list = grab_multiple("packages", self.profiles, grabfile_package) - self.packages = stack_lists(self.packages_list, incremental=1) - del self.packages_list - #self.packages = grab_stacked("packages", self.profiles, grabfile, incremental_lines=1) - - # revmaskdict - self.prevmaskdict={} - for x in self.packages: - mycatpkg=portage_dep.dep_getkey(x) - if not self.prevmaskdict.has_key(mycatpkg): - self.prevmaskdict[mycatpkg]=[x] - else: - self.prevmaskdict[mycatpkg].append(x) - - # get profile-masked use flags -- INCREMENTAL Child over parent - usemask_lists = grab_multiple("use.mask", self.profiles, grabfile) - self.usemask = stack_lists(usemask_lists, incremental=True) - del usemask_lists - use_defs_lists = grab_multiple("use.defaults", self.profiles, grabdict) - self.use_defs = stack_dictlist(use_defs_lists, incremental=True) - del use_defs_lists - - try: - mygcfg_dlists = grab_multiple("make.globals", self.profiles+["/etc"], getconfig) - self.mygcfg = stack_dicts(mygcfg_dlists, incrementals=portage_const.INCREMENTALS, ignore_none=1) - - if self.mygcfg == None: - self.mygcfg = {} - except SystemExit, e: - raise - except Exception, e: - writemsg("!!! %s\n" % (e)) - writemsg("!!! Incorrect multiline literals can cause this. Do not use them.\n") - writemsg("!!! Errors in this file should be reported on bugs.gentoo.org.\n") - sys.exit(1) - self.configlist.append(self.mygcfg) - self.configdict["globals"]=self.configlist[-1] - - self.mygcfg = {} - if self.profiles: - try: - mygcfg_dlists = grab_multiple("make.defaults", self.profiles, getconfig) - self.mygcfg = stack_dicts(mygcfg_dlists, incrementals=self.incrementals[:], ignore_none=1) - #self.mygcfg = grab_stacked("make.defaults", self.profiles, getconfig) - if self.mygcfg == None: - self.mygcfg = {} - except SystemExit, e: - raise - except Exception, e: - writemsg("!!! %s\n" % (e)) - writemsg("!!! 'rm -Rf /usr/portage/profiles; emerge sync' may fix this. If it does\n") - writemsg("!!! not then please report this to bugs.gentoo.org and, if possible, a dev\n") - writemsg("!!! on #gentoo (irc.freenode.org)\n") - sys.exit(1) - self.configlist.append(self.mygcfg) - self.configdict["defaults"]=self.configlist[-1] - - try: - # XXX: Should depend on root? - self.mygcfg=getconfig("/"+portage_const.MAKE_CONF_FILE) - if self.mygcfg == None: - self.mygcfg = {} - except SystemExit, e: - raise - except Exception, e: - writemsg("!!! %s\n" % (e)) - writemsg("!!! Incorrect multiline literals can cause this. Do not use them.\n") - sys.exit(1) - - - self.configlist.append(self.mygcfg) - self.configdict["conf"]=self.configlist[-1] - - self.configlist.append({}) - self.configdict["pkg"]=self.configlist[-1] - - #auto-use: - self.configlist.append({}) - self.configdict["auto"]=self.configlist[-1] - - #backup-env (for recording our calculated incremental variables:) - self.backupenv = os.environ.copy() - self.configlist.append(self.backupenv) # XXX Why though? - self.configdict["backupenv"]=self.configlist[-1] - - self.configlist.append(os.environ.copy()) - self.configdict["env"]=self.configlist[-1] - - # make lookuplist for loading package.* - self.lookuplist=self.configlist[:] - self.lookuplist.reverse() - - archlist = grabfile(self["PORTDIR"]+"/profiles/arch.list") - self.configdict["conf"]["PORTAGE_ARCHLIST"] = ' '.join(archlist) - - if os.environ.get("PORTAGE_CALLER",'') == "repoman": - # repoman shouldn't use local settings. - locations = [self["PORTDIR"] + "/profiles"] - self.pusedict = {} - self.pkeywordsdict = {} - self.punmaskdict = {} - else: - locations = [self["PORTDIR"] + "/profiles", portage_const.USER_CONFIG_PATH] - - # Never set anything in this. It's for non-originals. - self.pusedict=grabdict_package(portage_const.USER_CONFIG_PATH+"/package.use") - - #package.keywords - pkgdict=grabdict_package(portage_const.USER_CONFIG_PATH+"/package.keywords") - self.pkeywordsdict = {} - - for key in pkgdict.keys(): - # default to ~arch if no specific keyword is given - if not pkgdict[key]: - mykeywordlist = [] - if self.configdict["defaults"] and self.configdict["defaults"].has_key("ACCEPT_KEYWORDS"): - groups = self.configdict["defaults"]["ACCEPT_KEYWORDS"].split() - else: - groups = [] - for keyword in groups: - if not keyword[0] in "~-": - mykeywordlist.append("~"+keyword) - pkgdict[key] = mykeywordlist - cp = portage_dep.dep_getkey(key) - if not self.pkeywordsdict.has_key(cp): - self.pkeywordsdict[cp] = {} - self.pkeywordsdict[cp][key] = pkgdict[key] - - #package.unmask - pkgunmasklines = grabfile_package(portage_const.USER_CONFIG_PATH+"/package.unmask") - self.punmaskdict = {} - for x in pkgunmasklines: - mycatpkg=portage_dep.dep_getkey(x) - L = self.punmaskdict.setdefault(mycatpkg,[]) - L.append(x) - - #getting categories from an external file now - categories = grab_multiple("categories", locations, grabfile) - self.categories = stack_lists(categories, incremental=1) - del categories - - # get virtuals -- needs categories - self.loadVirtuals('/') - - #package.mask - # Don't enable per profile package.mask unless the profile - # specifically depends on the >=portage-2.0.51 using - # <portage-2.0.51 syntax. - # don't hardcode portage versions into portage. It's not nice. - if self.profiles and (">=sys-apps/portage-2.0.51" in self.packages \ - or "*>=sys-apps/portage-2.0.51" in self.packages): - pkgmasklines = grab_multiple("package.mask", self.profiles + locations, grabfile_package) - else: - pkgmasklines = grab_multiple("package.mask", locations, grabfile_package) - pkgmasklines = stack_lists(pkgmasklines, incremental=1) - - self.pmaskdict = {} - for x in pkgmasklines: - mycatpkg = portage_dep.dep_getkey(x) - L = self.pmaskdict.setdefault(mycatpkg,[]) - L.append(x) - - pkgprovidedlines = grab_multiple("package.provided", self.profiles, grabfile) - pkgprovidedlines = stack_lists(pkgprovidedlines, incremental=1) - - self.pprovideddict = {} - for x in pkgprovidedlines: - cpv=portage_versions.catpkgsplit(x) - if not x: - continue - mycatpkg=portage_dep.dep_getkey(x) - L = self.pprovideddict.setdefault(mycatpkg,[]) - L.append(x) - - - self.lookuplist=self.configlist[:] - self.lookuplist.reverse() - - useorder=self["USE_ORDER"] - if not useorder: - # reasonable defaults; this is important as without USE_ORDER, - # USE will always be "" (nothing set)! - useorder="env:pkg:conf:auto:defaults" - useordersplit=useorder.split(":") - - self.uvlist=[] - for x in useordersplit: - if x in self.configdict: - if "PKGUSE" in self.configdict[x]: - # Delete PkgUse, Not legal to set. - del self.configdict[x]["PKGUSE"] - #prepend db to list to get correct order - self.uvlist.insert(0,self.configdict[x]) - - self.configdict["env"]["PORTAGE_GID"]=str(portage_gid) - self.backupenv["PORTAGE_GID"]=str(portage_gid) - - if self.has_key("PORT_LOGDIR") and not self["PORT_LOGDIR"]: - # port_logdir is defined, but empty. this causes a traceback in doebuild. - writemsg(yellow("!!!")+" PORT_LOGDIR was defined, but set to nothing.\n") - writemsg(yellow("!!!")+" Disabling it. Please set it to a non null value.\n") - del self["PORT_LOGDIR"] - - if self["PORTAGE_CACHEDIR"]: - # XXX: Deprecated -- April 15 -- NJ - writemsg(yellow(">>> PORTAGE_CACHEDIR has been deprecated!")+"\n") - writemsg(">>> Please use PORTAGE_DEPCACHEDIR instead.\n") - self.depcachedir = self["PORTAGE_CACHEDIR"] - del self["PORTAGE_CACHEDIR"] - - if self["PORTAGE_DEPCACHEDIR"]: - #the auxcache is the only /var/cache/edb/ entry that stays at / even when "root" changes. - # XXX: Could move with a CHROOT functionality addition. - self.depcachedir = self["PORTAGE_DEPCACHEDIR"] - del self["PORTAGE_DEPCACHEDIR"] - - overlays = self["PORTDIR_OVERLAY"].split() - if overlays: - new_ov=[] - for ov in overlays: - ov=os.path.normpath(ov) - if os.path.isdir(ov): - new_ov.append(ov) - else: - writemsg(red("!!! Invalid PORTDIR_OVERLAY (not a dir): "+ov+"\n")) - self["PORTDIR_OVERLAY"] = " ".join(new_ov) - self.backup_changes("PORTDIR_OVERLAY") - - self.regenerate() - - - self.features = portage_util.unique_array(self["FEATURES"].split()) - self.features.sort() - - #XXX: Should this be temporary? Is it possible at all to have a default? - if "gpg" in self.features: - if not os.path.exists(self["PORTAGE_GPG_DIR"]) or not os.path.isdir(self["PORTAGE_GPG_DIR"]): - writemsg("PORTAGE_GPG_DIR is invalid. Removing gpg from FEATURES.\n") - self.features.remove("gpg") - self["FEATURES"] = " ".join(self.features) - self.backup_changes("FEATURES") - - if mycpv: - self.setcpv(mycpv) - - def autouse(self, myvartree, use_cache=1): - "returns set of USE variables auto-enabled due to packages being installed" - # XXX: harring wonders why profiledir is checked here... - from portage import profiledir - if profiledir==None: - return "" - myusevars="" - for myuse in self.use_defs: - dep_met = True - for mydep in self.use_defs[myuse]: - if not myvartree.dep_match(mydep,use_cache=True): - dep_met = False - break - if dep_met: - myusevars += " "+myuse - return myusevars - - - - def loadVirtuals(self,root): - self.virtuals = self.getvirtuals(root) - - def load_best_module(self,property_string): - best_mod = best_from_dict(property_string,self.modules,self.module_priority) - return load_mod(best_mod) - - def lock(self): - self.locked = 1 - - def unlock(self): - self.locked = 0 - - def modifying(self): - if self.locked: - raise Exception, "Configuration is locked." - - def backup_changes(self,key=None): - if key and self.configdict["env"].has_key(key): - self.backupenv[key] = copy.deepcopy(self.configdict["env"][key]) - else: - raise KeyError, "No such key defined in environment: %s" % key - - def reset(self,keeping_pkg=0,use_cache=1): - "reset environment to original settings" - envdict = self.configdict["env"] - # reinitialize env values to those of backupenv - envdict.clear() - envdict.update(self.backupenv) - self.modifiedkeys = [] - if not keeping_pkg: - self.puse = "" - self.configdict["pkg"].clear() - self.regenerate(use_cache=use_cache) - - def load_infodir(self,infodir): - if self.configdict.has_key("pkg"): - self.configdict["pkg"].clear() - else: - writemsg("No pkg setup for settings instance?\n") - sys.exit(17) - - if os.path.exists(infodir): - if os.path.exists(infodir+"/environment"): - self.configdict["pkg"]["PORT_ENV_FILE"] = infodir+"/environment" - elif os.path.exists(infodir+"/environment.bz2"): - self.configdict["pkg"]["PORT_ENV_FILE"] = infodir+"/environment.bz2" -# else: -# print "wth, no env found in the infodir, '%s'" % infodir -# import traceback -# traceback.print_stack() -# sys.exit(15) - myre = re.compile('^[A-Z]+$') - for filename in listdir(infodir,filesonly=1): - if myre.match(filename): - try: - mydata = open(infodir+"/"+filename).read().strip() - if len(mydata)<2048: - if filename == "USE": - self.configdict["pkg"][filename] = "-* "+mydata - else: - self.configdict["pkg"][filename] = mydata - except SystemExit, e: - raise - except: - writemsg("!!! Unable to read file: %s\n" % infodir+"/"+filename) - pass - return 1 - return 0 - - def setcpv(self,mycpv,use_cache=1): - self.modifying() - self.mycpv = mycpv - self.pusekey = portage_dep.best_match_to_list(self.mycpv, self.pusedict.keys()) - if self.pusekey: - newpuse = " ".join(self.pusedict[self.pusekey]) - else: - newpuse = "" - if newpuse == self.puse: - return - self.puse = newpuse - self.configdict["pkg"]["PKGUSE"] = self.puse[:] # For saving to PUSE file - self.configdict["pkg"]["USE"] = self.puse[:] # this gets appended to USE - self.reset(keeping_pkg=1,use_cache=use_cache) - - def setinst(self,mycpv,mydbapi): - """ - Grab the virtuals this package provides and add them into the tree virtuals. - """ - provides = mydbapi.aux_get(mycpv, ["PROVIDE"])[0] - - #XXX HACK - from portage import portdbapi - - if isinstance(mydbapi, portdbapi): - myuse = self["USE"] - else: - myuse = mydbapi.aux_get(mycpv, ["USE"])[0] - virts = flatten(portage_dep.use_reduce(portage_dep.paren_reduce(provides), uselist=myuse.split())) - - cp = portage_dep.dep_getkey(mycpv) - for virt in virts: - virt = portage_dep.dep_getkey(virt) - if not self.treeVirtuals.has_key(virt): - self.treeVirtuals[virt] = [] - self.treeVirtuals[virt] = portage_util.unique_array(self.treeVirtuals[virt]+[cp]) - # Reconstruct the combined virtuals. - val = stack_dictlist( [self.userVirtuals, self.treeVirtuals]+self.dirVirtuals, incremental=1) - for v in val.values(): - v.reverse() - self.virtuals = val - - def regenerate(self,useonly=0,use_cache=1): - if self.already_in_regenerate: - # XXX: THIS REALLY NEEDS TO GET FIXED. autouse() loops. - writemsg("!!! Looping in regenerate.\n",1) - return - else: - self.already_in_regenerate = 1 - - if useonly: - myincrementals=["USE"] - else: - myincrementals=self.incrementals[:] - - # XXX HACK, harring - # this is a design flaw of the code. - from portage import db, root - - rootdb = db.get(root) - for mykey in myincrementals: - if mykey=="USE": - mydbs=self.uvlist - # XXX Global usage of db... Needs to go away somehow. - if rootdb and "vartree" in rootdb: - _use = self.autouse( rootdb["vartree"], use_cache=use_cache) - else: - _use = "" - self.configdict["auto"]["USE"]= _use - else: - mydbs=self.configlist[:-1] - - myflags=[] - for curdb in mydbs: - if mykey not in curdb: - continue - #variables are already expanded - mysplit=curdb[mykey].split() - - for x in mysplit: - if x=="-*": - # "-*" is a special "minus" var that means "unset all settings". - # so USE="-* gnome" will have *just* gnome enabled. - myflags=[] - continue - - if x[0]=="+": - # Not legal. People assume too much. Complain. - writemsg(red("USE flags should not start with a '+': %s\n" % x)) - x=x[1:] - - if x[0]=="-": - if x[1:] in myflags: - # Unset/Remove it. - myflags.remove(x[1:]) - continue - - # We got here, so add it now. - if x not in myflags: - myflags.append(x) - - myflags.sort() - #store setting in last element of configlist, the original environment: - self.configlist[-1][mykey]=" ".join(myflags) - del myflags - - #cache split-up USE var in a global - usesplit=[] - - for x in self.configlist[-1]["USE"].split(): - if x not in self.usemask: - usesplit.append(x) - - if self.has_key("USE_EXPAND"): - for var in self["USE_EXPAND"].split(): - if self.has_key(var): - for x in self[var].split(): - mystr = var.lower()+"_"+x - if mystr not in usesplit: - usesplit.append(mystr) - - # Pre-Pend ARCH variable to USE settings so '-*' in env doesn't kill arch. - # XXX: harring wonders why profiledir is checked here... - from portage import profiledir - if profiledir: - if self.configdict["defaults"].has_key("ARCH"): - if self.configdict["defaults"]["ARCH"]: - if self.configdict["defaults"]["ARCH"] not in usesplit: - usesplit.insert(0,self.configdict["defaults"]["ARCH"]) - - self.configlist[-1]["USE"]=" ".join(usesplit) - - self.already_in_regenerate = 0 - - def getvirtuals(self, myroot): - myvirts = {} - - # This breaks catalyst/portage when setting to a fresh/empty root. - # Virtuals cannot be calculated because there is nothing to work - # from. So the only ROOT prefixed dir should be local configs. - #myvirtdirs = prefix_array(self.profiles,myroot+"/") - myvirtdirs = copy.deepcopy(self.profiles) - - self.treeVirtuals = {} - - # Repoman should ignore these. - user_profile_dir = None - if os.environ.get("PORTAGE_CALLER","") != "repoman": - user_profile_dir = myroot+portage_const.USER_CONFIG_PATH - - # XXX: Removing this as virtuals and profile/virtuals behave - # differently. portage/profile/virtuals overrides the default - # virtuals but are overridden by installed virtuals whereas - # portage/virtuals overrides everything. - - #if os.path.exists("/etc/portage/virtuals"): - # writemsg("\n\n*** /etc/portage/virtuals should be moved to /etc/portage/profile/virtuals\n") - # writemsg("*** Please correct this by merging or moving the file. (Deprecation notice)\n\n") - # time.sleep(1) - - - self.dirVirtuals = grab_multiple("virtuals", myvirtdirs, grabdict) - self.dirVirtuals.reverse() - self.userVirtuals = {} - if user_profile_dir and os.path.exists(user_profile_dir+"/virtuals"): - self.userVirtuals = grabdict(user_profile_dir+"/virtuals") - - # User settings and profile settings take precedence over tree. - profile_virtuals = stack_dictlist([self.userVirtuals]+self.dirVirtuals,incremental=1) - - # repoman doesn't need local virtuals - if os.environ.get("PORTAGE_CALLER","") != "repoman": - from portage import vartree - temp_vartree = vartree(myroot,profile_virtuals,categories=self.categories) - myTreeVirtuals = {} - for key, val in temp_vartree.get_all_provides().items(): - myTreeVirtuals[key] = portage_util.unique_array( [ portage_versions.pkgsplit(x)[0] for x in val ] ) - self.treeVirtuals.update(myTreeVirtuals) - del myTreeVirtuals -# myTreeVirtuals = map_dictlist_vals(getCPFromCPV,temp_vartree.get_all_provides()) -# for x,v in myTreeVirtuals.items(): -# self.treeVirtuals[x] = portage_util.unique_array(v) - - # User settings and profile settings take precedence over tree - val = stack_dictlist([self.userVirtuals,self.treeVirtuals]+self.dirVirtuals,incremental=1) - - for x in val.values(): - x.reverse() - return val - - def __delitem__(self,mykey): - for x in self.lookuplist: - if x != None: - if mykey in x: - del x[mykey] - - def __getitem__(self,mykey): - match = '' - for x in self.lookuplist: - if x == None: - writemsg("!!! lookuplist is null.\n") - elif x.has_key(mykey): - match = x[mykey] - break - - if 0 and match and mykey in ["PORTAGE_BINHOST"]: - # These require HTTP Encoding - try: - import urllib - if urllib.unquote(match) != match: - writemsg("Note: %s already contains escape codes." % (mykey)) - else: - match = urllib.quote(match) - except SystemExit, e: - raise - except: - writemsg("Failed to fix %s using urllib, attempting to continue.\n" % (mykey)) - pass - - elif mykey == "CONFIG_PROTECT_MASK": - match += " /etc/env.d" - - return match - - def has_key(self,mykey): - for x in self.lookuplist: - if x.has_key(mykey): - return 1 - return 0 - - def keys(self): - mykeys=[] - for x in self.lookuplist: - for y in x.keys(): - if y not in mykeys: - mykeys.append(y) - return mykeys - - def __setitem__(self,mykey,myvalue): - "set a value; will be thrown away at reset() time" - if not isinstance(myvalue, str): - raise ValueError("Invalid type being used as a value: '%s': '%s'" % (str(mykey),str(myvalue))) - self.modifying() - self.modifiedkeys += [mykey] - self.configdict["env"][mykey]=myvalue - - def environ(self): - "return our locally-maintained environment" - mydict={} - for x in self.keys(): - mydict[x]=self[x] - if not mydict.has_key("HOME") and mydict.has_key("BUILD_PREFIX"): - writemsg("*** HOME not set. Setting to "+mydict["BUILD_PREFIX"]+"\n") - mydict["HOME"]=mydict["BUILD_PREFIX"][:] - - return mydict - - def bash_environ(self): - "return our locally-maintained environment in a suitable bash assignment form" - mydict=self.environ() - final={} - for k in mydict.keys(): - # quotes and escaped chars suck. - s=mydict[k].replace("\\","\\\\\\\\") - s=s.replace("'","\\\\'") - s=s.replace("\n","\\\n") - final[k]="$'%s'" % s - return final - - -def stack_dicts(dicts, incremental=0, incrementals=[], ignore_none=0): - """Stacks an array of dict-types into one array. Optionally merging or - overwriting matching key/value pairs for the dict[key]->string. - Returns a single dict.""" - final_dict = None - for mydict in dicts: - if mydict == None: - if ignore_none: - continue - else: - return None - if final_dict == None: - final_dict = {} - for y in mydict.keys(): - if mydict[y]: - if final_dict.has_key(y) and (incremental or (y in incrementals)): - final_dict[y] += " "+mydict[y][:] - else: - final_dict[y] = mydict[y][:] - mydict[y] = ' '.join(mydict[y].split()) # Remove extra spaces. - return final_dict - -def stack_lists(lists, incremental=1): - """Stacks an array of list-types into one array. Optionally removing - distinct values using '-value' notation. Higher index is preferenced.""" - new_list = [] - for x in lists: - for y in x: - if y: - if incremental and y[0]=='-': - while y[1:] in new_list: - del new_list[new_list.index(y[1:])] - else: - if y not in new_list: - new_list.append(y[:]) - return new_list - -def stack_dictlist(original_dicts, incremental=0, incrementals=[], ignore_none=0): - """Stacks an array of dict-types into one array. Optionally merging or - overwriting matching key/value pairs for the dict[key]->list. - Returns a single dict. Higher index in lists is preferenced.""" - final_dict = None - kill_list = {} - for mydict in original_dicts: - if mydict == None: - continue - if final_dict == None: - final_dict = {} - for y in mydict.keys(): - if not final_dict.has_key(y): - final_dict[y] = [] - if not kill_list.has_key(y): - kill_list[y] = [] - - for thing in mydict[y]: - if thing and (thing not in kill_list[y]): - if (incremental or (y in incrementals)) and thing[0] == '-': - if thing[1:] not in kill_list[y]: - kill_list[y] += [thing[1:]] -# while(thing[1:] in final_dict[y]): -# del final_dict[y][final_dict[y].index(thing[1:])] - else: - if thing not in final_dict[y]: - final_dict[y].insert(0,thing[:]) - if final_dict.has_key(y) and not final_dict[y]: - del final_dict[y] - return final_dict - - -def best_from_dict(key, top_dict, key_order, EmptyOnError=1, FullCopy=1, AllowEmpty=1): - for x in key_order: - dico = top_dict.get(x) - if dico and key in dico: - if FullCopy: - return copy.deepcopy(dico[key]) - else: - return dico[key] - if EmptyOnError: - return "" - else: - raise KeyError, "Key not found in list; '%s'" % key - - -def load_mod(name): - components = name.split('.') - modname = ".".join(components[:-1]) - mod = __import__(modname) - for comp in components[1:]: - mod = getattr(mod, comp) - return mod diff --git a/pym/cvstree.py b/pym/cvstree.py deleted file mode 100644 index 7679259..0000000 --- a/pym/cvstree.py +++ /dev/null @@ -1,295 +0,0 @@ -# cvstree.py -- cvs tree utilities -# Copyright 1998-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/pym/cvstree.py,v 1.13 2005/02/26 06:35:20 jstubbs Exp $ -cvs_id_string="$Id: cvstree.py,v 1.13 2005/02/26 06:35:20 jstubbs Exp $"[5:-2] - -import string,os,time,sys,re -from stat import * - -# [D]/Name/Version/Date/Flags/Tags - -def pathdata(entries, path): - """(entries,path) - Returns the data(dict) for a specific file/dir at the path specified.""" - mysplit=string.split(path,"/") - myentries=entries - mytarget=mysplit[-1] - mysplit=mysplit[:-1] - for mys in mysplit: - if myentries["dirs"].has_key(mys): - myentries=myentries["dirs"][mys] - else: - return None - if myentries["dirs"].has_key(mytarget): - return myentries["dirs"][mytarget] - elif myentries["files"].has_key(mytarget): - return myentries["files"][mytarget] - else: - return None - -def fileat(entries, path): - return pathdata(entries,path) - -def isadded(entries, path): - """(entries,path) - Returns true if the path exists and is added to the cvs tree.""" - mytarget=pathdata(entries, path) - if mytarget: - if "cvs" in mytarget["status"]: - return 1 - - basedir=os.path.dirname(path) - filename=os.path.basename(path) - - try: - myfile=open(basedir+"/CVS/Entries","r") - except IOError: - return 0 - mylines=myfile.readlines() - myfile.close() - - rep=re.compile("^\/"+re.escape(filename)+"\/"); - for x in mylines: - if rep.search(x): - return 1 - - return 0 - -def findnew(entries,recursive=0,basedir=""): - """(entries,recursive=0,basedir="") - Recurses the entries tree to find all elements that have been added but - have not yet been committed. Returns a list of paths, optionally prepended - with a basedir.""" - if basedir and basedir[-1]!="/": - basedir=basedir+"/" - mylist=[] - for myfile in entries["files"].keys(): - if "cvs" in entries["files"][myfile]["status"]: - if "0" == entries["files"][myfile]["revision"]: - mylist.append(basedir+myfile) - if recursive: - for mydir in entries["dirs"].keys(): - mylist+=findnew(entries["dirs"][mydir],recursive,basedir+mydir) - return mylist - -def findchanged(entries,recursive=0,basedir=""): - """(entries,recursive=0,basedir="") - Recurses the entries tree to find all elements that exist in the cvs tree - and differ from the committed version. Returns a list of paths, optionally - prepended with a basedir.""" - if basedir and basedir[-1]!="/": - basedir=basedir+"/" - mylist=[] - for myfile in entries["files"].keys(): - if "cvs" in entries["files"][myfile]["status"]: - if "current" not in entries["files"][myfile]["status"]: - if "exists" in entries["files"][myfile]["status"]: - if entries["files"][myfile]["revision"]!="0": - mylist.append(basedir+myfile) - if recursive: - for mydir in entries["dirs"].keys(): - mylist+=findchanged(entries["dirs"][mydir],recursive,basedir+mydir) - return mylist - -def findmissing(entries,recursive=0,basedir=""): - """(entries,recursive=0,basedir="") - Recurses the entries tree to find all elements that are listed in the cvs - tree but do not exist on the filesystem. Returns a list of paths, - optionally prepended with a basedir.""" - if basedir and basedir[-1]!="/": - basedir=basedir+"/" - mylist=[] - for myfile in entries["files"].keys(): - if "cvs" in entries["files"][myfile]["status"]: - if "exists" not in entries["files"][myfile]["status"]: - if "removed" not in entries["files"][myfile]["status"]: - mylist.append(basedir+myfile) - if recursive: - for mydir in entries["dirs"].keys(): - mylist+=findmissing(entries["dirs"][mydir],recursive,basedir+mydir) - return mylist - -def findunadded(entries,recursive=0,basedir=""): - """(entries,recursive=0,basedir="") - Recurses the entries tree to find all elements that are in valid cvs - directories but are not part of the cvs tree. Returns a list of paths, - optionally prepended with a basedir.""" - if basedir and basedir[-1]!="/": - basedir=basedir+"/" - mylist=[] - - #ignore what cvs ignores. - for myfile in entries["files"].keys(): - if "cvs" not in entries["files"][myfile]["status"]: - mylist.append(basedir+myfile) - if recursive: - for mydir in entries["dirs"].keys(): - mylist+=findunadded(entries["dirs"][mydir],recursive,basedir+mydir) - return mylist - -def findremoved(entries,recursive=0,basedir=""): - """(entries,recursive=0,basedir="") - Recurses the entries tree to find all elements that are in flagged for cvs - deletions. Returns a list of paths, optionally prepended with a basedir.""" - if basedir and basedir[-1]!="/": - basedir=basedir+"/" - mylist=[] - for myfile in entries["files"].keys(): - if "removed" in entries["files"][myfile]["status"]: - mylist.append(basedir+myfile) - if recursive: - for mydir in entries["dirs"].keys(): - mylist+=findremoved(entries["dirs"][mydir],recursive,basedir+mydir) - return mylist - -def findall(entries, recursive=0, basedir=""): - """(entries,recursive=0,basedir="") - Recurses the entries tree to find all new, changed, missing, and unadded - entities. Returns a 4 element list of lists as returned from each find*().""" - - if basedir and basedir[-1]!="/": - basedir=basedir+"/" - mynew = findnew(entries,recursive,basedir) - mychanged = findchanged(entries,recursive,basedir) - mymissing = findmissing(entries,recursive,basedir) - myunadded = findunadded(entries,recursive,basedir) - myremoved = findremoved(entries,recursive,basedir) - return [mynew, mychanged, mymissing, myunadded, myremoved] - -ignore_list = re.compile("(^|/)(RCS(|LOG)|SCCS|CVS(|\.adm)|cvslog\..*|tags|TAGS|\.(make\.state|nse_depinfo)|.*~|(\.|)#.*|,.*|_$.*|.*\$|\.del-.*|.*\.(old|BAK|bak|orig|rej|a|olb|o|obj|so|exe|Z|elc|ln)|core)$") -def apply_cvsignore_filter(list): - x=0 - while x < len(list): - if ignore_list.match(list[x].split("/")[-1]): - list.pop(x) - else: - x+=1 - return list - -def getentries(mydir,recursive=0): - """(basedir,recursive=0) - Scans the given directory and returns an datadict of all the entries in - the directory seperated as a dirs dict and a files dict.""" - myfn=mydir+"/CVS/Entries" - # entries=[dirs, files] - entries={"dirs":{},"files":{}} - if not os.path.exists(mydir): - return entries - try: - myfile=open(myfn, "r") - mylines=myfile.readlines() - myfile.close() - except SystemExit, e: - raise - except: - mylines=[] - for line in mylines: - if line and line[-1]=="\n": - line=line[:-1] - if not line: - continue - if line=="D": # End of entries file - break - mysplit=string.split(line, "/") - if len(mysplit)!=6: - print "Confused:",mysplit - continue - if mysplit[0]=="D": - entries["dirs"][mysplit[1]]={"dirs":{},"files":{},"status":[]} - entries["dirs"][mysplit[1]]["status"]=["cvs"] - if os.path.isdir(mydir+"/"+mysplit[1]): - entries["dirs"][mysplit[1]]["status"]+=["exists"] - entries["dirs"][mysplit[1]]["flags"]=mysplit[2:] - if recursive: - rentries=getentries(mydir+"/"+mysplit[1],recursive) - #print rentries.keys() - #print entries["files"].keys() - #print entries["files"][mysplit[1]] - entries["dirs"][mysplit[1]]["dirs"]=rentries["dirs"] - entries["dirs"][mysplit[1]]["files"]=rentries["files"] - else: - # [D]/Name/revision/Date/Flags/Tags - entries["files"][mysplit[1]]={} - entries["files"][mysplit[1]]["revision"]=mysplit[2] - entries["files"][mysplit[1]]["date"]=mysplit[3] - entries["files"][mysplit[1]]["flags"]=mysplit[4] - entries["files"][mysplit[1]]["tags"]=mysplit[5] - entries["files"][mysplit[1]]["status"]=["cvs"] - if entries["files"][mysplit[1]]["revision"][0]=="-": - entries["files"][mysplit[1]]["status"]+=["removed"] - - for file in apply_cvsignore_filter(os.listdir(mydir)): - if file=="CVS": - continue - if file=="digest-framerd-2.4.3": - print mydir,file - if os.path.isdir(mydir+"/"+file): - if not entries["dirs"].has_key(file): - entries["dirs"][file]={"dirs":{},"files":{}} - if entries["dirs"][file].has_key("status"): - if "exists" not in entries["dirs"][file]["status"]: - entries["dirs"][file]["status"]+=["exists"] - else: - entries["dirs"][file]["status"]=["exists"] - elif os.path.isfile(mydir+"/"+file): - if file=="digest-framerd-2.4.3": - print "isfile" - if not entries["files"].has_key(file): - entries["files"][file]={"revision":"","date":"","flags":"","tags":""} - if entries["files"][file].has_key("status"): - if file=="digest-framerd-2.4.3": - print "has status" - if "exists" not in entries["files"][file]["status"]: - if file=="digest-framerd-2.4.3": - print "no exists in status" - entries["files"][file]["status"]+=["exists"] - else: - if file=="digest-framerd-2.4.3": - print "no status" - entries["files"][file]["status"]=["exists"] - try: - if file=="digest-framerd-2.4.3": - print "stat'ing" - mystat=os.stat(mydir+"/"+file) - mytime=time.asctime(time.gmtime(mystat[ST_MTIME])) - if not entries["files"][file].has_key("status"): - if file=="digest-framerd-2.4.3": - print "status not set" - entries["files"][file]["status"]=[] - if file=="digest-framerd-2.4.3": - print "date:",entries["files"][file]["date"] - print "sdate:",mytime - if mytime==entries["files"][file]["date"]: - entries["files"][file]["status"]+=["current"] - if file=="digest-framerd-2.4.3": - print "stat done" - - del mystat - except SystemExit, e: - raise - except Exception, e: - print "failed to stat",file - print e - return - - else: - print - print "File of unknown type:",mydir+"/"+file - print - return entries - -#class cvstree: -# def __init__(self,basedir): -# self.refdir=os.cwd() -# self.basedir=basedir -# self.entries={} -# self.entries["dirs"]={} -# self.entries["files"]={} -# self.entries["dirs"][self.basedir]=getentries(self.basedir) -# self.getrealdirs(self.dirs, self.files) -# def getrealdirs(self,dirs,files): -# for mydir in dirs.keys(): -# list = os.listdir( - - diff --git a/pym/dcache.py b/pym/dcache.py deleted file mode 100644 index 601a0bc..0000000 --- a/pym/dcache.py +++ /dev/null @@ -1,154 +0,0 @@ -"""list based, symlink aware fs listdir caching implementation""" -import os,stat,weakref - -def norm_path(mypath): - newpath = os.path.normpath(mypath) - if len(mypath) > 1: - if newpath[:2] == "//": - newpath=newpath.replace("//","/") - return newpath - -def abs_link(sym): - # note this doesn't parse every single entry. that's up to you. - l=os.readlink(sym) - if l[0] != '/': - l = os.path.dirname(sym)+"/"+l - return norm_path(l) - -class node: - """class representing a directory""" - __slots__=["dir_node_name","dir_node_ref","dirs","files","others","sdirs","sfiles","mtime"] -# instances = 0 - def __init__(self):#,dirs=[],others=[],files=[],mtime=-1): - self.dir_node_ref=[] - self.dir_node_name=[] - self.dirs=[] - self.files=[] - self.others=[] - self.sdirs=[] - self.sfiles=[] - self.mtime=-1 - -# def __del__(self): -# print "del'ing a node" -# del self.dir_node_n -# del self.sdirs -# del self.sfiles -# del self.dirs -# del self.files -# del self.others -# del self.mtime - - def get_node(self,nnode): - """retrieve directory node if exists""" - try: - x=self.dir_node_name.index(nnode) - return self.dir_node_ref[x] - except (ReferenceError,ValueError),e : -# print "ref exception",e - return None - - def add_node(self,nnode,ref_node=None,symlink=False): - self.dir_node_name.append(nnode) - if ref_node: - if symlink: - self.dir_node_ref.append(weakref.proxy(ref_node)) - else: - self.dir_node_ref.append(ref_node) - else: - self.dir_node_ref.append(node()) - return self.dir_node_ref[-1] - - def del_node(self,nnode): - try: - x=self.dir_node_name.index(nnode) - del self.dir_node_name[x] - del self.dir_node_ref[x] - except Exception,e: - print "warning, dcache was asked to delete a non_existant node: lacks node %s" % nnode - print "e=",e - - def rec_del_node(self): - while len(self.dir_node_n): - self.dir_node_name[0].rec_del_node() - del self.dir_node_name[0][0] - del self.dir_node_ref[0] - -class dcache: - def __init__(self): - self.cache=node() - - def _get_dir_ent(self, mypath,symlink=False): - p=mypath.split("/") - if not p[0]: - p = p[1:] - if not p[-1]: - p = p[0:-1] - fullpath='' - c = self.cache - if not len(p): - return self.cache - while len(p): - fullpath += '/' + p[0] - - g=c.get_node(p[0]) - if not g: - st=os.lstat(fullpath) - if stat.S_ISLNK(st.st_mode): - # yippee - fullpath=abs_link(fullpath) -# print "hijacking %s to %s" % (p[0], fullpath) - g=self._get_dir_ent(fullpath) - g=c.add_node(p[0],ref_node=self._get_dir_ent(fullpath)) - elif stat.S_ISDIR(st.st_mode): - g=c.add_node(p[0]) - else: - raise Exception("%s is not a dir!" % fullpath) - c=g - p.pop(0) - if symlink: - c["actpath"]=fullpath - return c - - def cacheddir(self, mypath): - mypath=norm_path(mypath) - if mypath=="/": - ent=self.cache - else: - ent = self._get_dir_ent(mypath) -# print "nodes mtime=",ent.mtime - listing_needed = (ent.mtime == -1) - - mtime = os.stat(mypath).st_mtime - if not listing_needed: -# print "nost listing needed" - if mtime != ent.mtime: - print "mtime flipped it" - self._invalidate_dir_node(ent) - listing_needed = True - -# print "ent = ",ent,"listing_needed=",listing_needed - if listing_needed: - ent.mtime=mtime -# print "set nodes mtime to",ent.mtime,"from",mtime - l = os.listdir(mypath) - for x in l: - try: - ps=os.lstat(mypath+"/"+x).st_mode - if stat.S_ISREG(ps): - ent.files.append(x) - elif stat.S_ISDIR(ps): - ent.dirs.append(x) - elif stat.S_ISLNK(ps): - ps=os.stat(mypath+"/"+x).st_mode - if stat.S_ISDIR(ps): - ent.sdirs.append(x) - else: - ent.sfiles.append(x) - else: - ent.others.append(x) - except: - ent.others.append(x) - return list(ent.dirs + ent.sdirs + ent.files + ent.sfiles + ent.others),\ - [1 for x in ent.dirs]+[3 for x in ent.sdirs]+ \ - [0 for x in ent.files]+ [2 for x in ent.sfiles]+[4 for x in ent.others] diff --git a/pym/dcdialog.py b/pym/dcdialog.py deleted file mode 100644 index 1687392..0000000 --- a/pym/dcdialog.py +++ /dev/null @@ -1,412 +0,0 @@ -# -# Changes and extensions by Carlos Castillo... -# -cvs_id_string="$Id: dcdialog.py,v 1.2 2005/02/26 06:35:20 jstubbs Exp $"[5:-2] - -# -# Module: dialog.py -# Copyright (c) 2000 Robb Shecter <robb@acm.org> -# All rights reserved. -# This source is covered by the GNU GPL. -# -# This module is a Python wrapper around the Linux "dialog" utility -# by Savio Lam and Stuart Herbert. My goals were to make dialog as -# easy to use from Python as possible. The demo code at the end of -# the module is a good example of how to use it. To run the demo, -# execute: -# -# python dialog.py -# -# This module has one class in it, "Dialog". An application typically -# creates an instance of it, and possibly sets the background title option. -# Then, methods can be called on it for interacting with the user. -# -# I wrote this because I want to use my 486-33 laptop as my main -# development computer (!), and I wanted a way to nicely interact with the -# user in console mode. There are apparently other modules out there -# with similar functionality, but they require the Python curses library. -# Writing this module from scratch was easier than figuring out how to -# recompile Python with curses enabled. :) -# -# One interesting feature is that the menu and selection windows allow -# *any* objects to be displayed and selected, not just strings. -# -# TO DO: -# Add code so that the input buffer is flushed before a dialog box is -# shown. This would make the UI more predictable for users. This -# feature could be turned on and off through an instance method. -# Drop using temporary files when interacting with 'dialog' -# (it's possible -- I've already tried :-). -# Try detecting the terminal window size in order to make reasonable -# height and width defaults. Hmmm - should also then check for -# terminal resizing... -# Put into a package name to make more reusable - reduce the possibility -# of name collisions. -# -# NOTES: -# there is a bug in (at least) Linux-Mandrake 7.0 Russian Edition -# running on AMD K6-2 3D that causes core dump when 'dialog' -# is running with --gauge option; -# in this case you'll have to recompile 'dialog' program. -# -# Modifications: -# Jul 2000, Sultanbek Tezadov (http://sultan.da.ru) -# Added: -# - 'gauge' widget *) -# - 'title' option to some widgets -# - 'checked' option to checklist dialog; clicking "Cancel" is now -# recognizable -# - 'selected' option to radiolist dialog; clicking "Cancel" is now -# recognizable -# - some other cosmetic changes and improvements -# - -import os -from tempfile import mktemp -from string import split -from time import sleep - -# -# Path of the dialog executable -# -DIALOG="/usr/bin/dialog" - - -class Dialog: - def __init__(self): - self.__bgTitle = '' # Default is no background title - - - def setBackgroundTitle(self, text): - self.__bgTitle = '--backtitle "%s"' % text - - - def __perform(self, cmd): - """Do the actual work of invoking dialog and getting the output.""" - fName = mktemp() - rv = os.system('%s %s %s 2> %s' % (DIALOG, self.__bgTitle, cmd, fName)) - f = open(fName) - output = f.readlines() - f.close() - os.unlink(fName) - return (rv, output) - - - def __perform_no_options(self, cmd): - """Call dialog w/out passing any more options. Needed by --clear.""" - return os.system(DIALOG + ' ' + cmd) - - - def __handleTitle(self, title): - if len(title) == 0: - return '' - else: - return '--title "%s" ' % title - - - def yesno(self, text, height=10, width=30, title=''): - """ - Put a Yes/No question to the user. - Uses the dialog --yesno option. - Returns a 1 or a 0. - """ - (code, output) = self.__perform(self.__handleTitle(title) +\ - '--yesno "%s" %d %d' % (text, height, width)) - return code == 0 - - - def msgbox(self, text, height=10, width=30, title=''): - """ - Pop up a message to the user which has to be clicked - away with "ok". - """ - self.__perform(self.__handleTitle(title) +\ - '--msgbox "%s" %d %d' % (text, height, width)) - - - def infobox(self, text, height=10, width=30): - """Make a message to the user, and return immediately.""" - self.__perform('--infobox "%s" %d %d' % (text, height, width)) - - - def inputbox(self, text, height=10, width=30, init='', title=''): - """ - Request a line of input from the user. - Returns the user's input or None if cancel was chosen. - """ - (c, o) = self.__perform(self.__handleTitle(title) +\ - '--inputbox "%s" %d %d "%s"' % (text, height, width, init)) - try: - return o[0] - except IndexError: - if c == 0: # empty string entered - return '' - else: # canceled - return None - - - def textbox(self, filename, height=20, width=60, title=None): - """Display a file in a scrolling text box.""" - if title is None: - title = filename - self.__perform(self.__handleTitle(title) +\ - ' --textbox "%s" %d %d' % (filename, height, width)) - - - def menu(self, text, height=15, width=54, list=[]): - """ - Display a menu of options to the user. This method simplifies the - --menu option of dialog, which allows for complex arguments. This - method receives a simple list of objects, and each one is assigned - a choice number. - The selected object is returned, or None if the dialog was canceled. - """ - menuheight = height - 8 - pairs = map(lambda i, item: (i + 1, item), range(len(list)), list) - choices = reduce(lambda res, pair: res + '%d "%s" ' % pair, pairs, '') - (code, output) = self.__perform('--menu "%s" %d %d %d %s' %\ - (text, height, width, menuheight, choices)) - try: - return list[int(output[0]) - 1] - except IndexError: - return None - - def menu_ext(self, text, height=15, width=54, list=[], list2=[]): - """ - Extended the method above for (string, string) pairs, for GLIS UI - """ - menuheight = height - 8 - pairs = [] - for i in range(len(list)): - pairs.append((list2[i],list[i])) - #pairs = map(lambda i, item: (i + 1, item), range(len(list)), list) - choices = reduce(lambda res, pair: res + '%s "%s" ' % pair, pairs, '') - (code, output) = self.__perform('--menu "%s" %d %d %d %s' %\ - (text, height, width, menuheight, choices)) - try: - return output[0] - except IndexError: - return None - - - def checklist(self, text, height=15, width=54, list=[], checked=None): - """ - Returns a list of the selected objects. - Returns an empty list if nothing was selected. - Returns None if the window was canceled. - checked -- a list of boolean (0/1) values; len(checked) must equal - len(list). - """ - if checked is None: - checked = [0]*len(list) - menuheight = height - 8 - triples = map( - lambda i, item, onoff, fs=('off', 'on'): (i + 1, item, fs[onoff]), - range(len(list)), list, checked) - choices = reduce(lambda res, triple: res + '%d "%s" %s ' % triple, - triples, '') - (c, o) = self.__perform('--checklist "%s" %d %d %d %s' %\ - (text, height, width, menuheight, choices)) - try: - output = o[0] - indexList = map(lambda x: int(x[1:-1]), split(output)) - objectList = filter(lambda item, list=list, indexList=indexList: - list.index(item) + 1 in indexList, - list) - return objectList - except IndexError: - if c == 0: # Nothing was selected - return [] - return None # Was canceled - - def checklist_ext(self, text, height=15, width=54, list=[], list2=[], checked=None): - """ - Returns a list of the selected objects. - Returns an empty list if nothing was selected. - Returns None if the window was canceled. - checked -- a list of boolean (0/1) values; len(checked) must equal - len(list). - """ - if checked is None: - checked = [0]*len(list) - menuheight = height - 8 - triples = [] - #equally 3 lines, much more readable - fs = ('off','on') - for i in range(len(list)): - triples.append((list2[i],list[i],fs[checked[i]])) - -## triples = map( -## lambda i, item, onoff, fs=('off', 'on'): (i + 1, item, fs[onoff]), -## range(len(list)), list, checked) - choices = reduce(lambda res, triple: res + '%s "%s" %s ' % triple, - triples, '') - (c, o) = self.__perform('--checklist "%s" %d %d %d %s' %\ - (text, height, width, menuheight, choices)) - try: - output = o[0] - return split(output) -## indexList = map(lambda x: int(x[1:-1]), split(output)) -## objectList = filter(lambda item, list=list, indexList=indexList: -## list.index(item) + 1 in indexList, -## list) -## return objectList - except IndexError: - if c == 0: # Nothing was selected - return [] - return None # Was canceled - - - def radiolist(self, text, height=15, width=54, list=[], selected=0): - """ - Return the selected object. - Returns empty string if no choice was selected. - Returns None if window was canceled. - selected -- the selected item (must be between 1 and len(list) - or 0, meaning no selection). - """ - menuheight = height - 8 - triples = map(lambda i, item: (i + 1, item, 'off'), - range(len(list)), list) - if selected: - i, item, tmp = triples[selected - 1] - triples[selected - 1] = (i, item, 'on') - choices = reduce(lambda res, triple: res + '%d "%s" %s ' % triple, - triples, '') - (c, o) = self.__perform('--radiolist "%s" %d %d %d %s' %\ - (text, height, width, menuheight, choices)) - try: - return list[int(o[0]) - 1] - except IndexError: - if c == 0: - return '' - return None - - - - def clear(self): - """ - Clear the screen. Equivalent to the dialog --clear option. - """ - self.__perform_no_options('--clear') - - - def scrollbox(self, text, height=20, width=60, title=''): - """ - This is a bonus method. The dialog package only has a function to - display a file in a scrolling text field. This method allows any - string to be displayed by first saving it in a temp file, and calling - --textbox. - """ - fName = mktemp() - f = open(fName, 'w') - f.write(text) - f.close() - self.__perform(self.__handleTitle(title) +\ - '--textbox "%s" %d %d' % (fName, height, width)) - os.unlink(fName) - - - def gauge_start(self, perc=0, text='', height=8, width=54, title=''): - """ - Display gauge output window. - Gauge normal usage (assuming that there is an instace of 'Dialog' - class named 'd'): - d.gauge_start() - # do something - d.gauge_iterate(10) # passed throgh 10% - # ... - d.gauge_iterate(100, 'any text here') # work is done - d.stop_gauge() # clean-up actions - """ - cmd = self.__handleTitle(title) +\ - '--gauge "%s" %d %d %d' % (text, height, width, perc) - cmd = '%s %s %s 2> /dev/null' % (DIALOG, self.__bgTitle, cmd) - self.pipe = os.popen(cmd, 'w') - #/gauge_start() - - - def gauge_iterate(self, perc, text=''): - """ - Update percentage point value. - - See gauge_start() function above for the usage. - """ - if text: - text = 'XXX\n%d\n%s\nXXX\n' % (perc, text) - else: - text = '%d\n' % perc - self.pipe.write(text) - self.pipe.flush() - #/gauge_iterate() - - - def gauge_stop(self): - """ - Finish previously started gauge. - - See gauge_start() function above for the usage. - """ - self.pipe.close() - #/gauge_stop() - - - -# -# DEMO APPLICATION -# -if __name__ == '__main__': - """ - This demo tests all the features of the class. - """ - d = Dialog() - d.setBackgroundTitle('dialog.py demo') - - d.infobox( - "One moment... Just wasting some time here to test the infobox...") - sleep(3) - - if d.yesno("Do you like this demo?"): - d.msgbox("Excellent! Here's the source code:") - else: - d.msgbox("Send your complaints to /dev/null") - - d.textbox("dialog.py") - - name = d.inputbox("What's your name?", init="Snow White") - fday = d.menu("What's your favorite day of the week?", - list=["Monday", "Tuesday", "Wednesday", "Thursday", - "Friday (The best day of all)", "Saturday", "Sunday"]) - food = d.checklist("What sandwich toppings do you like?", - list=["Catsup", "Mustard", "Pesto", "Mayonaise", "Horse radish", - "Sun-dried tomatoes"], checked=[0,0,0,1,1,1]) - sand = d.radiolist("What's your favorite kind of sandwich?", - list=["Hamburger", "Hotdog", "Burrito", "Doener", "Falafel", - "Bagel", "Big Mac", "Whopper", "Quarter Pounder", - "Peanut Butter and Jelly", "Grilled cheese"], selected=4) - - # Prepare the message for the final window - bigMessage = "Here are some vital statistics about you:\n\nName: " + name +\ - "\nFavorite day of the week: " + fday +\ - "\nFavorite sandwich toppings:\n" - for topping in food: - bigMessage = bigMessage + " " + topping + "\n" - bigMessage = bigMessage + "Favorite sandwich: " + str(sand) - - d.scrollbox(bigMessage) - - #<># Gauge Demo - d.gauge_start(0, 'percentage: 0', title='Gauge Demo') - for i in range(1, 101): - if i < 50: - msg = 'percentage: %d' % i - elif i == 50: - msg = 'Over 50%' - else: - msg = '' - d.gauge_iterate(i, msg) - sleep(0.1) - d.gauge_stop() - #<># - - d.clear() diff --git a/pym/dispatch_conf.py b/pym/dispatch_conf.py deleted file mode 100644 index 79ad46d..0000000 --- a/pym/dispatch_conf.py +++ /dev/null @@ -1,162 +0,0 @@ -# archive_conf.py -- functionality common to archive-conf and dispatch-conf -# Copyright 2003-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/pym/dispatch_conf.py,v 1.5 2005/06/04 11:15:12 jstubbs Exp $ -cvs_id_string="$Id: dispatch_conf.py,v 1.5 2005/06/04 11:15:12 jstubbs Exp $"[5:-2] - -# Library by Wayne Davison <gentoo@blorf.net>, derived from code -# written by Jeremy Wohl (http://igmus.org) - -from stat import * -import os, sys, commands, shutil - -sys.path = ["/usr/lib/portage/pym"]+sys.path -import portage - -RCS_BRANCH = '1.1.1' -RCS_LOCK = 'rcs -ko -M -l' -RCS_PUT = 'ci -t-"Archived config file." -m"dispatch-conf update."' -RCS_GET = 'co' -RCS_MERGE = 'rcsmerge -p -r' + RCS_BRANCH + ' %s >%s' - -DIFF3_MERGE = 'diff3 -mE %s %s %s >%s' - -def read_config(mandatory_opts): - try: - opts = portage.getconfig('/etc/dispatch-conf.conf') - except: - opts = None - - if not opts: - print >> sys.stderr, 'dispatch-conf: Error reading /etc/dispatch-conf.conf; fatal' - sys.exit(1) - - for key in mandatory_opts: - if not opts.has_key(key): - if key == "merge": - opts["merge"] = "sdiff --suppress-common-lines --output=%s %s %s" - else: - print >> sys.stderr, 'dispatch-conf: Missing option "%s" in /etc/dispatch-conf.conf; fatal' % (key,) - - if not os.path.exists(opts['archive-dir']): - os.mkdir(opts['archive-dir']) - elif not os.path.isdir(opts['archive-dir']): - print >> sys.stderr, 'dispatch-conf: Config archive dir [%s] must exist; fatal' % (opts['archive-dir'],) - sys.exit(1) - - return opts - - -def rcs_archive(archive, curconf, newconf, mrgconf): - """Archive existing config in rcs (on trunk). Then, if mrgconf is - specified and an old branch version exists, merge the user's changes - and the distributed changes and put the result into mrgconf. Lastly, - if newconf was specified, leave it in the archive dir with a .dist.new - suffix along with the last 1.1.1 branch version with a .dist suffix.""" - - try: - os.makedirs(os.path.dirname(archive)) - except: - pass - - try: - shutil.copy2(curconf, archive) - except(IOError, os.error), why: - print >> sys.stderr, 'dispatch-conf: Error copying %s to %s: %s; fatal' % \ - (curconf, archive, str(why)) - if os.path.exists(archive + ',v'): - os.system(RCS_LOCK + ' ' + archive) - os.system(RCS_PUT + ' ' + archive) - - ret = 0 - if newconf != '': - os.system(RCS_GET + ' -r' + RCS_BRANCH + ' ' + archive) - has_branch = os.path.exists(archive) - if has_branch: - os.rename(archive, archive + '.dist') - - try: - shutil.copy2(newconf, archive) - except(IOError, os.error), why: - print >> sys.stderr, 'dispatch-conf: Error copying %s to %s: %s; fatal' % \ - (newconf, archive, str(why)) - - if has_branch: - if mrgconf != '': - # This puts the results of the merge into mrgconf. - ret = os.system(RCS_MERGE % (archive, mrgconf)) - mystat = os.lstat(newconf) - os.chmod(mrgconf, mystat[ST_MODE]) - os.chown(mrgconf, mystat[ST_UID], mystat[ST_GID]) - os.rename(archive, archive + '.dist.new') - return ret - - -def file_archive(archive, curconf, newconf, mrgconf): - """Archive existing config to the archive-dir, bumping old versions - out of the way into .# versions (log-rotate style). Then, if mrgconf - was specified and there is a .dist version, merge the user's changes - and the distributed changes and put the result into mrgconf. Lastly, - if newconf was specified, archive it as a .dist.new version (which - gets moved to the .dist version at the end of the processing).""" - - try: - os.makedirs(os.path.dirname(archive)) - except: - pass - - # Archive the current config file if it isn't already saved - if os.path.exists(archive) \ - and len(commands.getoutput('diff -aq %s %s' % (curconf,archive))) != 0: - suf = 1 - while suf < 9 and os.path.exists(archive + '.' + str(suf)): - suf += 1 - - while suf > 1: - os.rename(archive + '.' + str(suf-1), archive + '.' + str(suf)) - suf -= 1 - - os.rename(archive, archive + '.1') - - try: - shutil.copy2(curconf, archive) - except(IOError, os.error), why: - print >> sys.stderr, 'dispatch-conf: Error copying %s to %s: %s; fatal' % \ - (curconf, archive, str(why)) - - if newconf != '': - # Save off new config file in the archive dir with .dist.new suffix - try: - shutil.copy2(newconf, archive + '.dist.new') - except(IOError, os.error), why: - print >> sys.stderr, 'dispatch-conf: Error copying %s to %s: %s; fatal' % \ - (newconf, archive + '.dist.new', str(why)) - - ret = 0 - if mrgconf != '' and os.path.exists(archive + '.dist'): - # This puts the results of the merge into mrgconf. - ret = os.system(DIFF3_MERGE % (curconf, archive + '.dist', newconf, mrgconf)) - mystat = os.lstat(newconf) - os.chmod(mrgconf, mystat[ST_MODE]) - os.chown(mrgconf, mystat[ST_UID], mystat[ST_GID]) - - return ret - - -def rcs_archive_post_process(archive): - """Check in the archive file with the .dist.new suffix on the branch - and remove the one with the .dist suffix.""" - os.rename(archive + '.dist.new', archive) - if os.path.exists(archive + '.dist'): - # Commit the last-distributed version onto the branch. - os.system(RCS_LOCK + RCS_BRANCH + ' ' + archive) - os.system(RCS_PUT + ' -r' + RCS_BRANCH + ' ' + archive) - os.unlink(archive + '.dist') - else: - # Forcefully commit the last-distributed version onto the branch. - os.system(RCS_PUT + ' -f -r' + RCS_BRANCH + ' ' + archive) - - -def file_archive_post_process(archive): - """Rename the archive file with the .dist.new suffix to a .dist suffix""" - os.rename(archive + '.dist.new', archive + '.dist') diff --git a/pym/ebuild.py b/pym/ebuild.py deleted file mode 100644 index 7391652..0000000 --- a/pym/ebuild.py +++ /dev/null @@ -1,1263 +0,0 @@ -#!/usr/bin/python -# ebuild.py; Ebuild classes/abstraction of phase processing, and communicating with a ebuild-daemon.sh instance -# Copyright 2005 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -#$Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/pym/ebuild.py,v 1.26 2005/05/10 00:30:47 ferringb Exp $ - - -import os,sys,traceback -import portage_const,types -#still needed? -from portage_const import * -import portage_locks, portage_util -import portage_exec -import portage_versions -import shutil, anydbm -import stat -import string - -def shutdown_all_processors(): - """kill off all known processors""" - global active_ebp_list, inactive_ebp_list - if type(active_ebp_list) != types.ListType: - print "warning, ebuild.active_ebp_list wasn't a list." - active_ebp_list = [] - if type(inactive_ebp_list) != types.ListType: - print "warning, ebuild.inactive_ebp_list wasn't a list." - inactive_ebp_list = [] - while len(active_ebp_list) > 0: - try: active_ebp_list[0].shutdown_processor() - except (IOError,OSError): - active_ebp_list.pop(0) - continue - try: active_ebp_list.pop(0) - except IndexError: pass - while len(inactive_ebp_list) > 0: - try: - inactive_ebp_list[0].shutdown_processor() - except (IOError,OSError): - inactive_ebp_list.pop(0) - continue - try: inactive_ebp_list.pop(0) - except IndexError: pass - - -inactive_ebp_list = [] -active_ebp_list = [] - -def request_ebuild_processor(ebuild_daemon_path=portage_const.EBUILD_DAEMON_PATH,userpriv=False, \ - sandbox=None,fakeroot=False,save_file=None): - """request an ebuild_processor instance from the pool, or create a new one - this walks through the requirements, matching a inactive processor if one exists - note fakerooted processors are never reused, do to the nature of fakeroot""" - - if sandbox == None: - sandbox = portage_exec.sandbox_capable - - global inactive_ebp_list, active_ebp_list - if not fakeroot: - for x in inactive_ebp_list: - if not x.locked() and x.ebd == ebuild_daemon_path and \ - x.userprived() == userpriv and (x.sandboxed() or not sandbox): - inactive_ebp_list.remove(x) - active_ebp_list.append(x) - return x - active_ebp_list.append(ebuild_processor(userpriv=userpriv,sandbox=sandbox,fakeroot=fakeroot,save_file=save_file)) - return active_ebp_list[-1] - -def release_ebuild_processor(ebp): - """the inverse of request_ebuild_processor. Any processor requested via request_ebuild_processor - _must_ be released via this function once it's no longer in use. - this includes fakerooted processors. - Returns True exempting when the processor requested to be released isn't marked as active""" - - global inactive_ebp_list, active_ebp_list - try: active_ebp_list.remove(ebp) - except ValueError: return False - - try: inactive_ebp_list.index(ebp) - except ValueError: - # if it's a fakeroot'd process, we throw it away. it's not useful outside of a chain of calls - if not ebp.onetime(): - inactive_ebp_list.append(ebp) - else: - del ebp - return True - - # if it makes it this far, that means ebp was already in the inactive list. - # which is indicative of an internal fsck up. - import traceback - print "ebp was requested to be free'd, yet it already is claimed inactive _and_ was in the active list" - print "this means somethings horked, badly" - traceback.print_stack() - return False - - - -class ebuild_processor: - """abstraction of a running ebuild.sh instance- the env, functions, etc that ebuilds expect.""" - def __init__(self, ebuild_daemon_path=portage_const.EBUILD_DAEMON_PATH,userpriv=False, sandbox=True, \ - fakeroot=False,save_file=None): - """ebuild_daemon_path shouldn't be fooled with unless the caller knows what they're doing. - sandbox enables a sandboxed processor - userpriv enables a userpriv'd processor - fakeroot enables a fakeroot'd processor- this is a mutually exclusive option to sandbox, and - requires userpriv to be enabled. Violating this will result in nastyness""" - - self.ebd = ebuild_daemon_path - from portage_data import portage_uid, portage_gid - spawn_opts = {} - - if fakeroot and (sandbox or not userpriv): - import traceback - traceback.print_stack() - print "warning, was asking to enable fakeroot but-" - print "sandbox",sandbox,"userpriv",userpriv - print "this isn't valid. bailing" - raise Exception,"cannot initialize with sandbox and fakeroot" - - if userpriv: - self.__userpriv = True - spawn_opts.update({"uid":portage_uid,"gid":portage_gid,"groups":[portage_gid],"umask":002}) - else: - if portage_exec.userpriv_capable: - spawn_opts.update({"gid":portage_gid,"groups":[0,portage_gid]}) - self.__userpriv = False - - # open the pipes to be used for chatting with the new daemon - cread, cwrite = os.pipe() - dread, dwrite = os.pipe() - self.__sandbox = False - self.__fakeroot = False - - # since it's questionable which spawn method we'll use (if sandbox or fakeroot fex), - # we ensure the bashrc is invalid. - env={"BASHRC":"/etc/portage/spork/not/valid/ha/ha"} - args = [] - if sandbox: - if fakeroot: - print "!!! ERROR: fakeroot was on, but sandbox was also on" - sys.exit(1) - self.__sandbox = True - spawn_func = portage_exec.spawn_sandbox - - elif fakeroot: - self.__fakeroot = True - spawn_func = portage_exec.spawn_fakeroot - args.append(save_file) - else: - spawn_func = portage_exec.spawn - - self.pid = spawn_func(self.ebd+" daemonize", fd_pipes={0:0, 1:1, 2:2, 3:cread, 4:dwrite}, - returnpid=True,env=env, *args, **spawn_opts)[0] - - os.close(cread) - os.close(dwrite) - self.ebd_write = os.fdopen(cwrite,"w") - self.ebd_read = os.fdopen(dread,"r") - - # basically a quick "yo" to the daemon - self.write("dude?") - if not self.expect("dude!"): - print "error in server coms, bailing." - raise Exception("expected 'dude!' response from ebd, which wasn't received. likely a bug") - if self.__sandbox: - self.write("sandbox_log?") - self.__sandbox_log = self.read().split()[0] - self.dont_export_vars=self.read().split() - # locking isn't used much, but w/ threading this will matter - self.unlock() - - def sandboxed(self): - """is this instance sandboxed?""" - return self.__sandbox - - def userprived(self): - """is this instance userprived?""" - return self.__userpriv - - def fakerooted(self): - """is this instance fakerooted?""" - return self.__fakeroot - - def onetime(self): - """is this instance going to be discarded after usage; eg is it fakerooted?""" - return self.__fakeroot - - def write(self, string,flush=True): - """talk to running daemon. Disabling flush is useful when dumping large amounts of data - all strings written are automatically \\n terminated""" - if string[-1] == "\n": - self.ebd_write.write(string) - else: - self.ebd_write.write(string +"\n") - if flush: - self.ebd_write.flush() - - def expect(self, want): - """read from the daemon, and return true or false if the returned string is what is expected""" - got=self.ebd_read.readline() - return want==got[:-1] - - def read(self,lines=1): - """read data from the daemon. Shouldn't be called except internally""" - mydata='' - while lines > 0: - mydata += self.ebd_read.readline() - lines -= 1 - return mydata - - def sandbox_summary(self, move_log=False): - """if the instance is sandboxed, print the sandbox access summary""" - if not os.path.exists(self.__sandbox_log): - self.write("end_sandbox_summary") - return 0 - violations=portage_util.grabfile(self.__sandbox_log) - if len(violations)==0: - self.write("end_sandbox_summary") - return 0 - if not move_log: - move_log=self.__sandbox_log - elif move_log != self.__sandbox_log: - myf=open(move_log) - for x in violations: - myf.write(x+"\n") - myf.close() - from output import red - self.ebd_write.write(red("--------------------------- ACCESS VIOLATION SUMMARY ---------------------------")+"\n") - self.ebd_write.write(red("LOG FILE = \"%s\"" % move_log)+"\n\n") - for x in violations: - self.ebd_write.write(x+"\n") - self.write(red("--------------------------------------------------------------------------------")+"\n") - self.write("end_sandbox_summary") - try: - os.remove(self.__sandbox_log) - except (IOError, OSError), e: - print "exception caught when cleansing sandbox_log=%s" % str(e) - return 1 - - def preload_eclasses(self, ec_file): - """this preloades eclasses into a function, thus avoiding the cost of going to disk. - preloading eutils (which is heaviliy inherited) speeds up regen times fex""" - if not os.path.exists(ec_file): - return 1 - self.write("preload_eclass %s" % ec_file) - if self.expect("preload_eclass succeeded"): - self.preloaded_eclasses=True - return True - return False - - def lock(self): - """lock the processor. Currently doesn't block any access, but will""" - self.processing_lock = True - - def unlock(self): - """unlock the processor""" - self.processing_lock = False - - def locked(self): - """is the processor locked?""" - return self.processing_lock - - def is_alive(self): - """returns if it's known if the processor has been shutdown. - Currently doesn't check to ensure the pid is still running, yet it should""" - return self.pid != None - - def shutdown_processor(self): - """tell the daemon to shut itself down, and mark this instance as dead""" - try: - if self.is_alive(): - self.write("shutdown_daemon") - self.ebd_write.close() - self.ebd_read.close() - - # now we wait. - os.waitpid(self.pid,0) - except (IOError,OSError,ValueError): - pass - - # we *really* ought to modify portageatexit so that we can set limits for waitpid. - # currently, this assumes all went well. - # which isn't always true. - self.pid = None - - def set_sandbox_state(self,state): - """tell the daemon whether to enable the sandbox, or disable it""" - if state: - self.write("set_sandbox_state 1") - else: - self.write("set_sandbox_state 0") - - def send_env(self, mysettings): - """essentially transfer the ebuild's desired env to the running daemon - accepts a portage.config instance, although it will accept dicts at some point""" - be=mysettings.bash_environ() - self.write("start_receiving_env\n") - exported_keys = '' - for x in be.keys(): - if x not in self.dont_export_vars: - self.write("%s=%s\n" % (x,be[x]), flush=False) - exported_keys += x+' ' - self.write("export "+exported_keys,flush=False) - self.write("end_receiving_env") - return self.expect("env_received") - - def set_logfile(self,logfile=''): - """relevant only when the daemon is sandbox'd, set the logfile""" - self.write("logging %s" % logfile) - return self.expect("logging_ack") - - - def __del__(self): - """simply attempts to notify the daemon to die""" - # for this to be reached means we ain't in a list no more. - if self.pid: - self.shutdown_processor() - - -class ebuild_handler: - """abstraction of ebuild phases, fetching exported keys, fetching srcs, etc""" - import portageq - def __init__(self, process_limit=5): - """process_limit is currently ignored""" - self.processed = 0 - self.__process_limit = process_limit - self.preloaded_eclasses = False - self.__ebp = None - - def __del__(self): - """only ensures any processors this handler has claimed are released""" - if self.__ebp: - release_ebuild_processor(self.__ebp) - - # this is an implementation of stuart's confcache/sandbox trickery, basically the file/md5 stuff implemented in - # python with a basic bash wrapper that calls back to this. - # all credit for the approach goes to him, as stated, this is just an implementation of it. - # bugs should be thrown at ferringb. - def load_confcache(self,transfer_to,confcache=portage_const.CONFCACHE_FILE, - confcache_list=portage_const.CONFCACHE_LIST): - """verifys a requested conf cache, removing the global cache if it's stale. - The handler should be the only one to call this""" - from portage_checksum import perform_md5 - from output import red - if not self.__ebp: - import traceback - traceback.print_stack() - print "err... no ebp, yet load_confcache called. invalid" - raise Exception,"load_confcache called yet no running processor. bug?" - - valid=True - lock=None - if not os.path.exists(confcache_list): - print "confcache file listing doesn't exist" - valid=False - elif not os.path.exists(confcache): - print "confcache doesn't exist" - valid=False - else: - lock=portage_locks.lockfile(confcache_list,wantnewlockfile=1) - try: - myf=anydbm.open(confcache_list, "r", 0664) - for l in myf.keys(): - # file, md5 - if perform_md5(l,calc_prelink=1) != myf[l]: - print red("***")+" confcache is stale: %s: recorded md5: %s: actual: %s:" % (l,myf[l],perform_md5(l,calc_prelink=1)) - raise Exception("md5 didn't match") - myf.close() - # verify env now. - new_cache=[] - env_vars=[] - - # guessing on THOST. I'm sure it's wrong... - - env_translate={"build_alias":"CBUILD","host_alias":"CHOST","target_alias":"THOST"} - cache=portage_util.grabfile(confcache) - - x=0 - while x < len(cache): - #ac_cv_env - if cache[x][0:10] == "ac_cv_env_": - f=cache[x][10:].find("_set") - if f == -1 or f==11: - cache.pop(x) - continue - env_vars.append(cache[x][10:10 + cache[x][10:].find("_set")]) - x += 1 - else: - new_cache.append(cache[x]) - x += 1 - - for x in env_vars: - self.__ebp.write("request %s" % env_translate.get(x,x)) - line=self.__ebp.read() - if line[-1] == "\n": - line=line[:-1] - new_cache.append("ac_cv_env_%s_set=%s" % (x, line)) - if line == "unset": - new_cache.append("ac_cv_env_%s_value=" % x) - else: - line=self.__ebp.read() - if line[-1] == "\n": - line=line[:-1] - if line.split()[0] != line: - #quoting... XXX - new_cache.append("ac_cv_env_%s_value='%s'" % (x,line)) - else: - new_cache.append("ac_cv_env_%s_value=%s" % (x,line)) - - myf=open(confcache,"w") - for x in new_cache: - myf.write(x+"\n") - myf.close() - - except SystemExit, e: - raise - except Exception,e: - print "caught exception: %s" % str(e) - try: myf.close() - except (IOError, OSError): pass - valid=False - - if not valid: - print "\nconfcache is invalid\n" - try: os.remove(confcache_list) - except OSError: pass - try: os.remove(confcache) - except OSError: pass - self.__ebp.write("empty") - valid=0 - else: - self.__ebp.write("location: %s" % confcache) - valid=1 - if lock: - portage_locks.unlockfile(lock) - return valid - - def update_confcache(self,settings,logfile,new_confcache, confcache=portage_const.CONFCACHE_FILE, \ - confcache_list=portage_const.CONFCACHE_LIST): - """internal function called when a processor has finished a configure, and wishes its cache - be transferred to the global cache - This runs through the sandbox log, storing the md5 of files along with the list of files to check. - Finally, it transfers the cache to the global location.""" - - if not self.__ebp: - import traceback - traceback.print_stack() - print "err... no ebp, yet load_confcache called. invalid" - sys.exit(1) - - import re - from portage_checksum import perform_md5 - if not (os.path.exists(logfile) and os.path.exists(new_confcache)) : - # eh? wth? - self.__ebp.write("failed") - return 0 - myfiles=portage_util.grabfile(logfile) - filter=re.compile('^(%s|/tmp|/dev|.*/\.ccache)/' % os.path.normpath(settings["PORTAGE_TMPDIR"])) - l=[] - for x in myfiles: - # get only read syscalls... - if x[0:8] == "open_rd:": - l.append(x.split()[1]) - - myfiles = portage_util.unique_array(l) - l=[] - for x in myfiles: - if not os.path.exists(x): - continue - if not filter.match(x): - l.append(x) - del myfiles - - if not len(l): - self.__ebp.write("updated") - return 0 - - lock=portage_locks.lockfile(confcache_list,wantnewlockfile=1) - # update phase. - if not os.path.exists(confcache_list): - prevmask=os.umask(0) - myf=anydbm.open(confcache_list,"n",0664) - os.umask(prevmask) - else: - myf=anydbm.open(confcache_list,"w",0664) - - for x in l: - try: - if not stat.S_ISDIR(os.stat(x).st_mode) and not myf.has_key(x): - myf[x]=str(perform_md5(x,calc_prelink=1)) - except (IOError, OSError): - # exceptions are only possibly (ignoring anydbm horkage) from os.stat - pass - myf.close() - from portage_data import portage_gid - os.chown(confcache_list, -1, portage_gid) - shutil.move(new_confcache, confcache) - os.chown(confcache, -1, portage_gid) - m=os.umask(0) - os.chmod(confcache, 0664) - os.chmod(confcache_list, 0664) - os.umask(m) - portage_locks.unlockfile(lock) - self.__ebp.write("updated") - return 0 - - def get_keys(self,myebuild,mysettings,myroot="/"): - """request the auxdbkeys from an ebuild - returns a dict when successful, None when failed""" -# print "getting keys for %s" % myebuild - # normally, - # userpriv'd, minus sandbox. which is odd. - # I say both, personally (and I'm writing it, so live with it) - if self.__ebp: - import traceback - traceback.print_stack() - print "self.__ebp exists. it shouldn't. this indicates a handler w/ an active ebp never" - print "released it, or a bug in the calls" - sys.exit(1) - - - self.__ebp = request_ebuild_processor(userpriv=portage_exec.userpriv_capable) - - if self.__adjust_env("depend",mysettings,myebuild,myroot): - return {} - - self.__ebp.write("process_ebuild depend") - self.__ebp.send_env(mysettings) - self.__ebp.set_sandbox_state(True) - self.__ebp.write("start_processing") - line=self.__generic_phase(["sending_keys"],mysettings,interpret_results=False) - if line != "sending_keys": - return None - mykeys={} - while line != "end_keys": - line=self.__ebp.read() - line=line[:-1] - if line == "failed": - self.__ebp.unlock() - return {} - if line == "end_keys" or not len(line): - continue - pair = line.split('=',1) - mykeys[pair[0]]=pair[1] - self.__ebp.expect("phases succeeded") - if not release_ebuild_processor(self.__ebp): - self.__ebp = None - raise Exception,"crud" - self.__ebp = None - return mykeys - - def __adjust_env(self,mydo,mysettings,myebuild,myroot,debug=0,listonly=0,fetchonly=0,cleanup=0,dbkey=None,\ - use_cache=1,fetchall=0,tree="porttree",use_info_env=True,verbosity=0): - """formerly portage.doebuild, since it's specific to ebuilds, it's now a method of ebuild handling. - severely gutted, and in need of cleansing/exorcism""" - from portage import db,ExtractKernelVersion,fetch,features, \ - digestgen,digestcheck,root,flatten, digestParseFile - from portage_data import portage_uid,portage_gid,secpass - import portage_dep - from portage_util import writemsg - - ebuild_path = os.path.abspath(myebuild) - pkg_dir = os.path.dirname(ebuild_path) - - if mysettings.configdict["pkg"].has_key("CATEGORY"): - cat = mysettings.configdict["pkg"]["CATEGORY"] - else: - cat = os.path.basename(os.path.normpath(pkg_dir+"/..")) - mypv = os.path.basename(ebuild_path)[:-7] - mycpv = cat+"/"+mypv - - mysplit=portage_versions.pkgsplit(mypv,silent=0) - if mysplit==None: - writemsg("!!! Error: PF is null '%s'; exiting.\n" % mypv) - return 1 - - if mydo == "clean": - cleanup=True - - if mydo != "depend": - # XXX: We're doing a little hack here to curtain the gvisible locking - # XXX: that creates a deadlock... Really need to isolate that. - mysettings.reset(use_cache=use_cache) - - mysettings.setcpv(mycpv,use_cache=use_cache) - - if not os.path.exists(myebuild): - writemsg("!!! doebuild: "+str(myebuild)+" not found for "+str(mydo)+"\n") - return 1 - - if debug: # Otherwise it overrides emerge's settings. - # We have no other way to set debug... debug can't be passed in - # due to how it's coded... Don't overwrite this so we can use it. - mysettings["PORTAGE_DEBUG"]=str(debug) - - mysettings["ROOT"] = myroot - - mysettings["EBUILD"] = ebuild_path - mysettings["O"] = pkg_dir - mysettings["CATEGORY"] = cat - mysettings["FILESDIR"] = pkg_dir+"/files" - mysettings["PF"] = mypv - - mysettings["ECLASSDIR"] = mysettings["PORTDIR"]+"/eclass" - - mysettings["PROFILE_PATHS"] = PROFILE_PATH+"\n"+CUSTOM_PROFILE_PATH - mysettings["P"] = mysplit[0]+"-"+mysplit[1] - mysettings["PN"] = mysplit[0] - mysettings["PV"] = mysplit[1] - mysettings["PR"] = mysplit[2] - - # ensure this is set for all phases, setup included. - # Should be ok again to set $T, as sandbox does not depend on it - mysettings["BUILD_PREFIX"] = mysettings["PORTAGE_TMPDIR"]+"/portage" - mysettings["PORTAGE_BUILDDIR"] = mysettings["BUILD_PREFIX"]+"/"+mysettings["PF"] - mysettings["T"] = mysettings["PORTAGE_BUILDDIR"]+"/temp" - mysettings["WORKDIR"] = mysettings["PORTAGE_BUILDDIR"]+"/work" - mysettings["D"] = mysettings["PORTAGE_BUILDDIR"]+"/image/" - - - # bailing now, probably horks a few things up, but neh. - # got to break a few eggs to make an omelot after all (spelling is wrong, too) :) - if mydo=="unmerge": - return 0 - - if mydo!="depend": - try: - mysettings["INHERITED"],mysettings["RESTRICT"] = db[root][tree].dbapi.aux_get( - mycpv,["INHERITED","RESTRICT"]) - - mysettings["PORTAGE_RESTRICT"]=string.join(flatten(portage_dep.use_reduce( - portage_dep.paren_reduce(mysettings["RESTRICT"]), - uselist=mysettings["USE"].split() )),' ') - - except SystemExit, e: - raise - except Exception, e: - print "caught exception %s in ebd_proc:doebuild" % str(e) - mysettings["RESTRICT"] = mysettings["PORTAGE_RESTRICT"] = "" - pass - - - if mysplit[2] == "r0": - mysettings["PVR"]=mysplit[1] - else: - mysettings["PVR"]=mysplit[1]+"-"+mysplit[2] - - mysettings["SLOT"]="" - - if mysettings.has_key("PATH"): - mysplit=string.split(mysettings["PATH"],":") - else: - mysplit=[] - - if PORTAGE_BIN_PATH not in mysplit: - mysettings["PATH"]=PORTAGE_BIN_PATH+":"+mysettings["PATH"] - - if tree=="bintree": - mysettings["BUILD_PREFIX"] += "-pkg" - - mysettings["HOME"] = mysettings["BUILD_PREFIX"]+"/homedir" - mysettings["PKG_TMPDIR"] = mysettings["PORTAGE_TMPDIR"]+"/binpkgs" - - if cleanup and os.path.exists(mysettings["PORTAGE_BUILDDIR"]): - print "cleansing builddir"+mysettings["PORTAGE_BUILDDIR"] - shutil.rmtree(mysettings["PORTAGE_BUILDDIR"]) - - if mydo=="clean": - # if clean, just flat out skip the rest of this crap. - return 0 - - mysettings["PORTAGE_BASHRC"] = EBUILD_SH_ENV_FILE - - #set up KV variable -- DEP SPEEDUP :: Don't waste time. Keep var persistent. - - if mydo not in ["depend","fetch","digest","manifest"]: - if not mysettings.has_key("KV"): - mykv,err1=ExtractKernelVersion(root+"usr/src/linux") - if mykv: - # Regular source tree - mysettings["KV"]=mykv - else: - mysettings["KV"]="" - - if (mydo!="depend") or not mysettings.has_key("KVERS"): - myso=os.uname()[2] - mysettings["KVERS"]=myso[1] - - - # get possible slot information from the deps file - if mydo=="depend": - if mysettings.has_key("PORTAGE_DEBUG") and mysettings["PORTAGE_DEBUG"]=="1": - # XXX: This needs to use a FD for saving the output into a file. - # XXX: Set this up through spawn - pass - writemsg("!!! DEBUG: dbkey: %s\n" % str(dbkey),2) - if dbkey: - mysettings["dbkey"] = dbkey - else: - mysettings["dbkey"] = mysettings.depcachedir+"/aux_db_key_temp" - - return 0 - - mysettings["PORTAGE_LOGFILE"]='' - logfile=None - - - #fetch/digest crap - if mydo not in ["prerm","postrm","preinst","postinst","config","help","setup","unmerge"]: - - newuris, alist = db["/"]["porttree"].dbapi.getfetchlist(mycpv,mysettings=mysettings) - alluris, aalist = db["/"]["porttree"].dbapi.getfetchlist(mycpv,mysettings=mysettings,all=1) - mysettings["A"]=string.join(alist," ") - mysettings["AA"]=string.join(aalist," ") - if ("mirror" in features) or fetchall: - fetchme=alluris[:] - checkme=aalist[:] - elif mydo=="digest": - fetchme=alluris[:] - checkme=aalist[:] - digestfn=mysettings["FILESDIR"]+"/digest-"+mysettings["PF"] - if os.path.exists(digestfn): - mydigests=digestParseFile(digestfn) - if mydigests: - for x in mydigests: - while x in checkme: - i = checkme.index(x) - del fetchme[i] - del checkme[i] - else: - fetchme=newuris[:] - checkme=alist[:] - - try: - if not os.path.exists(mysettings["DISTDIR"]): - os.makedirs(mysettings["DISTDIR"]) - if not os.path.exists(mysettings["DISTDIR"]+"/cvs-src"): - os.makedirs(mysettings["DISTDIR"]+"/cvs-src") - except OSError, e: - print "!!! File system problem. (Bad Symlink?)" - print "!!! Fetching may fail:",str(e) - - try: - mystat=os.stat(mysettings["DISTDIR"]+"/cvs-src") - if ((mystat[stat.ST_GID]!=portage_gid) or ((mystat[stat.ST_MODE]&00775)!=00775)) and not listonly: - print "*** Adjusting cvs-src permissions for portage user..." - os.chown(mysettings["DISTDIR"]+"/cvs-src",0,portage_gid) - os.chmod(mysettings["DISTDIR"]+"/cvs-src",00775) - portage_exec.spawn("chgrp -R "+str(portage_gid)+" "+mysettings["DISTDIR"]+"/cvs-src") - portage_exec.spawn("chmod -R g+rw "+mysettings["DISTDIR"]+"/cvs-src") - except (IOError, OSError): - pass - - if not fetch(fetchme, mysettings, listonly=listonly, fetchonly=fetchonly,verbosity=verbosity): - return 1 - - if mydo=="fetch" and listonly: - return 0 - - if "digest" in features: - #generate digest if it doesn't exist. - if mydo=="digest": - # exemption to the return rule - return (not digestgen(aalist,mysettings,overwrite=1,verbosity=verbosity)) - else: - digestgen(aalist,mysettings,overwrite=0,verbosity=verbosity) - - elif mydo=="digest": - #since we are calling "digest" directly, recreate the digest even if it already exists - return (not digestgen(aalist,mysettings,overwrite=1,verbosity=verbosity)) - if mydo=="manifest": - return (not digestgen(aalist,mysettings,overwrite=1,manifestonly=1,verbosity=verbosity)) - - if mydo=="fetch" or mydo=="unpack": - if not digestcheck(checkme, mysettings, ("strict" in features),verbosity=verbosity): - return 1 - - if mydo=="fetch": - return 0 - - if not os.path.exists(mysettings["BUILD_PREFIX"]): - os.makedirs(mysettings["BUILD_PREFIX"]) - os.chown(mysettings["BUILD_PREFIX"],portage_uid,portage_gid) - os.chmod(mysettings["BUILD_PREFIX"],00775) - - if not os.path.exists(mysettings["T"]): - print "creating temp dir" - os.makedirs(mysettings["T"]) - os.chown(mysettings["T"],portage_uid,portage_gid) - os.chmod(mysettings["T"],0770) - - logdir = mysettings["T"]+"/logging" - if not os.path.exists(logdir): - os.makedirs(logdir) - os.chown(logdir, portage_uid, portage_gid) - os.chmod(logdir, 0770) - - try: - #XXX: negative restrict - myrestrict = mysettings["PORTAGE_RESTRICT"].split() - if ("nouserpriv" not in myrestrict and "userpriv" not in myrestrict): - if ("userpriv" in mysettings.features) and (portage_uid and portage_gid): - if (secpass==2): - if os.path.exists(mysettings["HOME"]): - # XXX: Potentially bad, but held down by HOME replacement above. - portage_exec.spawn("rm -Rf "+mysettings["HOME"]) - if not os.path.exists(mysettings["HOME"]): - os.makedirs(mysettings["HOME"]) - elif ("userpriv" in features): - print "!!! Disabling userpriv from features... Portage UID/GID not valid." - del features[features.index("userpriv")] - except (IOError, OSError), e: - print "!!! Couldn't empty HOME:",mysettings["HOME"] - print "!!!",e - - - try: - # no reason to check for depend since depend returns above. - if not os.path.exists(mysettings["BUILD_PREFIX"]): - os.makedirs(mysettings["BUILD_PREFIX"]) - os.chown(mysettings["BUILD_PREFIX"],portage_uid,portage_gid) - if not os.path.exists(mysettings["PORTAGE_BUILDDIR"]): - os.makedirs(mysettings["PORTAGE_BUILDDIR"]) - os.chown(mysettings["PORTAGE_BUILDDIR"],portage_uid,portage_gid) - - - except OSError, e: - print "!!! File system problem. (ReadOnly? Out of space?)" - print "!!! Perhaps: rm -Rf",mysettings["BUILD_PREFIX"] - print "!!!",str(e) - return 1 - - try: - if not os.path.exists(mysettings["HOME"]): - os.makedirs(mysettings["HOME"]) - os.chown(mysettings["HOME"],portage_uid,portage_gid) - os.chmod(mysettings["HOME"],02770) - - except OSError, e: - print "!!! File system problem. (ReadOnly? Out of space?)" - print "!!! Failed to create fake home directory in PORTAGE_BUILDDIR" - print "!!!",str(e) - return 1 - - try: - if ("userpriv" in features) and ("ccache" in features): - if (not mysettings.has_key("CCACHE_DIR")) or (mysettings["CCACHE_DIR"]==""): - mysettings["CCACHE_DIR"]=mysettings["PORTAGE_TMPDIR"]+"/ccache" - if not os.path.exists(mysettings["CCACHE_DIR"]): - os.makedirs(mysettings["CCACHE_DIR"]) - os.chown(mysettings["CCACHE_DIR"],portage_uid,portage_gid) - os.chmod(mysettings["CCACHE_DIR"],0775) - except OSError, e: - print "!!! File system problem. (ReadOnly? Out of space?)" - print "!!! Perhaps: rm -Rf",mysettings["BUILD_PREFIX"] - print "!!!",str(e) - return 1 - - try: - mystat=os.stat(mysettings["CCACHE_DIR"]) - if (mystat[stat.ST_GID]!=portage_gid) or ((mystat[stat.ST_MODE]&02070)!=02070): - print "*** Adjusting ccache permissions for portage user..." - os.chown(mysettings["CCACHE_DIR"],portage_uid,portage_gid) - os.chmod(mysettings["CCACHE_DIR"],02770) - portage_exec.spawn("chown -R "+str(portage_uid)+":"+str(portage_gid)+" "+mysettings["CCACHE_DIR"]) - portage_exec.spawn("chmod -R g+rw "+mysettings["CCACHE_DIR"]) - except (OSError, IOError): - pass - - if "distcc" in features: - try: - if (not mysettings.has_key("DISTCC_DIR")) or (mysettings["DISTCC_DIR"]==""): - mysettings["DISTCC_DIR"]=mysettings["PORTAGE_TMPDIR"]+"/portage/.distcc" - if not os.path.exists(mysettings["DISTCC_DIR"]): - os.makedirs(mysettings["DISTCC_DIR"]) - os.chown(mysettings["DISTCC_DIR"],portage_uid,portage_gid) - os.chmod(mysettings["DISTCC_DIR"],02775) - for x in ("/lock", "/state"): - if not os.path.exists(mysettings["DISTCC_DIR"]+x): - os.mkdir(mysettings["DISTCC_DIR"]+x) - os.chown(mysettings["DISTCC_DIR"]+x,portage_uid,portage_gid) - os.chmod(mysettings["DISTCC_DIR"]+x,02775) - except OSError, e: - writemsg("\n!!! File system problem when setting DISTCC_DIR directory permissions.\n") - writemsg( "!!! DISTCC_DIR="+str(mysettings["DISTCC_DIR"]+"\n")) - writemsg( "!!! "+str(e)+"\n\n") - time.sleep(5) - features.remove("distcc") - mysettings["DISTCC_DIR"]="" - - # break off into process_phase - if mysettings.has_key("PORT_LOGDIR"): - try: - st=os.stat(mysettings["PORT_LOGDIR"]) - if not st.st_gid == portage_gid: - os.chown(mysettings["PORT_LOGDIR"], -1, portage_gid) - if not st.st_mode & (os.W_OK << 3): - os.chmod(mysettings["PORT_LOGDIR"], st.st_mode | (os.W_OK << 3)) - # by this time, we have write access to the logdir. or it's bailed. - try: - os.chown(mysettings["BUILD_PREFIX"],portage_uid,portage_gid) - os.chmod(mysettings["PORT_LOGDIR"],00770) - if not mysettings.has_key("LOG_PF") or (mysettings["LOG_PF"] != mysettings["PF"]): - mysettings["LOG_PF"]=mysettings["PF"] - mysettings["LOG_COUNTER"]=str(db[myroot]["vartree"].dbapi.get_counter_tick_core("/")) - mysettings["PORTAGE_LOGFILE"]="%s/%s-%s.log" % (mysettings["PORT_LOGDIR"],mysettings["LOG_COUNTER"],mysettings["LOG_PF"]) - if os.path.exists(mysettings["PORTAGE_LOGFILE"]): - os.chmod(mysettings["PORTAGE_LOGFILE"], 0664) - os.chown(mysettings["PORTAGE_LOGFILE"], -1,portage_gid) - except ValueError, e: - mysettings["PORT_LOGDIR"]="" - print "!!! Unable to chown/chmod PORT_LOGDIR. Disabling logging." - print "!!!",e - except (OSError, IOError): - print "!!! Cannot create log... No write access / Does not exist" - print "!!! PORT_LOGDIR:",mysettings["PORT_LOGDIR"] - mysettings["PORT_LOGDIR"]="" - - # if any of these are being called, handle them -- running them out of the sandbox -- and stop now. - if mydo in ["help","setup"]: - return 0 -# return spawn(EBUILD_SH_BINARY+" "+mydo,mysettings,debug=debug,free=1,logfile=logfile) - elif mydo in ["prerm","postrm","preinst","postinst","config"]: - mysettings.load_infodir(pkg_dir) - if not use_info_env: - print "overloading port_env_file setting to %s" % mysettings["T"]+"/environment" - mysettings["PORT_ENV_FILE"] = mysettings["T"] + "/environment" - if not os.path.exists(mysettings["PORT_ENV_FILE"]): - from output import red - print red("!!!")+" err.. it doesn't exist. that's bad." - sys.exit(1) - return 0 -# return spawn(EBUILD_SH_BINARY+" "+mydo,mysettings,debug=debug,free=1,logfile=logfile) - - try: - mysettings["SLOT"], mysettings["RESTRICT"] = db["/"]["porttree"].dbapi.aux_get(mycpv,["SLOT","RESTRICT"]) - except (IOError,KeyError): - print red("doebuild():")+" aux_get() error reading "+mycpv+"; aborting." - sys.exit(1) - - #initial dep checks complete; time to process main commands - - nosandbox=(("userpriv" in features) and ("usersandbox" not in features)) - actionmap={ - "depend": { "args":(0,1)}, # sandbox / portage - "setup": { "args":(1,0)}, # without / root - "unpack": {"dep":"setup", "args":(0,1)}, # sandbox / portage - "compile": {"dep":"unpack", "args":(nosandbox,1)}, # optional / portage - "test": {"dep":"compile", "args":(nosandbox,1)}, # optional / portage - "install": {"dep":"test", "args":(0,0)}, # sandbox / root - "rpm": {"dep":"install", "args":(0,0)}, # sandbox / root - "package": {"dep":"install", "args":(0,0)}, # sandbox / root - } - - if mydo in actionmap.keys(): - if mydo=="package": - for x in ["","/"+mysettings["CATEGORY"],"/All"]: - if not os.path.exists(mysettings["PKGDIR"]+x): - os.makedirs(mysettings["PKGDIR"]+x) - # REBUILD CODE FOR TBZ2 --- XXXX - return 0 -# return spawnebuild(mydo,actionmap,mysettings,debug,logfile=logfile) - elif mydo=="qmerge": - #check to ensure install was run. this *only* pops up when users forget it and are using ebuild - bail=False - if not os.path.exists(mysettings["PORTAGE_BUILDDIR"]+"/.completed_stages"): - bail=True - else: - myf=open(mysettings["PORTAGE_BUILDDIR"]+"/.completed_stages") - myd=myf.readlines() - myf.close() - if len(myd) == 0: - bail = True - else: - bail = ("install" not in myd[0].split()) - if bail: - print "!!! mydo=qmerge, but install phase hasn't been ran" - sys.exit(1) - - #qmerge is specifically not supposed to do a runtime dep check - return 0 -# return merge(mysettings["CATEGORY"],mysettings["PF"],mysettings["D"],mysettings["PORTAGE_BUILDDIR"]+"/build-info",myroot,mysettings) - elif mydo=="merge": - return 0 -# retval=spawnebuild("install",actionmap,mysettings,debug,alwaysdep=1,logfile=logfile) - if retval: - return retval - -# return merge(mysettings["CATEGORY"],mysettings["PF"],mysettings["D"],mysettings["PORTAGE_BUILDDIR"]+"/build-info",myroot,mysettings,myebuild=mysettings["EBUILD"]) - else: - print "!!! Unknown mydo:",mydo - sys.exit(1) - - # phases - # my... god... this... is... ugly. - # we're talking red headed step child of medusa ugly here. - - def process_phase(self,phase,mysettings,myebuild,myroot,allstages=False,**keywords): - """the public 'doebuild' interface- all phases are called here, along w/ a valid config - allstages is the equivalent of 'do merge, and all needed phases to get to it' - **keywords is options passed on to __adjust_env. It will be removed as __adjust_env is digested""" - from portage import merge,unmerge,features - - validcommands = ["help","clean","prerm","postrm","preinst","postinst", - "config","setup","depend","fetch","digest", - "unpack","compile","test","install","rpm","qmerge","merge", - "package","unmerge", "manifest"] - - if phase not in validcommands: - validcommands.sort() - writemsg("!!! doebuild: '%s' is not one of the following valid commands:" % phase) - for vcount in range(len(validcommands)): - if vcount%6 == 0: - writemsg("\n!!! ") - writemsg(string.ljust(validcommands[vcount], 11)) - writemsg("\n") - return 1 - - retval=self.__adjust_env(phase,mysettings,myebuild,myroot,**keywords) - if retval: - return retval - - if "userpriv" in features: - sandbox = ("usersandbox" in features) - else: - sandbox = ("sandbox" in features) - - droppriv=(("userpriv" in features) and \ - ("nouserpriv" not in string.split(mysettings["PORTAGE_RESTRICT"])) and portage_exec.userpriv_capable) - use_fakeroot=(("userpriv_fakeroot" in features) and droppriv and portage_exec.fakeroot_capable) - - # basically a nasty graph of 'w/ this phase, have it userprived/sandboxed/fakeroot', and run - # these phases prior - actionmap={ - "depend": { "sandbox":False, "userpriv":True, "fakeroot":False}, - "setup": { "sandbox":True, "userpriv":False, "fakeroot":False}, - "unpack": {"dep":"setup", "sandbox":sandbox, "userpriv":True, "fakeroot":False}, - "compile": {"dep":"unpack", "sandbox":sandbox,"userpriv":True, "fakeroot":False}, - "test": {"dep":"compile","sandbox":sandbox,"userpriv":True, "fakeroot":False}, - "install": {"dep":"test", "sandbox":(not use_fakeroot or (not use_fakeroot and sandbox)), - "userpriv":use_fakeroot,"fakeroot":use_fakeroot}, - "rpm": {"dep":"install","sandbox":False, "userpriv":use_fakeroot, "fakeroot":use_fakeroot}, - "package": {"dep":"install", "sandbox":False, "userpriv":use_fakeroot, "fakeroot":use_fakeroot}, - "merge" : {"dep":"install", "sandbox":True, "userpriv":False, "fakeroot":False} - } - - merging=False - # this shouldn't technically ever be called, get_keys exists for this. - # left in for compatability while portage.doebuild still exists - if phase=="depend": - return retval - elif phase=="unmerge": - return unmerge(mysettings["CATEGORY"],mysettings["PF"],myroot,mysettings) - elif phase in ["fetch","digest","manifest","clean"]: - return retval - elif phase=="merge": - merging=True - elif phase=="qmerge": - #no phases ran. - phase="merge" - merging=True -# return merge(mysettings["CATEGORY"],mysettings["PF"],mysettings["D"],mysettings["PORTAGE_BUILDDIR"]+"/build-info",myroot,\ -# mysettings) - - elif phase in ["help","clean","prerm","postrm","preinst","postinst","config"]: - self.__ebp = request_ebuild_processor(userpriv=False) - self.__ebp.write("process_ebuild %s" % phase) - self.__ebp.send_env(mysettings) - self.__ebp.set_sandbox_state(phase in ["help","clean"]) - self.__ebp.write("start_processing") - retval = self.__generic_phase([],mysettings) - release_ebuild_processor(self.__ebp) - self.__ebp = None - return not retval - - k=phase - # represent the phases to run, grouping each phase based upon if it's sandboxed, fakerooted, and userpriv'd - # ugly at a glance, but remember a processor can run multiple phases now. - # best to not be wasteful in terms of env saving/restoring, and just run all applicable phases in one shot - phases=[[[phase]]] - sandboxed=[[actionmap[phase]["sandbox"]]] - privs=[(actionmap[phase]["userpriv"],actionmap[phase]["fakeroot"])] - - if allstages: - while actionmap[k].has_key("dep"): - k=actionmap[k]["dep"] - if actionmap[k]["userpriv"] != privs[-1][0] or actionmap[k]["fakeroot"] != privs[-1][1]: - phases.append([[k]]) - sandboxed.append([actionmap[k]["sandbox"]]) - privs.append((actionmap[k]["userpriv"],actionmap[k]["fakeroot"])) - elif actionmap[k]["sandbox"] != sandboxed[-1][-1]: - phases[-1].append([k]) - sandboxed[-1].extend([actionmap[k]["sandbox"]]) - else: - phases[-1][-1].append(k) - privs.reverse() - phases.reverse() - sandboxed.reverse() - for x in phases: - for y in x: - y.reverse() - x.reverse() - # and now we have our phases grouped in parallel to the sandbox/userpriv/fakeroot state. - - all_phases = portage_util.flatten(phases) - -# print "all_phases=",all_phases -# print "phases=",phases -# print "sandbox=",sandboxed -# print "privs=",privs -# sys.exit(1) -# print "\n\ndroppriv=",droppriv,"use_fakeroot=",use_fakeroot,"\n\n" - - #temporary hack until sandbox + fakeroot (if ever) play nice. - while privs: - if self.__ebp == None or (droppriv and self.__ebp.userprived() != privs[0][0]) or \ - (use_fakeroot and self.__ebp.fakerooted() != privs[0][1]): - if self.__ebp != None: - print "swapping processors for",phases[0][0] - release_ebuild_processor(self.__ebp) - self.__ebp = None - opts={} - - #only engage fakeroot when userpriv'd - if use_fakeroot and privs[0][1]: - opts["save_file"] = mysettings["T"]+"/fakeroot_db" - - self.__ebp = request_ebuild_processor(userpriv=(privs[0][0] and droppriv), \ - fakeroot=(privs[0][1] and use_fakeroot), \ - - sandbox=(not (privs[0][1] and use_fakeroot) and portage_exec.sandbox_capable),**opts) - - #loop through the instances where the processor must have the same sandboxed state- - #note a sandbox'd process can have it's sandbox disabled. - #this seperation is needed since you can't mix sandbox and fakeroot atm. - for sandbox in sandboxed[0]: - if "merge" in phases[0][0]: - if len(phases[0][0]) == 1: - print "skipping this phase, it's just merge" - continue - phases[0][0].remove("merge") - - self.__ebp.write("process_ebuild %s" % string.join(phases[0][0]," ")) - self.__ebp.send_env(mysettings) - self.__ebp.set_sandbox_state(sandbox) - self.__ebp.write("start_processing") - phases[0].pop(0) - retval = not self.__generic_phase([],mysettings) - if retval: - release_ebuild_processor(self.__ebp) - self.__ebp = None - return retval - sandboxed.pop(0) - privs.pop(0) - phases.pop(0) - # hey hey. we're done. Now give it back. - release_ebuild_processor(self.__ebp) - self.__ebp = None - - # packaging moved out of ebuild.sh, and into this code. - # makes it so ebuild.sh no longer must run as root for the package phase. - if "package" in all_phases: - print "processing package" - #mv "${PF}.tbz2" "${PKGDIR}/All" - if not os.path.exists(mysettings["PKGDIR"]+"/All"): - os.makedirs(mysettings["PKGDIR"]+"/All") - if not os.path.exists(mysettings["PKGDIR"]+"/"+mysettings["CATEGORY"]): - os.makedirs(mysettings["PKGDIR"]+"/"+mysettings["CATEGORY"]) - if os.path.exists("%s/All/%s.tbz2" % (mysettings["PKGDIR"],mysettings["PF"])): - os.remove("%s/All/%s.tbz2" % (mysettings["PKGDIR"],mysettings["PF"])) - retval = not portage_util.movefile("%s/%s.tbz2" % (mysettings["PORTAGE_BUILDDIR"],mysettings["PF"]), - mysettings["PKGDIR"]+"/All/"+mysettings["PF"]+".tbz2") > 0 - if retval: return False - if os.path.exists("%s/%s/%s.tbz2" % (mysettings["PKGDIR"],mysettings["CATEGORY"],mysettings["PF"])): - os.remove("%s/%s/%s.tbz2" % (mysettings["PKGDIR"],mysettings["CATEGORY"],mysettings["PF"])) - os.symlink("%s/All/%s.tbz2" % (mysettings["PKGDIR"],mysettings["PF"]), - "%s/%s/%s.tbz2" % (mysettings["PKGDIR"],mysettings["CATEGORY"],mysettings["PF"])) - - #same as the package phase above, removes the root requirement for the rpm phase. - if "rpm" in all_phases: - rpm_name="%s-%s-%s" % (mysettings["PN"],mysettings["PV"],mysettings["PR"]) - - retval = not portage_util.movefile("%s/%s.tar.gz" % (mysettings["T"],mysettings["PF"]), - "/usr/src/redhat/SOURCES/%s.tar.gz" % mysettings["PF"]) > 0 - if retval: - print "moving src for rpm failed, retval=",retval - return False - - retval=portage_exec.spawn(("rpmbuild","-bb","%s/%s.spec" % \ - (mysettings["PORTAGE_BUILDDIR"],mysettings["PF"]))) - if retval: - print "Failed to integrate rpm spec file" - return retval - - if not os.path.exists(mysettings["RPMDIR"]+"/"+mysettings["CATEGORY"]): - os.makedirs(mysettings["RPMDIR"]+"/"+mysettings["CATEGORY"]) - - retval = not portage_util.movefile("/usr/src/redhat/RPMS/i386/%s.i386.rpm" % rpm_name, - "%s/%s/%s.rpm" % (mysettings["RPMDIR"],mysettings["CATEGORY"],rpm_name)) > 0 - if retval: - print "rpm failed" - return retval - - - # not great check, but it works. - # basically, if FEATURES="-buildpkg" emerge package was called, the files in the current - # image directory don't have their actual perms. so we use an ugly bit of bash - # to make the fakeroot (claimed) permissions/owners a reality. - if use_fakeroot and os.path.exists(mysettings["T"]+"/fakeroot_db") and merging: - print "correcting fakeroot privs" - retval=portage_exec.spawn(("/usr/lib/portage/bin/affect-fakeroot-perms.sh", \ - mysettings["T"]+"/fakeroot_db", \ - mysettings["D"]),env={"BASHRC":portage_const.INVALID_ENV_FILE}) - if retval or retval == None: - print red("!!!")+"affecting fakeroot perms after the fact failed" - return retval - - if merging: - print "processing merge" - retval = merge(mysettings["CATEGORY"],mysettings["PF"],mysettings["D"],mysettings["PORTAGE_BUILDDIR"]+"/build-info",myroot,\ - mysettings,myebuild=mysettings["EBUILD"]) - return retval - - # this basically handles all hijacks from the daemon, whether confcache or portageq. - def __generic_phase(self,breakers,mysettings,interpret_results=True): - """internal function that responds to the running ebuild processor's requests - this enables portageq hijack, sandbox summaries, confcache among other things - interpret_results controls whether this returns true/false, or the string the - processor spoke that caused this to release control - breaks is list of strings that cause this loop/interpretter to relinquish control""" - b = breakers[:] - b.extend(["prob","phases failed","phases succeeded","env_receiving_failed"]) - line='' - while line not in b: - line=self.__ebp.read() - line=line[:-1] - - if line[0:23] == "request_sandbox_summary": - self.__ebp.sandbox_summary(line[24:]) - elif line[0:17] == "request_confcache": - self.load_confcache(line[18:]) - elif line[0:16] == "update_confcache": - k=line[17:].split() - # sandbox_debug_log, local_cache - self.update_confcache(mysettings,k[0],k[1]) - elif line[0:8] == "portageq": - keys=line[8:].split() - try: - e,s=getattr(self.portageq,keys[0])(keys[1:]) - except SystemExit, e: - raise - except Exception, ex: - sys.stderr.write("caught exception %s\n" % str(ex)) - e=2 - s="ERROR: insufficient paramters!" - self.__ebp.write("return_code="+str(e)) - if len(s): - self.__ebp.write(s) - self.__ebp.write("stop_text") - self.processed += 1 - if interpret_results: - return (line=="phases succeeded") - return line - diff --git a/pym/eclass_cache.py b/pym/eclass_cache.py deleted file mode 100644 index 4c755a7..0000000 --- a/pym/eclass_cache.py +++ /dev/null @@ -1,72 +0,0 @@ -from portage_util import writemsg -import portage_file -import os, sys -from portage_data import portage_gid - -class cache: - """ - Maintains the cache information about eclasses used in ebuild. - """ - def __init__(self,porttree_root,overlays=[]): - self.porttree_root = porttree_root - - self.eclasses = {} # {"Name": ("location","_mtime_")} - - # screw with the porttree ordering, w/out having bash inherit match it, and I'll hurt you. - # ~harring - self.porttrees = [self.porttree_root]+overlays - self.porttrees = tuple(map(portage_file.normpath, self.porttrees)) - self._master_eclass_root = os.path.join(self.porttrees[0],"eclass") - self.update_eclasses() - - def close_caches(self): - import traceback - traceback.print_stack() - print "%s close_cache is deprecated" % self.__class__ - self.eclasses.clear() - - def flush_cache(self): - import traceback - traceback.print_stack() - print "%s flush_cache is deprecated" % self.__class__ - - self.update_eclasses() - - def update_eclasses(self): - self.eclasses = {} - eclass_len = len(".eclass") - for x in [portage_file.normpath(os.path.join(y,"eclass")) for y in self.porttrees]: - if not os.path.isdir(x): - continue - for y in [y for y in os.listdir(x) if y.endswith(".eclass")]: - try: - mtime=os.stat(x+"/"+y).st_mtime - except OSError: - continue - ys=y[:-eclass_len] - self.eclasses[ys] = (x, long(mtime)) - - def is_eclass_data_valid(self, ec_dict): -# print "checking", ec_dict - if not isinstance(ec_dict, dict): - return False - for eclass, tup in ec_dict.iteritems(): - if eclass not in self.eclasses or tuple(tup) != self.eclasses[eclass]: -# print "failed" - return False - - return True - - def get_eclass_data(self, inherits, from_master_only=False): - ec_dict = {} - for x in inherits: - try: - ec_dict[x] = self.eclasses[x] - except: - print "ec=",ec_dict - print "inherits=",inherits - raise - if from_master_only and self.eclasses[x][0] != self._master_eclass_root: - return None - - return ec_dict diff --git a/pym/elog_modules/.gitignore b/pym/elog_modules/.gitignore deleted file mode 100644 index 52e4e61..0000000 --- a/pym/elog_modules/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -*.pyc -*.pyo diff --git a/pym/elog_modules/__init__.py b/pym/elog_modules/__init__.py deleted file mode 100644 index e69de29..0000000 --- a/pym/elog_modules/__init__.py +++ /dev/null diff --git a/pym/elog_modules/mod_custom.py b/pym/elog_modules/mod_custom.py deleted file mode 100644 index 5492b82..0000000 --- a/pym/elog_modules/mod_custom.py +++ /dev/null @@ -1,16 +0,0 @@ -import elog_modules.mod_save, portage_exec, portage_exception - -def process(mysettings, cpv, logentries, fulltext): - elog_modules.mod_save.process(mysettings, cpv, logentries, fulltext) - - if (not "PORTAGE_LOG_COMMAND" in mysettings.keys()) \ - or len(mysettings["PORTAGE_LOG_COMMAND"]) == 0: - raise portage_exception.MissingParameter("!!! Custom logging requested but PORTAGE_LOG_COMMAND is not defined") - else: - mylogcmd = mysettings["PORTAGE_LOG_COMMAND"] - mylogcmd.replace("${LOGFILE}", elogfilename) - mylogcmd.replace("${PACKAGE}", cpv) - retval = portage_exec.spawn_bash(mylogcmd) - if retval != 0: - raise portage_exception.PortageException("!!! PORTAGE_LOG_COMMAND failed with exitcode %d" % retval) - return diff --git a/pym/elog_modules/mod_mail.py b/pym/elog_modules/mod_mail.py deleted file mode 100644 index 9528e30..0000000 --- a/pym/elog_modules/mod_mail.py +++ /dev/null @@ -1,54 +0,0 @@ -import smtplib, email.Message, socket - -def process(mysettings, cpv, logentries, fulltext): - mymailhost = "localhost" - mymailport = 25 - mymailuser = "" - mymailpasswd = "" - myrecipient = "root@localhost" - - # Syntax for PORTAGE_LOG_MAILURI (if defined): - # adress [[user:passwd@]mailserver[:port]] - # where adress: recipient adress - # user: username for smtp auth (defaults to none) - # passwd: password for smtp auth (defaults to none) - # mailserver: smtp server that should be used to deliver the mail (defaults to localhost) - # port: port to use on the given smtp server (defaults to 25, values > 100000 indicate that starttls should be used on (port-100000)) - if "PORTAGE_LOG_MAILURI" in mysettings.keys(): - if " " in mysettings["PORTAGE_LOG_MAILURI"]: - myrecipient, mymailuri = mysettings["PORTAGE_LOG_MAILURI"].split() - if "@" in mymailuri: - myauthdata, myconndata = mymailuri.split("@") - try: - mymailuser,mymailpasswd = myauthdata.split(":") - except ValueError: - print "!!! invalid SMTP AUTH configuration, trying unauthenticated ..." - else: - myconndata = mymailuri - if ":" in myconndata: - mymailhost,mymailport = myconndata.split(":") - else: - mymailhost = myconndata - else: - myrecipient = mysettings["PORTAGE_LOG_MAILURI"] - try: - mymessage = email.Message.Message() - mymessage.set_unixfrom("portage") - mymessage.set_payload(fulltext) - mymessage["To"] = myrecipient - mymessage["Subject"] = "[portage] Ebuild log for %s" % cpv - - if int(mymailport) > 100000: - myconn = smtplib.SMTP(mymailhost, int(mymailport) - 100000) - myconn.starttls() - else: - myconn = smtplib.SMTP(mymailhost, mymailport) - if mymailuser != "" and mymailpasswd != "": - myconn.login(mymailuser, mymailpasswd) - myconn.sendmail("portage", myrecipient, mymessage.as_string()) - myconn.quit() - except smtplib.SMTPException, e: - raise portage_exception.PortageException("!!! An error occured while trying to send logmail:\n"+e) - except socket.error, e: - raise portage_exception.PortageException("!!! A network error occured while trying to send logmail:\n"+e+"\nSure you configured PORTAGE_LOG_MAILURI correctly?") - return diff --git a/pym/elog_modules/mod_save.py b/pym/elog_modules/mod_save.py deleted file mode 100644 index 5af7107..0000000 --- a/pym/elog_modules/mod_save.py +++ /dev/null @@ -1,18 +0,0 @@ -import os, time -from portage_data import portage_uid, portage_gid - -def process(mysettings, cpv, logentries, fulltext): - cpv_path = cpv.replace("/", ":") - - elogdir = mysettings["PORTAGE_TMPDIR"]+"/elogs" - if not os.path.exists(elogdir): - os.makedirs(elogdir) - os.chown(elogdir, portage_uid, portage_gid) - os.chmod(elogdir, 0770) - - elogfilename = elogdir+"/"+cpv_path+"-"+time.strftime("%Y%m%d-%H%M%S", time.gmtime(time.time()))+".log" - elogfile = open(elogfilename, "w") - elogfile.write(fulltext) - elogfile.close() - - return diff --git a/pym/elog_modules/mod_syslog.py b/pym/elog_modules/mod_syslog.py deleted file mode 100644 index d58979f..0000000 --- a/pym/elog_modules/mod_syslog.py +++ /dev/null @@ -1,13 +0,0 @@ -import syslog -from portage_const import EBUILD_PHASES - -def process(mysettings, cpv, logentries, fulltext): - syslog.openlog("portage", syslog.LOG_ERR | syslog.LOG_WARNING | syslog.LOG_INFO | syslog.LOG_NOTICE, syslog.LOG_LOCAL5) - for phase in EBUILD_PHASES.split(): - if not phase in logentries: - continue - for msgtype,msgcontent in logentries[phase]: - pri = {"INFO": syslog.LOG_INFO, "WARN": syslog.LOG_WARNING, "ERROR": syslog.LOG_ERR, "LOG": syslog.LOG_NOTICE} - msgtext = "".join(msgcontent) - syslog.syslog(pri[msgtype], "%s: %s: %s" % (cpv, phase, msgtext)) - syslog.closelog() diff --git a/pym/emergehelp.py b/pym/emergehelp.py deleted file mode 100644 index c07dfb5..0000000 --- a/pym/emergehelp.py +++ /dev/null @@ -1,370 +0,0 @@ -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/pym/emergehelp.py,v 1.10 2005/02/26 06:35:20 jstubbs Exp $ -cvs_id_string="$Id: emergehelp.py,v 1.10 2005/02/26 06:35:20 jstubbs Exp $"[5:-2] - -import os,sys -from output import bold, turquoise, green - -def shorthelp(): - print - print - print bold("Usage:") - print " "+turquoise("emerge")+" [ "+green("options")+" ] [ "+green("action")+" ] [ "+turquoise("ebuildfile")+" | "+turquoise("tbz2file")+" | "+turquoise("dependency")+" ] [ ... ]" - print " "+turquoise("emerge")+" [ "+green("options")+" ] [ "+green("action")+" ] < "+turquoise("system")+" | "+turquoise("world")+" >" - print " "+turquoise("emerge")+" < "+turquoise("--sync")+" | "+turquoise("--metadata")+" | "+turquoise("--info")+" >" - print " "+turquoise("emerge")+" "+turquoise("--resume")+" [ "+green("--pretend")+" | "+green("--ask")+" | "+green("--skipfirst")+" ]" - print " "+turquoise("emerge")+" "+turquoise("--help")+" [ "+green("system")+" | "+green("config")+" | "+green("sync")+" ] " - print bold("Options:")+" "+green("-")+"["+green("abcCdDefhikKlnoOpPsSuUvV")+"] ["+green("--oneshot")+"] ["+green("--newuse")+"] ["+green("--noconfmem")+"]" - print " ["+green("--columns")+"] ["+green("--nospinner")+"]" - print bold("Actions:")+" [ "+green("--clean")+" | "+green("--depclean")+" | "+green("--inject")+" | "+green("--prune")+" | "+green("--regen")+" | "+green("--search")+" | "+green("--unmerge")+" ]" - print - -def help(myaction,myopts,havecolor=1): - if not havecolor: - nocolor() - if not myaction and ("--help" not in myopts): - shorthelp() - print - print " For more help try 'emerge --help' or consult the man page." - print - elif not myaction: - shorthelp() - print - print turquoise("Help (this screen):") - print " "+green("--help")+" ("+green("-h")+" short option)" - print " Displays this help; an additional argument (see above) will tell" - print " emerge to display detailed help." - print - print turquoise("Actions:") - print " "+green("--clean")+" ("+green("-c")+" short option)" - print " Cleans the system by removing outdated packages which will not" - print " remove functionalities or prevent your system from working." - print " The arguments can be in several different formats :" - print " * world " - print " * system or" - print " * 'dependency specification' (in single quotes is best.)" - print " Here are a few examples of the dependency specification format:" - print " "+bold("binutils")+" matches" - print " binutils-2.11.90.0.7 and binutils-2.11.92.0.12.3-r1" - print " "+bold("sys-devel/binutils")+" matches" - print " binutils-2.11.90.0.7 and binutils-2.11.92.0.12.3-r1" - print " "+bold(">sys-devel/binutils-2.11.90.0.7")+" matches" - print " binutils-2.11.92.0.12.3-r1" - print " "+bold(">=sys-devel/binutils-2.11.90.0.7")+" matches" - print " binutils-2.11.90.0.7 and binutils-2.11.92.0.12.3-r1" - print " "+bold("<=sys-devel/binutils-2.11.92.0.12.3-r1")+" matches" - print " binutils-2.11.90.0.7 and binutils-2.11.92.0.12.3-r1" - print - print " "+green("--depclean") - print " Cleans the system by removing packages that are not associated" - print " with explicitly merged packages. Depclean works by creating the" - print " full dependency tree from the system list and the world file," - print " then comparing it to installed packages. Packages installed, but" - print " not associated with an explicit merge are listed as candidates" - print " for unmerging."+turquoise(" WARNING: This can seriously affect your system by") - print " "+turquoise("removing packages that may have been linked against, but due to") - print " "+turquoise("changes in USE flags may no longer be part of the dep tree. Use") - print " "+turquoise("caution when employing this feature.") - print - print " "+green("--info") - print " Displays important portage variables that will be exported to" - print " ebuild.sh when performing merges. This information is useful" - print " for bug reports and verification of settings. All settings in" - print " make.{conf,globals,defaults} and the environment show up if" - print " run with the '--verbose' flag." - print - print " "+green("--metadata") - print " Causes portage to process all the metacache files as is normally done" - print " on the tail end of an rsync update using "+bold("emerge --sync")+". The" - print " processing creates the cache database that portage uses for" - print " pre-parsed lookups of package data." - print - print " "+green("--prune")+" ("+green("-P")+" short option)" - print " "+turquoise("WARNING: This action can remove important packages!") - print " Removes all but the most recently installed version of a package" - print " from your system. This action doesn't verify the possible binary" - print " compatibility between versions and can thus remove essential" - print " dependencies from your system." - print " The argument format is the same as for the "+bold("--clean")+" action." - print - print " "+green("--regen") - print " Causes portage to check and update the dependency cache of all" - print " ebuilds in the portage tree. This is not recommended for rsync" - print " users as rsync updates the cache using server-side caches." - print " Rsync users should simply 'emerge --sync' to regenerate." - print - print " "+green("--search")+" ("+green("-s")+" short option)" - print " searches for matches of the supplied string in the current local" - print " portage tree. The search string is a regular expression. Prepending" - print " the expression with a '@' will cause the category to be included in" - print " the search." - print " A few examples:" - print " "+bold("emerge search '^kde'") - print " list all packages starting with kde" - print " "+bold("emerge search 'gcc$'") - print " list all packages ending with gcc" - print " "+bold("emerge search @^dev-java.*jdk") - print " list all available Java JDKs" - print - print " "+green("--unmerge")+" ("+green("-C")+" short option)" - print " "+turquoise("WARNING: This action can remove important packages!") - print " Removes all matching packages "+bold("completely")+" from" - print " your system. Specify arguments using the dependency specification" - print " format described in the "+bold("--clean")+" action above." - print - print turquoise("Options:") - print " "+green("--ask")+" ("+green("-a")+" short option)" - print " before performing the merge, display what ebuilds and tbz2s will" - print " be installed, in the same format as when using --pretend; then" - print " ask whether to continue with the merge or abort. Using --ask is" - print " more efficient than using --pretend and then executing the same" - print " command without --pretend, as dependencies will only need to be" - print " calculated once." - print - print " "+green("--buildpkg")+" ("+green("-b")+" short option)" - print " Tell emerge to build binary packages for all ebuilds processed" - print " (in addition to actually merging the packages. Useful for" - print " maintainers or if you administrate multiple Gentoo Linux" - print " systems (build once, emerge tbz2s everywhere) as well as disaster" - print " recovery." - print - print " "+green("--buildpkgonly")+" ("+green("-B")+" short option)" - print " Creates a binary package, but does not merge it to the" - print " system. This has the restriction that unsatisfied dependencies" - print " must not exist for the desired package as they cannot be used if" - print " they do not exist on the system." - print - print " "+green("--changelog")+" ("+green("-l")+" short option)" - print " When pretending, also display the ChangeLog entries for packages" - print " that will be upgraded." - print - print " "+green("--columns") - print " Display the pretend output in a tabular form. Versions are" - print " aligned vertically." - print - print " "+green("--debug")+" ("+green("-d")+" short option)" - print " Tell emerge to run the ebuild command in --debug mode. In this" - print " mode, the bash build environment will run with the -x option," - print " causing it to output verbose debug information print to stdout." - print " --debug is great for finding bash syntax errors as providing" - print " very verbose information about the dependency and build process." - print - print " "+green("--deep")+" ("+green("-D")+" short option)" - print " When used in conjunction with --update, this flag forces emerge" - print " to consider the entire dependency tree of packages, instead of" - print " checking only the immediate dependencies of the packages. As an" - print " example, this catches updates in libraries that are not directly" - print " listed in the dependencies of a package." - print - print " "+green("--emptytree")+" ("+green("-e")+" short option)" - print " Virtually tweaks the tree of installed packages to contain" - print " nothing. This is great to use together with --pretend. This makes" - print " it possible for developers to get a complete overview of the" - print " complete dependency tree of a certain package." - print - print " "+green("--fetchonly")+" ("+green("-f")+" short option)" - print " Instead of doing any package building, just perform fetches for" - print " all packages (main package as well as all dependencies.) When" - print " used in combination with --pretend all the SRC_URIs will be" - print " displayed multiple mirrors per line, one line per file." - print - print " "+green("--fetch-all-uri")+" ("+green("-F")+" short option)" - print " Same as --fetchonly except that all package files, including those" - print " not required to build the package, will be processed." - print - print " "+green("--getbinpkg")+" ("+green("-g")+" short option)" - print " Using the server and location defined in PORTAGE_BINHOST, portage" - print " will download the information from each binary file there and it" - print " will use that information to help build the dependency list. This" - print " option implies '-k'. (Use -gK for binary-only merging.)" - print - print " "+green("--getbinpkgonly")+" ("+green("-G")+" short option)" - print " This option is identical to -g, as above, except it will not use" - print " ANY information from the local machine. All binaries will be" - print " downloaded from the remote server without consulting packages" - print " existing in the packages directory." - print - print " "+green("--newuse") - print " Tells emerge to include installed packages where USE flags have " - print " changed since installation." - print - print " "+green("--noconfmem") - print " Portage keeps track of files that have been placed into" - print " CONFIG_PROTECT directories, and normally it will not merge the" - print " same file more than once, as that would become annoying. This" - print " can lead to problems when the user wants the file in the case" - print " of accidental deletion. With this option, files will always be" - print " merged to the live fs instead of silently dropped." - print - print " "+green("--nodeps")+" ("+green("-O")+" short option)" - print " Merge specified packages, but don't merge any dependencies." - print " Note that the build may fail if deps aren't satisfied." - print - print " "+green("--noreplace")+" ("+green("-n")+" short option)" - print " Skip the packages specified on the command-line that have" - print " already been installed. Without this option, any packages," - print " ebuilds, or deps you specify on the command-line *will* cause" - print " Portage to remerge the package, even if it is already installed." - print " Note that Portage won't remerge dependencies by default." - print - print " "+green("--nospinner") - print " Disables the spinner regardless of terminal type." - print - print " "+green("--oneshot") - print " Emerge as normal, but don't add packages to the world profile." - print " This package will only be updated if it is depended upon by" - print " another package." - print - print " "+green("--onlydeps")+" ("+green("-o")+" short option)" - print " Only merge (or pretend to merge) the dependencies of the" - print " specified packages, not the packages themselves." - print - print " "+green("--pretend")+" ("+green("-p")+" short option)" - print " Instead of actually performing the merge, simply display what" - print " ebuilds and tbz2s *would* have been installed if --pretend" - print " weren't used. Using --pretend is strongly recommended before" - print " installing an unfamiliar package. In the printout, N = new," - print " U = updating, R = replacing, F = fetch restricted, B = blocked" - print " by an already installed package, D = possible downgrading," - print " S = slotted install. --verbose causes affecting use flags to be" - print " printed out accompanied by a '+' for enabled and a '-' for" - print " disabled USE flags." - print - print " "+green("--quiet")+" ("+green("-q")+" short option)" - print " Effects vary, but the general outcome is a reduced or condensed" - print " output from portage's displays." - print - print " "+green("--resume") - print " Resumes the last merge operation. Can be treated just like a" - print " regular merge as --pretend and other options work along side." - print " 'emerge --resume' only returns an error on failure. Nothing to" - print " do exits with a message and a success condition." - print - print " "+green("--searchdesc")+" ("+green("-S")+" short option)" - print " Matches the search string against the description field as well" - print " the package's name. Take caution as the descriptions are also" - print " matched as regular expressions." - print " emerge -S html" - print " emerge -S applet" - print " emerge -S 'perl.*module'" - print - print " "+green("--skipfirst") - print " This option is only valid in a resume situation. It removes the" - print " first package in the resume list so that a merge may continue in" - print " the presence of an uncorrectable or inconsequential error. This" - print " should only be used in cases where skipping the package will not" - print " result in failed dependencies." - print - print " "+green("--tree")+" ("+green("-t")+" short option)" - print " Shows the dependency tree using indentation for dependencies." - print " The packages are also listed in reverse merge order so that" - print " a package's dependencies follow the package. Only really useful" - print " in combination with --emptytree, --update or --deep." - print - print " "+green("--update")+" ("+green("-u")+" short option)" - print " Updates packages to the best version available, which may not" - print " always be the highest version number due to masking for testing" - print " and development. This will also update direct dependencies which" - print " may not what you want. In general use this option only in combi-" - print " nation with the world or system target." - print - print " "+green("--usepkg")+" ("+green("-k")+" short option)" - print " Tell emerge to use binary packages (from $PKGDIR) if they are" - print " available, thus possibly avoiding some time-consuming compiles." - print " This option is useful for CD installs; you can export" - print " PKGDIR=/mnt/cdrom/packages and then use this option to have" - print " emerge \"pull\" binary packages from the CD in order to satisfy" - print " dependencies." - print - print " "+green("--usepkgonly")+" ("+green("-K")+" short option)" - print " Like --usepkg above, except this only allows the use of binary" - print " packages, and it will abort the emerge if the package is not" - print " available at the time of dependency calculation." - print - print " "+green("--verbose")+" ("+green("-v")+" short option)" - print " Effects vary, but the general outcome is an increased or expanded" - print " display of content in portage's displays." - print - print " "+green("--version")+" ("+green("-V")+" short option)" - print " Displays the currently installed version of portage along with" - print " other information useful for quick reference on a system. See" - print " "+bold("emerge info")+" for more advanced information." - print - elif myaction in ["rsync","sync"]: - print - print bold("Usage: ")+turquoise("emerge")+" "+turquoise("--sync") - print - print " 'emerge --sync' tells emerge to update the Portage tree as specified in" - print " The SYNC variable found in /etc/make.conf. By default, SYNC instructs" - print " emerge to perform an rsync-style update with rsync.gentoo.org." - print - print " 'emerge-webrsync' exists as a helper app to emerge --sync, providing a" - print " method to receive the entire portage tree as a tarball that can be" - print " extracted and used. First time syncs would benefit greatly from this." - print - print " "+turquoise("WARNING:") - print " If using our rsync server, emerge will clean out all files that do not" - print " exist on it, including ones that you may have created. The exceptions" - print " to this are the distfiles, local and packages directories." - print - elif myaction=="system": - print - print bold("Usage: ")+turquoise("emerge")+" [ "+green("options")+" ] "+turquoise("system") - print - print " \"emerge system\" is the Portage system update command. When run, it" - print " will scan the etc/make.profile/packages file and determine what" - print " packages need to be installed so that your system meets the minimum" - print " requirements of your current system profile. Note that this doesn't" - print " necessarily bring your system up-to-date at all; instead, it just" - print " ensures that you have no missing parts. For example, if your system" - print " profile specifies that you should have sys-apps/iptables installed" - print " and you don't, then \"emerge system\" will install it (the most" - print " recent version that matches the profile spec) for you. It's always a" - print " good idea to do an \"emerge --pretend system\" before an \"emerge" - print " system\", just so you know what emerge is planning to do." - print - elif myaction=="config": - outstuff=green("Config file management support (preliminary)")+""" - -Portage has a special feature called "config file protection". The purpose of -this feature is to prevent new package installs from clobbering existing -configuration files. By default, config file protection is turned on for /etc -and the KDE configuration dirs; more may be added in the future. - -When Portage installs a file into a protected directory tree like /etc, any -existing files will not be overwritten. If a file of the same name already -exists, Portage will change the name of the to-be- installed file from 'foo' to -'._cfg0000_foo'. If '._cfg0000_foo' already exists, this name becomes -'._cfg0001_foo', etc. In this way, existing files are not overwritten, -allowing the administrator to manually merge the new config files and avoid any -unexpected changes. - -In addition to protecting overwritten files, Portage will not delete any files -from a protected directory when a package is unmerged. While this may be a -little bit untidy, it does prevent potentially valuable config files from being -deleted, which is of paramount importance. - -Protected directories are set using the CONFIG_PROTECT variable, normally -defined in /etc/make.globals. Directory exceptions to the CONFIG_PROTECTed -directories can be specified using the CONFIG_PROTECT_MASK variable. To find -files that need to be updated in /etc, type: - -# find /etc -iname '._cfg????_*' - -You can disable this feature by setting CONFIG_PROTECT="-*" in /etc/make.conf. -Then, Portage will mercilessly auto-update your config files. Alternatively, -you can leave Config File Protection on but tell Portage that it can overwrite -files in certain specific /etc subdirectories. For example, if you wanted -Portage to automatically update your rc scripts and your wget configuration, -but didn't want any other changes made without your explicit approval, you'd -add this to /etc/make.conf: - -CONFIG_PROTECT_MASK="/etc/wget /etc/rc.d" - -etc-update is also available to aid in the merging of these files. It provides -a vimdiff interactive merging setup and can auto-merge trivial changes. - -""" - print outstuff - diff --git a/pym/getbinpkg.py b/pym/getbinpkg.py deleted file mode 100644 index 3b4a53d..0000000 --- a/pym/getbinpkg.py +++ /dev/null @@ -1,541 +0,0 @@ -# getbinpkg.py -- Portage binary-package helper functions -# Copyright 2003-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/pym/getbinpkg.py,v 1.15 2005/02/26 06:35:20 jstubbs Exp $ -cvs_id_string="$Id: getbinpkg.py,v 1.15 2005/02/26 06:35:20 jstubbs Exp $"[5:-2] - -from output import * -import htmllib,HTMLParser,string,formatter,sys,os,xpak,time,tempfile,cPickle,base64 - -try: - import ftplib -except SystemExit, e: - raise -except Exception, e: - sys.stderr.write(red("!!! CANNOT IMPORT FTPLIB: ")+str(e)+"\n") - -try: - import httplib -except SystemExit, e: - raise -except Exception, e: - sys.stderr.write(red("!!! CANNOT IMPORT HTTPLIB: ")+str(e)+"\n") - -def make_metadata_dict(data): - myid,myglob = data - - mydict = {} - for x in xpak.getindex_mem(myid): - mydict[x] = xpak.getitem(data,x) - - return mydict - -class ParseLinks(HTMLParser.HTMLParser): - """Parser class that overrides HTMLParser to grab all anchors from an html - page and provide suffix and prefix limitors""" - def __init__(self): - self.PL_anchors = [] - HTMLParser.HTMLParser.__init__(self) - - def get_anchors(self): - return self.PL_anchors - - def get_anchors_by_prefix(self,prefix): - newlist = [] - for x in self.PL_anchors: - if (len(x) >= len(prefix)) and (x[:len(suffix)] == prefix): - if x not in newlist: - newlist.append(x[:]) - return newlist - - def get_anchors_by_suffix(self,suffix): - newlist = [] - for x in self.PL_anchors: - if (len(x) >= len(suffix)) and (x[-len(suffix):] == suffix): - if x not in newlist: - newlist.append(x[:]) - return newlist - - def handle_endtag(self,tag): - pass - - def handle_starttag(self,tag,attrs): - if tag == "a": - for x in attrs: - if x[0] == 'href': - if x[1] not in self.PL_anchors: - self.PL_anchors.append(x[1]) - - -def create_conn(baseurl,conn=None): - """(baseurl,conn) --- Takes a protocol://site:port/address url, and an - optional connection. If connection is already active, it is passed on. - baseurl is reduced to address and is returned in tuple (conn,address)""" - parts = string.split(baseurl, "://", 1) - if len(parts) != 2: - raise ValueError, "Provided URL does not contain protocol identifier. '%s'" % baseurl - protocol,url_parts = parts - del parts - host,address = string.split(url_parts, "/", 1) - del url_parts - address = "/"+address - - userpass_host = string.split(host, "@", 1) - if len(userpass_host) == 1: - host = userpass_host[0] - userpass = ["anonymous"] - else: - host = userpass_host[1] - userpass = string.split(userpass_host[0], ":") - del userpass_host - - if len(userpass) > 2: - raise ValueError, "Unable to interpret username/password provided." - elif len(userpass) == 2: - username = userpass[0] - password = userpass[1] - elif len(userpass) == 1: - username = userpass[0] - password = None - del userpass - - http_headers = {} - http_params = {} - if username and password: - http_headers = { - "Authorization": "Basic %s" % - string.replace( - base64.encodestring("%s:%s" % (username, password)), - "\012", - "" - ), - } - - if not conn: - if protocol == "https": - conn = httplib.HTTPSConnection(host) - elif protocol == "http": - conn = httplib.HTTPConnection(host) - elif protocol == "ftp": - passive = 1 - if(host[-1] == "*"): - passive = 0 - host = host[:-1] - conn = ftplib.FTP(host) - if password: - conn.login(username,password) - else: - sys.stderr.write(yellow(" * No password provided for username")+" '"+str(username)+"'\n\n") - conn.login(username) - conn.set_pasv(passive) - conn.set_debuglevel(0) - else: - raise NotImplementedError, "%s is not a supported protocol." % protocol - - return (conn,protocol,address, http_params, http_headers) - -def make_ftp_request(conn, address, rest=None, dest=None): - """(conn,address,rest) --- uses the conn object to request the data - from address and issuing a rest if it is passed.""" - try: - - if dest: - fstart_pos = dest.tell() - - conn.voidcmd("TYPE I") - fsize = conn.size(address) - - if (rest != None) and (rest < 0): - rest = fsize+int(rest) - if rest < 0: - rest = 0 - - if rest != None: - mysocket = conn.transfercmd("RETR "+str(address), rest) - else: - mysocket = conn.transfercmd("RETR "+str(address)) - - mydata = "" - while 1: - somedata = mysocket.recv(8192) - if somedata: - if dest: - dest.write(somedata) - else: - mydata = mydata + somedata - else: - break - - if dest: - data_size = fstart_pos - dest.tell() - else: - data_size = len(mydata) - - mysocket.close() - conn.voidresp() - conn.voidcmd("TYPE A") - - return mydata,not (fsize==data_size),"" - - except ValueError, e: - return None,int(str(e)[:4]),str(e) - - -def make_http_request(conn, address, params={}, headers={}, dest=None): - """(conn,address,params,headers) --- uses the conn object to request - the data from address, performing Location forwarding and using the - optional params and headers.""" - - rc = 0 - response = None - while (rc == 0) or (rc == 301) or (rc == 302): - try: - if (rc != 0): - conn,ignore,ignore,ignore,ignore = create_conn(address) - conn.request("GET", address, params, headers) - except SystemExit, e: - raise - except Exception, e: - return None,None,"Server request failed: "+str(e) - response = conn.getresponse() - rc = response.status - - # 301 means that the page address is wrong. - if ((rc == 301) or (rc == 302)): - ignored_data = response.read() - del ignored_data - for x in string.split(str(response.msg), "\n"): - parts = string.split(x, ": ", 1) - if parts[0] == "Location": - if (rc == 301): - sys.stderr.write(red("Location has moved: ")+str(parts[1])+"\n") - if (rc == 302): - sys.stderr.write(red("Location has temporarily moved: ")+str(parts[1])+"\n") - address = parts[1] - break - - if (rc != 200) and (rc != 206): - sys.stderr.write(str(response.msg)+"\n") - sys.stderr.write(response.read()+"\n") - sys.stderr.write("address: "+address+"\n") - return None,rc,"Server did not respond successfully ("+str(response.status)+": "+str(response.reason)+")" - - if dest: - dest.write(response.read()) - return "",0,"" - - return response.read(),0,"" - - -def match_in_array(array, prefix="", suffix="", match_both=1, allow_overlap=0): - myarray = [] - - if not (prefix and suffix): - match_both = 0 - - for x in array: - add_p = 0 - if prefix and (len(x) >= len(prefix)) and (x[:len(prefix)] == prefix): - add_p = 1 - - if match_both: - if prefix and not add_p: # Require both, but don't have first one. - continue - else: - if add_p: # Only need one, and we have it. - myarray.append(x[:]) - continue - - if not allow_overlap: # Not allow to overlap prefix and suffix - if len(x) >= (len(prefix)+len(suffix)): - y = x[len(prefix):] - else: - continue # Too short to match. - else: - y = x # Do whatever... We're overlapping. - - if suffix and (len(x) >= len(suffix)) and (x[-len(suffix):] == suffix): - myarray.append(x) # It matches - else: - continue # Doesn't match. - - return myarray - - - -def dir_get_list(baseurl,conn=None): - """(baseurl[,connection]) -- Takes a base url to connect to and read from. - URL should be in the for <proto>://<site>[:port]<path> - Connection is used for persistent connection instances.""" - - if not conn: - keepconnection = 0 - else: - keepconnection = 1 - - conn,protocol,address,params,headers = create_conn(baseurl, conn) - - listing = None - if protocol in ["http","https"]: - page,rc,msg = make_http_request(conn,address,params,headers) - - if page: - parser = ParseLinks() - parser.feed(page) - del page - listing = parser.get_anchors() - else: - raise Exception, "Unable to get listing: %s %s" % (rc,msg) - elif protocol in ["ftp"]: - if address[-1] == '/': - olddir = conn.pwd() - conn.cwd(address) - listing = conn.nlst() - conn.cwd(olddir) - del olddir - else: - listing = conn.nlst(address) - else: - raise TypeError, "Unknown protocol. '%s'" % protocol - - if not keepconnection: - conn.close() - - return listing - -def file_get_metadata(baseurl,conn=None, chunk_size=3000): - """(baseurl[,connection]) -- Takes a base url to connect to and read from. - URL should be in the for <proto>://<site>[:port]<path> - Connection is used for persistent connection instances.""" - - if not conn: - keepconnection = 0 - else: - keepconnection = 1 - - conn,protocol,address,params,headers = create_conn(baseurl, conn) - - if protocol in ["http","https"]: - headers["Range"] = "bytes=-"+str(chunk_size) - data,rc,msg = make_http_request(conn, address, params, headers) - elif protocol in ["ftp"]: - data,rc,msg = make_ftp_request(conn, address, -chunk_size) - else: - raise TypeError, "Unknown protocol. '%s'" % protocol - - if data: - xpaksize = xpak.decodeint(data[-8:-4]) - if (xpaksize+8) > chunk_size: - myid = file_get_metadata(baseurl, conn, (xpaksize+8)) - if not keepconnection: - conn.close() - return myid - else: - xpak_data = data[len(data)-(xpaksize+8):-8] - del data - - myid = xpak.xsplit_mem(xpak_data) - if not myid: - myid = None,None - del xpak_data - else: - myid = None,None - - if not keepconnection: - conn.close() - - return myid - - -def file_get(baseurl,dest,conn=None,fcmd=None): - """(baseurl,dest,fcmd=) -- Takes a base url to connect to and read from. - URL should be in the for <proto>://[user[:pass]@]<site>[:port]<path>""" - - if not fcmd: - return file_get_lib(baseurl,dest,conn) - - fcmd = string.replace(fcmd, "${DISTDIR}", dest) - fcmd = string.replace(fcmd, "${URI}", baseurl) - fcmd = string.replace(fcmd, "${FILE}", os.path.basename(baseurl)) - mysplit = string.split(fcmd) - mycmd = mysplit[0] - myargs = [os.path.basename(mycmd)]+mysplit[1:] - mypid=os.fork() - if mypid == 0: - os.execv(mycmd,myargs) - sys.stderr.write("!!! Failed to spawn fetcher.\n") - sys.exit(1) - retval=os.waitpid(mypid,0)[1] - if (retval & 0xff) == 0: - retval = retval >> 8 - else: - sys.stderr.write("Spawned processes caught a signal.\n") - sys.exit(1) - if retval != 0: - sys.stderr.write("Fetcher exited with a failure condition.\n") - return 0 - return 1 - -def file_get_lib(baseurl,dest,conn=None): - """(baseurl[,connection]) -- Takes a base url to connect to and read from. - URL should be in the for <proto>://<site>[:port]<path> - Connection is used for persistent connection instances.""" - - if not conn: - keepconnection = 0 - else: - keepconnection = 1 - - conn,protocol,address,params,headers = create_conn(baseurl, conn) - - sys.stderr.write("Fetching '"+str(os.path.basename(address)+"'\n")) - if protocol in ["http","https"]: - data,rc,msg = make_http_request(conn, address, params, headers, dest=dest) - elif protocol in ["ftp"]: - data,rc,msg = make_ftp_request(conn, address, dest=dest) - else: - raise TypeError, "Unknown protocol. '%s'" % protocol - - if not keepconnection: - conn.close() - - return rc - - -def dir_get_metadata(baseurl, conn=None, chunk_size=3000, verbose=1, usingcache=1, makepickle=None): - """(baseurl,conn,chunk_size,verbose) -- - """ - if not conn: - keepconnection = 0 - else: - keepconnection = 1 - - if makepickle == None: - makepickle = "/var/cache/edb/metadata.idx.most_recent" - - conn,protocol,address,params,headers = create_conn(baseurl, conn) - - filedict = {} - - try: - metadatafile = open("/var/cache/edb/remote_metadata.pickle") - metadata = cPickle.load(metadatafile) - sys.stderr.write("Loaded metadata pickle.\n") - metadatafile.close() - except SystemExit, e: - raise - except: - metadata = {} - if not metadata.has_key(baseurl): - metadata[baseurl]={} - if not metadata[baseurl].has_key("indexname"): - metadata[baseurl]["indexname"]="" - if not metadata[baseurl].has_key("timestamp"): - metadata[baseurl]["timestamp"]=0 - if not metadata[baseurl].has_key("unmodified"): - metadata[baseurl]["unmodified"]=0 - if not metadata[baseurl].has_key("data"): - metadata[baseurl]["data"]={} - - filelist = dir_get_list(baseurl, conn) - tbz2list = match_in_array(filelist, suffix=".tbz2") - metalist = match_in_array(filelist, prefix="metadata.idx") - del filelist - - # Determine if our metadata file is current. - metalist.sort() - metalist.reverse() # makes the order new-to-old. - havecache=0 - for mfile in metalist: - if usingcache and \ - ((metadata[baseurl]["indexname"] != mfile) or \ - (metadata[baseurl]["timestamp"] < int(time.time()-(60*60*24)))): - # Try to download new cache until we succeed on one. - data="" - for trynum in [1,2,3]: - mytempfile = tempfile.TemporaryFile() - try: - file_get(baseurl+"/"+mfile, mytempfile, conn) - if mytempfile.tell() > len(data): - mytempfile.seek(0) - data = mytempfile.read() - except ValueError, e: - sys.stderr.write("--- "+str(e)+"\n") - if trynum < 3: - sys.stderr.write("Retrying...\n") - mytempfile.close() - continue - if match_in_array([mfile],suffix=".gz"): - sys.stderr.write("gzip'd\n") - try: - import gzip - mytempfile.seek(0) - gzindex = gzip.GzipFile(mfile[:-3],'rb',9,mytempfile) - data = gzindex.read() - except SystemExit, e: - raise - except Exception, e: - mytempfile.close() - sys.stderr.write("!!! Failed to use gzip: "+str(e)+"\n") - mytempfile.close() - try: - metadata[baseurl]["data"] = cPickle.loads(data) - del data - metadata[baseurl]["indexname"] = mfile - metadata[baseurl]["timestamp"] = int(time.time()) - metadata[baseurl]["modified"] = 0 # It's not, right after download. - sys.stderr.write("Pickle loaded.\n") - break - except SystemExit, e: - raise - except Exception, e: - sys.stderr.write("!!! Failed to read data from index: "+str(mfile)+"\n") - sys.stderr.write("!!! "+str(e)+"\n") - try: - metadatafile = open("/var/cache/edb/remote_metadata.pickle", "w+") - cPickle.dump(metadata,metadatafile) - metadatafile.close() - except SystemExit, e: - raise - except Exception, e: - sys.stderr.write("!!! Failed to write binary metadata to disk!\n") - sys.stderr.write("!!! "+str(e)+"\n") - break - # We may have metadata... now we run through the tbz2 list and check. - sys.stderr.write(yellow("cache miss: 'x'")+" --- "+green("cache hit: 'o'")+"\n") - for x in tbz2list: - x = os.path.basename(x) - if ((not metadata[baseurl]["data"].has_key(x)) or \ - (x not in metadata[baseurl]["data"].keys())): - sys.stderr.write(yellow("x")) - metadata[baseurl]["modified"] = 1 - myid = file_get_metadata(baseurl+"/"+x, conn, chunk_size) - - if myid[0]: - metadata[baseurl]["data"][x] = make_metadata_dict(myid) - elif verbose: - sys.stderr.write(red("!!! Failed to retrieve metadata on: ")+str(x)+"\n") - else: - sys.stderr.write(green("o")) - sys.stderr.write("\n") - - try: - if metadata[baseurl].has_key("modified") and metadata[baseurl]["modified"]: - metadata[baseurl]["timestamp"] = int(time.time()) - metadatafile = open("/var/cache/edb/remote_metadata.pickle", "w+") - cPickle.dump(metadata,metadatafile) - metadatafile.close() - if makepickle: - metadatafile = open(makepickle, "w") - cPickle.dump(metadata[baseurl]["data"],metadatafile) - metadatafile.close() - except SystemExit, e: - raise - except Exception, e: - sys.stderr.write("!!! Failed to write binary metadata to disk!\n") - sys.stderr.write("!!! "+str(e)+"\n") - - if not keepconnection: - conn.close() - - return metadata[baseurl]["data"] diff --git a/pym/orig_dict_cache.py b/pym/orig_dict_cache.py deleted file mode 100644 index 72b8116..0000000 --- a/pym/orig_dict_cache.py +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/python -# orig_dict_cache.py; older listdir caching implementation -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -#$Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/pym/orig_dict_cache.py,v 1.7 2004/11/09 23:20:47 ferringb Exp $ - -"""per process caching of os.listdir returns. -Symlink unaware, so beware of webs of symlinks""" - -import portage_util, os, stat -import portage_file - -dircache = {} -cacheHit = 0 -cacheMiss = 0 -cacheStale = 0 - -def cacheddir(my_original_path): - """return results from cache, updating cache if its stale/incomplete""" - global cacheHit, cacheMiss, cacheStale, dircache - mypath=portage_file.normpath(my_original_path) - if dircache.has_key(mypath): - cacheHit += 1 - cached_mtime, list, ftype = dircache[mypath] - else: - cacheMiss += 1 - cached_mtime, list, ftype = -1, [], [] - pathstat = os.stat(mypath) - if stat.S_ISDIR(pathstat[stat.ST_MODE]): - mtime = pathstat[stat.ST_MTIME] - else: - raise Exception - if mtime != cached_mtime: - if dircache.has_key(mypath): - cacheStale += 1 - list = os.listdir(mypath) - ftype = [] - for x in list: - try: - pathstat = os.lstat(mypath+"/"+x) - - if stat.S_ISREG(pathstat[stat.ST_MODE]): - ftype.append(0) - elif stat.S_ISDIR(pathstat[stat.ST_MODE]): - ftype.append(1) - elif stat.S_ISLNK(pathstat[stat.ST_MODE]): - pathstat = os.stat(mypath+"/"+x) - if stat.S_ISREG(pathstat[stat.ST_MODE]): - ftype.append(2) - elif stat.S_ISDIR(pathstat[stat.ST_MODE]): - ftype.append(3) - else: - ftype.append(4) - - except SystemExit, e: - raise - except: - ftype.append(3) - dircache[mypath] = mtime, list, ftype - - return list[:],ftype[:] - - portage_util.writemsg("cacheddirStats: H:%d/M:%d/S:%d\n" % (cacheHit, cacheMiss, cacheStale),10) - return ret_list, ret_ftype diff --git a/pym/output.py b/pym/output.py deleted file mode 100644 index 3038176..0000000 --- a/pym/output.py +++ /dev/null @@ -1,167 +0,0 @@ -# Copyright 1998-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/pym/output.py,v 1.25 2005/02/26 06:35:20 jstubbs Exp $ -cvs_id_string="$Id: output.py,v 1.25 2005/02/26 06:35:20 jstubbs Exp $"[5:-2] - -import os,sys,re - -havecolor=1 -dotitles=1 - -esc_seq = "\x1b[" - -g_attr = {} -g_attr["normal"] = 0 - -g_attr["bold"] = 1 -g_attr["faint"] = 2 -g_attr["standout"] = 3 -g_attr["underline"] = 4 -g_attr["blink"] = 5 -g_attr["overline"] = 6 # Why is overline actually useful? -g_attr["reverse"] = 7 -g_attr["invisible"] = 8 - -g_attr["no-attr"] = 22 -g_attr["no-standout"] = 23 -g_attr["no-underline"] = 24 -g_attr["no-blink"] = 25 -g_attr["no-overline"] = 26 -g_attr["no-reverse"] = 27 -# 28 isn't defined? -# 29 isn't defined? -g_attr["black"] = 30 -g_attr["red"] = 31 -g_attr["green"] = 32 -g_attr["yellow"] = 33 -g_attr["blue"] = 34 -g_attr["magenta"] = 35 -g_attr["cyan"] = 36 -g_attr["white"] = 37 -# 38 isn't defined? -g_attr["default"] = 39 -g_attr["bg_black"] = 40 -g_attr["bg_red"] = 41 -g_attr["bg_green"] = 42 -g_attr["bg_yellow"] = 43 -g_attr["bg_blue"] = 44 -g_attr["bg_magenta"] = 45 -g_attr["bg_cyan"] = 46 -g_attr["bg_white"] = 47 -g_attr["bg_default"] = 49 - - -# make_seq("blue", "black", "normal") -def color(fg, bg="default", attr=["normal"]): - mystr = esc_seq[:] + "%02d" % g_attr[fg] - for x in [bg]+attr: - mystr += ";%02d" % g_attr[x] - return mystr+"m" - - - -codes={} -codes["reset"] = esc_seq + "39;49;00m" - -codes["bold"] = esc_seq + "01m" -codes["faint"] = esc_seq + "02m" -codes["standout"] = esc_seq + "03m" -codes["underline"] = esc_seq + "04m" -codes["blink"] = esc_seq + "05m" -codes["overline"] = esc_seq + "06m" # Who made this up? Seriously. - -codes["teal"] = esc_seq + "36m" -codes["turquoise"] = esc_seq + "36;01m" - -codes["fuchsia"] = esc_seq + "35;01m" -codes["purple"] = esc_seq + "35m" - -codes["blue"] = esc_seq + "34;01m" -codes["darkblue"] = esc_seq + "34m" - -codes["green"] = esc_seq + "32;01m" -codes["darkgreen"] = esc_seq + "32m" - -codes["yellow"] = esc_seq + "33;01m" -codes["brown"] = esc_seq + "33m" - -codes["red"] = esc_seq + "31;01m" -codes["darkred"] = esc_seq + "31m" - -def nc_len(mystr): - tmp = re.sub(esc_seq + "^m]+m", "", mystr); - return len(tmp) - -def xtermTitle(mystr): - if havecolor and dotitles and os.environ.has_key("TERM") and sys.stderr.isatty(): - myt=os.environ["TERM"] - legal_terms = ["xterm","Eterm","aterm","rxvt","screen","kterm","rxvt-unicode"] - if (myt in legal_terms) or myt.startswith("xterm") or myt.startswith("screen"): - sys.stderr.write("\x1b]2;"+str(mystr)+"\x07") - sys.stderr.flush() - if (myt.startswith("screen")): - sys.stderr.write("\x1bk"+str(mystr)+"\x1b\\") - sys.stderr.flush() - -def xtermTitleReset(): - if havecolor and dotitles and os.environ.has_key("TERM"): - myt=os.environ["TERM"] - xtermTitle(os.environ["TERM"]) - - -def notitles(): - "turn off title setting" - dotitles=0 - -def nocolor(): - "turn off colorization" - havecolor=0 - for x in codes.keys(): - codes[x]="" - -def resetColor(): - return codes["reset"] - -def ctext(color,text): - return codes[ctext]+text+codes["reset"] - -def bold(text): - return codes["bold"]+text+codes["reset"] -def white(text): - return bold(text) - -def teal(text): - return codes["teal"]+text+codes["reset"] -def turquoise(text): - return codes["turquoise"]+text+codes["reset"] -def darkteal(text): - return turquoise(text) - -def fuscia(text): # Don't use this one. It's spelled wrong! - return codes["fuchsia"]+text+codes["reset"] -def fuchsia(text): - return codes["fuchsia"]+text+codes["reset"] -def purple(text): - return codes["purple"]+text+codes["reset"] - -def blue(text): - return codes["blue"]+text+codes["reset"] -def darkblue(text): - return codes["darkblue"]+text+codes["reset"] - -def green(text): - return codes["green"]+text+codes["reset"] -def darkgreen(text): - return codes["darkgreen"]+text+codes["reset"] - -def yellow(text): - return codes["yellow"]+text+codes["reset"] -def brown(text): - return codes["brown"]+text+codes["reset"] -def darkyellow(text): - return brown(text) - -def red(text): - return codes["red"]+text+codes["reset"] -def darkred(text): - return codes["darkred"]+text+codes["reset"] diff --git a/pym/portage.py b/pym/portage.py deleted file mode 100644 index 8cc4982..0000000 --- a/pym/portage.py +++ /dev/null @@ -1,5375 +0,0 @@ - -# portage.py -- core Portage functionality -# Copyright 1998-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/pym/portage.py,v 1.589 2005/04/29 04:43:19 vapier Exp $ -cvs_id_string="$Id: portage.py,v 1.589 2005/04/29 04:43:19 vapier Exp $"[5:-2] - -VERSION="$Revision: 1.589 $"[11:-2] + "-cvs" - -# =========================================================================== -# START OF IMPORTS -- START OF IMPORTS -- START OF IMPORTS -- START OF IMPORT -# =========================================================================== - - -try: - import sys -except SystemExit, e: - raise -except: - print "Failed to import sys! Something is _VERY_ wrong with python." - raise SystemExit, 127 - -try: - import os,string,types,atexit,signal,fcntl - import time,cPickle,traceback,copy - import re,pwd,grp - import shlex,shutil - import stat - from time import sleep - from random import shuffle -except SystemExit, e: - raise -except Exception, e: - sys.stderr.write("\n\n") - sys.stderr.write("!!! Failed to complete python imports. There are internal modules for\n") - sys.stderr.write("!!! python and failure here indicates that you have a problem with python\n") - sys.stderr.write("!!! itself and thus portage is no able to continue processing.\n\n") - - sys.stderr.write("!!! You might consider starting python with verbose flags to see what has\n") - sys.stderr.write("!!! gone wrong. Here is the information we got for this exception:\n") - - sys.stderr.write(" "+str(e)+"\n\n"); - sys.exit(127) -except: - sys.stderr.write("\n\n") - sys.stderr.write("!!! Failed to complete python imports. There are internal modules for\n") - sys.stderr.write("!!! python and failure here indicates that you have a problem with python\n") - sys.stderr.write("!!! itself and thus portage is no able to continue processing.\n\n") - - sys.stderr.write("!!! You might consider starting python with verbose flags to see what has\n") - sys.stderr.write("!!! gone wrong. The exception was non-standard and we were unable to catch it.\n\n") - sys.exit(127) - - -try: - #XXX: This should get renamed to bsd_chflags, I think. - import chflags - bsd_chflags = chflags -except SystemExit, e: - raise -except: - # XXX: This should get renamed to bsd_chflags, I think. - bsd_chflags = None - -try: - from config import config - import ebuild - import cvstree - import xpak - import getbinpkg - import portage_dep - import eclass_cache - import portage_versions - - #assign these to portage's namespace to keep the tool monkeys happy. - catpkgsplit = portage_versions.catpkgsplit - pkgsplit = portage_versions.pkgsplit - pkgcmp = portage_versions.pkgcmp - - # XXX: This needs to get cleaned up. - import output - from output import blue, bold, brown, darkblue, darkgreen, darkred, darkteal, \ - darkyellow, fuchsia, fuscia, green, purple, red, teal, turquoise, white, \ - xtermTitle, xtermTitleReset, yellow - - import portage_const - from portage_const import VDB_PATH, PRIVATE_PATH, CACHE_PATH, DEPCACHE_PATH, \ - USER_CONFIG_PATH, MODULES_FILE_PATH, CUSTOM_PROFILE_PATH, PORTAGE_BASE_PATH, \ - PORTAGE_BIN_PATH, PORTAGE_PYM_PATH, PROFILE_PATH, LOCALE_DATA_PATH, \ - EBUILD_SH_BINARY, SANDBOX_BINARY, BASH_BINARY, \ - MOVE_BINARY, PRELINK_BINARY, WORLD_FILE, MAKE_CONF_FILE, MAKE_DEFAULTS_FILE, \ - DEPRECATED_PROFILE_FILE, USER_VIRTUALS_FILE, EBUILD_SH_ENV_FILE, \ - INVALID_ENV_FILE, CUSTOM_MIRRORS_FILE, SANDBOX_PIDS_FILE, CONFIG_MEMORY_FILE,\ - INCREMENTALS, STICKIES - - from portage_data import ostype, lchown, userland, secpass, uid, wheelgid, \ - portage_uid, portage_gid - - import portage_util - from portage_util import grab_multiple, grabdict, grabdict_package, grabfile, grabfile_package, \ - grabints, pickle_read, pickle_write, stack_dictlist, stack_dicts, stack_lists, \ - unique_array, varexpand, writedict, writeints, writemsg, getconfig, movefile, flatten, \ - abssymlink - from portage_file import normpath, listdir - import portage_exception - import portage_gpg - import portage_locks - import portage_exec - from portage_locks import unlockfile,unlockdir,lockfile,lockdir - import portage_checksum - from portage_checksum import perform_md5,perform_checksum,prelink_capable - - import transports.bundled_lib - import transports.fetchcommand -except SystemExit, e: - raise -except Exception, e: - sys.stderr.write("\n\n") - sys.stderr.write("!!! Failed to complete portage imports. There are internal modules for\n") - sys.stderr.write("!!! portage and failure here indicates that you have a problem with your\n") - sys.stderr.write("!!! installation of portage. Please try a rescue portage located in the\n") - sys.stderr.write("!!! portage tree under '/usr/portage/sys-apps/portage/files/' (default).\n") - sys.stderr.write("!!! There is a README.RESCUE file that details the steps required to perform\n") - sys.stderr.write("!!! a recovery of portage.\n") - - sys.stderr.write(" "+str(e)+"\n\n") - sys.exit(127) - - -# =========================================================================== -# END OF IMPORTS -- END OF IMPORTS -- END OF IMPORTS -- END OF IMPORTS -- END -# =========================================================================== - - -def exithandler(signum,frame): - """Handles ^C interrupts in a sane manner""" - signal.signal(signal.SIGINT, signal.SIG_IGN) - signal.signal(signal.SIGTERM, signal.SIG_IGN) - - # 0=send to *everybody* in process group - print "caught %i in %i" % (signum, os.getpid()) - portageexit() - print "Exiting due to signal" - os.kill(0,signum) - sys.exit(1) - -signal.signal(signal.SIGCHLD, signal.SIG_DFL) -signal.signal(signal.SIGINT, exithandler) -signal.signal(signal.SIGTERM, exithandler) - -def getcwd(): - "this fixes situations where the current directory doesn't exist" - try: - return os.getcwd() - except SystemExit, e: - raise - except: - os.chdir("/") - return "/" -getcwd() - -def suffix_array(array,suffix,doblanks=1): - """Appends a given suffix to each element in an Array/List/Tuple. - Returns a List.""" - if type(array) not in (list,tuple): - raise TypeError, "List or Tuple expected. Got %s" % type(array) - newarray=[] - for x in array: - if x or doblanks: - newarray.append(x + suffix) - else: - newarray.append(x) - return newarray - -def prefix_array(array,prefix,doblanks=1): - """Prepends a given prefix to each element in an Array/List/Tuple. - Returns a List.""" - if type(array) not in (list,tuple): - raise TypeError, "List or Tuple expected. Got %s" % type(array) - newarray=[] - for x in array: - if x or doblanks: - newarray.append(prefix + x) - else: - newarray.append(x) - return newarray - -starttime=long(time.time()) -features=[] - -def tokenize(mystring): - """breaks a string like 'foo? (bar) oni? (blah (blah))' - into embedded lists; returns None on paren mismatch""" - - # This function is obsoleted. - # Use dep_parenreduce - - newtokens=[] - curlist=newtokens - prevlists=[] - level=0 - accum="" - for x in mystring: - if x=="(": - if accum: - curlist.append(accum) - accum="" - prevlists.append(curlist) - curlist=[] - level=level+1 - elif x==")": - if accum: - curlist.append(accum) - accum="" - if level==0: - writemsg("!!! tokenizer: Unmatched left parenthesis in:\n'"+str(mystring)+"'\n") - return None - newlist=curlist - curlist=prevlists.pop() - curlist.append(newlist) - level=level-1 - elif x in string.whitespace: - if accum: - curlist.append(accum) - accum="" - else: - accum=accum+x - if accum: - curlist.append(accum) - if (level!=0): - writemsg("!!! tokenizer: Exiting with unterminated parenthesis in:\n'"+str(mystring)+"'\n") - return None - return newtokens - - -def elog_process(cpv, mysettings): - mylogfiles = listdir(mysettings["T"]+"/logging/") - # shortcut for packages without any messages - if len(mylogfiles) == 0: - return - # exploit listdir() file order so we process log entries in cronological order - mylogfiles.reverse() - mylogentries = {} - for f in mylogfiles: - msgfunction, msgtype = f.split(".") - if not msgtype.upper() in mysettings["PORTAGE_LOG_CLASSES"].split() \ - and not msgtype.lower() in mysettings["PORTAGE_LOG_CLASSES"].split(): - continue - if msgfunction not in portage_const.EBUILD_PHASES.split(): - print "!!! can't process invalid log file: %s" % f - continue - if not msgfunction in mylogentries: - mylogentries[msgfunction] = [] - msgcontent = open(mysettings["T"]+"/logging/"+f, "r").readlines() - mylogentries[msgfunction].append((msgtype, msgcontent)) - - # in case the filters matched all messages - if len(mylogentries) == 0: - return - - # generate a single string with all log messages - fulllog = "" - for phase in portage_const.EBUILD_PHASES.split(): - if not phase in mylogentries: - continue - for msgtype,msgcontent in mylogentries[phase]: - fulllog += "%s: %s\n" % (msgtype, phase) - for line in msgcontent: - fulllog += line - fulllog += "\n" - - # pass the processing to the individual modules - logsystems = mysettings["PORTAGE_LOG_SYSTEM"].split() - for s in logsystems: - try: - # FIXME: ugly ad.hoc import code - # TODO: implement a common portage module loader - logmodule = __import__("elog_modules.mod_"+s) - m = getattr(logmodule, "mod_"+s) - m.process(mysettings, cpv, mylogentries, fulllog) - except (ImportError, AttributeError), e: - print "!!! Error while importing logging modules:" - print e - except portage_exception.PortageException, e: - print e - -#parse /etc/env.d and generate /etc/profile.env - -#move this to config. -def env_update(root,makelinks=1): - if not os.path.exists(root+"etc/env.d"): - prevmask=os.umask(0) - os.makedirs(root+"etc/env.d",0755) - os.umask(prevmask) - fns=listdir(root+"etc/env.d") - fns.sort() - pos=0 - while (pos<len(fns)): - if len(fns[pos])<=2: - del fns[pos] - continue - if (fns[pos][0] not in string.digits) or (fns[pos][1] not in string.digits): - del fns[pos] - continue - pos=pos+1 - - specials={ - "KDEDIRS":[],"PATH":[],"CLASSPATH":[],"LDPATH":[],"MANPATH":[], - "INFODIR":[],"INFOPATH":[],"ROOTPATH":[],"CONFIG_PROTECT":[], - "CONFIG_PROTECT_MASK":[],"PRELINK_PATH":[],"PRELINK_PATH_MASK":[], - "PYTHONPATH":[], "ADA_INCLUDE_PATH":[], "ADA_OBJECTS_PATH":[] - } - colon_separated = [ - "ADA_INCLUDE_PATH", "ADA_OBJECTS_PATH", - "LDPATH", "MANPATH", - "PATH", "PRELINK_PATH", - "PRELINK_PATH_MASK", "PYTHON_PATH" - ] - - env={} - - for x in fns: - # don't process backup files - if x[-1]=='~' or x[-4:]==".bak": - continue - myconfig=getconfig(root+"etc/env.d/"+x) - if myconfig==None: - writemsg("!!! Parsing error in "+str(root)+"etc/env.d/"+str(x)+"\n") - #parse error - continue - # process PATH, CLASSPATH, LDPATH - for myspec in specials.keys(): - if myconfig.has_key(myspec): - if myspec in colon_separated: - specials[myspec].extend(string.split(varexpand(myconfig[myspec]),":")) - else: - specials[myspec].append(varexpand(myconfig[myspec])) - del myconfig[myspec] - # process all other variables - for myenv in myconfig.keys(): - env[myenv]=varexpand(myconfig[myenv]) - - if os.path.exists(root+"etc/ld.so.conf"): - myld=open(root+"etc/ld.so.conf") - myldlines=myld.readlines() - myld.close() - oldld=[] - for x in myldlines: - #each line has at least one char (a newline) - if x[0]=="#": - continue - oldld.append(x[:-1]) - # os.rename(root+"etc/ld.so.conf",root+"etc/ld.so.conf.bak") - # Where is the new ld.so.conf generated? (achim) - else: - oldld=None - - ld_cache_update=False - if os.environ.has_key("PORTAGE_CALLER") and \ - os.environ["PORTAGE_CALLER"] == "env-update": - ld_cache_update = True - - newld=specials["LDPATH"] - if (oldld!=newld): - #ld.so.conf needs updating and ldconfig needs to be run - myfd=open(root+"etc/ld.so.conf","w") - myfd.write("# ld.so.conf autogenerated by env-update; make all changes to\n") - myfd.write("# contents of /etc/env.d directory\n") - for x in specials["LDPATH"]: - myfd.write(x+"\n") - myfd.close() - ld_cache_update=True - - # Update prelink.conf if we are prelink-enabled - if prelink_capable: - newprelink=open(root+"etc/prelink.conf","w") - newprelink.write("# prelink.conf autogenerated by env-update; make all changes to\n") - newprelink.write("# contents of /etc/env.d directory\n") - - for x in ["/bin","/sbin","/usr/bin","/usr/sbin","/lib","/usr/lib"]: - newprelink.write("-l "+x+"\n"); - for x in specials["LDPATH"]+specials["PATH"]+specials["PRELINK_PATH"]: - if not x: - continue - if x[-1] != "/": - x += "/" - plmasked=0 - for y in specials["PRELINK_PATH_MASK"]: - if y[-1]!='/': - y=y+"/" - if y==x[0:len(y)]: - plmasked=1 - break - if not plmasked: - newprelink.write("-h "+x+"\n") - for x in specials["PRELINK_PATH_MASK"]: - newprelink.write("-b "+x+"\n") - newprelink.close() - - if not mtimedb.has_key("ldpath"): - mtimedb["ldpath"]={} - - for x in specials["LDPATH"]+['/usr/lib','/lib']: - try: - newldpathtime=os.stat(x)[stat.ST_MTIME] - except SystemExit, e: - raise - except: - newldpathtime=0 - if mtimedb["ldpath"].has_key(x): - if mtimedb["ldpath"][x]==newldpathtime: - pass - else: - mtimedb["ldpath"][x]=newldpathtime - ld_cache_update=True - else: - mtimedb["ldpath"][x]=newldpathtime - ld_cache_update=True - - if (ld_cache_update or makelinks): - # We can't update links if we haven't cleaned other versions first, as - # an older package installed ON TOP of a newer version will cause ldconfig - # to overwrite the symlinks we just made. -X means no links. After 'clean' - # we can safely create links. - writemsg(">>> Regenerating "+str(root)+"etc/ld.so.cache...\n") - cwd="/" - try: cwd=os.getcwd() - except (OSError, IOError): pass - if makelinks: - portage_exec.spawn("/sbin/ldconfig -r "+root) - else: - portage_exec.spawn("/sbin/ldconfig -X -r "+root) - try: os.chdir(cwd) - except OSError: pass - - del specials["LDPATH"] - - penvnotice = "# THIS FILE IS AUTOMATICALLY GENERATED BY env-update.\n" - penvnotice += "# DO NOT EDIT THIS FILE. CHANGES TO STARTUP PROFILES\n" - cenvnotice = penvnotice - penvnotice += "# GO INTO /etc/profile NOT /etc/profile.env\n\n" - cenvnotice += "# GO INTO /etc/csh.cshrc NOT /etc/csh.env\n\n" - - #create /etc/profile.env for bash support - outfile=open(root+"/etc/profile.env","w") - outfile.write(penvnotice) - - for path, values in specials.items(): - if not values: - continue - if path in ["CONFIG_PROTECT","CONFIG_PROTECT_MASK"]: - sep = " " - else: - sep = ":" - outstring = "export %s='%s'\n" % (path,sep.join(values)) - outfile.write(outstring) - - #create /etc/profile.env - for x in env: - if type(env[x])!=str: - continue - outfile.write("export "+x+"='"+env[x]+"'\n") - outfile.close() - - #create /etc/csh.env for (t)csh support - outfile=open(root+"/etc/csh.env","w") - outfile.write(cenvnotice) - - for path, values in specials.items(): - if not values: - continue - if path in ["CONFIG_PROTECT","CONFIG_PROTECT_MASK"]: - sep = " " - else: - sep = ":" - outstring = "setenv %s '%s'\n" % (path, sep.join(values)) - outfile.write(outstring) - - #create /etc/csh.env - for x in env: - if type(env[x])!=str: - continue - outfile.write("setenv "+x+" '"+env[x]+"'\n") - outfile.close() - -def new_protect_filename(mydest, newmd5=None): - """Resolves a config-protect filename for merging, optionally - using the last filename if the md5 matches. - (dest,md5) ==> 'string' --- path_to_target_filename - (dest) ==> ('next', 'highest') --- next_target and most-recent_target - """ - - # config protection filename format: - # ._cfg0000_foo - # 0123456789012 - prot_num=-1 - last_pfile="" - - if (len(mydest) == 0): - raise ValueError, "Empty path provided where a filename is required" - if (mydest[-1]=="/"): # XXX add better directory checking - raise ValueError, "Directory provided but this function requires a filename" - if not os.path.exists(mydest): - return mydest - - real_filename = os.path.basename(mydest) - real_dirname = os.path.dirname(mydest) - for pfile in listdir(real_dirname): - if pfile[0:5] != "._cfg": - continue - if pfile[10:] != real_filename: - continue - try: - new_prot_num = int(pfile[5:9]) - if new_prot_num > prot_num: - prot_num = new_prot_num - last_pfile = pfile - except SystemExit, e: - raise - except: - continue - prot_num = prot_num + 1 - - new_pfile = os.path.normpath(real_dirname+"/._cfg"+str(prot_num).zfill(4)+"_"+real_filename) - old_pfile = os.path.normpath(real_dirname+"/"+last_pfile) - if last_pfile and newmd5: - if portage_checksum.perform_md5(real_dirname+"/"+last_pfile) == newmd5: - return old_pfile - else: - return new_pfile - elif newmd5: - return new_pfile - else: - return (new_pfile, old_pfile) - -#XXX: These two are now implemented in portage_util.py but are needed here -#XXX: until the isvalidatom() dependency is sorted out. - -def grabdict_package(myfilename,juststrings=0): - pkgs=grabdict(myfilename, juststrings=juststrings, empty=1) - for x in pkgs.keys(): - if not portage_dep.isvalidatom(x): - del(pkgs[x]) - writemsg("--- Invalid atom in %s: %s\n" % (myfilename, x)) - return pkgs - -def grabfile_package(myfilename,compatlevel=0): - pkgs=grabfile(myfilename,compatlevel) - for x in range(len(pkgs)-1,-1,-1): - pkg = pkgs[x] - if pkg[0] == "-": - pkg = pkg[1:] - if pkg[0] == "*": - pkg = pkg[1:] - if not portage_dep.isvalidatom(pkg): - writemsg("--- Invalid atom in %s: %s\n" % (myfilename, pkgs[x])) - del(pkgs[x]) - return pkgs - -# returns a tuple. (version[string], error[string]) -# They are pretty much mutually exclusive. -# Either version is a string and error is none, or -# version is None and error is a string -# -def ExtractKernelVersion(base_dir): - lines = [] - pathname = os.path.join(base_dir, 'Makefile') - try: - f = open(pathname, 'r') - except OSError, details: - return (None, str(details)) - except IOError, details: - return (None, str(details)) - - try: - for i in range(4): - lines.append(f.readline()) - except OSError, details: - return (None, str(details)) - except IOError, details: - return (None, str(details)) - - lines = [ l.strip() for l in lines ] - - version = '' - - #XXX: The following code relies on the ordering of vars within the Makefile - for line in lines: - # split on the '=' then remove annoying whitespace - items = [ i.strip() for i in line.split('=') ] - if items[0] == 'VERSION' or \ - items[0] == 'PATCHLEVEL': - version += items[1] - version += "." - elif items[0] == 'SUBLEVEL': - version += items[1] - elif items[0] == 'EXTRAVERSION' and \ - items[-1] != items[0]: - version += items[1] - - # Grab a list of files named localversion* and sort them - localversions = os.listdir(base_dir) - for x in range(len(localversions)-1,-1,-1): - if localversions[x][:12] != "localversion": - del localversions[x] - localversions.sort() - - # Append the contents of each to the version string, stripping ALL whitespace - for lv in localversions: - version += string.join(string.split(string.join(grabfile(base_dir+"/"+lv))), "") - - # Check the .config for a CONFIG_LOCALVERSION and append that too, also stripping whitespace - kernelconfig = getconfig(base_dir+"/.config") - if kernelconfig and kernelconfig.has_key("CONFIG_LOCALVERSION"): - version += string.join(string.split(kernelconfig["CONFIG_LOCALVERSION"]), "") - - return (version,None) - - -# XXX This would be to replace getstatusoutput completely. -# XXX Issue: cannot block execution. Deadlock condition. -def spawn(mystring,mysettings,debug=0,free=0,droppriv=0,fd_pipes=None,**keywords): - """spawn a subprocess with optional sandbox protection, - depending on whether sandbox is enabled. The "free" argument, - when set to 1, will disable sandboxing. This allows us to - spawn processes that are supposed to modify files outside of the - sandbox. We can't use os.system anymore because it messes up - signal handling. Using spawn allows our Portage signal handler - to work.""" - - if type(mysettings) == types.DictType: - env=mysettings - keywords["opt_name"]="[ %s ]" % "portage" - else: - if not isinstance(mysettings, config): - raise TypeError, "Invalid type for config object: %s" % mysettings.__class_ - env=mysettings.environ() - keywords["opt_name"]="[%s]" % mysettings["PF"] - - - # XXX: Negative RESTRICT word - myrestrict = mysettings["RESTRICT"].split() - droppriv=(droppriv and "userpriv" in mysettings.features and - "nouserpriv" not in myrestrict and "userpriv" not in myrestrict) - - if ("sandbox" in features) and (not free): - keywords["opt_name"] += " sandbox" - if droppriv and portage_gid and portage_uid: - keywords.update({"uid":portage_uid,"gid":portage_gid,"groups":[portage_gid],"umask":002}) - return portage_exec.spawn_sandbox(mystring,env=env,**keywords) - else: - keywords["opt_name"] += " bash" - return portage_exec.spawn_bash(mystring,env=env,**keywords) - -def fetch(myuris, mysettings, listonly=0, fetchonly=0, locks_in_subdir=".locks",use_locks=1, try_mirrors=1,verbosity=0): - "fetch files. Will use digest file if available." - - # 'nomirror' is bad/negative logic. You Restrict mirroring, not no-mirroring. - myrestrict = mysettings["RESTRICT"].split() - if "mirror" in myrestrict or "nomirror" in myrestrict: - if ("mirror" in mysettings.features) and ("lmirror" not in mysettings.features): - # lmirror should allow you to bypass mirror restrictions. - # XXX: This is not a good thing, and is temporary at best. - if verbosity: - print ">>> \"mirror\" mode desired and \"mirror\" restriction found; skipping fetch." - return 1 - - global thirdpartymirrors - - if not isinstance(mysettings, config): - raise TypeError, "Invalid type for config object: %s" % mysettings.__class_ - - custommirrors=grabdict(CUSTOM_MIRRORS_FILE) - - mymirrors=[] - - if listonly or ("distlocks" not in features): - use_locks = 0 - - # local mirrors are always added - if custommirrors.has_key("local"): - mymirrors += custommirrors["local"] - - if ("nomirror" in mysettings["RESTRICT"].split()) or \ - ("mirror" in mysettings["RESTRICT"].split()): - # We don't add any mirrors. - pass - else: - if try_mirrors: - for x in mysettings["GENTOO_MIRRORS"].split(): - if x: - if x[-1] == '/': - mymirrors += [x[:-1]] - else: - mymirrors += [x] - - mydigests={} - digestfn = mysettings["FILESDIR"]+"/digest-"+mysettings["PF"] - if os.path.exists(digestfn): - mydigests = digestParseFile(digestfn) - - fsmirrors = [] - for x in range(len(mymirrors)-1,-1,-1): - if mymirrors[x] and mymirrors[x][0]=='/': - fsmirrors += [mymirrors[x]] - del mymirrors[x] - - for myuri in myuris: - myfile=os.path.basename(myuri) - try: - destdir = mysettings["DISTDIR"]+"/" - if not os.path.exists(destdir+myfile): - for mydir in fsmirrors: - if os.path.exists(mydir+"/"+myfile): - writemsg(_("Local mirror has file: %(file)s\n" % {"file":myfile})) - shutil.copyfile(mydir+"/"+myfile,destdir+"/"+myfile) - break - except (OSError,IOError),e: - # file does not exist - writemsg(_("!!! %(file)s not found in %(dir)s." % {"file":myfile,"dir":mysettings["DISTDIR"]}),verbosity) - gotit=0 - - if "fetch" in mysettings["RESTRICT"].split(): - # fetch is restricted. Ensure all files have already been downloaded; otherwise, - # print message and exit. - gotit=1 - for myuri in myuris: - myfile=os.path.basename(myuri) - try: - mystat=os.stat(mysettings["DISTDIR"]+"/"+myfile) - except (OSError,IOError),e: - # file does not exist - # FIXME: gettext doesn't work yet - # writemsg(_("!!! %(file)s not found in %(dir)s." % {"file":myfile, "dir":mysettings["DISTDIR"]}),verbosity) - writemsg("!!! %(file)s not found in %(dir)s." % {"file":myfile, "dir":mysettings["DISTDIR"]},verbosity) - gotit=0 - if not gotit: - writemsg("\n!!!"+mysettings["CATEGORY"]+"/"+mysettings["PF"]+"has fetch restriction turned on.\n"+ - "!!! This probably means that this ebuild's files must be downloaded\n"+ - "!!! manually. See the comments in the ebuild for more information.\n\n", - verbosity) - spawn(EBUILD_SH_BINARY+" nofetch",mysettings) - return 0 - return 1 - locations=mymirrors[:] - filedict={} - primaryuri_indexes={} - for myuri in myuris: - myfile=os.path.basename(myuri) - if not filedict.has_key(myfile): - filedict[myfile]=[] - for y in range(0,len(locations)): - filedict[myfile].append(locations[y]+"/distfiles/"+myfile) - if myuri[:9]=="mirror://": - eidx = myuri.find("/", 9) - if eidx != -1: - mirrorname = myuri[9:eidx] - - # Try user-defined mirrors first - if custommirrors.has_key(mirrorname): - for cmirr in custommirrors[mirrorname]: - filedict[myfile].append(cmirr+"/"+myuri[eidx+1:]) - # remove the mirrors we tried from the list of official mirrors - if cmirr.strip() in thirdpartymirrors[mirrorname]: - thirdpartymirrors[mirrorname].remove(cmirr) - # now try the official mirrors - if thirdpartymirrors.has_key(mirrorname): - try: - shuffle(thirdpartymirrors[mirrorname]) - except SystemExit, e: - raise - except: - writemsg(red("!!! YOU HAVE A BROKEN PYTHON/GLIBC.\n"),verbosity) - writemsg( "!!! You are most likely on a pentium4 box and have specified -march=pentium4\n",verbosity) - writemsg( "!!! or -fpmath=sse2. GCC was generating invalid sse2 instructions in versions\n",verbosity) - writemsg( "!!! prior to 3.2.3. Please merge the latest gcc or rebuid python with either\n",verbosity) - writemsg( "!!! -march=pentium3 or set -mno-sse2 in your cflags.\n\n\n",verbosity) - time.sleep(10) - - for locmirr in thirdpartymirrors[mirrorname]: - filedict[myfile].append(locmirr+"/"+myuri[eidx+1:]) - - - if not filedict[myfile]: - writemsg("No known mirror by the name: %s\n" % (mirrorname),verbosity) - else: - writemsg("Invalid mirror definition in SRC_URI:\n",verbosity) - writemsg(" %s\n" % (myuri),verbosity) - else: - if "primaryuri" in mysettings["RESTRICT"].split(): - # Use the source site first. - if primaryuri_indexes.has_key(myfile): - primaryuri_indexes[myfile] += 1 - else: - primaryuri_indexes[myfile] = 0 - filedict[myfile].insert(primaryuri_indexes[myfile], myuri) - else: - filedict[myfile].append(myuri) - - missingSourceHost = False - for myfile in filedict.keys(): # Gives a list, not just the first one - if not filedict[myfile]: - writemsg("Warning: No mirrors available for file '%s'\n" % (myfile),verbosity) - missingSourceHost = True - if missingSourceHost: - return 0 - del missingSourceHost - - can_fetch=True - if not os.access(mysettings["DISTDIR"]+"/",os.W_OK): - writemsg("!!! No write access to %s" % mysettings["DISTDIR"]+"/\n",verbosity) - can_fetch=False - else: - mystat=os.stat(mysettings["DISTDIR"]+"/") - if mystat.st_gid != portage_gid: - try: - os.chown(mysettings["DISTDIR"],-1,portage_gid) - except OSError, oe: - if oe.errno == 1: - writemsg(red("!!!")+" Unable to chgrp of %s to portage, continuing\n" % - mysettings["DISTDIR"],verbosity) - else: - raise oe - - # writable by portage_gid? This is specific to root, adjust perms if needed automatically. - if not stat.S_IMODE(mystat.st_mode) & 020: - try: - os.chmod(mysettings["DISTDIR"],stat.S_IMODE(mystat.st_mode) | 020) - except OSError, oe: - if oe.errno == 1: - writemsg(red("!!!")+" Unable to chmod %s to perms 0755. Non-root users will experience issues.\n" % mysettings["DISTDIR"],verbosity) - else: - raise oe - - if use_locks and locks_in_subdir: - if os.path.exists(mysettings["DISTDIR"]+"/"+locks_in_subdir): - if not os.access(mysettings["DISTDIR"]+"/"+locks_in_subdir,os.W_OK): - writemsg("!!! No write access to write to %s. Aborting.\n" % mysettings["DISTDIR"]+"/"+locks_in_subdir,verbosity) - return 0 - else: - old_umask=os.umask(0002) - os.mkdir(mysettings["DISTDIR"]+"/"+locks_in_subdir,0775) - if os.stat(mysettings["DISTDIR"]+"/"+locks_in_subdir).st_gid != portage_gid: - try: - os.chown(mysettings["DISTDIR"]+"/"+locks_in_subdir,-1,portage_gid) - except SystemExit, e: - raise - except: - pass - os.umask(old_umask) - - - fetcher = get_preferred_fetcher() - for myfile in filedict.keys(): - fetched=0 - file_lock = None - if listonly: - writemsg("\n",verbosity) - else: - if use_locks and can_fetch: - if locks_in_subdir: - file_lock = portage_locks.lockfile(mysettings["DISTDIR"]+"/"+locks_in_subdir+"/"+myfile,wantnewlockfile=1,verbosity=verbosity) - else: - file_lock = portage_locks.lockfile(mysettings["DISTDIR"]+"/"+myfile,wantnewlockfile=1,verbosity=verbosity) - try: - for loc in filedict[myfile]: - if listonly: - writemsg(loc+" ",verbosity) - continue - - try: - mystat=os.stat(mysettings["DISTDIR"]+"/"+myfile) - if mydigests.has_key(myfile): - #if we have the digest file, we know the final size and can resume the download. - if mystat[stat.ST_SIZE]<mydigests[myfile]["size"]: - fetched=1 - else: - #we already have it downloaded, skip. - #if our file is bigger than the recorded size, digestcheck should catch it. - if not fetchonly: - fetched=2 - else: - # Check md5sum's at each fetch for fetchonly. - verified_ok,reason = portage_checksum.verify_all(mysettings["DISTDIR"]+"/"+myfile, mydigests[myfile]) - if not verified_ok: - writemsg("!!! Previously fetched file: "+str(myfile)+"\n!!! Reason: "+reason+"\nRefetching...\n\n",verbosity) - os.unlink(mysettings["DISTDIR"]+"/"+myfile) - fetched=0 - else: - for x_key in mydigests[myfile].keys(): - writemsg(">>> Previously fetched file: "+str(myfile)+" "+x_key+" ;-)\n",verbosity) - fetched=2 - break #No need to keep looking for this file, we have it! - else: - #we don't have the digest file, but the file exists. Assume it is fully downloaded. - fetched=2 - except (OSError,IOError),e: - writemsg("An exception was caught(1)...\nFailing the download: %s.\n" % (str(e)),verbosity+1) - fetched=0 - - if not can_fetch: - if fetched != 2: - if fetched == 0: - writemsg("!!! File %s isn't fetched but unable to get it.\n" % myfile,verbosity) - else: - writemsg("!!! File %s isn't fully fetched, but unable to complete it\n" % myfile,verbosity) - return 0 - else: - continue - - # check if we can actually write to the directory/existing file. - if fetched!=2 and os.path.exists(mysettings["DISTDIR"]+"/"+myfile) != \ - os.access(mysettings["DISTDIR"]+"/"+myfile, os.W_OK): - writemsg(red("***")+" Lack write access to %s, failing fetch\n" % str(mysettings["DISTDIR"]+"/"+myfile),verbosity) - fetched=0 - break - elif fetched!=2: - #we either need to resume or start the download - #you can't use "continue" when you're inside a "try" block - if fetched==1: - #resume mode: - writemsg(">>> Resuming download...\n",verbosity) - locfetch=fetcher.resume - else: - #normal mode: - locfetch=fetcher.fetch - writemsg(">>> Downloading "+str(loc)+"\n",verbosity) - try: - myret=locfetch(loc,file_name=mysettings["DISTDIR"]+"/"+myfile, \ - verbose=(verbosity==0)) - if myret==127 and \ - isinstance(fetcher,transports.fetchcommand.CustomConnection): - # this is an indication of a missing libs for the binary. - # fex: USE="ssl" wget, missing libssl. - # - # lets try to be helpful. ;-) - f=transports.bundled_lib.BundledConnection() - if fetched==1: - myret=f.resume(loc, \ - file_name=mysettings["DISTDIR"]+"/"+myfile, - verbose=(verbosity==0)) - else: - myret=f.fetch(loc, \ - file_name=mysettings["DISTDIR"]+"/"+myfile, - verbose=(verbosity==0)) - if not myret: - writemsg(red("!!!")+"\n") - writemsg(red("!!!")+" FETCHCOMMAND/RESUMECOMMAND exited with code 127\n") - writemsg(red("!!!")+" This is indicative of missing libs for the fetch/resume binaries\n") - writemsg(red("!!!")+" Added, the independ BundledConnection succeeded\n") - writemsg(red("!!!")+" Please check your installation.\n") - writemsg(red("!!!")+" Defaulting to BundledConnection for the remainder of this fetch request\n") - writemsg(red("!!!")+"\n") - fetcher = f - finally: - #if root, -always- set the perms. - if os.path.exists(mysettings["DISTDIR"]+"/"+myfile) and (fetched != 1 or os.getuid() == 0): - if os.stat(mysettings["DISTDIR"]+"/"+myfile).st_gid != portage_gid: - try: - os.chown(mysettings["DISTDIR"]+"/"+myfile,-1,portage_gid) - except SystemExit, e: - raise - except: - writemsg("chown failed on distfile: " + str(myfile),verbosity) - os.chmod(mysettings["DISTDIR"]+"/"+myfile,0664) - - if mydigests!=None and mydigests.has_key(myfile): - try: - mystat=os.stat(mysettings["DISTDIR"]+"/"+myfile) - # no exception? file exists. let digestcheck() report - # an appropriately for size or md5 errors - if (mystat[stat.ST_SIZE]<mydigests[myfile]["size"]): - # Fetch failed... Try the next one... Kill 404 files though. - if (mystat[stat.ST_SIZE]<100000) and (len(myfile)>4) and not ((myfile[-5:]==".html") or (myfile[-4:]==".htm")): - html404=re.compile("<title>.*(not found|404).*</title>",re.I|re.M) - try: - if html404.search(open(mysettings["DISTDIR"]+"/"+myfile).read()): - try: - os.unlink(mysettings["DISTDIR"]+"/"+myfile) - writemsg(">>> Deleting invalid distfile. (Improper 404 redirect from server.)\n",verbosity) - except SystemExit, e: - raise - except: - pass - except SystemExit, e: - raise - except: - pass - continue - if not fetchonly: - fetched=2 - break - else: - # File is the correct size--check the MD5 sum for the fetched - # file NOW, for those users who don't have a stable/continuous - # net connection. This way we have a chance to try to download - # from another mirror... - verified_ok,reason = portage_checksum.verify_all(mysettings["DISTDIR"]+"/"+myfile, mydigests[myfile]) - if not verified_ok: - writemsg("!!! Fetched file: "+str(myfile)+" VERIFY FAILED!\n!!! Reason: "+reason+"\nRemoving corrupt distfile...\n",verbosity) - os.unlink(mysettings["DISTDIR"]+"/"+myfile) - fetched=0 - else: - for x_key in mydigests[myfile].keys(): - writemsg(">>> "+str(myfile)+" "+x_key+" ;-)\n",verbosity) - fetched=2 - break - except (OSError,IOError),e: - writemsg("An exception was caught(2)...\nFailing the download: %s.\n" % (str(e)),verbosity+1) - fetched=0 - else: - if not myret: - fetched=2 - break - elif mydigests!=None: - writemsg("No digest file available and download failed.\n\n") - finally: - if use_locks and file_lock: - portage_locks.unlockfile(file_lock) - - if listonly: - writemsg("\n") - if (fetched!=2) and not listonly: - writemsg("!!! Couldn't download "+str(myfile)+". Aborting.\n",verbosity) - return 0 - return 1 - - -def digestCreate(myfiles,basedir,oldDigest={}): - """Takes a list of files and the directory they are in and returns the - dict of dict[filename][CHECKSUM_KEY] = hash - returns None on error.""" - mydigests={} - for x in myfiles: - print "<<<",x - myfile=os.path.normpath(basedir+"///"+x) - if os.path.exists(myfile): - if not os.access(myfile, os.R_OK): - print "!!! Given file does not appear to be readable. Does it exist?" - print "!!! File:",myfile - return None - mydigests[x] = portage_checksum.perform_all(myfile) - mysize = os.stat(myfile)[stat.ST_SIZE] - else: - if x in oldDigest: - # DeepCopy because we might not have a unique reference. - mydigests[x] = copy.deepcopy(oldDigest[x]) - mysize = oldDigest[x]["size"] - else: - print "!!! We have a source URI, but no file..." - print "!!! File:",myfile - return None - - if "size" in mydigests[x] and (mydigests[x]["size"] != mysize): - raise portage_exception.DigestException, "Size mismatch during checksums" - mydigests[x]["size"] = mysize - - - return mydigests - -def digestCreateLines(filelist, mydigests): - mylines = [] - for myarchive in filelist: - mysize = mydigests[myarchive]["size"] - if len(mydigests[myarchive]) == 0: - raise portage_exception.DigestException, "No generate digest for '%(file)s'" % {"file":myarchive} - for sumName in mydigests[myarchive].keys(): - if sumName not in portage_checksum.get_valid_checksum_keys(): - continue - mysum = mydigests[myarchive][sumName] - - myline = " ".join([sumName, mysum, myarchive, str(mysize)]) - if sumName != "MD5": - # XXXXXXXXXXXXXXXX This cannot be used! - # Older portage make very dumb assumptions about the formats. - # We need a lead-in period before we break everything. - continue - mylines.append(myline) - return mylines - -def digestgen(myarchives,mysettings,overwrite=1,manifestonly=0,verbosity=0): - """generates digest file if missing. Assumes all files are available. If - overwrite=0, the digest will only be created if it doesn't already exist.""" - - # archive files - basedir=mysettings["DISTDIR"]+"/" - digestfn=mysettings["FILESDIR"]+"/digest-"+mysettings["PF"] - - # portage files -- p(ortagefiles)basedir - pbasedir=mysettings["O"]+"/" - manifestfn=pbasedir+"Manifest" - - if not manifestonly: - if not os.path.isdir(mysettings["FILESDIR"]): - os.makedirs(mysettings["FILESDIR"]) - mycvstree=cvstree.getentries(pbasedir, recursive=1) - - if ("cvs" in features) and os.path.exists(pbasedir+"/CVS"): - if not cvstree.isadded(mycvstree,"files"): - if "autoaddcvs" in features: - writemsg(">>> Auto-adding files/ dir to CVS...\n",verbosity - 1) - spawn("cd "+pbasedir+"; cvs add files",mysettings,free=1) - else: - writemsg("--- Warning: files/ is not added to cvs.\n",verbosity) - - if (not overwrite) and os.path.exists(digestfn): - return 1 - - print green(">>> Generating digest file...") - - # Track the old digest so that we can assume checksums without requiring - # all files be downloaded. 'Assuming' - # XXX: <harring>- why does this seem like a way to pollute the hell out of the - # digests? This strikes me as lining the path between your bed and coffee machine - # with land mines... - myolddigest = {} - if os.path.exists(digestfn): - myolddigest = digestParseFile(digestfn) - - mydigests=digestCreate(myarchives, basedir, oldDigest=myolddigest) - if mydigests==None: # There was a problem, exit with an errorcode. - return 0 - - try: - outfile=open(digestfn, "w+") - except SystemExit, e: - raise - except Exception, e: - print "!!! Filesystem error skipping generation. (Read-Only?)" - print "!!!",e - return 0 - for x in digestCreateLines(myarchives, mydigests): - outfile.write(x+"\n") - outfile.close() - try: - os.chown(digestfn,os.getuid(),portage_gid) - os.chmod(digestfn,0664) - except SystemExit, e: - raise - except Exception,e: - print e - - print green(">>> Generating manifest file...") - mypfiles=listdir(pbasedir,recursive=1,filesonly=1,ignorecvs=1) - mypfiles=cvstree.apply_cvsignore_filter(mypfiles) - if "Manifest" in mypfiles: - del mypfiles[mypfiles.index("Manifest")] - - mydigests=digestCreate(mypfiles, pbasedir) - if mydigests==None: # There was a problem, exit with an errorcode. - return 0 - - try: - outfile=open(manifestfn, "w+") - except SystemExit, e: - raise - except Exception, e: - print "!!! Filesystem error skipping generation. (Read-Only?)" - print "!!!",e - return 0 - for x in digestCreateLines(mypfiles, mydigests): - outfile.write(x+"\n") - outfile.close() - try: - os.chown(manifestfn,os.getuid(),portage_gid) - os.chmod(manifestfn,0664) - except SystemExit, e: - raise - except Exception,e: - print e - - if "cvs" in features and os.path.exists(pbasedir+"/CVS"): - mycvstree=cvstree.getentries(pbasedir, recursive=1) - myunaddedfiles="" - if not manifestonly and not cvstree.isadded(mycvstree,digestfn): - if digestfn[:len(pbasedir)]==pbasedir: - myunaddedfiles=digestfn[len(pbasedir):]+" " - else: - myunaddedfiles=digestfn+" " - if not cvstree.isadded(mycvstree,manifestfn[len(pbasedir):]): - if manifestfn[:len(pbasedir)]==pbasedir: - myunaddedfiles+=manifestfn[len(pbasedir):]+" " - else: - myunaddedfiles+=manifestfn - if myunaddedfiles: - if "autoaddcvs" in features: - print blue(">>> Auto-adding digest file(s) to CVS...") - spawn("cd "+pbasedir+"; cvs add "+myunaddedfiles,mysettings,free=1) - else: - print "--- Warning: digests are not yet added into CVS." - print darkgreen(">>> Computed message digests.") - print - return 1 - - -def digestParseFile(myfilename): - """(filename) -- Parses a given file for entries matching: - MD5 MD5_STRING_OF_HEX_CHARS FILE_NAME FILE_SIZE - Ignores lines that do not begin with 'MD5' and returns a - dict with the filenames as keys and [md5,size] as the values.""" - - if not os.path.exists(myfilename): - return None - mylines = portage_util.grabfile(myfilename, compat_level=1) - - mydigests={} - for x in mylines: - myline=x.split() - if len(myline) < 4: - #invalid line - continue - if myline[0] not in portage_checksum.get_valid_checksum_keys(): - continue - mykey = myline.pop(0) - myhash = myline.pop(0) - mysize = long(myline.pop()) - myfn = " ".join(myline) - if myfn not in mydigests: - mydigests[myfn] = {} - mydigests[myfn][mykey] = myhash - if "size" in mydigests[myfn]: - if mydigests[myfn]["size"] != mysize: - raise portage_exception.DigestException, "Conflicting sizes in digest: %(filename)s" % {"filename":myfilename} - else: - mydigests[myfn]["size"] = mysize - return mydigests - -# XXXX strict was added here to fix a missing name error. -# XXXX It's used below, but we're not paying attention to how we get it? -def digestCheckFiles(myfiles, mydigests, basedir, note="", strict=0,verbosity=0): - """(fileslist, digestdict, basedir) -- Takes a list of files and a dict - of their digests and checks the digests against the indicated files in - the basedir given. Returns 1 only if all files exist and match the md5s. - """ - for x in myfiles: - if not mydigests.has_key(x): - writemsg("\n",verbosity) - writemsg(red("!!! No message digest entry found for file \""+x+".\"")+"\n"+ - "!!! Most likely a temporary problem. Try 'emerge sync' again later.\n"+ - "!!! If you are certain of the authenticity of the file then you may type\n"+ - "!!! the following to generate a new digest:\n"+ - "!!! ebuild /usr/portage/category/package/package-version.ebuild digest\n", - verbosity) - return 0 - myfile=os.path.normpath(basedir+"/"+x) - if not os.path.exists(myfile): - if strict: - writemsg("!!! File does not exist:"+str(myfile)+"\n",verbosity) - return 0 - continue - - ok,reason = portage_checksum.verify_all(myfile,mydigests[x]) - if not ok: - writemsg("\n"+red("!!! Digest verification Failed:")+"\n"+ - red("!!!")+" "+str(myfile)+"\n"+ - red("!!! Reason: ")+reason+"\n", - verbosity) - return 0 - else: - writemsg(">>> md5 "+note+" ;-) %s\n" % str(x),verbosity) - return 1 - - -def digestcheck(myfiles, mysettings, strict=0,verbosity=0): - """Checks md5sums. Assumes all files have been downloaded.""" - # archive files - basedir=mysettings["DISTDIR"]+"/" - digestfn=mysettings["FILESDIR"]+"/digest-"+mysettings["PF"] - - # portage files -- p(ortagefiles)basedir - pbasedir=mysettings["O"]+"/" - manifestfn=pbasedir+"Manifest" - - if not (os.path.exists(digestfn) and os.path.exists(manifestfn)): - if "digest" in features: - writemsg(">>> No package digest/Manifest file found.\n",verbosity) - writemsg(">>> \"digest\" mode enabled; auto-generating new digest...\n",verbosity) - return digestgen(myfiles,mysettings,verbosity=verbosity) - else: - if not os.path.exists(manifestfn): - if strict: - writemsg(red("!!! No package manifest found:")+" %s\n" % manifestfn,verbosity) - return 0 - else: - writemsg("--- No package manifest found: %s\n" % manifestfn,verbosity) - if not os.path.exists(digestfn): - writemsg("!!! No package digest file found: %s\n" % digestfn,verbosity) - writemsg("!!! Type \"ebuild foo.ebuild digest\" to generate it.\n", verbosity) - return 0 - - mydigests=digestParseFile(digestfn) - if mydigests==None: - writemsg("!!! Failed to parse digest file: %s\n" % digestfn, verbosity) - return 0 - mymdigests=digestParseFile(manifestfn) - if "strict" not in features: - # XXX: Remove this when manifests become mainstream. - pass - elif mymdigests==None: - writemsg("!!! Failed to parse manifest file: %s\n" % manifestfn,verbosity) - if strict: - return 0 - else: - # Check the portage-related files here. - mymfiles=listdir(pbasedir,recursive=1,filesonly=1,ignorecvs=1) - manifest_files = mymdigests.keys() - for x in range(len(mymfiles)-1,-1,-1): - if mymfiles[x]=='Manifest': # We don't want the manifest in out list. - del mymfiles[x] - continue - if mymfiles[x] in manifest_files: - manifest_files.remove(mymfiles[x]) - elif len(cvstree.apply_cvsignore_filter([mymfiles[x]]))==0: - # we filter here, rather then above; manifest might have files flagged by the filter. - # if something is returned, then it's flagged as a bad file - # manifest doesn't know about it, so we kill it here. - del mymfiles[x] - else: - writemsg(red("!!! Security Violation: A file exists that is not in the manifest.")+"\n",verbosity) - writemsg("!!! File: %s\n" % mymfiles[x],verbosity) - if strict: - return 0 - - if manifest_files and strict: - for x in grabfile(USER_CONFIG_PATH+"/manifest_excludes"): - if x in manifest_files: - #writemsg(yellow(">>>")+" md5-ignore: "+x,verbosity) - manifest_files.remove(x) - - if manifest_files: - writemsg(red("!!! Files listed in the manifest do not exist!")+"\n",verbosity) - for x in manifest_files: - writemsg(x+"\n",verbosity) - return 0 - - if not digestCheckFiles(mymfiles, mymdigests, pbasedir, note="files ", strict=strict, verbosity=verbosity): - if strict: - writemsg(">>> Please ensure you have sync'd properly. Please try '"+bold("emerge sync")+"' and\n"+ - ">>> optionally examine the file(s) for corruption. "+bold("A sync will fix most cases.")+"\n\n", - verbosity) - return 0 - else: - writemsg("--- Manifest check failed. 'strict' not enabled; ignoring.\n\n",verbosity) - - # Just return the status, as it's the last check. - return digestCheckFiles(myfiles, mydigests, basedir, note="src_uri", strict=strict,verbosity=verbosity) - -# note, use_info_env is a hack to allow treewalk to specify the correct env. it sucks, but so does this doebuild -# setup -def doebuild(myebuild,mydo,myroot,mysettings,debug=0,listonly=0,fetchonly=0,cleanup=0,dbkey=None,use_cache=1,\ - fetchall=0,tree="porttree",allstages=True,use_info_env=True,verbosity=0): - - retval = ebuild.ebuild_handler().process_phase(mydo,mysettings,myebuild,myroot, debug=debug, listonly=listonly, \ - fetchonly=fetchonly, cleanup=cleanup, use_cache=use_cache, fetchall=fetchall, tree=tree, allstages=allstages, \ - use_info_env=use_info_env,verbosity=verbosity) - - #def doebuild(myebuild,mydo,myroot,mysettings,debug=0,listonly=0,fetchonly=0,cleanup=0,dbkey=None,use_cache=1,fetchall=0,tree="porttree",allstages=True,use_info_env=True): -# retval=ebuild.ebuild_handler().process_phase(mydo, mysettings,myebuild,myroot,debug=debug,listonly=listonly,fetchonly=fetchonly,cleanup=cleanup,dbkey=None,use_cache=1,fetchall=0,tree="porttree",allstages=allstages,use_info_env=use_info_env) - return retval - - -expandcache={} - -def merge(mycat,mypkg,pkgloc,infloc,myroot,mysettings,myebuild=None): - mylink=dblink(mycat,mypkg,myroot,mysettings) - return mylink.merge(pkgloc,infloc,myroot,myebuild) - -def unmerge(cat,pkg,myroot,mysettings,mytrimworld=1): - mylink=dblink(cat,pkg,myroot,mysettings) - if mylink.exists(): - mylink.unmerge(trimworld=mytrimworld,cleanup=1) - mylink.delete() - -def getCPFromCPV(mycpv): - """Calls portage_versions.pkgsplit on a cpv and returns only the cp.""" - return portage_versions.pkgsplit(mycpv)[0] - - -def dep_parenreduce(mysplit,mypos=0): - """ - Accepts a list of strings, and converts - '(' and ')' surrounded items to sub-lists - """ - while (mypos<len(mysplit)): - if (mysplit[mypos]=="("): - firstpos=mypos - mypos=mypos+1 - while (mypos<len(mysplit)): - if mysplit[mypos]==")": - mysplit[firstpos:mypos+1]=[mysplit[firstpos+1:mypos]] - mypos=firstpos - break - elif mysplit[mypos]=="(": - #recurse - mysplit=dep_parenreduce(mysplit,mypos=mypos) - mypos=mypos+1 - mypos=mypos+1 - return mysplit - -def dep_opconvert(mysplit,myuse,mysettings): - """ - Does dependency operator conversion - """ - - - mypos=0 - newsplit=[] - while mypos<len(mysplit): - if type(mysplit[mypos])==types.ListType: - newsplit.append(dep_opconvert(mysplit[mypos],myuse,mysettings)) - mypos += 1 - elif mysplit[mypos]==")": - #mismatched paren, error - return None - elif mysplit[mypos]=="||": - if ((mypos+1)>=len(mysplit)) or (type(mysplit[mypos+1])!=types.ListType): - # || must be followed by paren'd list - return None - try: - mynew=dep_opconvert(mysplit[mypos+1],myuse,mysettings) - except SystemExit, e: - raise - except Exception, e: - print "!!! Unable to satisfy OR dependency:", " || ".join(mysplit) - raise - mynew[0:0]=["||"] - newsplit.append(mynew) - mypos += 2 - elif mysplit[mypos][-1]=="?": - #uses clause, i.e "gnome? ( foo bar )" - #this is a quick and dirty hack so that repoman can enable all USE vars: - if (len(myuse)==1) and (myuse[0]=="*") and mysettings: - # enable it even if it's ! (for repoman) but kill it if it's - # an arch variable that isn't for this arch. XXX Sparc64? - k=mysplit[mypos][:-1] - if k[0]=="!": - k=k[1:] - if k not in archlist and k not in mysettings.usemask: - enabled=1 - elif k in archlist: - if k==mysettings["ARCH"]: - if mysplit[mypos][0]=="!": - enabled=0 - else: - enabled=1 - elif mysplit[mypos][0]=="!": - enabled=1 - else: - enabled=0 - else: - enabled=0 - else: - if mysplit[mypos][0]=="!": - myusevar=mysplit[mypos][1:-1] - if myusevar in myuse: - enabled=0 - else: - enabled=1 - else: - myusevar=mysplit[mypos][:-1] - if myusevar in myuse: - enabled=1 - else: - enabled=0 - if (mypos+2<len(mysplit)) and (mysplit[mypos+2]==":"): - #colon mode - if enabled: - #choose the first option - if type(mysplit[mypos+1])==types.ListType: - newsplit.append(dep_opconvert(mysplit[mypos+1],myuse,mysettings)) - else: - newsplit.append(mysplit[mypos+1]) - else: - #choose the alternate option - if type(mysplit[mypos+1])==types.ListType: - newsplit.append(dep_opconvert(mysplit[mypos+3],myuse,mysettings)) - else: - newsplit.append(mysplit[mypos+3]) - mypos += 4 - else: - #normal use mode - if enabled: - if type(mysplit[mypos+1])==types.ListType: - newsplit.append(dep_opconvert(mysplit[mypos+1],myuse,mysettings)) - else: - newsplit.append(mysplit[mypos+1]) - #otherwise, continue. - mypos += 2 - else: - #normal item - newsplit.append(mysplit[mypos]) - mypos += 1 - return newsplit - -def dep_virtual(mysplit, mysettings): - """ - Does virtual dependency conversion - """ - newsplit=[] - for x in mysplit: - if type(x)==list: - newsplit.append(dep_virtual(x, mysettings)) - else: - mykey=portage_dep.dep_getkey(x) - if mysettings.virtuals.has_key(mykey): - if len(mysettings.virtuals[mykey])==1: - a=x.replace( mykey, mysettings.virtuals[mykey][0]) - else: - if x[0]=="!": - # blocker needs "and" not "or(||)". - a=[] - else: - a=['||'] - for y in mysettings.virtuals[mykey]: - a.append( x.replace( mykey, y) ) - newsplit.append(a) - else: - newsplit.append(x) - return newsplit - -def dep_eval(deplist): - if len(deplist)==0: - return 1 - if deplist[0]=="||": - #or list; we just need one "1" - for x in deplist[1:]: - if type(x)==types.ListType: - if dep_eval(x)==1: - return 1 - elif x==1: - return 1 - return 0 - else: - for x in deplist: - if type(x)==types.ListType: - if dep_eval(x)==0: - return 0 - elif x==0 or x==2: - return 0 - return 1 - -def dep_zapdeps(unreduced,reduced,vardbapi=None,use_binaries=0): - """ - Takes an unreduced and reduced deplist and removes satisfied dependencies. - Returned deplist contains steps that must be taken to satisfy dependencies. - """ - writemsg("ZapDeps -- %s\n" % (use_binaries), 2) - if unreduced==[] or unreduced==['||'] : - return [] - if unreduced[0]=="||": - if dep_eval(reduced): - #deps satisfied, return empty list. - return [] - else: - #try to find an installed dep. - ### We use fakedb when --update now, so we can't use local vardbapi here. - ### This should be fixed in the feature. - ### see bug 45468. - ##if vardbapi: - ## mydbapi=vardbapi - ##else: - ## mydbapi=db[root]["vartree"].dbapi - mydbapi=db[root]["vartree"].dbapi - - if db["/"].has_key("porttree"): - myportapi=db["/"]["porttree"].dbapi - else: - myportapi=None - - if use_binaries and db["/"].has_key("bintree"): - mybinapi=db["/"]["bintree"].dbapi - writemsg("Using bintree...\n",2) - else: - mybinapi=None - - x=1 - candidate=[] - while x<len(reduced): - writemsg("x: %s, reduced[x]: %s\n" % (x,reduced[x]), 2) - if (type(reduced[x])==types.ListType): - newcand = dep_zapdeps(unreduced[x], reduced[x], vardbapi=vardbapi, use_binaries=use_binaries) - candidate.append(newcand) - else: - if (reduced[x]==False): - candidate.append([unreduced[x]]) - else: - candidate.append([]) - x+=1 - - #use installed and no-masked package(s) in portage. - for x in candidate: - match=1 - for pkg in x: - if not mydbapi.match(pkg): - match=0 - break - if myportapi: - if not myportapi.match(pkg): - match=0 - break - if match: - writemsg("Installed match: %s\n" % (x), 2) - return x - - # Use binary packages if available. - if mybinapi: - for x in candidate: - match=1 - for pkg in x: - if not mybinapi.match(pkg): - match=0 - break - else: - writemsg("Binary match: %s\n" % (pkg), 2) - if match: - writemsg("Binary match final: %s\n" % (x), 2) - return x - - #use no-masked package(s) in portage tree - if myportapi: - for x in candidate: - match=1 - for pkg in x: - if not myportapi.match(pkg): - match=0 - break - if match: - writemsg("Porttree match: %s\n" % (x), 2) - return x - - #none of the no-masked pkg, use the first one - writemsg("Last resort candidate: %s\n" % (candidate[0]), 2) - return candidate[0] - else: - if dep_eval(reduced): - #deps satisfied, return empty list. - return [] - else: - returnme=[] - x=0 - while x<len(reduced): - if type(reduced[x])==types.ListType: - returnme+=dep_zapdeps(unreduced[x],reduced[x], vardbapi=vardbapi, use_binaries=use_binaries) - else: - if reduced[x]==False: - returnme.append(unreduced[x]) - x += 1 - return returnme - -def cpv_getkey(mycpv): - myslash=mycpv.split("/") - mysplit=portage_versions.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,use_cache=1): - mysplit=mykey.split("/") - if len(mysplit)==1: - if mydb and type(mydb)==types.InstanceType: - for x in settings.categories: - if mydb.cp_list(x+"/"+mykey,use_cache=use_cache): - return x+"/"+mykey - if virts_p.has_key(mykey): - print "VIRTS_P (Report to #gentoo-portage or bugs.g.o):",mykey - return(virts_p[mykey][0]) - return "null/"+mykey - elif mydb: - if type(mydb)==types.InstanceType: - if (not mydb.cp_list(mykey,use_cache=use_cache)) and virts and virts.has_key(mykey): - return virts[mykey][0] - return mykey - -def cpv_expand(mycpv,mydb=None,use_cache=1): - """ - Given a string (packagename or virtual) expand it into a valid - cat/package string. Virtuals use the mydb to determine which provided - virtual is a valid choice and defaults to the first element when there - are no installed/available candidates. - """ - myslash=mycpv.split("/") - mysplit=portage_versions.pkgsplit(myslash[-1]) - if len(myslash)>2: - # this is illegal case. - mysplit=[] - mykey=mycpv - elif len(myslash)==2: - if mysplit: - mykey=myslash[0]+"/"+mysplit[0] - else: - mykey=mycpv - if mydb: - writemsg("mydb.__class__: %s\n" % (mydb.__class__), 1) - if type(mydb)==types.InstanceType: - if (not mydb.cp_list(mykey,use_cache=use_cache)) and virts and virts.has_key(mykey): - writemsg("virts[%s]: %s\n" % (str(mykey),virts[mykey]), 1) - mykey_orig = mykey - for vkey in virts[mykey]: - if mydb.cp_list(vkey,use_cache=use_cache): - mykey = vkey - writemsg("virts chosen: %s\n" % (mykey), 1) - break - if mykey == mykey_orig: - mykey=virts[mykey][0] - writemsg("virts defaulted: %s\n" % (mykey), 1) - #we only perform virtual expansion if we are passed a dbapi - else: - #specific cpv, no category, ie. "foo-1.0" - if mysplit: - myp=mysplit[0] - else: - # "foo" ? - myp=mycpv - mykey=None - matches=[] - if mydb: - for x in settings.categories: - if mydb.cp_list(x+"/"+myp,use_cache=use_cache): - matches.append(x+"/"+myp) - if (len(matches)>1): - raise ValueError, matches - elif matches: - mykey=matches[0] - - if not mykey and type(mydb)!=types.ListType: - if virts_p.has_key(myp): - print "VIRTS_P,ce (Report to #gentoo-portage or bugs.g.o):",myp - mykey=virts_p[myp][0] - #again, we only perform virtual expansion if we have a dbapi (not a list) - if not mykey: - mykey="null/"+myp - if mysplit: - if mysplit[2]=="r0": - return mykey+"-"+mysplit[1] - else: - return mykey+"-"+mysplit[1]+"-"+mysplit[2] - else: - return mykey - -def dep_transform(mydep,oldkey,newkey): - origdep=mydep - if not len(mydep): - return mydep - if mydep[0]=="*": - mydep=mydep[1:] - prefix="" - postfix="" - if mydep[-1]=="*": - mydep=mydep[:-1] - postfix="*" - if mydep[:2] in [ ">=", "<=" ]: - prefix=mydep[:2] - mydep=mydep[2:] - elif mydep[:1] in "=<>~!": - prefix=mydep[:1] - mydep=mydep[1:] - if mydep==oldkey: - return prefix+newkey+postfix - else: - return origdep - -def dep_expand(mydep,mydb=None,use_cache=1): - if not len(mydep): - return mydep - if mydep[0]=="*": - mydep=mydep[1:] - prefix="" - postfix="" - if mydep[-1]=="*": - mydep=mydep[:-1] - postfix="*" - if mydep[:2] in [ ">=", "<=" ]: - prefix=mydep[:2] - mydep=mydep[2:] - elif mydep[:1] in "=<>~!": - prefix=mydep[:1] - mydep=mydep[1:] - return prefix+cpv_expand(mydep,mydb=mydb,use_cache=use_cache)+postfix - -def get_parsed_deps(depstring,mydbapi,mysettings,use="yes",mode=None,myuse=None): - - if use=="all": - #enable everything (for repoman) - myusesplit=["*"] - elif use=="yes": - if myuse==None: - #default behavior - myusesplit = mysettings["USE"].split() - else: - myusesplit = myuse - # We've been given useflags to use. - #print "USE FLAGS PASSED IN." - #print myuse - #if "bindist" in myusesplit: - # print "BINDIST is set!" - #else: - # print "BINDIST NOT set." - else: - #we are being run by autouse(), don't consult USE vars yet. - # WE ALSO CANNOT USE SETTINGS - myusesplit=[] - - #convert parenthesis to sublists - mysplit = portage_dep.paren_reduce(depstring) - - if mysettings: - # XXX: use="all" is only used by repoman. Why would repoman checks want - # profile-masked USE flags to be enabled? - #if use=="all": - # mymasks=archlist[:] - #else: - mymasks=mysettings.usemask+archlist[:] - - while mysettings["ARCH"] in mymasks: - del mymasks[mymasks.index(mysettings["ARCH"])] - mysplit = portage_dep.use_reduce(mysplit,uselist=myusesplit,masklist=mymasks,matchall=(use=="all"),excludeall=[mysettings["ARCH"]]) - else: - mysplit = portage_dep.use_reduce(mysplit,uselist=myusesplit,matchall=(use=="all")) - return mysplit - -def dep_check(depstring,mydbapi,mysettings,use="yes",mode=None,myuse=None,use_cache=1,use_binaries=0): - """Takes a depend string and parses the condition.""" - - mysplit=get_parsed_deps(depstring,mydbapi,mysettings,use=use,myuse=myuse) - # Do the || conversions - mysplit=portage_dep.dep_opconvert(mysplit) - - #convert virtual dependencies to normal packages. - mysplit=dep_virtual(mysplit, mysettings) - #if mysplit==None, then we have a parse error (paren mismatch or misplaced ||) - #up until here, we haven't needed to look at the database tree - - if mysplit==None: - return [0,"Parse Error (parentheses mismatch?)"] - elif mysplit==[]: - #dependencies were reduced to nothing - return [1,[]] - mysplit2=mysplit[:] - mysplit2=dep_wordreduce(mysplit2,mysettings,mydbapi,mode,use_cache=use_cache) - if mysplit2==None: - return [0,"Invalid token"] - - writemsg("\n\n\n", 1) - writemsg("mysplit: %s\n" % (mysplit), 1) - writemsg("mysplit2: %s\n" % (mysplit2), 1) - myeval=dep_eval(mysplit2) - writemsg("myeval: %s\n" % (myeval), 1) - - if myeval: - return [1,[]] - else: - myzaps = dep_zapdeps(mysplit,mysplit2,vardbapi=mydbapi,use_binaries=use_binaries) - mylist = flatten(myzaps) - writemsg("myzaps: %s\n" % (myzaps), 1) - writemsg("mylist: %s\n" % (mylist), 1) - #remove duplicates - mydict={} - for x in mylist: - mydict[x]=1 - writemsg("mydict: %s\n" % (mydict), 1) - return [1,mydict.keys()] - -def dep_wordreduce(mydeplist,mysettings,mydbapi,mode,use_cache=1): - "Reduces the deplist to ones and zeros" - mypos=0 - deplist=mydeplist[:] - while mypos<len(deplist): - if type(deplist[mypos])==types.ListType: - #recurse - deplist[mypos]=dep_wordreduce(deplist[mypos],mysettings,mydbapi,mode,use_cache=use_cache) - elif deplist[mypos]=="||": - pass - else: - mykey = portage_dep.dep_getkey(deplist[mypos]) - if mysettings and mysettings.pprovideddict.has_key(mykey) and \ - portage_dep.match_from_list(deplist[mypos], mysettings.pprovideddict[mykey]): - deplist[mypos]=True - else: - if mode: - mydep=mydbapi.xmatch(mode,deplist[mypos]) - else: - mydep=mydbapi.match(deplist[mypos],use_cache=use_cache) - if mydep!=None: - tmp=(len(mydep)>=1) - if deplist[mypos][0]=="!": - #tmp=not tmp - # This is ad-hoc code. We should rewrite this later.. (See #52377) - # The reason is that portage uses fakedb when --update option now. - # So portage considers that a block package doesn't exist even if it exists. - # Then, #52377 happens. - # ==== start - # emerge checks if it's block or not, so we can always set tmp=False. - # but it's not clean.. - tmp=False - # ==== end - deplist[mypos]=tmp - else: - #encountered invalid string - return None - mypos=mypos+1 - return deplist - -def fixdbentries(old_value, new_value, dbdir): - """python replacement for the fixdbentries script, replaces old_value - with new_value for package names in files in dbdir.""" - for myfile in [f for f in os.listdir(dbdir) if not f == "CONTENTS"]: - f = open(dbdir+"/"+myfile, "r") - mycontent = f.read() - f.close() - if not mycontent.count(old_value): - continue - old_value = re.escape(old_value); - mycontent = re.sub(old_value+"$", new_value, mycontent) - mycontent = re.sub(old_value+"(\\s)", new_value+"\\1", mycontent) - mycontent = re.sub(old_value+"(-[^a-zA-Z])", new_value+"\\1", mycontent) - mycontent = re.sub(old_value+"([^a-zA-Z0-9-])", new_value+"\\1", mycontent) - f = open(dbdir+"/"+myfile, "w") - f.write(mycontent) - f.close() - -class packagetree: - def __init__(self,virtual,clone=None): - if clone: - self.tree=clone.tree.copy() - self.populated=clone.populated - self.virtual=clone.virtual - self.dbapi=None - else: - self.tree={} - self.populated=0 - self.virtual=virtual - self.dbapi=None - - def resolve_key(self,mykey): - return key_expand(mykey,mydb=self.dbapi) - - def dep_nomatch(self,mypkgdep): - mykey=portage_dep.dep_getkey(mypkgdep) - nolist=self.dbapi.cp_list(mykey) - mymatch=self.dbapi.match(mypkgdep) - if not mymatch: - return nolist - for x in mymatch: - if x in nolist: - nolist.remove(x) - return nolist - - def depcheck(self,mycheck,use="yes",myusesplit=None): - return dep_check(mycheck,self.dbapi,use=use,myuse=myusesplit) - - def populate(self): - "populates the tree with values" - populated=1 - pass - -def best(mymatches): - "accepts None arguments; assumes matches are valid." - global bestcount - if mymatches==None: - return "" - if not len(mymatches): - return "" - bestmatch=mymatches[0] - p2=portage_versions.catpkgsplit(bestmatch)[1:] - for x in mymatches[1:]: - p1=portage_versions.catpkgsplit(x)[1:] - if portage_versions.pkgcmp(p1,p2)>0: - bestmatch=x - p2=portage_versions.catpkgsplit(bestmatch)[1:] - return bestmatch - -class portagetree: - def __init__(self,root="/",virtual=None,clone=None): - global portdb - if clone: - self.root=clone.root - self.portroot=clone.portroot - self.pkglines=clone.pkglines - else: - self.root=root - self.portroot=settings["PORTDIR"] - self.virtual=virtual - self.dbapi=portdb - - def dep_bestmatch(self,mydep): - "compatibility method" - mymatch=self.dbapi.xmatch("bestmatch-visible",mydep) - if mymatch==None: - return "" - return mymatch - - def dep_match(self,mydep): - "compatibility method" - mymatch=self.dbapi.xmatch("match-visible",mydep) - if mymatch==None: - return [] - return mymatch - - def exists_specific(self,cpv): - return self.dbapi.cpv_exists(cpv) - - def getallnodes(self): - """new behavior: these are all *unmasked* nodes. There may or may not be available - masked package for nodes in this nodes list.""" - return self.dbapi.cp_all() - - def getname(self,pkgname): - "returns file location for this particular package (DEPRECATED)" - if not pkgname: - return "" - mysplit=pkgname.split("/") - psplit=portage_versions.pkgsplit(mysplit[1]) - return self.portroot+"/"+mysplit[0]+"/"+psplit[0]+"/"+mysplit[1]+".ebuild" - - def resolve_specific(self,myspec): - cps=portage_versions.catpkgsplit(myspec) - if not cps: - return None - mykey=key_expand(cps[0]+"/"+cps[1],mydb=self.dbapi) - mykey=mykey+"-"+cps[2] - if cps[3]!="r0": - mykey=mykey+"-"+cps[3] - return mykey - - def depcheck(self,mycheck,use="yes",myusesplit=None): - return dep_check(mycheck,self.dbapi,use=use,myuse=myusesplit) - - def getslot(self,mycatpkg): - "Get a slot for a catpkg; assume it exists." - myslot = "" - try: - myslot=self.dbapi.aux_get(mycatpkg,["SLOT"])[0] - except SystemExit, e: - raise - except Exception, e: - pass - return myslot - - -class dbapi: - def __init__(self): - pass - - def close_caches(self): - pass - - def cp_list(self,cp,use_cache=1): - return - - def aux_get(self,mycpv,mylist): - "stub code for returning auxiliary db information, such as SLOT, DEPEND, etc." - 'input: "sys-apps/foo-1.0",["SLOT","DEPEND","HOMEPAGE"]' - 'return: ["0",">=sys-libs/bar-1.0","http://www.foo.com"] or [] if mycpv not found' - raise NotImplementedError - - def match(self,origdep,use_cache=1): - mydep=dep_expand(origdep,mydb=self) - mykey=portage_dep.dep_getkey(mydep) - mycat=mykey.split("/")[0] - return portage_dep.match_from_list(mydep,self.cp_list(mykey,use_cache=use_cache)) - - def match2(self,mydep,mykey,mylist): - writemsg("DEPRECATED: dbapi.match2\n") - portage_dep.match_from_list(mydep,mylist) - - def counter_tick(self,myroot,mycpv=None): - return self.counter_tick_core(myroot,incrementing=1,mycpv=mycpv) - - def get_counter_tick_core(self,myroot,mycpv=None): - return self.counter_tick_core(myroot,incrementing=0,mycpv=mycpv)+1 - - def counter_tick_core(self,myroot,incrementing=1,mycpv=None): - "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" - changed=0 - min_counter = 0 - if mycpv: - mysplit = portage_versions.pkgsplit(mycpv) - for x in self.match(mysplit[0],use_cache=0): - # fixed bug #41062 - if x==mycpv: - continue - try: - old_counter = long(self.aux_get(x,["COUNTER"])[0]) - writemsg("COUNTER '%d' '%s'\n" % (old_counter, x),1) - except SystemExit, e: - raise - except: - old_counter = 0 - writemsg("!!! BAD COUNTER in '%s'\n" % (x)) - if old_counter > min_counter: - min_counter = old_counter - - # We write our new counter value to a new file that gets moved into - # place to avoid filesystem corruption. - if os.path.exists(cpath): - cfile=open(cpath, "r") - try: - counter=long(cfile.readline()) - except (ValueError,OverflowError): - try: - counter=long(portage_exec.spawn_get_output("for FILE in $(find /"+VDB_PATH+" -type f -name COUNTER); do echo $(<${FILE}); done | sort -n | tail -n1 | tr -d '\n'",spawn_type=portage_exec.spawn_bash)[1]) - writemsg("!!! COUNTER was corrupted; resetting to value of %d\n" % counter) - changed=1 - except (ValueError,OverflowError): - writemsg("!!! COUNTER data is corrupt in pkg db. The values need to be\n") - writemsg("!!! corrected/normalized so that portage can operate properly.\n") - writemsg("!!! A simple solution is not yet available so try #gentoo on IRC.\n") - sys.exit(2) - cfile.close() - else: - try: - counter=long(portage_exec.spawn_get_output("for FILE in $(find /"+VDB_PATH+" -type f -name COUNTER); do echo $(<${FILE}); done | sort -n | tail -n1 | tr -d '\n'",spawn_type=portage_exec.spawn_bash)[1]) - writemsg("!!! Global counter missing. Regenerated from counter files to: %s\n" % counter) - except SystemExit, e: - raise - except: - writemsg("!!! Initializing global counter.\n") - counter=long(0) - changed=1 - - if counter < min_counter: - counter = min_counter+1000 - changed = 1 - - if incrementing or changed: - - #increment counter - counter += 1 - # update new global counter file - newcpath=cpath+".new" - newcfile=open(newcpath,"w") - newcfile.write(str(counter)) - newcfile.close() - # now move global counter file into place - os.rename(newcpath,cpath) - return counter - - def invalidentry(self, mypath): - if re.search("portage_lockfile$",mypath): - if not os.environ.has_key("PORTAGE_MASTER_PID"): - writemsg("Lockfile removed: %s\n" % mypath, 1) - portage_locks.unlockfile((mypath,None,None)) - else: - # Nothing we can do about it. We're probably sandboxed. - pass - elif re.search(".*/-MERGING-(.*)",mypath): - if os.path.exists(mypath): - writemsg(red("INCOMPLETE MERGE:")+" "+mypath+"\n") - else: - writemsg("!!! Invalid db entry: %s\n" % mypath) - - - -class fakedbapi(dbapi): - "This is a dbapi to use for the emptytree function. It's empty, but things can be added to it." - def __init__(self): - self.cpvdict={} - self.cpdict={} - - def cpv_exists(self,mycpv): - return self.cpvdict.has_key(mycpv) - - def cp_list(self,mycp,use_cache=1): - return self.cpdict.get(mycp,[]) - - def cp_all(self): - returnme=[] - for x in self.cpdict.keys(): - returnme.extend(self.cpdict[x]) - return returnme - - def cpv_inject(self,mycpv): - """Adds a cpv from the list of available packages.""" - mycp=cpv_getkey(mycpv) - self.cpvdict[mycpv]=1 - cplist = self.cpdict.setdefault(mycp,[]) - if mycpv not in cplist: - cplist.append(mycpv) - - #def cpv_virtual(self,oldcpv,newcpv): - # """Maps a cpv to the list of available packages.""" - # mycp=cpv_getkey(newcpv) - # self.cpvdict[newcpv]=1 - # if not self.virtdict.has_key(mycp): - # self.virtdict[mycp]=[] - # if not mycpv in self.virtdict[mycp]: - # self.virtdict[mycp].append(oldcpv) - # cpv_remove(oldcpv) - - def cpv_remove(self,mycpv): - """Removes a cpv from the list of available packages.""" - mycp=cpv_getkey(mycpv) - if mycpv in self.cpvdict: - del self.cpvdict[mycpv] - cpvlist = self.cpdict.get(mycp) - if cpvlist is None: - return - while mycpv in cpvlist: - cpvlist.remove( mycpv ) - if not cpvlist: - del self.cpdict[mycp] - -class bindbapi(fakedbapi): - def __init__(self,mybintree=None): - self.bintree = mybintree - self.cpvdict={} - self.cpdict={} - - def aux_get(self,mycpv,wants): - mysplit = mycpv.split("/") - mylist = [] - tbz2name = mysplit[1]+".tbz2" - if self.bintree and not self.bintree.isremote(mycpv): - tbz2 = xpak.tbz2(self.bintree.getname(mycpv)) - for x in wants: - if self.bintree and self.bintree.isremote(mycpv): - # We use the cache for remote packages - if self.bintree.remotepkgs[tbz2name].has_key(x): - mylist.append(self.bintree.remotepkgs[tbz2name][x][:]) # [:] Copy String - else: - mylist.append("") - else: - myval = tbz2.getfile(x) - if myval == None: - myval = "" - else: - myval = ' '.join(myval.split()) - mylist.append(myval) - - return mylist - - -cptot=0 -class vardbapi(dbapi): - def __init__(self,root,categories=None): - self.root = root - #cache for category directory mtimes - self.mtdircache = {} - #cache for dependency checks - self.matchcache = {} - #cache for cp_list results - self.cpcache = {} - self.blockers = None - self.categories = copy.deepcopy(categories) - - def cpv_exists(self,mykey): - "Tells us whether an actual ebuild exists on disk (no masking)" - return os.path.exists(self.root+VDB_PATH+"/"+mykey) - - def cpv_counter(self,mycpv): - "This method will grab the COUNTER. Returns a counter value." - cdir=self.root+VDB_PATH+"/"+mycpv - cpath=self.root+VDB_PATH+"/"+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() - elif os.path.exists(cdir): - mys = portage_versions.pkgsplit(mycpv) - myl = self.match(mys[0],use_cache=0) - print mys,myl - if len(myl) == 1: - try: - # Only one package... Counter doesn't matter. - myf = open(cpath, "w") - myf.write("1") - myf.flush() - myf.close() - counter = 1 - except SystemExit, e: - raise - except Exception, e: - writemsg("!!! COUNTER file is missing for "+str(mycpv)+" in /var/db.\n") - writemsg("!!! Please run /usr/lib/portage/bin/fix-db.pl or\n") - writemsg("!!! Please run /usr/lib/portage/bin/fix-db.py or\n") - writemsg("!!! unmerge this exact version.\n") - writemsg("!!! %s\n" % e) - sys.exit(1) - else: - writemsg("!!! COUNTER file is missing for "+str(mycpv)+" in /var/db.\n") - writemsg("!!! Please run /usr/lib/portage/bin/fix-db.pl or\n") - writemsg("!!! Please run /usr/lib/portage/bin/fix-db.py or\n") - writemsg("!!! remerge the package.\n") - sys.exit(1) - 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" - os.makedirs(self.root+VDB_PATH+"/"+mycpv) - counter=db[self.root]["vartree"].dbapi.counter_tick(self.root,mycpv=mycpv) - # write local package counter so that emerge clean does the right thing - lcfile=open(self.root+VDB_PATH+"/"+mycpv+"/COUNTER","w") - lcfile.write(str(counter)) - lcfile.close() - - def isInjected(self,mycpv): - if self.cpv_exists(mycpv): - if os.path.exists(self.root+VDB_PATH+"/"+mycpv+"/INJECTED"): - return True - if not os.path.exists(self.root+VDB_PATH+"/"+mycpv+"/CONTENTS"): - return True - return False - - def move_ent(self,mylist): - origcp=mylist[1] - newcp=mylist[2] - origmatches=self.match(origcp,use_cache=0) - if not origmatches: - return - for mycpv in origmatches: - mycpsplit=portage_versions.catpkgsplit(mycpv) - mynewcpv=newcp+"-"+mycpsplit[2] - mynewcat=newcp.split("/")[0] - if mycpsplit[3]!="r0": - mynewcpv += "-"+mycpsplit[3] - mycpsplit_new = portage_versions.catpkgsplit(mynewcpv) - origpath=self.root+VDB_PATH+"/"+mycpv - if not os.path.exists(origpath): - continue - writemsg("@") - if not os.path.exists(self.root+VDB_PATH+"/"+mynewcat): - #create the directory - os.makedirs(self.root+VDB_PATH+"/"+mynewcat) - newpath=self.root+VDB_PATH+"/"+mynewcpv - if os.path.exists(newpath): - #dest already exists; keep this puppy where it is. - continue - spawn(MOVE_BINARY+" "+origpath+" "+newpath,settings, free=1) - - # We need to rename the ebuild now. - old_eb_path = newpath+"/"+mycpsplit[1] +"-"+mycpsplit[2] - new_eb_path = newpath+"/"+mycpsplit_new[1]+"-"+mycpsplit[2] - if mycpsplit[3] != "r0": - old_eb_path += "-"+mycpsplit[3] - new_eb_path += "-"+mycpsplit[3] - if os.path.exists(old_eb_path+".ebuild"): - os.rename(old_eb_path+".ebuild", new_eb_path+".ebuild") - - catfile=open(newpath+"/CATEGORY", "w") - catfile.write(mynewcat+"\n") - catfile.close() - - dbdir = self.root+VDB_PATH - for catdir in listdir(dbdir): - catdir = dbdir+"/"+catdir - if os.path.isdir(catdir): - for pkgdir in listdir(catdir): - pkgdir = catdir+"/"+pkgdir - if os.path.isdir(pkgdir): - fixdbentries(origcp, newcp, pkgdir) - - def move_slot_ent(self,mylist): - pkg=mylist[1] - origslot=mylist[2] - newslot=mylist[3] - - origmatches=self.match(pkg,use_cache=0) - if not origmatches: - return - for mycpv in origmatches: - origpath=self.root+VDB_PATH+"/"+mycpv - if not os.path.exists(origpath): - continue - - slot=grabfile(origpath+"/SLOT"); - if (not slot): - continue - - if (slot[0]!=origslot): - continue - - writemsg("s") - slotfile=open(origpath+"/SLOT", "w") - slotfile.write(newslot+"\n") - slotfile.close() - - def cp_list(self,mycp,use_cache=1): - mysplit=mycp.split("/") - if mysplit[0] == '*': - mysplit[0] = mysplit[0][1:] - try: - mystat=os.stat(self.root+VDB_PATH+"/"+mysplit[0])[stat.ST_MTIME] - except OSError: - mystat=0 - if use_cache and self.cpcache.has_key(mycp): - cpc=self.cpcache[mycp] - if cpc[0]==mystat: - return cpc[1] - list=listdir(self.root+VDB_PATH+"/"+mysplit[0]) - - if (list==None): - return [] - returnme=[] - for x in list: - if x[0] == '-': - #writemsg(red("INCOMPLETE MERGE:")+str(x[len("-MERGING-"):])+"\n") - continue - ps=portage_versions.pkgsplit(x) - if not ps: - self.invalidentry(self.root+VDB_PATH+"/"+mysplit[0]+"/"+x) - continue - if len(mysplit) > 1: - if ps[0]==mysplit[1]: - returnme.append(mysplit[0]+"/"+x) - if use_cache: - self.cpcache[mycp]=[mystat,returnme] - elif self.cpcache.has_key(mycp): - del self.cpcache[mycp] - return returnme - - def cpv_all(self, use_cache=1): - return list(self.iter_cpv_all(use_cache=use_cache)) - - def iter_cpv_all(self,use_cache=1): - basepath = self.root+VDB_PATH+"/" - - mycats = self.categories - if mycats == None: - # XXX: CIRCULAR DEP! This helps backwards compat. --NJ (10 Sept 2004) - mycats = settings.categories - - for x in mycats: - for y in listdir(basepath+x): - subpath = x+"/"+y - # -MERGING- should never be a cpv, nor should files. - if os.path.isdir(basepath+subpath) and (portage_versions.pkgsplit(y) is not None): - yield subpath - - def cp_all(self,use_cache=1): - mylist = self.cpv_all(use_cache=use_cache) - d=dict() - for y in self.iter_cpv_all(use_cache=use_cache): - if y[0] == '*': - y = y[1:] - mysplit=portage_versions.catpkgsplit(y) - if not mysplit: - self.invalidentry(self.root+VDB_PATH+"/"+y) - continue - mykey=mysplit[0]+"/"+mysplit[1] - d[mysplit[0]+"/"+mysplit[1]] = None - return d.keys() - - def checkblockers(self,origdep): - pass - - def match(self,origdep,use_cache=1): - "caching match function" - mydep=dep_expand(origdep,mydb=self,use_cache=use_cache) - mykey=portage_dep.dep_getkey(mydep) - mycat=mykey.split("/")[0] - if not use_cache: - if self.matchcache.has_key(mycat): - del self.mtdircache[mycat] - del self.matchcache[mycat] - return portage_dep.match_from_list(mydep,self.cp_list(mykey,use_cache=use_cache)) - try: - curmtime=os.stat(self.root+VDB_PATH+"/"+mycat)[stat.ST_MTIME] - except SystemExit, e: - raise - except: - curmtime=0 - - if not self.matchcache.has_key(mycat) or not self.mtdircache[mycat]==curmtime: - # clear cache entry - self.mtdircache[mycat]=curmtime - self.matchcache[mycat]={} - if not self.matchcache[mycat].has_key(mydep): - mymatch=portage_dep.match_from_list(mydep,self.cp_list(mykey,use_cache=use_cache)) - self.matchcache[mycat][mydep]=mymatch - return self.matchcache[mycat][mydep][:] - - def aux_get(self, mycpv, wants): - global auxdbkeys - results = [] - if not self.cpv_exists(mycpv): - return [] - for x in wants: - myfn = self.root+VDB_PATH+"/"+str(mycpv)+"/"+str(x) - if os.access(myfn,os.R_OK): - myf = open(myfn, "r") - myd = myf.read() - myf.close() - myd = " ".join( myd.split() ) - else: - myd = "" - results.append(myd) - return results - - -class vartree(packagetree): - """ - this tree will scan a var/db/pkg database located at root (passed to init) - """ - def __init__(self,root="/",virtual=None,clone=None,categories=None): - if clone: - self.root = clone.root - self.dbapi = copy.deepcopy(clone.dbapi) - self.populated = 1 - else: - self.root = root - self.dbapi = vardbapi(self.root,categories=categories) - self.populated = 1 - - def zap(self,mycpv): - return - - def inject(self,mycpv): - return - - def get_provide(self,mycpv): - myprovides=[] - try: - mylines = grabfile(self.root+VDB_PATH+"/"+mycpv+"/PROVIDE") - if mylines: - myuse = grabfile(self.root+VDB_PATH+"/"+mycpv+"/USE") - myuse = " ".join(myuse).split() - mylines = " ".join(mylines) - mylines = flatten(portage_dep.use_reduce(portage_dep.paren_reduce(mylines), uselist=myuse)) - for myprovide in mylines: - mys = portage_versions.catpkgsplit(myprovide) - if not mys: - mys = myprovide.split("/") - myprovides += [mys[0] + "/" + mys[1]] - return myprovides - except SystemExit, e: - raise - except Exception, e: - print - print "Check " + self.root+VDB_PATH+"/"+mycpv+"/PROVIDE and USE." - print "Possibly Invalid: " + str(mylines) - print "Exception: "+str(e) - print - return [] - - def get_all_provides(self): - myprovides = {} - for node in self.getallcpv(): - for mykey in self.get_provide(node): - if myprovides.has_key(mykey): - myprovides[mykey] += [node] - else: - myprovides[mykey] = [node] - return myprovides - - def dep_bestmatch(self,mydep,use_cache=1): - "compatibility method -- all matches, not just visible ones" - #mymatch=best(match(dep_expand(mydep,self.dbapi),self.dbapi)) - mymatch=best(self.dbapi.match(dep_expand(mydep,mydb=self.dbapi),use_cache=use_cache)) - if mymatch==None: - return "" - else: - return mymatch - - def dep_match(self,mydep,use_cache=1): - "compatibility method -- we want to see all matches, not just visible ones" - #mymatch=match(mydep,self.dbapi) - mymatch=self.dbapi.match(mydep,use_cache=use_cache) - if mymatch==None: - return [] - else: - return mymatch - - def exists_specific(self,cpv): - return self.dbapi.cpv_exists(cpv) - - def getallcpv(self): - """temporary function, probably to be renamed --- Gets a list of all - category/package-versions installed on the system.""" - return self.dbapi.cpv_all() - - def getallnodes(self): - """new behavior: these are all *unmasked* nodes. There may or may not be available - masked package for nodes in this nodes list.""" - return self.dbapi.cp_all() - - def exists_specific_cat(self,cpv,use_cache=1): - cpv=key_expand(cpv,mydb=self.dbapi,use_cache=use_cache) - a=portage_versions.catpkgsplit(cpv) - if not a: - return 0 - mylist=listdir(self.root+VDB_PATH+"/"+a[0]) - for x in mylist: - b=portage_versions.pkgsplit(x) - if not b: - self.dbapi.invalidentry(self.root+VDB_PATH+"/"+a[0]+"/"+x) - continue - if a[1]==b[0]: - return 1 - return 0 - - def getebuildpath(self,fullpackage): - cat,package=fullpackage.split("/") - return self.root+VDB_PATH+"/"+fullpackage+"/"+package+".ebuild" - - def getnode(self,mykey,use_cache=1): - mykey=key_expand(mykey,mydb=self.dbapi,use_cache=use_cache) - if not mykey: - return [] - mysplit=mykey.split("/") - mydirlist=listdir(self.root+VDB_PATH+"/"+mysplit[0]) - returnme=[] - for x in mydirlist: - mypsplit=portage_versions.pkgsplit(x) - if not mypsplit: - self.dbapi.invalidentry(self.root+VDB_PATH+"/"+mysplit[0]+"/"+x) - continue - if mypsplit[0]==mysplit[1]: - appendme=[mysplit[0]+"/"+x,[mysplit[0],mypsplit[0],mypsplit[1],mypsplit[2]]] - returnme.append(appendme) - return returnme - - - def getslot(self,mycatpkg): - "Get a slot for a catpkg; assume it exists." - myslot = "" - try: - myslot=" ".join(grabfile(self.root+VDB_PATH+"/"+mycatpkg+"/SLOT")) - except SystemExit, e: - raise - except Exception, e: - pass - return myslot - - def hasnode(self,mykey,use_cache): - """Does the particular node (cat/pkg key) exist?""" - mykey=key_expand(mykey,mydb=self.dbapi,use_cache=use_cache) - mysplit=mykey.split("/") - mydirlist=listdir(self.root+VDB_PATH+"/"+mysplit[0]) - for x in mydirlist: - mypsplit=portage_versions.pkgsplit(x) - if not mypsplit: - self.dbapi.invalidentry(self.root+VDB_PATH+"/"+mysplit[0]+"/"+x) - continue - if mypsplit[0]==mysplit[1]: - return 1 - return 0 - - def populate(self): - self.populated=1 - - -auxdbkeys=[ - 'DEPEND', 'RDEPEND', 'SLOT', 'SRC_URI', - 'RESTRICT', 'HOMEPAGE', 'LICENSE', 'DESCRIPTION', - 'KEYWORDS', 'INHERITED', 'IUSE', 'CDEPEND', - 'PDEPEND', 'PROVIDE', - 'UNUSED_01', 'UNUSED_02', 'UNUSED_03', 'UNUSED_04', - 'UNUSED_05', 'UNUSED_06', 'UNUSED_07', 'UNUSED_08', - ] -auxdbkeylen=len(auxdbkeys) - -def close_portdbapi_caches(): - for i in portdbapi.portdbapi_instances: - i.close_caches() -class portdbapi(dbapi): - """this tree will scan a portage directory located at root (passed to init)""" - portdbapi_instances = [] - - def __init__(self,porttree_root,mysettings=None): - portdbapi.portdbapi_instances.append(self) - self.lock_held = 0; - - if mysettings: - self.mysettings = mysettings - else: - self.mysettings = config(clone=settings) - - self.manifestVerifyLevel = None - self.manifestVerifier = None - self.manifestCache = {} # {location: [stat, md5]} - self.manifestMissingCache = [] - - if "gpg" in self.mysettings.features: - self.manifestVerifyLevel = portage_gpg.EXISTS - if "strict" in self.mysettings.features: - self.manifestVerifyLevel = portage_gpg.MARGINAL - self.manifestVerifier = portage_gpg.FileChecker(self.mysettings["PORTAGE_GPG_DIR"], "gentoo.gpg", minimumTrust=self.manifestVerifyLevel) - elif "severe" in self.mysettings.features: - self.manifestVerifyLevel = portage_gpg.TRUSTED - self.manifestVerifier = portage_gpg.FileChecker(self.mysettings["PORTAGE_GPG_DIR"], "gentoo.gpg", requireSignedRing=True, minimumTrust=self.manifestVerifyLevel) - else: - self.manifestVerifier = portage_gpg.FileChecker(self.mysettings["PORTAGE_GPG_DIR"], "gentoo.gpg", minimumTrust=self.manifestVerifyLevel) - - #self.root=settings["PORTDIR"] - self.porttree_root = porttree_root - - self.depcachedir = self.mysettings.depcachedir - - self.eclassdb = eclass_cache.cache(self.porttree_root, self.mysettings["PORTDIR_OVERLAY"].split()) - - self.metadb = {} - self.metadbmodule = self.mysettings.load_best_module("portdbapi.metadbmodule") - - #if the portdbapi is "frozen", then we assume that we can cache everything (that no updates to it are happening) - self.xcache={} - self.frozen=0 - - self.porttrees=[self.porttree_root]+self.mysettings["PORTDIR_OVERLAY"].split() - - filtered_auxdbkeys = [x for x in auxdbkeys if not x.startswith("UNUSED")] - self.auxdbmodule = self.mysettings.load_best_module("portdbapi.auxdbmodule") - self.auxdb = {} - for x in self.porttrees: - self.auxdb[x] = self.auxdbmodule(x, filtered_auxdbkeys, basepath=portage_const.DEPCACHE_PATH, - gid=portage_gid) - - - def getmaskingreason(self,mycpv): - mysplit = portage_versions.catpkgsplit(mycpv) - if not mysplit: - raise ValueError("invalid CPV: %s" % mycpv) - if not self.cpv_exists(mycpv): - raise KeyError("CPV %s does not exist" % mycpv) - mycp=mysplit[0]+"/"+mysplit[1] - - if settings.pmaskdict.has_key(mycp): - for x in settings.pmaskdict[mycp]: - if mycpv in self.xmatch("match-all", x): - pmaskfile = open(settings["PORTDIR"]+"/profiles/package.mask") - comment = "" - l = "\n" - while len(l) > 0: - l = pmaskfile.readline() - if len(l) == 0: - pmaskfile.close() - return None - if l[0] == "#": - comment += l - elif l == "\n": - comment = "" - elif l.strip() == x: - pmaskfile.close() - return comment - pmaskfile.close() - return None - - def getmaskingstatus(self,mycpv): - mysplit = portage_versions.catpkgsplit(mycpv) - if not mysplit: - raise ValueError("invalid CPV: %s" % mycpv) - if not self.cpv_exists(mycpv): - raise KeyError("CPV %s does not exist" % mycpv) - mycp=mysplit[0]+"/"+mysplit[1] - - rValue = [] - - # profile checking - revmaskdict=settings.prevmaskdict - if revmaskdict.has_key(mycp): - for x in revmaskdict[mycp]: - if x[0]=="*": - myatom = x[1:] - else: - myatom = x - if not portage_dep.match_to_list(mycpv, [myatom]): - rValue.append("profile") - break - - # package.mask checking - maskdict=settings.pmaskdict - unmaskdict=settings.punmaskdict - if maskdict.has_key(mycp): - for x in maskdict[mycp]: - if mycpv in self.xmatch("match-all", x): - unmask=0 - if unmaskdict.has_key(mycp): - for z in unmaskdict[mycp]: - if mycpv in self.xmatch("match-all",z): - unmask=1 - break - if unmask==0: - rValue.append("package.mask") - - # keywords checking - mygroups = self.aux_get(mycpv, ["KEYWORDS"])[0].split() - pgroups=groups[:] - myarch = settings["ARCH"] - pkgdict = settings.pkeywordsdict - - cp = portage_dep.dep_getkey(mycpv) - if pkgdict.has_key(cp): - matches = portage_dep.match_to_list(mycpv, pkgdict[cp].keys()) - for match in matches: - pgroups.extend(pkgdict[cp][match]) - - kmask = "missing" - - for keyword in pgroups: - if keyword in mygroups: - kmask=None - - if kmask: - for gp in mygroups: - if gp=="*": - kmask=None - break - elif gp=="-*": - break - elif gp=="-"+myarch: - kmask="-"+myarch - break - elif gp=="~"+myarch: - kmask="~"+myarch - break - - if kmask: - rValue.append(kmask+" keyword") - return rValue - - - def regen_keys(self,cleanse_stale=True): - """walk all entries of this instance to update the cache. - If the cache is pregenned, pass it in via src_cache, and the cache will be updated - from that instance. - cleanse_stale controls whether or not the cache's old/stale entries are removed. - This is useful both for emerge metadata, and emerge regen (moreso for regen)""" - - import cache.cache_errors - valid_nodes = {} - for x in self.cp_all(): -# print "processing pkg %s" % x - for y in self.cp_list(x): - valid_nodes[y] = None - try: self.aux_get(y,["_mtime_"]) - except cache.cache_errors.CacheError, ce: - print "Cache Exception-", ce - del ce - for loc, tree in self.auxdb.items(): - print "cleansing cache for tree at %s" % loc - for x in tree.keys(): - if x not in valid_nodes: - try: del tree[x] - except (KeyError, cache.cache_errors.CacheError): - pass - - - def close_caches(self): - pass -# for y in self.auxdb[x].keys(): -# self.auxdb[x][y].sync() -# self.auxdb[x][y].close() -# del self.auxdb[x][y] -# del self.auxdb[x] -# self.eclassdb.close_caches() - - def flush_cache(self): - self.metadb.clear() - self.auxdb.clear() -# self.eclassdb.flush_cache() - - def finddigest(self,mycpv): - try: - mydig = self.findname2(mycpv)[0] - mydigs = mydig.split("/")[:-1] - mydig = "/".join(mydigs) - - mysplit = mycpv.split("/") - except SystemExit, e: - raise - except: - return "" - return mydig+"/files/digest-"+mysplit[-1] - - def findname(self,mycpv): - return self.findname2(mycpv)[0] - - def findname2(self,mycpv): - "returns file location for this particular package and in_overlay flag" - if not mycpv: - return "",0 - mysplit=mycpv.split("/") - if mysplit[0]=="virtual": - print "!!! Cannot resolve a virtual package name to an ebuild." - print "!!! This is a bug, please report it. ("+mycpv+")" - sys.exit(1) - - psplit=portage_versions.pkgsplit(mysplit[1]) - ret=None - if psplit: - for x in self.porttrees: - file=x+"/"+mysplit[0]+"/"+psplit[0]+"/"+mysplit[1]+".ebuild" - - if os.access(file, os.R_OK): - # when found - ret=[file, x] - if ret: - return ret[0], ret[1] - - # when not found - return None, 0 - - def aux_get(self,mycpv,mylist,strict=0,metacachedir=None,debug=0): - """ - stub code for returning auxilliary db information, such as SLOT, DEPEND, etc. - 'input: "sys-apps/foo-1.0",["SLOT","DEPEND","HOMEPAGE"]' - 'return: ["0",">=sys-libs/bar-1.0","http://www.foo.com"] or raise KeyError if error' - """ - global auxdbkeys,auxdbkeylen - - cat,pkg = mycpv.split( "/", 1) - - if metacachedir: - if cat not in self.metadb: - self.metadb[cat] = self.metadbmodule(metacachedir,cat,auxdbkeys,uid,portage_gid) - - myebuild, mylocation=self.findname2(mycpv) - - if not myebuild: - writemsg("!!! aux_get(): ebuild path for '%(cpv)s' not specified:\n" % {"cpv":mycpv}) - writemsg("!!! %s\n" % myebuild) - raise KeyError, "'%(cpv)s' at %(path)s" % {"cpv":mycpv,"path":myebuild} - - if "gpg" in self.mysettings.features: - myManifestPath = os.path.join("/",os.path.dirname(myebuild),"Manifest") - try: - mys = portage_gpg.fileStats(myManifestPath) - if (myManifestPath in self.manifestCache) and \ - (self.manifestCache[myManifestPath] == mys): - pass - elif self.manifestVerifier: - if not self.manifestVerifier.verify(myManifestPath): - # Verification failed the desired level. - raise portage_exception.UntrustedSignature, "Untrusted/Missing signature on Manifest: %(manifest)s" % {"manifest":myManifestPath} - - if ("severe" in self.mysettings.features) and \ - (mys != portage_gpg.fileStats(myManifestPath)): - raise portage_exception.SecurityViolation, "Manifest changed: %(manifest)s" % {"manifest":myManifestPath} - - except portage_exception.InvalidSignature, e: - if ("strict" in self.mysettings.features) or \ - ("severe" in self.mysettings.features): - raise - writemsg("!!! INVALID MANIFEST SIGNATURE DETECTED: %(manifest)s\n" % {"manifest":myManifestPath}) - except portage_exception.MissingSignature, e: - if ("severe" in self.mysettings.features): - raise - if ("strict" in self.mysettings.features): - if myManifestPath not in self.manifestMissingCache: - writemsg("!!! WARNING: Missing signature in: %(manifest)s\n" % {"manifest":myManifestPath}) - self.manifestMissingCache.insert(0,myManifestPath) - except (OSError,portage_exception.FileNotFound), e: - if ("strict" in self.mysettings.features) or \ - ("severe" in self.mysettings.features): - raise portage_exception.SecurityViolation, "Error in verification of signatures: %(errormsg)s" % {"errormsg":str(e)} - writemsg("!!! Manifest is missing or inaccessable: %(manifest)s\n" % {"manifest":myManifestPath}) - -# XXX no no. -# -# if mylocation not in self.auxdb: -# self.auxdb[mylocation] = {} - - - try: - emtime = os.stat(myebuild).st_mtime - except (OSError, IOError): - writemsg("!!! aux_get(): ebuild for '%(cpv)s' does not exist at:\n" % {"cpv":mycpv}) - writemsg("!!! %s\n" % myebuild) - raise KeyError - - mydata={} - - # fix the indenting, lazy ass. - if True: - doregen=False - try: - mydata = self.auxdb[mylocation][mycpv] - if emtime != long(mydata.get("_mtime_",0)): - doregen=True - elif len(mydata.get("_eclasses_",())) > 0: - doregen = not self.eclassdb.is_eclass_data_valid(mydata["_eclasses_"]) - - except SystemExit,e: - raise - except Exception, e: -# print "exception 1=", e - doregen = True - if not isinstance(e, KeyError): - # CorruptionError is the likely candidate - writemsg("auxdb exception: (%s): %s\n" % (mylocation+"::"+cat+"/"+pkg,str(e))) -# if self.auxdb[mylocation][cat].has_key(pkg): -# self.auxdb[mylocation][cat].del_key(pkg) -# self.auxdb[mylocation][cat].sync() - - try: del self.auxdb[mycpv] - except KeyError: pass - - writemsg("auxdb is valid: "+str(not doregen)+" "+str(pkg)+"\n", 2) - if doregen: -# print "doregen for %s, " % mycpv,doregen - writemsg("doregen: %s %s\n" % (doregen,mycpv), 2) - writemsg("Generating cache entry(0) for: "+str(myebuild)+"\n",1) - - # XXX: Part of the gvisible hack/fix to prevent deadlock - # XXX: through doebuild. Need to isolate this somehow... - self.mysettings.reset() - - # XXX: is this truly required? - # ~harring. - if self.lock_held: - raise "Lock is already held by me?" - - self.lock_held = 1 - - mydata=ebuild.ebuild_handler().get_keys(myebuild,self.mysettings) - self.lock_held = 0 - if mydata == None: - raise Exception("Failed sourcing %s" % mycpv) - - mydata["_mtime_"] = emtime - if mydata.get("INHERITED", False): - mydata["_eclasses_"] = self.eclassdb.get_eclass_data( \ - mydata["INHERITED"].split() ) - del mydata["INHERITED"] - else: - mydata["_eclasses_"] = {} - - self.auxdb[mylocation][mycpv] = mydata -# if not self.eclassdb.update_package(mylocation, cat, pkg, mydata.get("INHERITED","").split()): -# print "failed updating eclass cache" -# sys.exit(1) - - #finally, we look at our internal cache entry and return the requested data. - returnme = [] - for x in mylist: - if x == "INHERITED": - returnme.append(' '.join(mydata.get("_eclasses_",{}).keys())) - else: - returnme.append(mydata.get(x,"")) - return returnme - - def getfetchlist(self,mypkg,useflags=None,mysettings=None,all=0): - if mysettings == None: - mysettings = self.mysettings - try: - myuris = self.aux_get(mypkg,["SRC_URI"])[0] - except (IOError,KeyError): - print red("getfetchlist():")+" aux_get() error reading "+mypkg+"; aborting." - sys.exit(1) - - useflags = mysettings["USE"].split() - - myurilist = portage_dep.paren_reduce(myuris) - myurilist = portage_dep.use_reduce(myurilist,uselist=useflags,matchall=all) - newuris = flatten(myurilist) - - myfiles = [] - for x in newuris: - mya = os.path.basename(x) - if not mya in myfiles: - myfiles.append(mya) - return [newuris, myfiles] - - def getfetchsizes(self,mypkg,useflags=None,debug=0): - # returns a filename:size dictionnary of remaining downloads - mydigest=self.finddigest(mypkg) - mymd5s=digestParseFile(mydigest) - if not mymd5s: - if debug: print "[empty/missing/bad digest]: "+mypkg - return None - filesdict={} - if useflags == None: - myuris, myfiles = self.getfetchlist(mypkg,all=1) - else: - myuris, myfiles = self.getfetchlist(mypkg,useflags=useflags) - #XXX: maybe this should be improved: take partial downloads - # into account? check md5sums? - for myfile in myfiles: - if debug and myfile not in mymd5s.keys(): - print "[bad digest]: missing",myfile,"for",mypkg - elif myfile in mymd5s.keys(): - distfile=settings["DISTDIR"]+"/"+myfile - if not os.access(distfile, os.R_OK): - filesdict[myfile]=int(mymd5s[myfile]["size"]) - return filesdict - - def fetch_check(self, mypkg, useflags=None, mysettings=None, all=False): - if not useflags: - if mysettings: - useflags = mysettings["USE"].split() - myuri, myfiles = self.getfetchlist(mypkg, useflags=useflags, mysettings=mysettings, all=all) - mydigest = self.finddigest(mypkg) - mysums = digestParseFile(mydigest) - - failures = {} - for x in myfiles: - if not mysums or x not in mysums: - ok = False - reason = "digest missing" - else: - ok,reason = portage_checksum.verify_all(self.mysettings["DISTDIR"]+"/"+x, mysums[x]) - if not ok: - failures[x] = reason - if failures: - return False - return True - - def getsize(self,mypkg,useflags=None,debug=0): - # returns the total size of remaining downloads - # - # we use getfetchsizes() now, so this function would be obsoleted - # - filesdict=self.getfetchsizes(mypkg,useflags=useflags,debug=debug) - if filesdict==None: - return "[empty/missing/bad digest]" - mysize=0 - for myfile in filesdict.keys(): - mysum+=filesdict[myfile] - return mysum - - def cpv_exists(self,mykey): - "Tells us whether an actual ebuild exists on disk (no masking)" - cps2=mykey.split("/") - cps=portage_versions.catpkgsplit(mykey,silent=0) - if not cps: - #invalid cat/pkg-v - return 0 - if self.findname(cps[0]+"/"+cps2[1]): - return 1 - else: - return 0 - - def cp_all(self): - "returns a list of all keys in our tree" - d={} - for oroot in self.porttrees: - for x in self.mysettings.categories: - for y in listdir(os.path.join(oroot, x),ignorecvs=1): - mykey=x+"/"+y - d[x+"/"+y] = None - return d.keys() - - def p_list(self,mycp): - d={} - for oroot in self.porttrees: - for x in listdir(oroot+"/"+mycp,ignorecvs=1): - if x[-7:]==".ebuild": - mye=x[:-7] - d[mye] = None - return d.keys() - - def cp_list(self,mycp,use_cache=1): - mysplit=mycp.split("/") - returnme=[] - d={} - for oroot in self.porttrees: - for x in listdir(oroot+"/"+mycp,ignorecvs=1): - if x[-7:]==".ebuild": - d[mysplit[0]+"/"+x[:-7]] = None - return d.keys() - - def freeze(self): - for x in ["list-visible","bestmatch-visible","match-visible","match-all"]: - self.xcache[x]={} - self.frozen=1 - - def melt(self): - self.xcache={} - self.frozen=0 - - def xmatch(self,level,origdep,mydep=None,mykey=None,mylist=None): - "caching match function; very trick stuff" - #if no updates are being made to the tree, we can consult our xcache... - if self.frozen: - try: - return self.xcache[level][origdep] - except KeyError: - pass - - if not mydep: - #this stuff only runs on first call of xmatch() - #create mydep, mykey from origdep - mydep=dep_expand(origdep,mydb=self) - mykey=portage_dep.dep_getkey(mydep) - - if level=="list-visible": - #a list of all visible packages, not called directly (just by xmatch()) - #myval=self.visible(self.cp_list(mykey)) - myval=self.gvisible(self.visible(self.cp_list(mykey))) - elif level=="bestmatch-visible": - #dep match -- best match of all visible packages - myval=best(self.xmatch("match-visible",None,mydep=mydep,mykey=mykey)) - #get all visible matches (from xmatch()), then choose the best one - elif level=="bestmatch-list": - #dep match -- find best match but restrict search to sublist - myval=best(portage_dep.match_from_list(mydep,mylist)) - #no point is calling xmatch again since we're not caching list deps - elif level=="match-list": - #dep match -- find all matches but restrict search to sublist (used in 2nd half of visible()) - myval=portage_dep.match_from_list(mydep,mylist) - elif level=="match-visible": - #dep match -- find all visible matches - myval=portage_dep.match_from_list(mydep,self.xmatch("list-visible",None,mydep=mydep,mykey=mykey)) - #get all visible packages, then get the matching ones - elif level=="match-all": - #match *all* visible *and* masked packages - myval=portage_dep.match_from_list(mydep,self.cp_list(mykey)) - else: - print "ERROR: xmatch doesn't handle",level,"query!" - raise KeyError - if self.frozen and (level not in ["match-list","bestmatch-list"]): - self.xcache[level][mydep]=myval - return myval - - def match(self,mydep,use_cache=1): - return self.xmatch("match-visible",mydep) - - def visible(self,mylist): - """two functions in one. Accepts a list of cpv values and uses the package.mask *and* - packages file to remove invisible entries, returning remaining items. This function assumes - that all entries in mylist have the same category and package name.""" - if (mylist==None) or (len(mylist)==0): - return [] - newlist=mylist[:] - #first, we mask out packages in the package.mask file - mykey=newlist[0] - cpv=portage_versions.catpkgsplit(mykey) - if not cpv: - #invalid cat/pkg-v - print "visible(): invalid cat/pkg-v:",mykey - return [] - mycp=cpv[0]+"/"+cpv[1] - maskdict=self.mysettings.pmaskdict - unmaskdict=self.mysettings.punmaskdict - if maskdict.has_key(mycp): - for x in maskdict[mycp]: - mymatches=self.xmatch("match-all",x) - if mymatches==None: - #error in package.mask file; print warning and continue: - print "visible(): package.mask entry \""+x+"\" is invalid, ignoring..." - continue - for y in mymatches: - unmask=0 - if unmaskdict.has_key(mycp): - for z in unmaskdict[mycp]: - mymatches_unmask=self.xmatch("match-all",z) - if y in mymatches_unmask: - unmask=1 - break - if unmask==0: - try: - newlist.remove(y) - except ValueError: - pass - - revmaskdict=self.mysettings.prevmaskdict - if revmaskdict.has_key(mycp): - for x in revmaskdict[mycp]: - #important: only match against the still-unmasked entries... - #notice how we pass "newlist" to the xmatch() call below.... - #Without this, ~ deps in the packages files are broken. - mymatches=self.xmatch("match-list",x,mylist=newlist) - if mymatches==None: - #error in packages file; print warning and continue: - print "emerge: visible(): profile packages entry \""+x+"\" is invalid, ignoring..." - continue - pos=0 - while pos<len(newlist): - if newlist[pos] not in mymatches: - del newlist[pos] - else: - pos += 1 - return newlist - - def gvisible(self,mylist): - "strip out group-masked (not in current group) entries" - global groups - if mylist==None: - return [] - newlist=[] - - pkgdict = self.mysettings.pkeywordsdict - for mycpv in mylist: - #we need to update this next line when we have fully integrated the new db api - auxerr=0 - try: - myaux=db["/"]["porttree"].dbapi.aux_get(mycpv, ["KEYWORDS"]) - except (KeyError,IOError,TypeError): - continue - if not myaux[0]: - # KEYWORDS="" - #print "!!! No KEYWORDS for "+str(mycpv)+" -- Untested Status" - continue - mygroups=myaux[0].split() - pgroups=groups[:] - cp = portage_dep.dep_getkey(mycpv) - if cp in pkgdict: - matches = portage_dep.match_to_list(mycpv, pkgdict[cp].keys()) - for atom in matches: - pgroups.extend(pkgdict[cp][atom]) - match=0 - for gp in mygroups: - if gp=="*": - writemsg("--- WARNING: Package '%s' uses '*' keyword.\n" % mycpv) - match=1 - break - elif "-"+gp in pgroups: - match=0 - break - elif gp in pgroups: - match=1 - break - else: - if "*" in pgroups: - for gp in mygroups: - if not gp[0] in "~-": - match=1 - break - if "~*" in pgroups: - for gp in mygroups: - if gp[0] != "-": - match=1 - break - if match: - newlist.append(mycpv) - return newlist - -class binarytree(packagetree): - "this tree scans for a list of all packages available in PKGDIR" - def __init__(self,root,pkgdir,virtual=None,clone=None): - - if clone: - # XXX This isn't cloning. It's an instance of the same thing. - self.root=clone.root - self.pkgdir=clone.pkgdir - self.dbapi=clone.dbapi - self.populated=clone.populated - self.tree=clone.tree - self.remotepkgs=clone.remotepkgs - self.invalids=clone.invalids - else: - self.root=root - #self.pkgdir=settings["PKGDIR"] - self.pkgdir=pkgdir - self.dbapi=bindbapi(self) - self.populated=0 - self.tree={} - self.remotepkgs={} - self.invalids=[] - - def move_ent(self,mylist): - if not self.populated: - self.populate() - origcp=mylist[1] - newcp=mylist[2] - origmatches=self.dbapi.cp_list(origcp) - if not origmatches: - return - for mycpv in origmatches: - mycpsplit=portage_versions.catpkgsplit(mycpv) - mynewcpv=newcp+"-"+mycpsplit[2] - mynewcat=newcp.split("/")[0] - mynewpkg=mynewcpv.split("/")[1] - myoldpkg=mycpv.split("/")[1] - if mycpsplit[3]!="r0": - mynewcpv += "-"+mycpsplit[3] - if (mynewpkg != myoldpkg) and os.path.exists(self.getname(mynewcpv)): - writemsg("!!! Cannot update binary: Destination exists.\n") - writemsg("!!! "+mycpv+" -> "+mynewcpv+"\n") - continue - tbz2path=self.getname(mycpv) - if os.path.exists(tbz2path) and not os.access(tbz2path,os.W_OK): - writemsg("!!! Cannot update readonly binary: "+mycpv+"\n") - continue - - #print ">>> Updating data in:",mycpv - sys.stdout.write("%") - sys.stdout.flush() - mytmpdir=settings["PORTAGE_TMPDIR"]+"/tbz2" - mytbz2=xpak.tbz2(tbz2path) - mytbz2.decompose(mytmpdir, cleanup=1) - - fixdbentries(origcp, newcp, mytmpdir) - - catfile=open(mytmpdir+"/CATEGORY", "w") - catfile.write(mynewcat+"\n") - catfile.close() - try: - os.rename(mytmpdir+"/"+mycpv.split("/")[1]+".ebuild", mytmpdir+"/"+mynewcpv.split("/")[1]+".ebuild") - except SystemExit, e: - raise - except Exception, e: - pass - - mytbz2.recompose(mytmpdir, cleanup=1) - - self.dbapi.cpv_remove(mycpv) - if (mynewpkg != myoldpkg): - os.rename(tbz2path,self.getname(mynewcpv)) - self.dbapi.cpv_inject(mynewcpv) - return 1 - - def move_slot_ent(self,mylist,mytmpdir): - #mytmpdir=settings["PORTAGE_TMPDIR"]+"/tbz2" - mytmpdir=mytmpdir+"/tbz2" - if not self.populated: - self.populate() - pkg=mylist[1] - origslot=mylist[2] - newslot=mylist[3] - origmatches=self.dbapi.match(pkg) - if not origmatches: - return - for mycpv in origmatches: - mycpsplit=portage_versions.catpkgsplit(mycpv) - myoldpkg=mycpv.split("/")[1] - tbz2path=self.getname(mycpv) - if os.path.exists(tbz2path) and not os.access(tbz2path,os.W_OK): - writemsg("!!! Cannot update readonly binary: "+mycpv+"\n") - continue - - #print ">>> Updating data in:",mycpv - mytbz2=xpak.tbz2(tbz2path) - mytbz2.decompose(mytmpdir, cleanup=1) - - slot=grabfile(mytmpdir+"/SLOT"); - if (not slot): - continue - - if (slot[0]!=origslot): - continue - - sys.stdout.write("S") - sys.stdout.flush() - - slotfile=open(mytmpdir+"/SLOT", "w") - slotfile.write(newslot+"\n") - slotfile.close() - mytbz2.recompose(mytmpdir, cleanup=1) - return 1 - - def update_ents(self,mybiglist,mytmpdir): - #XXX mytmpdir=settings["PORTAGE_TMPDIR"]+"/tbz2" - if not self.populated: - self.populate() - for mycpv in self.dbapi.cp_all(): - tbz2path=self.getname(mycpv) - if os.path.exists(tbz2path) and not os.access(tbz2path,os.W_OK): - writemsg("!!! Cannot update readonly binary: "+mycpv+"\n") - continue - #print ">>> Updating binary data:",mycpv - writemsg("*") - mytbz2=xpak.tbz2(tbz2path) - mytbz2.decompose(mytmpdir,cleanup=1) - for mylist in mybiglist: - mylist=mylist.split() - if mylist[0] != "move": - continue - fixdbentries(mylist[1], mylist[2], mytmpdir) - mytbz2.recompose(mytmpdir,cleanup=1) - return 1 - - def populate(self, getbinpkgs=0,getbinpkgsonly=0): - "populates the binarytree" - if (not os.path.isdir(self.pkgdir) and not getbinpkgs): - return 0 - if (not os.path.isdir(self.pkgdir+"/All") and not getbinpkgs): - return 0 - - if (not getbinpkgsonly) and os.path.exists(self.pkgdir+"/All"): - for mypkg in listdir(self.pkgdir+"/All"): - if mypkg[-5:]!=".tbz2": - continue - mytbz2=xpak.tbz2(self.pkgdir+"/All/"+mypkg) - mycat=mytbz2.getfile("CATEGORY") - if not mycat: - #old-style or corrupt package - writemsg("!!! Invalid binary package: "+mypkg+"\n") - self.invalids.append(mypkg) - continue - mycat=mycat.strip() - fullpkg=mycat+"/"+mypkg[:-5] - mykey=portage_dep.dep_getkey(fullpkg) - try: - # invalid tbz2's can hurt things. - self.dbapi.cpv_inject(fullpkg) - except SystemExit, e: - raise - except: - continue - - if getbinpkgs and not settings["PORTAGE_BINHOST"]: - writemsg(red("!!! PORTAGE_BINHOST unset, but use is requested.\n")) - - if getbinpkgs and settings["PORTAGE_BINHOST"] and not self.remotepkgs: - try: - chunk_size = long(settings["PORTAGE_BINHOST_CHUNKSIZE"]) - if chunk_size < 8: - chunk_size = 8 - except SystemExit, e: - raise - except: - chunk_size = 3000 - - writemsg(green("Fetching binary packages info...\n")) - self.remotepkgs = getbinpkg.dir_get_metadata(settings["PORTAGE_BINHOST"], chunk_size=chunk_size) - writemsg(green(" -- DONE!\n\n")) - - for mypkg in self.remotepkgs.keys(): - if not self.remotepkgs[mypkg].has_key("CATEGORY"): - #old-style or corrupt package - writemsg("!!! Invalid remote binary package: "+mypkg+"\n") - del self.remotepkgs[mypkg] - continue - mycat=self.remotepkgs[mypkg]["CATEGORY"].strip() - fullpkg=mycat+"/"+mypkg[:-5] - mykey=portage_dep.dep_getkey(fullpkg) - try: - # invalid tbz2's can hurt things. - #print "cpv_inject("+str(fullpkg)+")" - self.dbapi.cpv_inject(fullpkg) - #print " -- Injected" - except SystemExit, e: - raise - except: - writemsg("!!! Failed to inject remote binary package:"+str(fullpkg)+"\n") - del self.remotepkgs[mypkg] - continue - self.populated=1 - - def inject(self,cpv): - return self.dbapi.cpv_inject(cpv) - - def exists_specific(self,cpv): - if not self.populated: - self.populate() - return self.dbapi.match(dep_expand("="+cpv,mydb=self.dbapi)) - - def dep_bestmatch(self,mydep): - "compatibility method -- all matches, not just visible ones" - if not self.populated: - self.populate() - writemsg("\n\n", 1) - writemsg("mydep: %s\n" % mydep, 1) - mydep=dep_expand(mydep,mydb=self.dbapi) - writemsg("mydep: %s\n" % mydep, 1) - mykey=portage_dep.dep_getkey(mydep) - writemsg("mykey: %s\n" % mykey, 1) - mymatch=best(portage_dep.match_from_list(mydep,self.dbapi.cp_list(mykey))) - writemsg("mymatch: %s\n" % mymatch, 1) - if mymatch==None: - return "" - return mymatch - - def getname(self,pkgname): - "returns file location for this particular package" - mysplit=pkgname.split("/") - if len(mysplit)==1: - return self.pkgdir+"/All/"+self.resolve_specific(pkgname)+".tbz2" - else: - return self.pkgdir+"/All/"+mysplit[1]+".tbz2" - - def isremote(self,pkgname): - "Returns true if the package is kept remotely." - mysplit=pkgname.split("/") - remote = (not os.path.exists(self.getname(pkgname))) and self.remotepkgs.has_key(mysplit[1]+".tbz2") - return remote - - def get_use(self,pkgname): - mysplit=pkgname.split("/") - if self.isremote(pkgname): - return self.remotepkgs[mysplit[1]+".tbz2"]["USE"][:].split() - tbz2=xpak.tbz2(self.getname(pkgname)) - return tbz2.getfile("USE").split() - - def gettbz2(self,pkgname): - "fetches the package from a remote site, if necessary." - print "Fetching '"+str(pkgname)+"'" - mysplit = pkgname.split("/") - tbz2name = mysplit[1]+".tbz2" - if not self.isremote(pkgname): - if (tbz2name not in self.invalids): - return - else: - writemsg("Resuming download of this tbz2, but it is possible that it is corrupt.\n") - mydest = self.pkgdir+"/All/" - try: - os.makedirs(mydest, 0775) - except SystemExit, e: - raise - except: - pass - getbinpkg.file_get(settings["PORTAGE_BINHOST"]+"/"+tbz2name, mydest, fcmd=settings["RESUMECOMMAND"]) - return - - def getslot(self,mycatpkg): - "Get a slot for a catpkg; assume it exists." - myslot = "" - try: - myslot=self.dbapi.aux_get(mycatpkg,["SLOT"])[0] - except SystemExit, e: - raise - except Exception, e: - pass - return myslot - -class dblink: - "this class provides an interface to the standard text package database" - def __init__(self,cat,pkg,myroot,mysettings,treetype="porttree"): - "create a dblink object for cat/pkg. This dblink entry may or may not exist" - self.cat = cat - self.pkg = pkg - self.mycpv = self.cat+"/"+self.pkg - self.mysplit = portage_versions.pkgsplit(self.mycpv) - self.treetype = treetype - - self.dbroot = os.path.normpath(myroot+VDB_PATH) - self.dbcatdir = self.dbroot+"/"+cat - self.dbpkgdir = self.dbcatdir+"/"+pkg - self.dbtmpdir = self.dbcatdir+"/-MERGING-"+pkg - self.dbdir = self.dbpkgdir - - self.lock_pkg = None - self.lock_tmp = None - self.lock_num = 0 # Count of the held locks on the db. - - self.settings = mysettings - if self.settings==1: - raise ValueError - - self.myroot=myroot - self.updateprotect() - self.contentscache=[] - - def lockdb(self): - if self.lock_num == 0: - self.lock_pkg = portage_locks.lockdir(self.dbpkgdir) - self.lock_tmp = portage_locks.lockdir(self.dbtmpdir) - self.lock_num += 1 - - def unlockdb(self): - self.lock_num -= 1 - if self.lock_num == 0: - portage_locks.unlockdir(self.lock_tmp) - portage_locks.unlockdir(self.lock_pkg) - - def getpath(self): - "return path to location of db information (for >>> informational display)" - return self.dbdir - - def exists(self): - "does the db entry exist? boolean." - return os.path.exists(self.dbdir) - - def create(self): - "create the skeleton db directory structure. No contents, virtuals, provides or anything. Also will create /var/db/pkg if necessary." - # XXXXX Delete this eventually - raise Exception, "This is bad. Don't use it." - if not os.path.exists(self.dbdir): - os.makedirs(self.dbdir) - - def delete(self): - "erase this db entry completely" - if not os.path.exists(self.dbdir): - return - try: - for x in listdir(self.dbdir): - os.unlink(self.dbdir+"/"+x) - os.rmdir(self.dbdir) - except OSError, e: - print "!!! Unable to remove db entry for this package." - print "!!! It is possible that a directory is in this one. Portage will still" - print "!!! register this package as installed as long as this directory exists." - print "!!! You may delete this directory with 'rm -Rf "+self.dbdir+"'" - print "!!! "+str(e) - print - sys.exit(1) - - def clearcontents(self): - if os.path.exists(self.dbdir+"/CONTENTS"): - os.unlink(self.dbdir+"/CONTENTS") - - def getcontents(self): - if not os.path.exists(self.dbdir+"/CONTENTS"): - return None - if self.contentscache != []: - return self.contentscache - pkgfiles={} - myc=open(self.dbdir+"/CONTENTS","r") - mylines=myc.readlines() - myc.close() - pos=1 - for line in mylines: - mydat = line.split() - # we do this so we can remove from non-root filesystems - # (use the ROOT var to allow maintenance on other partitions) - try: - mydat[1]=os.path.normpath(root+mydat[1][1:]) - if mydat[0]=="obj": - #format: type, mtime, md5sum - pkgfiles[" ".join(mydat[1:-2])]=[mydat[0], mydat[-1], mydat[-2]] - elif mydat[0]=="dir": - #format: type - pkgfiles[" ".join(mydat[1:])]=[mydat[0] ] - elif mydat[0]=="sym": - #format: type, mtime, dest - x=len(mydat)-1 - if (x >= 13) and (mydat[-1][-1]==')'): # Old/Broken symlink entry - mydat = mydat[:-10]+[mydat[-10:][stat.ST_MTIME][:-1]] - writemsg("FIXED SYMLINK LINE: %s\n" % mydat, 1) - x=len(mydat)-1 - splitter=-1 - while(x>=0): - if mydat[x]=="->": - splitter=x - break - x=x-1 - if splitter==-1: - return None - pkgfiles[" ".join(mydat[1:splitter])]=[mydat[0], mydat[-1], " ".join(mydat[(splitter+1):-1])] - elif mydat[0]=="dev": - #format: type - pkgfiles[" ".join(mydat[1:])]=[mydat[0] ] - elif mydat[0]=="fif": - #format: type - pkgfiles[" ".join(mydat[1:])]=[mydat[0]] - else: - return None - except (KeyError,IndexError): - print "portage: CONTENTS line",pos,"corrupt!" - pos += 1 - self.contentscache=pkgfiles - return pkgfiles - - def updateprotect(self): - #do some config file management prep - self.protect=[] - for x in self.settings["CONFIG_PROTECT"].split(): - ppath=normpath(self.myroot+x)+"/" - if os.path.isdir(ppath): - self.protect.append(ppath) - - self.protectmask=[] - for x in self.settings["CONFIG_PROTECT_MASK"].split(): - ppath=normpath(self.myroot+x)+"/" - if os.path.isdir(ppath): - self.protectmask.append(ppath) - #if it doesn't exist, silently skip it - - def isprotected(self,obj): - """Checks if obj is in the current protect/mask directories. Returns - 0 on unprotected/masked, and 1 on protected.""" - masked=0 - protected=0 - for ppath in self.protect: - if (len(ppath) > masked) and (obj[0:len(ppath)]==ppath): - protected=len(ppath) - #config file management - for pmpath in self.protectmask: - if (len(pmpath) >= protected) and (obj[0:len(pmpath)]==pmpath): - #skip, it's in the mask - masked=len(pmpath) - return (protected > masked) - - def unmerge(self,pkgfiles=None,trimworld=1,cleanup=0): - global dircache - dircache={} - - self.lockdb() - - self.settings.load_infodir(self.dbdir) - - if not pkgfiles: - print "No package files given... Grabbing a set." - pkgfiles=self.getcontents() - - # Now, don't assume that the name of the ebuild is the same as the - # name of the dir; the package may have been moved. - myebuildpath=None - - # We should use the environement file if possible, - # as it has all sourced files already included. - # XXX: Need to ensure it doesn't overwrite any important vars though. - if os.access(self.dbdir+"/environment.bz2", os.R_OK): - portage_exec.spawn("bzip2 -d "+self.dbdir+"/environment.bz2") - - if not myebuildpath: - mystuff=listdir(self.dbdir) - 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,self.settings,cleanup=cleanup,use_cache=0, \ - tree=self.treetype) - # XXX: Decide how to handle failures here. - if a != 0: - writemsg("!!! FAILED prerm: "+str(a)+"\n") - sys.exit(123) - - if pkgfiles: - mykeys=pkgfiles.keys() - mykeys.sort() - mykeys.reverse() - - self.updateprotect() - - #process symlinks second-to-last, directories last. - mydirs=[] - mysyms=[] - modprotect="/lib/modules/" - for obj in mykeys: - obj=os.path.normpath(obj) - if obj[:2]=="//": - obj=obj[1:] - if not os.path.exists(obj): - if not os.path.islink(obj): - #we skip this if we're dealing with a symlink - #because os.path.exists() will operate on the - #link target rather than the link itself. - print "--- !found "+str(pkgfiles[obj][0]), obj - continue - # next line includes a tweak to protect modules from being unmerged, - # but we don't protect modules from being overwritten if they are - # upgraded. We effectively only want one half of the config protection - # functionality for /lib/modules. For portage-ng both capabilities - # should be able to be independently specified. - if self.isprotected(obj) or ((len(obj) > len(modprotect)) and (obj[0:len(modprotect)]==modprotect)): - print "--- cfgpro "+str(pkgfiles[obj][0]), obj - continue - - lstatobj=os.lstat(obj) - lmtime=str(lstatobj[stat.ST_MTIME]) - 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): - print "--- !dir ","dir", obj - continue - mydirs.append(obj) - elif pkgfiles[obj][0]=="sym": - if not os.path.islink(obj): - print "--- !sym ","sym", obj - continue - mysyms.append(obj) - elif pkgfiles[obj][0]=="obj": - if not os.path.isfile(obj): - print "--- !obj ","obj", obj - continue - mymd5=portage_checksum.perform_md5(obj, calc_prelink=1) - - # string.lower is needed because db entries used to be in upper-case. The - # string.lower allows for backwards compatibility. - if mymd5 != pkgfiles[obj][2].lower(): - print "--- !md5 ","obj", obj - continue - try: - os.unlink(obj) - except (OSError,IOError),e: - pass - print "<<< ","obj",obj - elif pkgfiles[obj][0]=="fif": - if not stat.S_ISFIFO(lstatobj[stat.ST_MODE]): - print "--- !fif ","fif", obj - continue - try: - os.unlink(obj) - except (OSError,IOError),e: - pass - print "<<< ","fif",obj - elif pkgfiles[obj][0]=="dev": - print "--- ","dev",obj - - #Now, we need to remove symlinks and directories. We'll repeatedly - #remove dead symlinks, then directories until we stop making progress. - #This is how we'll clean up directories containing symlinks pointing to - #directories that are now empty. These cases will require several - #iterations through our two-stage symlink/directory cleaning loop. - - #main symlink and directory removal loop: - - #progress -- are we making progress? Initialized to 1 so loop will start - progress=1 - while progress: - #let's see if we're able to make progress this iteration... - progress=0 - - #step 1: remove all the dead symlinks we can... - - pos = 0 - while pos<len(mysyms): - obj=mysyms[pos] - if os.path.exists(obj): - pos += 1 - else: - #we have a dead symlink; remove it from our list, then from existence - del mysyms[pos] - #we've made progress! - progress = 1 - try: - os.unlink(obj) - print "<<< ","sym",obj - except (OSError,IOError),e: - print "!!! ","sym",obj - #immutable? - pass - - #step 2: remove all the empty directories we can... - - pos = 0 - while pos<len(mydirs): - obj=mydirs[pos] - objld=listdir(obj) - - if objld == None: - print "mydirs["+str(pos)+"]",mydirs[pos] - print "obj",obj - print "objld",objld - # the directory doesn't exist yet, continue - pos += 1 - continue - - if len(objld)>0: - #we won't remove this directory (yet), continue - pos += 1 - continue - elif (objld != None): - #zappo time - del mydirs[pos] - #we've made progress! - progress = 1 - try: - os.rmdir(obj) - print "<<< ","dir",obj - except (OSError,IOError),e: - #immutable? - pass - #else: - # print "--- !empty","dir", obj - # continue - - #step 3: if we've made progress, we'll give this another go... - - #step 4: otherwise, we'll print out the remaining stuff that we didn't unmerge (and rightly so!) - - #directories that aren't empty: - for x in mydirs: - print "--- !empty dir", x - - #symlinks whose target still exists: - for x in mysyms: - print "--- !targe sym", x - - #step 5: well, removal of package objects is complete, now for package *meta*-objects.... - - #remove self from vartree database so that our own virtual gets zapped if we're the last node - db[self.myroot]["vartree"].zap(self.mycpv) - - # New code to remove stuff from the world and virtuals files when unmerged. - if trimworld: - worldlist=grabfile(self.myroot+WORLD_FILE) - mykey=cpv_getkey(self.mycpv) - newworldlist=[] - for x in worldlist: - if portage_dep.dep_getkey(x)==mykey: - matches=db[self.myroot]["vartree"].dbapi.match(x,use_cache=0) - if not matches: - #zap our world entry - pass - elif (len(matches)==1) and (matches[0]==self.mycpv): - #zap our world entry - pass - else: - #others are around; keep it. - newworldlist.append(x) - else: - #this doesn't match the package we're unmerging; keep it. - newworldlist.append(x) - - # if the base dir doesn't exist, create it. - # (spanky noticed bug) - # XXX: dumb question, but abstracting the root uid might be wise/useful for - # 2nd pkg manager installation setups. - if not os.path.exists(os.path.dirname(self.myroot+WORLD_FILE)): - pdir = os.path.dirname(self.myroot + WORLD_FILE) - os.makedirs(pdir, mode=0755) - os.chown(pdir, 0, portage_gid) - os.chmod(pdir, 02770) - - myworld=open(self.myroot+WORLD_FILE,"w") - for x in newworldlist: - myworld.write(x+"\n") - myworld.close() - - #do original postrm - if myebuildpath and os.path.exists(myebuildpath): - # XXX: This should be the old config, not the current one. - # XXX: Use vardbapi to load up env vars. - a=doebuild(myebuildpath,"postrm",self.myroot,self.settings,use_cache=0,tree=self.treetype) - # XXX: Decide how to handle failures here. - if a != 0: - writemsg("!!! FAILED postrm: "+str(a)+"\n") - sys.exit(123) - - self.unlockdb() - - def isowner(self,filename,destroot): - """ check if filename is a new file or belongs to this package - (for this or a previous version)""" - destfile = os.path.normpath(destroot+"/"+filename) - if not os.path.exists(destfile): - return True - if self.getcontents() and filename in self.getcontents().keys(): - return True - - return False - - def treewalk(self,srcroot,destroot,inforoot,myebuild,cleanup=0): - global db - # srcroot = ${D}; - # destroot = where to merge, ie. ${ROOT}, - # inforoot = root of db entry, - # secondhand = list of symlinks that have been skipped due to - # their target not existing (will merge later), - - if not os.path.exists(self.dbcatdir): - os.makedirs(self.dbcatdir) - - # This blocks until we can get the dirs to ourselves. - self.lockdb() - - stopmerge=False - import dcache - dc=dcache.dcache() - do_prelink = ("prelink" in features and portage_checksum.prelink_capable) - if "collision-protect" in features or "verify-rdepend" in features or do_prelink: - myfilelist = listdir(srcroot, recursive=1, filesonly=1,followSymlinks=False,cacheObject=dc) - # the linkcheck only works if we are in srcroot - try: - mycwd = os.getcwd() - except OSError: - mycwd="/" - os.chdir(srcroot) - mysymlinks = filter(os.path.islink, listdir(srcroot, recursive=1, - filesonly=0,followSymlinks=False, cacheObject=dc)) - os.chdir(mycwd) - - # check for package collisions - otherversions=[] - for v in db[self.myroot]["vartree"].dbapi.cp_list(self.mysplit[0]): - otherversions.append(v.split("/")[1]) - - if self.pkg in otherversions: - otherversions.remove(self.pkg) # we already checked this package - - if "collision-protect" in features: - starttime=time.time() - i=0 - - otherpkg=[] - mypkglist=[] - - for v in otherversions: - # should we check for same SLOT here ? - mypkglist.append(dblink(self.cat,v,destroot,self.settings)) - - print - print green("*")+" checking "+str(len(myfilelist))+" files for package collisions" - for f in myfilelist: - nocheck = False - # listdir isn't intelligent enough to exclude symlinked dirs, - # so we have to do it ourself - for s in mysymlinks: - # the length comparison makes sure that the symlink itself is checked - if f[:len(s)] == s and len(f) > len(s): - nocheck = True - if nocheck: - continue - i=i+1 - if i % 1000 == 0: - print "%6d files checked ..." % i - if f[0] != "/": - f="/"+f - isowned = False - for ver in [self]+mypkglist: - if (ver.isowner(f, destroot) or ver.isprotected(f)): - isowned = True - break - if not isowned: - print "existing file "+f+" is not owned by this package" - stopmerge=True - print green("*")+" spent %.2f seconds checking for file collisions" % (time.time()-starttime) - if stopmerge: - print red("*")+" This package is blocked because it wants to overwrite" - print red("*")+" files belonging to other packages (see messages above)." - print red("*")+" If you have no clue what this is all about report it " - print red("*")+" as a bug for this package on http://bugs.gentoo.org" - print - print red("package "+self.cat+"/"+self.pkg+" NOT merged") - print - # Why is the package already merged here db-wise? Shouldn't be the case - # only unmerge if it ia new package and has no contents - if not self.getcontents(): - self.unmerge() - self.delete() - self.unlockdb() - sys.exit(1) - - prelink_bins = [] - if "verify-rdepend" in features or do_prelink: - checklist=[] - print - print green("*")+ " grabbing %s/%s's binaries/libs" % (self.cat,self.pkg) - - try: - mycwd = os.getcwd() - except OSError: - mycwd="/" - os.chdir(srcroot) - - for f in myfilelist: - nocheck = False - # listdir isn't intelligent enough to exclude symlinked dirs, - # so we have to do it ourself - for s in mysymlinks: - # the length comparison makes sure that the symlink itself is checked - if f[:len(s)] == s and len(f) > len(s): - continue - - retval, bins=portage_exec.spawn_get_output("ldd -r %s" % f,collect_fds=[1],emulate_gso=False) - if retval: - continue - for x in bins: - y=x.split() - if y[0][0:13] != "linux-gate.so" and y[0] not in checklist: - checklist.append(y[0]) - - prelink_bins.append(f) - os.chdir(mycwd) - - if "verify-rdepend" in features: - starttime=time.time() - print green("*")+ " checking %s/%s RDEPEND" % (self.cat, self.pkg) - - # Step1: filter package's provided libs first. - candidates_checked=["%s/%s" % (self.cat,self.pkg)] - if len(checklist): - l=[] - for x in myfilelist: - l.append(x.split("/")[-1]) - #mysymlinks is pairs of src, trg. add srcs in. - for x in range(0,len(mysymlinks),2): - l.append(mysymlinks[x].split("/")[-1]) - y=0 - while y < len(checklist): - if checklist[y] in l or checklist[y] in myfilelist: - checklist.pop(y) - else: - y+=1 - - # Step2: filter out libs from the packages states RDEPEND - if len(checklist): - rdep=portage_dep.paren_reduce(db[self.myroot][self.treetype].dbapi.aux_get( \ - self.mycpv,["RDEPEND"])[0]) - rdep=portage_util.unique_array(flatten(portage_dep.use_reduce(rdep, \ - uselist=self.settings["USE"],matchall=False))) - - r=[] - for x in rdep: - r.extend(db[self.myroot]["vartree"].dbapi.match(x)) - - rdep=r - - # filter first package rdeps, then virtual/.?libc, then gcc - - lm = db[self.myroot]["vartree"].dbapi.match("virtual/glibc") - lm.extend(db[self.myroot]["vartree"].dbapi.match("virtual/libc")) - lm = portage_util.unique_array(lm) - - for rd,msg in [(r,"%s/%s's RDEPEND" % (self.cat,self.pkg)), \ - (lm, "virtual/glibc, virtual/libc"), \ - (db[self.myroot]["vartree"].dbapi.match("gcc"), "gcc")]: - - print green("*")+" Parsing %s contents" % msg - - candidates_checked.extend(rd) - - for r in rd: - s=portage_versions.catsplit(r) -# print "%s=" % r, s - c=dblink(s[0],s[1],self.myroot,self.settings).getcontents() - if c == None: - print yellow("---")+" Installed package %s seems to lack a contents file" % r - else: - y=0 - l=[] - - # build a list of obj files minus their directory. - for x in c.keys(): - if c[x][0] in ["obj","sym"]: - l.append(x.split("/")[-1]) - - while y < len(checklist): - if c.has_key(checklist[y]) or checklist[y] in l: -# print "%s satisfied by %s" % (checklist[y], r) - checklist.pop(y) - else: - y+=1 - if len(checklist) == 0: - break - if len(checklist) == 0: - break - - # Step3: breadth then depth walk of package's RDEPEND's, RDEPEND's. - # not much for this, since it's entirely possible invalid deps could be filtered out. - # probably worth doing uselist=[], since at this point, a depend atom can't specify use flag. - if len(checklist): - # so now we recursive walk the RDEPEND's of cpv's RDEPENDS. yay. - print green("*")+" Parsing breadth then depth of %s/%s's RDEPEND's now (libs remain)" % (self.cat,self.pkg) - candidate=rdep - - while len(checklist) and len(candidate): - r=candidate.pop(0) - - candidates_checked.append(r) - - s=portage_versions.catsplit(r) - c=dblink(s[0],s[1],self.myroot,self.settings).getcontents() - if c == None: - print yellow("---")+" Installed package %s seems to lack a contents file" % r - else: - l=[] - - # build a list of obj files minus their directory. - for x in c.keys(): - if c[x][0] in ["obj","sym"]: - l.append(x.split("/")[-1]) - - y=0 - while y < len(checklist): - if c.has_key(checklist[y]) or checklist[y] in l: - checklist.pop(y) - else: - y+=1 - - if len(checklist): - # append this nodes rdepend. - rdep,u=db[self.myroot]["vartree"].dbapi.aux_get(r,["RDEPEND","USE"]) - pd=flatten(portage_dep.use_reduce(portage_dep.paren_reduce(rdep),\ - uselist=u,matchall=False)) - pd=portage_util.unique_array(pd) - for x in pd: - for y in db["/"]["vartree"].dbapi.match(x): - if y not in candidates_checked: - candidate.append(y) - candidate=portage_util.unique_array(flatten(candidate)) - - # Step4: Complain. Loudly. - if len(checklist): - print - print red("!!!")+" %s/%s has an incomplete RDEPEND: Unmatched libs:" % (self.cat, self.pkg) - print red("!!! ")+string.join(checklist,", ") - print - for x in range(0,10): - sys.stdout.write("\a") - if "severe" in features: - if not self.getcontents(): - self.unmerge() - self.delete() - self.unlockdb() - sys.exit(1) - - print green("*")+" spent %.2f seconds verifying RDEPEND" % (time.time()-starttime) - - - if do_prelink: - starttime=time.time() - print - print green("*")+ " prelinking %d binaries" % len(prelink_bins) - c = [PRELINK_BINARY] - if settings.has_key("PRELINK_OPTS"): - c.extend(settings["PRELINK_OPTS"].split()) - - for x in range(0,len(prelink_bins),10): - c2=c[:] - if x + 10 > len(prelink_bins): - c2.extend(prelink_bins[x:]) - else: - c2.extend(prelink_bins[x:x+10]) - try: - portage_exec.spawn(c2) - except SystemExit: - raise - except Exception,e: - print "caught exception while prelinking",e - - print green("*")+" spent %.2f seconds prelinking" % (time.time()-starttime) - - - # get old contents info for later unmerging - oldcontents = self.getcontents() - - self.dbdir = self.dbtmpdir - self.delete() - if not os.path.exists(self.dbtmpdir): - os.makedirs(self.dbtmpdir) - - print ">>> Merging",self.mycpv,"to",destroot - - # run preinst script - if myebuild: - # if we are merging a new ebuild, use *its* pre/postinst rather than using the one in /var/db/pkg - # (if any). - a=doebuild(myebuild,"preinst",root,self.settings,cleanup=0,use_cache=0, \ - use_info_env=False,tree=self.treetype) - else: - a=doebuild(inforoot+"/"+self.pkg+".ebuild","preinst",root,self.settings,cleanup=0, \ - use_cache=0,tree=self.treetype) - - # XXX: Decide how to handle failures here. - if a != 0: - writemsg("!!! FAILED preinst: "+str(a)+"\n") - sys.exit(123) - - # copy "info" files (like SLOT, CFLAGS, etc.) into the database - for x in listdir(inforoot): - self.copyfile(inforoot+"/"+x) - - # get current counter value (counter_tick also takes care of incrementing it) - # XXX Need to make this destroot, but it needs to be initialized first. XXX - # XXX bis: leads to some invalidentry() call through cp_all(). - counter = db["/"]["vartree"].dbapi.counter_tick(self.myroot,mycpv=self.mycpv) - # write local package counter for recording - lcfile = open(self.dbtmpdir+"/COUNTER","w") - lcfile.write(str(counter)) - lcfile.close() - - # open CONTENTS file (possibly overwriting old one) for recording - outfile=open(self.dbtmpdir+"/CONTENTS","w") - - self.updateprotect() - - #if we have a file containing previously-merged config file md5sums, grab it. - if os.path.exists(destroot+CONFIG_MEMORY_FILE): - cfgfiledict=grabdict(destroot+CONFIG_MEMORY_FILE) - else: - cfgfiledict={} - if self.settings.has_key("NOCONFMEM"): - cfgfiledict["IGNORE"]=1 - else: - cfgfiledict["IGNORE"]=0 - - # set umask to 0 for merging; back up umask, save old one in prevmask (since this is a global change) - mymtime = long(time.time()) - prevmask = os.umask(0) - secondhand = [] - - # we do a first merge; this will recurse through all files in our srcroot but also build up a - # "second hand" of symlinks to merge later - if self.mergeme(srcroot,destroot,outfile,secondhand,"",cfgfiledict,mymtime): - return 1 - - # now, it's time for dealing our second hand; we'll loop until we can't merge anymore. The rest are - # broken symlinks. We'll merge them too. - lastlen=0 - while len(secondhand) and len(secondhand)!=lastlen: - # clear the thirdhand. Anything from our second hand that - # couldn't get merged will be added to thirdhand. - - thirdhand=[] - self.mergeme(srcroot,destroot,outfile,thirdhand,secondhand,cfgfiledict,mymtime) - - #swap hands - lastlen=len(secondhand) - - # our thirdhand now becomes our secondhand. It's ok to throw - # away secondhand since thirdhand contains all the stuff that - # couldn't be merged. - secondhand = thirdhand - - if len(secondhand): - # force merge of remaining symlinks (broken or circular; oh well) - self.mergeme(srcroot,destroot,outfile,None,secondhand,cfgfiledict,mymtime) - - #restore umask - os.umask(prevmask) - - #if we opened it, close it - outfile.flush() - outfile.close() - - if (oldcontents): - print ">>> Safely unmerging already-installed instance..." - self.dbdir = self.dbpkgdir - self.unmerge(oldcontents,trimworld=0) - self.dbdir = self.dbtmpdir - print ">>> original instance of package unmerged safely." - - # We hold both directory locks. - self.dbdir = self.dbpkgdir - self.delete() - movefile(self.dbtmpdir, self.dbpkgdir, mysettings=self.settings) - - self.unlockdb() - - #write out our collection of md5sums - if cfgfiledict.has_key("IGNORE"): - del cfgfiledict["IGNORE"] - - # XXXX: HACK! PathSpec is very necessary here. - if not os.path.exists(destroot+PRIVATE_PATH): - os.makedirs(destroot+PRIVATE_PATH) - os.chown(destroot+PRIVATE_PATH,os.getuid(),portage_gid) - os.chmod(destroot+PRIVATE_PATH,02770) - dirlist = prefix_array(listdir(destroot+PRIVATE_PATH),destroot+PRIVATE_PATH+"/") - while dirlist: - dirlist.sort() - dirlist.reverse() # Gets them in file-before basedir order - x = dirlist[0] - if os.path.isdir(x): - dirlist += prefix_array(listdir(x),x+"/") - continue - os.unlink(destroot+PRIVATE_PATH+"/"+x) - - mylock = portage_locks.lockfile(destroot+CONFIG_MEMORY_FILE) - writedict(cfgfiledict,destroot+CONFIG_MEMORY_FILE) - portage_locks.unlockfile(mylock) - - #do postinst script - if myebuild: - # if we are merging a new ebuild, use *its* pre/postinst rather than using the one in /var/db/pkg - # (if any). - a=doebuild(myebuild,"postinst",root,self.settings,use_cache=0,use_info_env=False,cleanup=0,tree=self.treetype) - else: - a=doebuild(inforoot+"/"+self.pkg+".ebuild","postinst",root,self.settings,use_cache=0,cleanup=0,tree=self.treetype) - - # XXX: Decide how to handle failures here. - if a != 0: - writemsg("!!! FAILED postinst: "+str(a)+"\n") - sys.exit(123) - - downgrade = False - for v in otherversions: - if portage_versions.pkgcmp(portage_versions.catpkgsplit(self.pkg)[1:], portage_versions.catpkgsplit(v)[1:]) < 0: - downgrade = True - - #update environment settings, library paths. DO NOT change symlinks. - env_update(self.myroot,makelinks=(not downgrade)) - #dircache may break autoclean because it remembers the -MERGING-pkg file - global dircache - if dircache.has_key(self.dbcatdir): - del dircache[self.dbcatdir] - print ">>>",self.mycpv,"merged." - - # Process ebuild logfiles - elog_process(self.mycpv, self.settings) - - return 0 - - def mergeme(self,srcroot,destroot,outfile,secondhand,stufftomerge,cfgfiledict,thismtime): - srcroot=os.path.normpath("///"+srcroot)+"/" - destroot=os.path.normpath("///"+destroot)+"/" - # this is supposed to merge a list of files. There will be 2 forms of argument passing. - if type(stufftomerge)==str: - #A directory is specified. Figure out protection paths, listdir() it and process it. - mergelist=listdir(srcroot+stufftomerge) - offset=stufftomerge - # We need mydest defined up here to calc. protection paths. This is now done once per - # directory rather than once per file merge. This should really help merge performance. - # Trailing / ensures that protects/masks with trailing /'s match. - mytruncpath="/"+offset+"/" - myppath=self.isprotected(mytruncpath) - else: - mergelist=stufftomerge - offset="" - for x in mergelist: - mysrc=os.path.normpath("///"+srcroot+offset+x) - mydest=os.path.normpath("///"+destroot+offset+x) - # myrealdest is mydest without the $ROOT prefix (makes a difference if ROOT!="/") - myrealdest="/"+offset+x - # stat file once, test using S_* macros many times (faster that way) - try: - mystat=os.lstat(mysrc) - except SystemExit, e: - raise - except OSError, e: - writemsg("\n") - writemsg(red("!!! ERROR: There appears to be ")+bold("FILE SYSTEM CORRUPTION.")+red(" A file that is listed\n")) - writemsg(red("!!! as existing is not capable of being stat'd. If you are using an\n")) - writemsg(red("!!! experimental kernel, please boot into a stable one, force an fsck,\n")) - writemsg(red("!!! and ensure your filesystem is in a sane state. ")+bold("'shutdown -Fr now'\n")) - writemsg(red("!!! File: ")+str(mysrc)+"\n") - writemsg(red("!!! Error: ")+str(e)+"\n") - sys.exit(1) - except Exception, e: - writemsg("\n") - writemsg(red("!!! ERROR: An unknown error has occurred during the merge process.\n")) - writemsg(red("!!! A stat call returned the following error for the following file:")) - writemsg( "!!! Please ensure that your filesystem is intact, otherwise report\n") - writemsg( "!!! this as a portage bug at bugs.gentoo.org. Append 'emerge info'.\n") - writemsg( "!!! File: "+str(mysrc)+"\n") - writemsg( "!!! Error: "+str(e)+"\n") - sys.exit(1) - - - mymode=mystat[stat.ST_MODE] - # handy variables; mydest is the target object on the live filesystems; - # mysrc is the source object in the temporary install dir - try: - mydmode=os.lstat(mydest)[stat.ST_MODE] - except SystemExit, e: - raise - except: - #dest file doesn't exist - mydmode=None - - if stat.S_ISLNK(mymode): - # we are merging a symbolic link - myabsto=abssymlink(mysrc) - if myabsto[0:len(srcroot)]==srcroot: - myabsto=myabsto[len(srcroot):] - if myabsto[0]!="/": - myabsto="/"+myabsto - myto=os.readlink(mysrc) - if self.settings and self.settings["D"]: - if myto.find(self.settings["D"])==0: - myto=myto[len(self.settings["D"]):] - # myrealto contains the path of the real file to which this symlink points. - # we can simply test for existence of this file to see if the target has been merged yet - myrealto=os.path.normpath(os.path.join(destroot,myabsto)) - if mydmode!=None: - #destination exists - if not stat.S_ISLNK(mydmode): - if stat.S_ISDIR(mydmode): - # directory in the way: we can't merge a symlink over a directory - # we won't merge this, continue with next file... - continue - if self.isprotected(mydest): - # Use md5 of the target in ${D} if it exists... - if os.path.exists(os.path.normpath(srcroot+myabsto)): - mydest = new_protect_filename(myrealdest, newmd5=portage_checksum.perform_md5(srcroot+myabsto)) - else: - mydest = new_protect_filename(myrealdest, newmd5=portage_checksum.perform_md5(myabsto)) - - # if secondhand==None it means we're operating in "force" mode and should not create a second hand. - if (secondhand!=None) and (not os.path.exists(myrealto)): - # either the target directory doesn't exist yet or the target file doesn't exist -- or - # the target is a broken symlink. We will add this file to our "second hand" and merge - # it later. - secondhand.append(mysrc[len(srcroot):]) - continue - # unlinking no longer necessary; "movefile" will overwrite symlinks atomically and correctly - mymtime=movefile(mysrc,mydest,newmtime=thismtime,sstat=mystat, mysettings=self.settings) - if mymtime!=None: - print ">>>",mydest,"->",myto - outfile.write("sym "+myrealdest+" -> "+myto+" "+str(mymtime)+"\n") - else: - print "!!! Failed to move file." - print "!!!",mydest,"->",myto - sys.exit(1) - elif stat.S_ISDIR(mymode): - # we are merging a directory - if mydmode!=None: - # destination exists - - if bsd_chflags: - # Save then clear flags on dest. - dflags=bsd_chflags.lgetflags(mydest) - if(bsd_chflags.lchflags(mydest, 0)<0): - writemsg("!!! Couldn't clear flags on '"+mydest+"'.\n") - - if not os.access(mydest, os.W_OK): - pkgstuff = portage_versions.pkgsplit(self.pkg) - writemsg("\n!!! Cannot write to '"+mydest+"'.\n") - writemsg("!!! Please check permissions and directories for broken symlinks.\n") - writemsg("!!! You may start the merge process again by using ebuild:\n") - writemsg("!!! ebuild "+self.settings["PORTDIR"]+"/"+self.cat+"/"+pkgstuff[0]+"/"+self.pkg+".ebuild merge\n") - writemsg("!!! And finish by running this: env-update\n\n") - return 1 - - if stat.S_ISLNK(mydmode) or stat.S_ISDIR(mydmode): - # a symlink to an existing directory will work for us; keep it: - print "---",mydest+"/" - if bsd_chflags: - bsd_chflags.lchflags(mydest, dflags) - else: - # a non-directory and non-symlink-to-directory. Won't work for us. Move out of the way. - if movefile(mydest,mydest+".backup", mysettings=self.settings) == None: - print "failed move" - sys.exit(1) - print "bak",mydest,mydest+".backup" - #now create our directory - if selinux_enabled: - sid = selinux.get_sid(mysrc) - selinux.secure_mkdir(mydest,sid) - else: - os.mkdir(mydest) - if bsd_chflags: - bsd_chflags.lchflags(mydest, dflags) - os.chmod(mydest,mystat[0]) - lchown(mydest,mystat[4],mystat[5]) - print ">>>",mydest+"/" - else: - #destination doesn't exist - if selinux_enabled: - sid = selinux.get_sid(mysrc) - selinux.secure_mkdir(mydest,sid) - else: - os.mkdir(mydest) - os.chmod(mydest,mystat[0]) - if bsd_chflags: - bsd_chflags.lchflags(mydest, bsd_chflags.lgetflags(mysrc)) - lchown(mydest,mystat[4],mystat[5]) - print ">>>",mydest+"/" - outfile.write("dir "+myrealdest+"\n") - # recurse and merge this directory - if self.mergeme(srcroot,destroot,outfile,secondhand,offset+x+"/",cfgfiledict,thismtime): - return 1 - elif stat.S_ISREG(mymode): - # we are merging a regular file - mymd5=portage_checksum.perform_md5(mysrc,calc_prelink=1) - # calculate config file protection stuff - mydestdir=os.path.dirname(mydest) - moveme=1 - zing="!!!" - if mydmode!=None: - # destination file exists - if stat.S_ISDIR(mydmode): - # install of destination is blocked by an existing directory with the same name - moveme=0 - print "!!!",mydest - elif stat.S_ISREG(mydmode) or (stat.S_ISLNK(mydmode) and os.path.exists(mydest) and stat.S_ISREG(os.stat(mydest)[stat.ST_MODE])): - cfgprot=0 - # install of destination is blocked by an existing regular file, - # or by a symlink to an existing regular file; - # now, config file management may come into play. - # we only need to tweak mydest if cfg file management is in play. - if myppath: - # we have a protection path; enable config file management. - destmd5=portage_checksum.perform_md5(mydest,calc_prelink=1) - cycled=0 - if cfgfiledict.has_key(myrealdest): - if destmd5 in cfgfiledict[myrealdest]: - #cycle - print "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=cfgfiledict["IGNORE"] - cfgprot=cfgfiledict["IGNORE"] - 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]=[] - if mymd5 not in cfgfiledict[myrealdest]: - cfgfiledict[myrealdest].append(mymd5) - #don't record more than 16 md5sums - if len(cfgfiledict[myrealdest])>16: - del cfgfiledict[myrealdest][0] - - if cfgprot: - mydest = new_protect_filename(myrealdest, newmd5=mymd5) - - # whether config protection or not, we merge the new file the - # same way. Unless moveme=0 (blocking directory) - if moveme: - mymtime=movefile(mysrc,mydest,newmtime=thismtime,sstat=mystat, mysettings=self.settings) - if mymtime == None: - print "failed move" - sys.exit(1) - zing=">>>" - else: - mymtime=thismtime - # We need to touch the destination so that on --update the - # old package won't yank the file with it. (non-cfgprot related) - os.utime(myrealdest,(thismtime,thismtime)) - zing="---" - if self.settings["ARCH"] == "ppc-macos" and myrealdest[-2:] == ".a": - - # XXX kludge, bug #58848; can be killed when portage stops relying on - # md5+mtime, and uses refcounts - # alright, we've fooled w/ mtime on the file; this pisses off static archives - # basically internal mtime != file's mtime, so the linker (falsely) thinks - # the archive is stale, and needs to have it's toc rebuilt. - - myf=open(myrealdest,"r+") - - # ar mtime field is digits padded with spaces, 12 bytes. - lms=str(thismtime+5).ljust(12) - myf.seek(0) - magic=myf.read(8) - if magic != "!<arch>\n": - # not an archive (dolib.a from portage.py makes it here fex) - myf.close() - else: - st=os.stat(myrealdest) - while myf.tell() < st.st_size - 12: - # skip object name - myf.seek(16,1) - - # update mtime - myf.write(lms) - - # skip uid/gid/mperm - myf.seek(20,1) - - # read the archive member's size - x=long(myf.read(10)) - - # skip the trailing newlines, and add the potential - # extra padding byte if it's not an even size - myf.seek(x + 2 + (x % 2),1) - - # and now we're at the end. yay. - myf.close() - mymd5=portage_checksum.perform_md5(myrealdest,calc_prelink=1) - os.utime(myrealdest,(thismtime,thismtime)) - - if mymtime!=None: - zing=">>>" - outfile.write("obj "+myrealdest+" "+mymd5+" "+str(mymtime)+"\n") - print zing,mydest - else: - # we are merging a fifo or device node - zing="!!!" - if mydmode==None: - # destination doesn't exist - if movefile(mysrc,mydest,newmtime=thismtime,sstat=mystat, mysettings=self.settings)!=None: - zing=">>>" - if stat.S_ISFIFO(mymode): - # we don't record device nodes in CONTENTS, - # although we do merge them. - outfile.write("fif "+myrealdest+"\n") - else: - sys.exit(1) - print zing+" "+mydest - - def merge(self,mergeroot,inforoot,myroot,myebuild=None,cleanup=0): - return self.treewalk(mergeroot,myroot,inforoot,myebuild,cleanup=cleanup) - - def getstring(self,name): - """ - returns contents of a file with whitespace - (including newlines) converted to spaces - """ - if not os.path.exists(self.dbdir+"/"+name): - return "" - myfile=open(self.dbdir+"/"+name,"r") - mydata=myfile.read().split() - return " ".join(mydata) - - def copyfile(self,fname): - shutil.copyfile(fname,self.dbdir+"/"+os.path.basename(fname)) - - def getfile(self,fname): - if not os.path.exists(self.dbdir+"/"+fname): - return "" - myfile=open(self.dbdir+"/"+fname,"r") - mydata=myfile.read() - myfile.close() - return mydata - - def setfile(self,fname,data): - myfile=open(self.dbdir+"/"+fname,"w") - myfile.write(data) - myfile.close() - - def getelements(self,ename): - if not os.path.exists(self.dbdir+"/"+ename): - return [] - myelement=open(self.dbdir+"/"+ename,"r") - mylines=myelement.readlines() - myreturn=[] - for x in mylines: - for y in x[:-1].split(): - myreturn.append(y) - myelement.close() - return myreturn - - def setelements(self,mylist,ename): - myelement=open(self.dbdir+"/"+ename,"w") - for x in mylist: - myelement.write(x+"\n") - myelement.close() - - def isregular(self): - "Is this a regular package (does it have a CATEGORY file? A dblink can be virtual *and* regular)" - return os.path.exists(self.dbdir+"/CATEGORY") - -def cleanup_pkgmerge(mypkg,origdir=None): - shutil.rmtree(settings["PORTAGE_TMPDIR"]+"/binpkgs/"+mypkg) - if os.path.exists(settings["PORTAGE_TMPDIR"]+"/portage/"+mypkg+"/temp/environment"): - os.unlink(settings["PORTAGE_TMPDIR"]+"/portage/"+mypkg+"/temp/environment") - if origdir: - os.chdir(origdir) - -def pkgmerge(mytbz2,myroot,mysettings): - """will merge a .tbz2 file, returning a list of runtime dependencies - that must be satisfied, or None if there was a merge error. This - code assumes the package exists.""" - if mytbz2[-5:]!=".tbz2": - print "!!! Not a .tbz2 file" - return None - mypkg=os.path.basename(mytbz2)[:-5] - xptbz2=xpak.tbz2(mytbz2) - pkginfo={} - mycat=xptbz2.getfile("CATEGORY") - if not mycat: - print "!!! CATEGORY info missing from info chunk, aborting..." - return None - mycat=mycat.strip() - mycatpkg=mycat+"/"+mypkg - tmploc=mysettings["PORTAGE_TMPDIR"]+"/binpkgs/" - pkgloc=tmploc+"/"+mypkg+"/bin/" - infloc=tmploc+"/"+mypkg+"/inf/" - myebuild=tmploc+"/"+mypkg+"/inf/"+os.path.basename(mytbz2)[:-4]+"ebuild" - if os.path.exists(tmploc+"/"+mypkg): - shutil.rmtree(tmploc+"/"+mypkg,1) - os.makedirs(pkgloc) - os.makedirs(infloc) - print ">>> extracting info" - xptbz2.unpackinfo(infloc) - # run pkg_setup early, so we can bail out early - # (before extracting binaries) if there's a problem - origdir=getcwd() - os.chdir(pkgloc) - - mysettings.configdict["pkg"]["CATEGORY"] = mycat - a=doebuild(myebuild,"setup",myroot,mysettings,tree="bintree") - print ">>> extracting",mypkg - notok=spawn("bzip2 -dqc -- '"+mytbz2+"' | tar xpf -",mysettings,free=1) - if notok: - print "!!! Error extracting",mytbz2 - cleanup_pkgmerge(mypkg,origdir) - return None - - # the merge takes care of pre/postinst and old instance - # auto-unmerge, virtual/provides updates, etc. - mysettings.load_infodir(infloc) - mylink=dblink(mycat,mypkg,myroot,mysettings,treetype="bintree") - mylink.merge(pkgloc,infloc,myroot,myebuild,cleanup=1) - - if not os.path.exists(infloc+"/RDEPEND"): - returnme="" - else: - #get runtime dependencies - a=open(infloc+"/RDEPEND","r") - returnme=" ".join( a.read().split()) - a.close() - cleanup_pkgmerge(mypkg,origdir) - return returnme - - -if os.environ.has_key("ROOT"): - root=os.environ["ROOT"] - if not len(root): - root="/" - elif root[-1]!="/": - root=root+"/" -else: - root="/" -if root != "/": - if not os.path.exists(root[:-1]): - writemsg("!!! Error: ROOT "+root+" does not exist. Please correct this.\n") - writemsg("!!! Exiting.\n\n") - sys.exit(1) - elif not os.path.isdir(root[:-1]): - writemsg("!!! Error: ROOT "+root[:-1]+" is not a directory. Please correct this.\n") - writemsg("!!! Exiting.\n\n") - sys.exit(1) - -#create tmp and var/tmp if they don't exist; read config -os.umask(0) -if not os.path.exists(root+"tmp"): - writemsg(">>> "+root+"tmp doesn't exist, creating it...\n") - os.mkdir(root+"tmp",01777) -if not os.path.exists(root+"var/tmp"): - writemsg(">>> "+root+"var/tmp doesn't exist, creating it...\n") - try: - os.mkdir(root+"var",0755) - except (OSError,IOError): - pass - try: - os.mkdir(root+"var/tmp",01777) - except SystemExit, e: - raise - except: - writemsg("portage: couldn't create /var/tmp; exiting.\n") - sys.exit(1) - - -##################################### -# Deprecation Checks - -os.umask(022) -profiledir=None -if os.path.isdir(PROFILE_PATH): - profiledir = PROFILE_PATH - if os.access(DEPRECATED_PROFILE_FILE, os.R_OK): - deprecatedfile = open(DEPRECATED_PROFILE_FILE, "r") - dcontent = deprecatedfile.readlines() - deprecatedfile.close() - newprofile = dcontent[0] - writemsg(red("\n!!! Your current profile is deprecated and not supported anymore.\n")) - writemsg(red("!!! Please upgrade to the following profile if possible:\n")) - writemsg(8*" "+green(newprofile)+"\n") - if len(dcontent) > 1: - writemsg("To upgrade do the following steps:\n") - for myline in dcontent[1:]: - writemsg(myline) - writemsg("\n\n") - -if os.path.exists(USER_VIRTUALS_FILE): - writemsg(red("\n!!! /etc/portage/virtuals is deprecated in favor of\n")) - writemsg(red("!!! /etc/portage/profile/virtuals. Please move it to\n")) - writemsg(red("!!! this new location.\n\n")) - -# -##################################### - -db={} - -# ============================================================================= -# ============================================================================= -# ----------------------------------------------------------------------------- -# We're going to lock the global config to prevent changes, but we need -# to ensure the global settings are right. -settings=config(config_profile_path=PROFILE_PATH,config_incrementals=portage_const.INCREMENTALS) - -# useful info -settings["PORTAGE_MASTER_PID"]=str(os.getpid()) -settings.backup_changes("PORTAGE_MASTER_PID") - -def do_vartree(mysettings): - global virts, virts_p, db - virts=mysettings.getvirtuals("/") - virts_p={} - - if virts: - myvkeys=virts.keys() - for x in myvkeys: - vkeysplit=x.split("/") - if not virts_p.has_key(vkeysplit[1]): - virts_p[vkeysplit[1]]=virts[x] - db["/"]={ - "virtuals":virts, - "vartree":vartree("/",virts), - } - if root!="/": - virts=mysettings.getvirtuals(root) - db[root]={ - "virtuals":virts, - "vartree":vartree(root,virts)} - #We need to create the vartree first, then load our settings, and then set up our other trees - -# XXX: This is a circular fix. -#do_vartree(settings) -#settings.loadVirtuals('/') -do_vartree(settings) -#settings.loadVirtuals('/') - -settings.reset() # XXX: Regenerate use after we get a vartree -- GLOBAL - - -# XXX: Might cause problems with root="/" assumptions -portdb=portdbapi(settings["PORTDIR"]) - -settings.lock() -# ----------------------------------------------------------------------------- -# ============================================================================= -# ============================================================================= - - -if 'selinux' in settings["USE"].split(" "): - try: - import selinux - selinux_enabled=1 - portage_exec.selinux_capable = True - except OSError, e: - writemsg(red("!!! SELinux not loaded: ")+str(e)+"\n") - selinux_enabled=0 - except ImportError: - writemsg(red("!!! SELinux module not found.")+" Please verify that it was installed.\n") - selinux_enabled=0 -else: - selinux_enabled=0 - -cachedirs=[CACHE_PATH] -if root!="/": - cachedirs.append(root+CACHE_PATH) -if not os.environ.has_key("SANDBOX_ACTIVE"): - for cachedir in cachedirs: - if not os.path.exists(cachedir): - os.makedirs(cachedir,0755) - writemsg(">>> "+cachedir+" doesn't exist, creating it...\n") - if not os.path.exists(cachedir+"/dep"): - os.makedirs(cachedir+"/dep",2755) - writemsg(">>> "+cachedir+"/dep doesn't exist, creating it...\n") - try: - os.chown(cachedir,uid,portage_gid) - os.chmod(cachedir,0775) - except OSError: - pass - try: - mystat=os.lstat(cachedir+"/dep") - os.chown(cachedir+"/dep",uid,portage_gid) - os.chmod(cachedir+"/dep",0775) - if mystat[stat.ST_GID]!=portage_gid: - spawn("chown -R "+str(uid)+":"+str(portage_gid)+" "+cachedir+"/dep",settings,free=1) - spawn("chmod -R u+rw,g+rw "+cachedir+"/dep",settings,free=1) - except OSError: - pass - -def flushmtimedb(record): - if mtimedb: - if record in mtimedb.keys(): - del mtimedb[record] - #print "mtimedb["+record+"] is cleared." - else: - writemsg("Invalid or unset record '"+record+"' in mtimedb.\n") - -#grab mtimes for eclasses and upgrades -mtimedb={} -mtimedbkeys=[ -"updates", "info", -"version", "starttime", -"resume", "ldpath" -] -mtimedbfile=root+"var/cache/edb/mtimedb" -try: - mypickle=cPickle.Unpickler(open(mtimedbfile)) - mypickle.find_global=None - mtimedb=mypickle.load() - if mtimedb.has_key("old"): - mtimedb["updates"]=mtimedb["old"] - del mtimedb["old"] - if mtimedb.has_key("cur"): - del mtimedb["cur"] -except SystemExit, e: - raise -except: - #print "!!!",e - mtimedb={"updates":{},"version":"","starttime":0} - -for x in mtimedb.keys(): - if x not in mtimedbkeys: - writemsg("Deleting invalid mtimedb key: "+str(x)+"\n") - del mtimedb[x] - -#,"porttree":portagetree(root,virts),"bintree":binarytree(root,virts)} -features=settings["FEATURES"].split() - -do_upgrade_packagesmessage=0 -def do_upgrade(mykey): - global do_upgrade_packagesmessage - writemsg("\n\n") - writemsg(green("Performing Global Updates: ")+bold(mykey)+"\n") - writemsg("(Could take a couple of minutes if you have a lot of binary packages.)\n") - writemsg(" "+bold(".")+"='update pass' "+bold("*")+"='binary update' "+bold("@")+"='/var/db move'\n"+" "+bold("s")+"='/var/db SLOT move' "+bold("S")+"='binary SLOT move' "+bold("p")+"='update /etc/portage/package.*'\n") - processed=1 - #remove stale virtual entries (mappings for packages that no longer exist) - - update_files={} - file_contents={} - myxfiles = ["package.mask","package.unmask","package.keywords","package.use"] - myxfiles = myxfiles + prefix_array(myxfiles, "profile/") - for x in myxfiles: - try: - myfile = open("/etc/portage/"+x,"r") - file_contents[x] = myfile.readlines() - myfile.close() - except IOError: - if file_contents.has_key(x): - del file_contents[x] - continue - - worldlist=grabfile("/"+WORLD_FILE) - myupd=grabfile(mykey) - db["/"]["bintree"]=binarytree("/",settings["PKGDIR"],virts) - for myline in myupd: - mysplit=myline.split() - if not len(mysplit): - continue - if mysplit[0]!="move" and mysplit[0]!="slotmove": - writemsg("portage: Update type \""+mysplit[0]+"\" not recognized.\n") - processed=0 - continue - if mysplit[0]=="move" and len(mysplit)!=3: - writemsg("portage: Update command \""+myline+"\" invalid; skipping.\n") - processed=0 - continue - if mysplit[0]=="slotmove" and len(mysplit)!=4: - writemsg("portage: Update command \""+myline+"\" invalid; skipping.\n") - processed=0 - continue - sys.stdout.write(".") - sys.stdout.flush() - - if mysplit[0]=="move": - db["/"]["vartree"].dbapi.move_ent(mysplit) - db["/"]["bintree"].move_ent(mysplit) - #update world entries: - for x in range(0,len(worldlist)): - #update world entries, if any. - worldlist[x]=dep_transform(worldlist[x],mysplit[1],mysplit[2]) - - #update /etc/portage/packages.* - for x in file_contents: - for mypos in range(0,len(file_contents[x])): - line=file_contents[x][mypos] - if line.strip()=="" or line.strip()[0]=="#": - continue - key=portage_dep.dep_getkey(line.split()[0]) - if key==mysplit[1]: - file_contents[x][mypos]=line.replace(mysplit[1],mysplit[2]) - update_files[x]=1 - sys.stdout.write("p") - sys.stdout.flush() - - elif mysplit[0]=="slotmove": - db["/"]["vartree"].dbapi.move_slot_ent(mysplit) - db["/"]["bintree"].move_slot_ent(mysplit,settings["PORTAGE_TMPDIR"]+"/tbz2") - - for x in update_files: - mydblink = dblink('','','/',settings) - if mydblink.isprotected("/etc/portage/"+x): - updating_file=new_protect_filename("/etc/portage/"+x)[0] - else: - updating_file="/etc/portage/"+x - try: - myfile=open(updating_file,"w") - myfile.writelines(file_contents[x]) - myfile.close() - except IOError: - continue - - # We gotta do the brute force updates for these now. - if (settings["PORTAGE_CALLER"] in ["fixpackages"]) or \ - ("fixpackages" in features): - db["/"]["bintree"].update_ents(myupd,settings["PORTAGE_TMPDIR"]+"/tbz2") - else: - do_upgrade_packagesmessage = 1 - - if processed: - #update our internal mtime since we processed all our directives. - mtimedb["updates"][mykey]=os.stat(mykey)[stat.ST_MTIME] - myworld=open("/"+WORLD_FILE,"w") - for x in worldlist: - myworld.write(x+"\n") - myworld.close() - print "" - -exit_callbacks = [] - -def append_exit_callback(func,args=[],kwargs={}): - """append a callback to the exit callback list - args is positionally expanded and must be a list/tuple - kwargs is a optional param, and expanded- must be a dict.""" - global exit_callbacks - exit_callbacks.append((func,args,kwargs)) - -def kill_spawned_pids(): - """since exit_callbacks takes an array, and kwargs upon initializing, it's possible that - faulty code in portage_exec.spawn might replace spawned_pids, instead of modifying it. - In doing so, that would make portage not have an up to date list of pids - so, we call this function instead which pulls (at exit time) from portage_exec.spawned_pids""" - portage_exec.cleanup(portage_exec.spawned_pids) - -#order here is important. we want to attempt to cleanly shutdown the daemons prior to -#resorting to wax'ing them w/ a sigint/sigkill -append_exit_callback(ebuild.shutdown_all_processors) -append_exit_callback(kill_spawned_pids) - -def portageexit(): - global uid,portage_gid,portdb,db - global exit_callbacks - for x in exit_callbacks: - try: - x[0](*x[1],**x[2]) - except SystemExit: - raise - except Exception, e: - print "caught exception for exit_callback func",x[0] - print e - pass - - if secpass and not os.environ.has_key("SANDBOX_ACTIVE"): - # wait child process death - try: - while True: - os.wait() - except OSError: - #writemsg(">>> All child process are now dead.") - pass - - close_portdbapi_caches() - - if mtimedb: - # Store mtimedb - mymfn=mtimedbfile - try: - mtimedb["version"]=VERSION - cPickle.dump(mtimedb, open(mymfn,"w"), cPickle.HIGHEST_PROTOCOL) - #print "*** Wrote out mtimedb data successfully." - os.chown(mymfn,uid,portage_gid) - os.chmod(mymfn,0664) - except SystemExit, e: - raise - except Exception, e: - pass - try: - os.chown(mymfn,-1,portage_gid) - m=os.umask(0) - os.chmod(mymfn,0664) - os.umask(m) - except (IOError, OSError): - pass - -atexit.register(portageexit) - -if (secpass==2) and (not os.environ.has_key("SANDBOX_ACTIVE")): - if settings["PORTAGE_CALLER"] in ["emerge","fixpackages"]: - #only do this if we're root and not running repoman/ebuild digest - updpath=os.path.normpath(settings["PORTDIR"]+"///profiles/updates") - didupdate=0 - if not mtimedb.has_key("updates"): - mtimedb["updates"]={} - try: - mylist=listdir(updpath) - # resort the list - mylist=[myfile[3:]+"-"+myfile[:2] for myfile in mylist] - mylist.sort() - mylist=[myfile[5:]+"-"+myfile[:4] for myfile in mylist] - for myfile in mylist: - mykey=updpath+"/"+myfile - if not os.path.isfile(mykey): - continue - if (not mtimedb["updates"].has_key(mykey)) or \ - (mtimedb["updates"][mykey] != os.stat(mykey)[stat.ST_MTIME]) or \ - (settings["PORTAGE_CALLER"] == "fixpackages"): - didupdate=1 - do_upgrade(mykey) - portageexit() # This lets us save state for C-c. - except OSError: - #directory doesn't exist - pass - if didupdate: - #make sure our internal databases are consistent; recreate our virts and vartree - do_vartree(settings) - if do_upgrade_packagesmessage and \ - listdir(settings["PKGDIR"]+"/All/"): - writemsg("\n\n\n ** Skipping packages. Run 'fixpackages' or set it in FEATURES to fix the") - writemsg("\n tbz2's in the packages directory. "+bold("Note: This can take a very long time.")) - writemsg("\n") - - - - - -#continue setting up other trees -db["/"]["porttree"]=portagetree("/",virts) -db["/"]["bintree"]=binarytree("/",settings["PKGDIR"],virts) -if root!="/": - db[root]["porttree"]=portagetree(root,virts) - db[root]["bintree"]=binarytree(root,settings["PKGDIR"],virts) -thirdpartymirrors=grabdict(settings["PORTDIR"]+"/profiles/thirdpartymirrors") - -if not os.path.exists(settings["PORTAGE_TMPDIR"]): - writemsg("portage: the directory specified in your PORTAGE_TMPDIR variable, \""+settings["PORTAGE_TMPDIR"]+",\"\n") - writemsg("does not exist. Please create this directory or correct your PORTAGE_TMPDIR setting.\n") - sys.exit(1) -if not os.path.isdir(settings["PORTAGE_TMPDIR"]): - writemsg("portage: the directory specified in your PORTAGE_TMPDIR variable, \""+settings["PORTAGE_TMPDIR"]+",\"\n") - writemsg("is not a directory. Please correct your PORTAGE_TMPDIR setting.\n") - sys.exit(1) - -# COMPATABILITY -- This shouldn't be used. -pkglines = settings.packages - -groups=settings["ACCEPT_KEYWORDS"].split() -archlist=[] -for myarch in grabfile(settings["PORTDIR"]+"/profiles/arch.list"): - archlist += [myarch,"~"+myarch] -for group in groups: - if not archlist: - writemsg("--- 'profiles/arch.list' is empty or not available. Empty portage tree?\n") - break - elif (group not in archlist) and group[0]!='-': - writemsg("\n"+red("!!! INVALID ACCEPT_KEYWORDS: ")+str(group)+"\n") - -# Clear the cache -dircache={} - -if not "sandbox" in features or not "usersandbox" in features: - portage_exec.sandbox_capable = False - -fetcher=None -def get_preferred_fetcher(): - """get the preferred fetcher. basically an initial check to verify FETCHCOMMAND/RESUMECOMMAND - are actually usable. - - If they aren't, it defaults to complaining for every request for a fetcher, and returning - transports.bundled_lib.BundledConnection. - This only checks the command's bin is available- it won't catch wget w/ missing libssl issues. - That's reserved for fetch at the moment""" - - global fetcher,settings - usable=True - if fetcher == None: - if not (settings.has_key("FETCHCOMMAND") and settings.has_key("RESUMECOMMAND")): - print red("!!!")+" warning, either FETCHCOMMAND or RESUMECOMMAND aren't defined." - print red("!!!")+" falling back to the bundled libs. Please rectify this." - usable=False - else: - f=settings["FETCHCOMMAND"].split()[0] - r=settings["RESUMECOMMAND"].split()[0] - usable=((os.path.exists(f) and os.access(f,os.X_OK)) or portage_exec.find_binary(f)) - if usable and r != f: - usable=((os.path.exists(f) and os.access(f,os.X_OK)) or portage_exec.find_binary(r)) - - # note this doesn't check for wget/libssl type issues. fetch manages that. - - if usable: - if selinux_enabled: - selinux_context=selinux.getcontext() - selinux_context=selinux_context.replace(settings["PORTAGE_T"], \ - settings["PORTAGE_FETCH_T"]) - else: - selinux_context = None - - fetcher=transports.fetchcommand.CustomConnection(settings,selinux_context=selinux_context) - if usable: - return fetcher - return transports.bundled_lib.BundledConnection() - -if not os.path.islink(PROFILE_PATH) and os.path.exists(settings["PORTDIR"]+"/profiles"): - writemsg(red("\a\n\n!!! "+PROFILE_PATH+" is not a symlink and will probably prevent most merges.\n")) - writemsg(red("!!! It should point into a profile within %s/profiles/\n" % settings["PORTDIR"])) - writemsg(red("!!! (You can safely ignore this message when syncing. It's harmless.)\n\n\n")) - time.sleep(3) - -# ============================================================================ -# ============================================================================ - diff --git a/pym/portage_checksum.py b/pym/portage_checksum.py deleted file mode 100644 index 106c805..0000000 --- a/pym/portage_checksum.py +++ /dev/null @@ -1,131 +0,0 @@ -# portage_checksum.py -- core Portage functionality -# Copyright 1998-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/pym/portage_checksum.py,v 1.12 2005/02/26 06:35:20 jstubbs Exp $ -cvs_id_string="$Id: portage_checksum.py,v 1.12 2005/02/26 06:35:20 jstubbs Exp $"[5:-2] - -from portage_const import PRIVATE_PATH,PRELINK_BINARY -import os -import shutil -import stat -import portage_exec -import portage_util -import portage_locks -import sha - -prelink_capable = False -if os.path.exists(PRELINK_BINARY): - if portage_exec.spawn(PRELINK_BINARY+" --version",fd_pipes={}) == 0: - prelink_capable=1 - -def perform_md5(x, calc_prelink=0): - return perform_checksum(x, md5hash, calc_prelink)[0] - -def perform_sha1(x, calc_prelink=0): - return perform_checksum(x, sha1hash, calc_prelink)[0] - -def perform_all(x, calc_prelink=0): - mydict = {} - mydict["SHA1"] = perform_sha1(x, calc_prelink) - mydict["MD5"] = perform_md5(x, calc_prelink) - return mydict - -def get_valid_checksum_keys(): - return ["SHA1", "MD5"] - -def verify_all(filename, mydict, calc_prelink=0, strict=0): - # Dict relates to single file only. - # returns: (passed,reason) - file_is_ok = True - reason = "Reason unknown" - try: - if mydict["size"] != os.stat(filename)[stat.ST_SIZE]: - return False,"Filesize does not match recorded size" - except OSError, e: - return False, str(e) - for x in mydict.keys(): - if x == "size": - continue - elif x == "SHA1": - if mydict[x] != perform_sha1(filename, calc_prelink=calc_prelink): - if strict: - raise portage_exception.DigestException, "Failed to verify '$(file)s' on checksum type '%(type)s'" % {"file":filename, "type":x} - else: - file_is_ok = False - reason = "Failed on %s verification" % (x,) - break - elif x == "MD5": - if mydict[x] != perform_md5(filename, calc_prelink=calc_prelink): - if strict: - raise portage_exception.DigestException, "Failed to verify '$(file)s' on checksum type '%(type)s'" % {"file":filename, "type":x} - else: - file_is_ok = False - reason = "Failed on %s verification" % (x,) - break - return file_is_ok,reason - -# We _try_ to load this module. If it fails we do the slow fallback. -try: - import fchksum - - def md5hash(filename): - return fchksum.fmd5t(filename) - -except ImportError: - import md5 - def md5hash(filename): - f = open(filename, 'rb') - blocksize=32768 - data = f.read(blocksize) - size = 0L - sum = md5.new() - while data: - sum.update(data) - size = size + len(data) - data = f.read(blocksize) - f.close() - - return (sum.hexdigest(),size) - -def sha1hash(filename): - f = open(filename, 'rb') - blocksize=32768 - data = f.read(blocksize) - size = 0L - sum = sha.new() - while data: - sum.update(data) - size = size + len(data) - data = f.read(blocksize) - f.close() - - return (sum.hexdigest(),size) - -def perform_checksum(filename, hash_function=md5hash, calc_prelink=0): - myfilename = filename[:] - prelink_tmpfile = PRIVATE_PATH+"/prelink-checksum.tmp."+str(os.getpid()) - mylock = None - - if calc_prelink and prelink_capable: - mylock = portage_locks.lockfile(prelink_tmpfile, wantnewlockfile=1) - # Create non-prelinked temporary file to md5sum. - # Raw data is returned on stdout, errors on stderr. - # Non-prelinks are just returned. - try: - shutil.copy2(filename,prelink_tmpfile) - except SystemExit, e: - raise - except Exception,e: - portage_util.writemsg("!!! Unable to copy file '"+str(filename)+"'.\n") - portage_util.writemsg("!!! "+str(e)+"\n") - sys.exit(1) - portage_exec.spawn(PRELINK_BINARY+" --undo "+prelink_tmpfile,fd_pipes={}) - myfilename=prelink_tmpfile - - myhash, mysize = hash_function(myfilename) - - if calc_prelink and prelink_capable: - os.unlink(prelink_tmpfile) - portage_locks.unlockfile(mylock) - - return (myhash,mysize) diff --git a/pym/portage_const.py b/pym/portage_const.py deleted file mode 100644 index dbe0111..0000000 --- a/pym/portage_const.py +++ /dev/null @@ -1,65 +0,0 @@ -# portage: Constants -# Copyright 1998-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/pym/portage_const.py,v 1.10 2005/04/29 04:43:19 vapier Exp $ -cvs_id_string="$Id: portage_const.py,v 1.10 2005/04/29 04:43:19 vapier Exp $"[5:-2] - -# =========================================================================== -# START OF CONSTANTS -- START OF CONSTANTS -- START OF CONSTANTS -- START OF -# =========================================================================== - -VDB_PATH = "var/db/pkg" -PRIVATE_PATH = "/var/lib/portage" -CACHE_PATH = "/var/cache/edb" -DEPCACHE_PATH = CACHE_PATH+"/dep" - -USER_CONFIG_PATH = "/etc/portage" -MODULES_FILE_PATH = USER_CONFIG_PATH+"/modules" -CUSTOM_PROFILE_PATH = USER_CONFIG_PATH+"/profile" - -PORTAGE_BASE_PATH = "/usr/lib/portage" -PORTAGE_BIN_PATH = PORTAGE_BASE_PATH+"/bin" -PORTAGE_PYM_PATH = PORTAGE_BASE_PATH+"/pym" -PROFILE_PATH = "/etc/make.profile" -LOCALE_DATA_PATH = PORTAGE_BASE_PATH+"/locale" - -EBUILD_SH_BINARY = PORTAGE_BIN_PATH+"/ebuild.sh" -EBUILD_DAEMON_PATH = PORTAGE_BIN_PATH+"/ebuild-daemon.sh" - -SANDBOX_BINARY = "/usr/bin/sandbox" -# XXX compatibility hack. this shouldn't ever hit a stable release. -import os -if not os.path.exists(SANDBOX_BINARY): - if os.path.exists(PORTAGE_BIN_PATH+"/sandbox"): - SANDBOX_BINARY=PORTAGE_BIN_PATH+"/sandbox" - -BASH_BINARY = "/bin/bash" -MOVE_BINARY = "/bin/mv" -PRELINK_BINARY = "/usr/sbin/prelink" - -WORLD_FILE = PRIVATE_PATH+"/world" -MAKE_CONF_FILE = "/etc/make.conf" -MAKE_DEFAULTS_FILE = PROFILE_PATH + "/make.defaults" -DEPRECATED_PROFILE_FILE = PROFILE_PATH+"/deprecated" -USER_VIRTUALS_FILE = USER_CONFIG_PATH+"/virtuals" -EBUILD_SH_ENV_FILE = USER_CONFIG_PATH+"/bashrc" -INVALID_ENV_FILE = "/etc/spork/is/not/valid/profile.env" -CUSTOM_MIRRORS_FILE = USER_CONFIG_PATH+"/mirrors" -SANDBOX_PIDS_FILE = "/tmp/sandboxpids.tmp" -CONFIG_MEMORY_FILE = PRIVATE_PATH + "/config" - -INCREMENTALS=["USE","FEATURES","ACCEPT_KEYWORDS","ACCEPT_LICENSE","CONFIG_PROTECT_MASK","CONFIG_PROTECT","PRELINK_PATH","PRELINK_PATH_MASK"] -STICKIES=["KEYWORDS_ACCEPT","USE","CFLAGS","CXXFLAGS","MAKEOPTS","EXTRA_ECONF","EXTRA_EINSTALL","EXTRA_EMAKE"] - -CONFCACHE_FILE = CACHE_PATH+"/confcache" -CONFCACHE_LIST = CACHE_PATH+"/confcache_files.anydbm" - -LIBFAKEROOT_PATH = "/usr/lib/libfakeroot.so" -FAKEROOT_PATH = "/usr/bin/fakeroot" - -RSYNC_BIN = "/usr/bin/rsync" -RSYNC_HOST = "rsync.gentoo.org/gentoo-portage" - -CVS_BIN = "/usr/bin/cvs" - -EBUILD_PHASES = "setup unpack compile test install preinst postinst prerm postrm" diff --git a/pym/portage_contents.py b/pym/portage_contents.py deleted file mode 100644 index e6ad4a0..0000000 --- a/pym/portage_contents.py +++ /dev/null @@ -1,161 +0,0 @@ -# portage_contents.py -- (Persistent) Contents File Management -# Copyright 1998-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/pym/portage_contents.py,v 1.4 2005/02/26 06:35:20 jstubbs Exp $ -cvs_id_string="$Id: portage_contents.py,v 1.4 2005/02/26 06:35:20 jstubbs Exp $"[5:-2] - -import os,string,types,sys,copy -import portage_exception -import portage_const - -#import gettext -#gettext_t = gettext.translation('portage.contents', portage_const.LOCALE_DATA_PATH) -#_ = gettext_t.ugettext -def _(mystr): - return mystr - - -FILES_KEY = "\0FILES\0" -OWNER_KEY = "\0OWNER\0" - - -def ContentsHandler(filename): - infile = open(filename) - myfiles = [] - mydirs = [] - - mylines = infile.readlines() - infile.close() - for line in mylines: - if line[-1] == '\n': - line = line[:-1] - parts = string.split(line) - - mytype = parts[0] - mytarget = None - - if mytype in ["dir","dev","fif"]: - mypath = string.join(parts[1:]) - elif mytype == "obj": - mypath = string.join(parts[1:-2]) - elif mytype == "sym": - sl = string.join(parts[1:-1]) - sl = string.split(sl, " -> ") - - mypath = sl[0] - mytarget = sl[1] - else: - print _("Unknown type:"),mytype - - if mytype in ["dir"]: - mydirs.append(mypath) - else: - myfiles.append(mypath) - - mydirs.sort() - myfiles.sort() - return myfiles,mydirs - -class PathLookupTable: - """Creates a temporary lookup table for paths from files.""" - def __init__(self,dbname): - #if not self.validLocation(dbname): - # raise portage_exception.InvalidLocation, dbname - #self.base = copy.deepcopy(dbname) - - self.files = [] - self.pathtree = {} - - def addFromFile(self, filename, handler): - if type(handler) != types.FunctionType: - raise portage_exception.IncorrectParameter, _("Handler of type '%(type)s' not 'function'") % {"type": type(handler)} - - filelist,dirlist = handler(filename) - filestat = os.stat(filename) - - if type(filelist) != types.ListType: - raise portage_exception.InvalidDataType, _("%(handler)s returned an invalid file list") % {"handler": handler.__name__} - if type(dirlist) != types.ListType: - raise portage_exception.InvalidDataType, _("%(handler)s returned an invalid directory list") % {"handler": handler.__name__} - - for x in filelist: - if not x: - continue - x = os.path.normpath(x) - if len(x) > 1: - if x[:2] == "//": - x = x[1:] - if type(x) != types.StringType: - raise portage_exception.InvalidDataType, _("%(handler)s returned an invalid subelement in dataset") % {"handler": handler.__name__} - xs = string.split(x, "/") - self.addFilePath(xs,filename) - - for x in dirlist: - if not x: - continue - x = os.path.normpath(x) - if len(x) > 1: - if x[:2] == "//": - x = x[1:] - if type(x) != types.StringType: - raise portage_exception.InvalidDataType, _("%(handler)s returned an invalid subelement in dataset") % {"handler": handler.__name__} - xs = string.split(x, "/") - self.addDirectoryPath(xs,filename) - - def addDirectoryPath(self,split_path, owner): - pt = self.pathtree - for x in split_path: - if x not in pt.keys(): - pt[x] = {FILES_KEY:{},OWNER_KEY:[]} - if owner not in pt[x][OWNER_KEY]: - pt[x][OWNER_KEY].append(owner[:]) - pt = pt[x] - return pt - - def addFilePath(self,split_path, owner): - pt = self.addDirectoryPath(split_path[:-1], owner) - if split_path[-1] not in pt[FILES_KEY]: - pt[FILES_KEY][split_path[-1][:]] = [] - if owner not in pt[FILES_KEY][split_path[-1][:]]: - pt[FILES_KEY][split_path[-1][:]].append(owner[:]) - - def whoProvides(self,path): - if type(path) != types.StringType: - raise portage_exception.InvalidData, _("Path passed is not a string: %(path)s") % {"path": path} - x = os.path.normpath(path) - if x[0:2] == '//': - x = x[1:] - - xs = x.split("/") - pt = self.pathtree - final_dir = xs.pop(-1) - for subpath in xs: - if subpath in pt.keys(): - pt = pt[subpath] - - owners = [] - if final_dir in pt[FILES_KEY]: - for x in pt[FILES_KEY][final_dir]: - if x not in owners: - owners.append(x[:]) - if final_dir in pt: - for x in pt[final_dir][OWNER_KEY]: - if x not in owners: - owners.append(x[:]) - - return owners - - - -def test(): - import os - plt = PathLookupTable("spork") - for x in os.listdir("/var/db/pkg"): - for y in os.listdir("/var/db/pkg/"+x): - c_path = "/var/db/pkg/"+x+"/"+y+"/CONTENTS" - if os.path.exists(c_path): - plt.addFromFile(c_path, ContentsHandler) - print "/bin/bash:", plt.whoProvides("/bin/bash") - print "/var/spool:", plt.whoProvides("/var/spool") - print "/etc/init.d", plt.whoProvides("/etc/init.d") - return plt diff --git a/pym/portage_data.py b/pym/portage_data.py deleted file mode 100644 index 9eab5a5..0000000 --- a/pym/portage_data.py +++ /dev/null @@ -1,84 +0,0 @@ -# portage_data.py -- Calculated/Discovered Data Values -# Copyright 1998-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/pym/portage_data.py,v 1.7 2005/02/26 06:35:20 jstubbs Exp $ -cvs_id_string="$Id: portage_data.py,v 1.7 2005/02/26 06:35:20 jstubbs Exp $"[5:-2] - -import os,pwd,grp -from portage_util import writemsg -from output import green,red - -ostype=os.uname()[0] - -lchown = None -if ostype=="Linux": - userland="GNU" - os.environ["XARGS"]="xargs -r" -elif ostype in ["Darwin","FreeBSD","OpenBSD"]: - if ostype == "Darwin": - lchown=os.chown - userland="BSD" - os.environ["XARGS"]="xargs" -else: - writemsg(red("Operating system")+" \""+ostype+"\" "+red("currently unsupported. Exiting.")+"\n") - sys.exit(1) - -if not lchown: - if "lchown" in dir(os): - # Included in python-2.3 - lchown = os.lchown - else: - import missingos - lchown = missingos.lchown - - - -os.environ["USERLAND"]=userland - -#Secpass will be set to 1 if the user is root or in the portage group. -secpass=0 - -uid=os.getuid() -wheelgid=0 - -if uid==0: - secpass=2 -try: - wheelgid=grp.getgrnam("wheel")[2] - if (not secpass) and (wheelgid in os.getgroups()): - secpass=1 -except KeyError: - writemsg("portage initialization: your system doesn't have a 'wheel' group.\n") - writemsg("Please fix this as it is a normal system requirement. 'wheel' is GID 10\n") - writemsg("'emerge baselayout' and an 'etc-update' should remedy this problem.\n") - pass - -#Discover the uid and gid of the portage user/group -try: - portage_uid=pwd.getpwnam("portage")[2] - portage_gid=grp.getgrnam("portage")[2] - if (secpass==0): - secpass=1 -except KeyError: - portage_uid=0 - portage_gid=wheelgid - writemsg("\n") - writemsg( red("portage: 'portage' user or group missing. Please update baselayout\n")) - writemsg( red(" and merge portage user(250) and group(250) into your passwd\n")) - writemsg( red(" and group files. Non-root compilation is disabled until then.\n")) - writemsg( " Also note that non-root/wheel users will need to be added to\n") - writemsg( " the portage group to do portage commands.\n") - writemsg("\n") - writemsg( " For the defaults, line 1 goes into passwd, and 2 into group.\n") - writemsg(green(" portage:x:250:250:portage:/var/tmp/portage:/bin/false\n")) - writemsg(green(" portage::250:portage\n")) - writemsg("\n") - -if (uid!=0) and (portage_gid not in os.getgroups()): - if not os.environ.has_key("PORTAGE_SCRIPT"): - writemsg("\n") - writemsg(red("*** You are not in the portage group. You may experience cache problems\n")) - writemsg(red("*** due to permissions preventing the creation of the on-disk cache.\n")) - writemsg(red("*** Please add this user to the portage group if you wish to use portage.\n")) - writemsg("\n") - diff --git a/pym/portage_dep.py b/pym/portage_dep.py deleted file mode 100644 index 66b7bd1..0000000 --- a/pym/portage_dep.py +++ /dev/null @@ -1,1040 +0,0 @@ -# deps.py -- Portage dependency resolution functions -# Copyright 2003-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/pym/portage_dep.py,v 1.35 2005/05/05 06:24:08 jstubbs Exp $ -cvs_id_string="$Id: portage_dep.py,v 1.35 2005/05/05 06:24:08 jstubbs Exp $"[5:-2] - -# DEPEND SYNTAX: -# -# 'use?' only affects the immediately following word! -# Nesting is the only legal way to form multiple '[!]use?' requirements. -# -# Where: 'a' and 'b' are use flags, and 'z' is a depend atom. -# -# "a? z" -- If 'a' in [use], then b is valid. -# "a? ( z )" -- Syntax with parenthesis. -# "a? b? z" -- Deprecated. -# "a? ( b? z )" -- Valid -# "a? ( b? ( z ) ) -- Valid -# - -import os,string,types,sys,copy -import portage_exception -import portage_versions -import portage_syntax - -OPERATORS="*<=>~!" -ENDVERSION_KEYS = ["pre", "p", "alpha", "beta", "rc"] - -def dep_getcpv(s): - return s.strip(OPERATORS) - -def get_operator(mydep): - """ - returns '~', '=', '>', '<', '=*', '>=', or '<=' - """ - - if mydep[0] == "~": - operator = "~" - elif mydep[0] == "=": - if mydep[-1] == "*": - operator = "=*" - else: - operator = "=" - elif mydep[0] in "><": - if len(mydep) > 1 and mydep[1] == "=": - operator = mydep[0:2] - else: - operator = mydep[0] - else: - operator = None - return operator - -def isjustname(mypkg): - myparts=mypkg.split('-') - for x in myparts: - if portage_versions.ververify(x): - return 0 - return 1 - - -def isvalidatom(atom): - mycpv_cps = portage_versions.catpkgsplit(dep_getcpv(atom)) - operator = get_operator(atom) - if operator: - if mycpv_cps and mycpv_cps[0] != "null": - # >=cat/pkg-1.0 - return 1 - else: - # >=cat/pkg or >=pkg-1.0 (no category) - return 0 - if mycpv_cps: - # cat/pkg-1.0 - return 0 - if len(atom.split('/'))==2: - # cat/pkg - return 1 - else: - return 0 - - -def strip_empty(myarr): - for x in range(len(myarr)-1, -1, -1): - if not myarr[x]: - del myarr[x] - return myarr - -def paren_reduce(mystr,tokenize=1): - "Accepts a list of strings, and converts '(' and ')' surrounded items to sub-lists" - mylist = [] - while mystr: - if ("(" not in mystr) and (")" not in mystr): - freesec = mystr - subsec = None - tail = "" - elif mystr[0] == ")": - return [mylist,mystr[1:]] - elif ("(" in mystr) and (mystr.index("(") < mystr.index(")")): - freesec,subsec = mystr.split("(",1) - subsec,tail = paren_reduce(subsec,tokenize) - else: - subsec,tail = mystr.split(")",1) - if tokenize: - subsec = strip_empty(subsec.split(" ")) - return [mylist+subsec,tail] - return [mylist+[subsec],tail] - mystr = tail - if freesec: - if tokenize: - mylist = mylist + strip_empty(freesec.split(" ")) - else: - mylist = mylist + [freesec] - if subsec is not None: - mylist = mylist + [subsec] - return mylist - -def use_reduce(deparray, uselist=[], masklist=[], matchall=0, excludeall=[]): - """Takes a paren_reduce'd array and reduces the use? conditionals out - leaving an array with subarrays - """ - # Quick validity checks - for x in range(1,len(deparray)): - if deparray[x] in ["||","&&"]: - if len(deparray) == x: - # Operator is the last element - raise portage_exception.InvalidDependString("INVALID "+deparray[x]+" DEPEND STRING: "+str(deparray)) - if type(deparray[x+1]) != types.ListType: - # Operator is not followed by a list - raise portage_exception.InvalidDependString("INVALID "+deparray[x]+" DEPEND STRING: "+str(deparray)) - if deparray and deparray[-1] and deparray[-1][-1] == "?": - # Conditional with no target - raise portage_exception.InvalidDependString("INVALID "+deparray[x]+" DEPEND STRING: "+str(deparray)) - - #XXX: Compatibility -- Still required? - if ("*" in uselist): - matchall=1 - - mydeparray = deparray[:] - rlist = [] - while mydeparray: - head = mydeparray.pop(0) - - if type(head) == types.ListType: - rlist = rlist + [use_reduce(head, uselist, masklist, matchall, excludeall)] - - else: - if head[-1] == "?": # Use reduce next group on fail. - # Pull any other use conditions and the following atom or list into a separate array - newdeparray = [head] - while isinstance(newdeparray[-1], str) and newdeparray[-1][-1] == "?": - if mydeparray: - newdeparray.append(mydeparray.pop(0)) - else: - raise ValueError, "Conditional with no target." - - # Deprecation checks - warned = 0 - if len(newdeparray[-1]) == 0: - sys.stderr.write("Note: Empty target in string. (Deprecated)\n") - warned = 1 - if len(newdeparray) != 2: - sys.stderr.write("Note: Nested use flags without parenthesis (Deprecated)\n") - warned = 1 - if warned: - sys.stderr.write(" --> "+string.join(map(str,[head]+newdeparray))+"\n") - - # Check that each flag matches - ismatch = True - for head in newdeparray[:-1]: - head = head[:-1] - if head[0] == "!": - head = head[1:] - if not matchall and head in uselist or head in excludeall: - ismatch = False - break - elif head not in masklist: - if not matchall and head not in uselist: - ismatch = False - break - else: - ismatch = False - - # If they all match, process the target - if ismatch: - target = newdeparray[-1] - if isinstance(target, list): - rlist += [use_reduce(target, uselist, masklist, matchall, excludeall)] - else: - rlist += [target] - - else: - rlist += [head] - - return rlist - - -def dep_opconvert(deplist): - """Move || and && to the beginning of the following arrays""" - # Hack in management of the weird || for dep_wordreduce, etc. - # dep_opconvert: [stuff, ["||", list, of, things]] - # At this point: [stuff, "||", [list, of, things]] - retlist = [] - x = 0 - while x != len(deplist): - if isinstance(deplist[x], list): - retlist.append(dep_opconvert(deplist[x])) - elif deplist[x] == "||" or deplist[x] == "&&": - retlist.append([deplist[x]] + dep_opconvert(deplist[x+1])) - x += 1 - else: - retlist.append(deplist[x]) - x += 1 - return retlist - - - - - - -class DependencyGraph(object): - """Self-contained directed graph of abstract nodes. - - This is a enhanced version of the digraph class. It supports forward - and backward dependencies as well as primitive circular dependency - resolution. It is fully self contained and requires only that nodes - added to the graph are immutable. - - There are no validity checks done on the values passed to any method, - but is written so that invalid data will either cause an exception to - be raised. For this reason, this should not be used as part of any - external API.""" - - - def __init__(self): - """Create an empty graph.""" - # The entire graph is stored inside this one dictionary. - # The keys represent each node within the graph. Each node - # is paired with a list of nodes depending on it and a list - # of nodes it depends on. The complete structure is: - # { node : ( [node], [node] ) } - self.graph = {} - - # Strictly speaking, the graph shouldn't care about the order - # that packages are added to the graph, but using it ensures - # that system packages stay before world packages when pulling - # nodes one at a time. - self.order = [] - - def clone(self): - """Create an exact duplicate of this graph.""" - clone = DependencyGraph() - # A manual copy should save a slight amount of time, but - # is dependent on whether python's deepcopy is implemented - # in python or not. It is at the moment. - for node in self.graph: - clone.graph[node] = (self.graph[node][0][:], - self.graph[node][1][:]) - clone.order = self.order[:] - return clone - - def has_node(self, node): - """Indicate the existance of a node in the graph.""" - return self.graph.has_key(node) - - def add_node(self, node): - """Add a node to the graph if it hasn't been already.""" - if self.graph.has_key(node): - return - self.graph[node] = ([], []) - self.order.append(node) - - def add_relationship(self, parent, child): - """Add a relationship between two pre-existing nodes.""" - # This code needs to raise an exception if either the - # parent or child have not in fact been added prior. - if parent not in self.graph[child][0]: - self.graph[child][0].append(parent) - self.graph[parent][1].append(child) - - def remove_relationship(self, parent, child): - """Remove an existing relationship between two nodes.""" - self.graph[child][0].remove(parent) - self.graph[parent][1].remove(child) - - def get_relationships(self, node): - """Retrieve parent and children lists of a node. - - @rtype: ( [node], [node] ) - """ - # This code also needs to raise an exception if the node - # has not been added prior. - relationships = (self.graph[node][0][:], - self.graph[node][1][:]) - return relationships - - def remove_node(self, node): - """Remove a node from the graph, destroying any relationships. - - Any relationships destroyed by removing this node are returned. - - @rtype: ( [node], [node] ) - """ - # This code also needs to raise an exception if the node - # has not been added prior. - - relationships = self.get_relationships(node) - - # Ensuring that all relationships are destroyed keeps the - # graph in a sane state. A node must _never_ depend on another - # node that does not exist in the graph. - for parent in relationships[0]: - self.graph[parent][1].remove(node) - for child in relationships[1]: - self.graph[child][0].remove(node) - - # Kill of the other side of the relationships in one shot. - del self.graph[node] - - # Make sure to remove the node from the ordered list as well. - self.order.remove(node) - - return relationships - - def get_all_nodes(self): - """Return a list of every node in the graph. - - @rtype: [node] - """ - # Assuming our graph is in a sane state, self.order contains - # the same set of nodes as self.graph.keys(). - return self.order[:] - - def get_leaf_nodes(self): - """Return a list of all nodes that have no child dependencies. - - If all nodes have child dependencies and the graph is not - empty, circular dependency resolution is attempted. In such a - circumstance, only one node is ever returned and is passed back - by way of an exception. - - @rtype: [node] - """ - # If the graph is empty, just return an empty list. - if not self.graph: - return [] - - # Iterate through the graph's nodes and add any that have no - # child dependencies. If we find such nodes, return them. - nodes = [] - for node in self.order: - if not self.graph[node][1]: - nodes.append(node) - if nodes: - return nodes - - # If we've got this far, then a circular dependency set that - # contains every node. However, there is usually a subset of - # nodes that are self-contained. We will find the subset with - # the most parents so that circular dependencies can be dealt - # with (and not have to be recalculated) as early as possible. - - # Create a list of tuples containing the number of parents - # paired with the corresponding node. - counts = [] - # We'll keep a record of the actual parents for later on. - parents = {} - for node in self.graph: - parents[node] = self.get_parent_nodes(node, depth=0) - if len(parents[node]) == len(self.graph): - # XXX: Every node in the graph depends on - # this node. Following the logic through will - # return this node or another that has equal - # number of parents, so shortcut it here. - return [node] - counts += [(len(parents[node]), node)] - - # Reverse sort the generated list. - counts.sort() - counts.reverse() - - # Find the first node that is in a circular dependency set. - for count in counts: - node = count[1] - children = self.get_child_nodes(node, depth=0) - if node in children: - break - - # Now we'll order the nodes in the set by parent count. - counts = [] - for node in children: - counts += [(len(parents[node]), node)] - - # Reverse sort the generated list. - counts.sort() - counts.reverse() - - # Return the first node in the list. - # XXX: This needs to be changed into an exception. - return [counts[0][1]] - - def get_root_nodes(self): - """Return the smallest possible list of starting nodes. - - Ordinarily, all nodes with no parent nodes are returned. - However, if there are any circular dependencies that can - not be reached through one of these nodes, they will be - resolved and a suitable starting node chosen. - - @rtype: [node] - """ - # Create a copy of our graph. - clone = self.clone() - - # Keep processing the graph until it is empty. - roots = [] - while clone.graph: - - # Find all nodes that have no parent nodes. - newroots = [] - for node in clone.order: - if not clone.graph[node][0]: - newroots.append(node) - - # Remove them and all their descendents from the graph. - for node in newroots: - for child in clone.get_child_nodes(node, depth=0): - clone.remove_node(child) - clone.remove_node(node) - - # And add them to our list of root nodes. - roots.extend(newroots) - - # If the graph is empty, stop processing. - if not clone.graph: - break - - # If the graph isn't empty, then we have a circular - # dependency. We'll just remove one leaf node and - # then look for parentless nodes again. - clone.remove_node(clone.get_leaf_nodes()[0]) - - # Sort the list of roots by the node addition order. - newroots = self.order[:] - for x in range(len(newroots)-1,-1,-1): - if newroots[x] not in roots: - del newroots[x] - - # Return the sorted list. - return newroots - - def get_parent_nodes(self, node, depth=1): - """Return a list of nodes that depend on a node. - - The examined node will be included in the returned list - if the node exists in a circular dependency. - - @param depth: Maximum depth to recurse to, or 0 for all. - @rtype: [node] - """ - return self.__traverse_nodes(node, depth, 0) - - def get_child_nodes(self, node, depth=1): - """Return a list of nodes depended on by node. - - The examined node will be included in the returned list - if the node exists in a circular dependency. - - @param depth: Maximum depth to recurse to, or 0 for all. - @rtype: [node] - """ - return self.__traverse_nodes(node, depth, 1) - - def __traverse_nodes(self, origin, depth, path): - # Set depth to the maximum if it is 0. - if not depth: - depth = len(self.graph) - - traversed = {} # The list of nodes to be returned - - # This function _needs_ to be fast, so we use a stack - # based implementation rather than recursive calls. - stack = [] # Stack of previous depths - node = origin # The current node we are checking - index = 0 # Progress through the node's relations - length = len(self.graph[node][path]) - - graph = self.graph # Faster access via local scope - - # Repeat while the stack is not empty or there are more - # relations to be processed for the current node. - while stack or length != index: - - # If we're finished at the current depth, move back up. - if index == length: - (depth, node, index, length) = stack.pop() - - # Otherwise, process the next relation. - else: - relation = graph[node][path][index] - # Add the relation to our list if necessary... - if relation not in traversed: - traversed[relation] = None - # ...and then check if we can go deeper - if depth != 1: - # Add state to the stack. - stack += [(depth, node, index, length)] - # Reset state for the new node. - depth -= 1 - node = relation - index = 0 - length = len(graph[node][path]) - # Restart the loop. - continue - - # Move onto the next relation. - index += 1 - - # Return our list. - return traversed.keys() - -def dep_getkey(mydep): - if not len(mydep): - return mydep - if mydep[0]=="*": - mydep=mydep[1:] - if mydep[-1]=="*": - mydep=mydep[:-1] - if mydep[0]=="!": - mydep=mydep[1:] - if mydep[:2] in [ ">=", "<=" ]: - mydep=mydep[2:] - elif mydep[:1] in "=<>~": - mydep=mydep[1:] - if isspecific(mydep): - mysplit=portage_versions.catpkgsplit(mydep) - if not mysplit: - return mydep - return mysplit[0]+"/"+mysplit[1] - else: - return mydep - - -iscache={} -def isspecific(mypkg): - "now supports packages with no category" - if mypkg in iscache: - return iscache[mypkg] - mysplit=mypkg.split("/") - if not isjustname(mysplit[-1]): - iscache[mypkg]=1 - return 1 - iscache[mypkg]=0 - return 0 - -def match_to_list(mypkg,mylist): - """(pkgname,list) - Searches list for entries that matches the package. - """ - matches=[] - for x in mylist: - if match_from_list(x,[mypkg]): - if x not in matches: - matches.append(x) - return matches - -def best_match_to_list(mypkg,mylist): - """(pkgname,list) - Returns the most specific entry (assumed to be the longest one) - that matches the package given. - """ - # XXX Assumption is wrong sometimes. - maxlen = 0 - bestm = None - for x in match_to_list(mypkg,mylist): - if len(x) > maxlen: - maxlen = len(x) - bestm = x - return bestm - - - -def match_from_list(mydep,candidate_list): - if mydep[0] == "!": - mydep = mydep[1:] - - mycpv = dep_getcpv(mydep) - mycpv_cps = portage_versions.catpkgsplit(mycpv) # Can be None if not specific - - if not mycpv_cps: - cat,pkg = portage_versions.catsplit(mycpv) - ver = None - rev = None - else: - cat,pkg,ver,rev = mycpv_cps - if mydep == mycpv: - raise KeyError, "Specific key requires an operator (%s) (try adding an '=')" % (mydep) - - if ver and rev: - operator = get_operator(mydep) - if not operator: - writemsg("!!! Invanlid atom: %s\n" % mydep) - return [] - else: - operator = None - - mylist = [] - - if operator == None: - for x in candidate_list: - xs = portage_versions.pkgsplit(x) - if xs == None: - if x != mycpv: - continue - elif xs[0] != mycpv: - continue - mylist.append(x) - - elif operator == "=": # Exact match - if mycpv in candidate_list: - mylist = [mycpv] - - elif operator == "=*": # glob match - # The old verion ignored _tag suffixes... This one doesn't. - for x in candidate_list: - if x[0:len(mycpv)] == mycpv: - mylist.append(x) - - elif operator == "~": # version, any revision, match - for x in candidate_list: - xs = portage_versions.catpkgsplit(x) - if xs[0:2] != mycpv_cps[0:2]: - continue - if xs[2] != ver: - continue - mylist.append(x) - - elif operator in [">", ">=", "<", "<="]: - for x in candidate_list: - try: - result = portage_versions.pkgcmp(portage_versions.pkgsplit(x), [cat+"/"+pkg,ver,rev]) - except SystemExit, e: - raise - except: - writemsg("\nInvalid package name: %s\n" % x) - sys.exit(73) - if result == None: - continue - elif operator == ">": - if result > 0: - mylist.append(x) - elif operator == ">=": - if result >= 0: - mylist.append(x) - elif operator == "<": - if result < 0: - mylist.append(x) - elif operator == "<=": - if result <= 0: - mylist.append(x) - else: - raise KeyError, "Unknown operator: %s" % mydep - else: - raise KeyError, "Unknown operator: %s" % mydep - - return mylist - - -def prepare_prefdict(preferences): - myprefdict = {} - idx = 0 - for atom in preferences: - if atom.cpv.key not in myprefdict: - myprefdict[atom.cpv.key] = [] - myprefdict[atom.cpv.key].append((idx, atom)) - idx += 1 - myprefdict["____"] = idx - return myprefdict - - -def transform_dependspec(dependspec, prefdict): - def dotransform(dependspec, prefdict): - dependspec = copy.copy(dependspec) - elements = dependspec.elements - dependspec.elements = [] - neworder = [] - prio = prefdict["____"] - for element in elements[:]: - if isinstance(element, portage_syntax.DependSpec): - neworder.append(dotransform(element, prefdict)) - elements.remove(element) - elif element.cpv.key in prefdict: - for (idx, pref) in prefdict[element.cpv.key]: - if pref.intersects(element): - if idx < prio: - prio = idx - if pref.encapsulates(element): - neworder.append((idx, element)) - elements.remove(element) - else: - subdependspec = portage_syntax.DependSpec(element_class=portage_syntax.Atom) - if element.encapsulates(pref): - subsubdependspec = portage_syntax.DependSpec(element_class=portage_syntax.Atom) - subsubdependspec.add_element(pref) - subsubdependspec.add_element(element) - subdependspec.add_element(subsubdependspec) - else: - subdependspec.add_element(pref) - subdependspec.add_element(element) - subdependspec.preferential = True - neworder.append((idx, subdependspec)) - elements.remove(element) - neworder.sort() - for element in neworder: - dependspec.add_element(element[1]) - for element in elements: - dependspec.add_element(element) - return (prio, dependspec) - return dotransform(dependspec, prefdict)[1] - - -def transform_virtuals(pkg, dependspec, virtuals): - dependspec = copy.copy(dependspec) - elements = dependspec.elements - dependspec.elements = [] - for element in elements: - if isinstance(element, portage_syntax.DependSpec): - dependspec.elements.append(transform_virtuals(pkg, element, virtuals)) - elif element.cpv.key not in virtuals: - dependspec.elements.append(element) - else: - subdepspec = portage_syntax.DependSpec(element_class=portage_syntax.Atom) - subdepspec.preferential = True - for virtual in virtuals[element.cpv.key]: - atom = element.with_key(virtual) - if not atom.match(pkg): - subdepspec.add_element(element.with_key(virtual)) - dependspec.elements.append(subdepspec) - return dependspec - - -class StateGraph(object): - - def __init__(self): - # key : (bool, [GluePkg], [GluePkg], [Atom], [Atom]) - self.pkgrec = {} - # key : [Atom] - self.unmatched_atoms = {} - # [Atom] - self.unmatched_preferentials = [] - # key : [pkg, [[Atom]]] - self.preferential_atoms = {} - # key : [key] - self.reverse_preferentials = {} - - def get_unmatched_atoms(self): - unmatched = [] - for key in self.unmatched_atoms: - unmatched.append(self.unmatched_atoms[key][0]) - return unmatched - - def get_unmatched_preferentials(self): - return self.unmatched_preferentials[:] - - def get_unneeded_packages(self): - unneeded = [] - for key in self.pkgrec: - unneeded.extend(self.pkgrec[key][1]) - return unneeded - - def get_needed_packages(self): - needed = [] - for key in self.pkgrec: - needed.extend(self.pkgrec[key][0]) - return needed - - def get_conflicts(self): - conflicts = [] - for key in self.pkgrec: - slots = {} - in_conflict = False - for pkg in self.pkgrec[key][0]: - if pkg.slot in slots: - slots[pkg.slot].append(pkg) - in_conflict = True - else: - slots[pkg.slot] = [pkg] - if in_conflict: - for slot in slots: - if len(slots[slot]) > 1: - conflicts.append(slots[slot]) - return conflicts - - def add_package(self, pkg, keep=False): - key = pkg.key - if key not in self.pkgrec: - self.pkgrec[key] = ([], [pkg], [], [], [keep]) - else: - if not self.pkgrec[key][4][0]: - self.pkgrec[key][4][0] = keep - self.pkgrec[key][1].append(pkg) - self._recheck(key) - - def remove_package(self, pkg): - key = pkg.key - if pkg not in self.pkgrec[key][1]: - self._demote_pkg(pkg) - self.pkgrec[key][1].remove(pkg) - self._recheck(key) - - def _recheck(self, key): - (used, unused, unmatched) = self._select_pkgs(key) - for pkg in used: - if pkg not in self.pkgrec[key][0]: - self._promote_pkg(pkg) - for pkg in unused: - if pkg not in self.pkgrec[key][1]: - self._demote_pkg(pkg) - if key in self.unmatched_atoms: - del self.unmatched_atoms[key] - for idx in range(len(self.unmatched_preferentials)-1, -1, -1): - if self.unmatched_preferentials[idx].cpv.key == key: - del self.unmatched_preferentials[idx] - if unmatched: - for atom in unmatched: - if atom in self.pkgrec[key][2]: - if key in self.unmatched_atoms: - self.unmatched_atoms[key].append(atom) - else: - self.unmatched_atoms[key] = [atom] - else: - self.unmatched_preferentials.append(atom) - if not self.pkgrec[key][0] and not self.pkgrec[key][1] and not self.pkgrec[key][2] and not self.pkgrec[key][3] and not self.pkgrec[key][4][0]: - del self.pkgrec[key] - - def _select_pkgs(self, key): - allpkgs = self.pkgrec[key][0] + self.pkgrec[key][1] - used = [] - unused = [] - regular_atoms = [] - unmatched = [] - for atom in self.pkgrec[key][2] + self.pkgrec[key][3]: - if atom.blocks: - for pkg in allpkgs[:]: - if atom.match(pkg): - allpkgs.remove(pkg) - unused.append(pkg) - elif atom not in regular_atoms: - regular_atoms.append(atom) - - if regular_atoms: - slots = {} - for pkg in allpkgs: - if pkg.slot not in slots: - slots[pkg.slot] = [] - slots[pkg.slot].append(pkg) - - used_slots = [] - multislot_atoms = [] - for atom in regular_atoms: - matched_slots = [] - for slot in slots: - for pkg in slots[slot]: - if atom.match(pkg): - matched_slots.append(slot) - break - if len(matched_slots) > 1: - multislot_atoms.append(atom) - break - if atom in multislot_atoms: - continue - if not matched_slots: - unmatched.append(atom) - continue - slot = matched_slots[0] - if slot not in used_slots: - used_slots.append(slot) - for idx in range(len(slots[slot])-1, -1, -1): - if not atom.match(slots[slot][idx]): - unused.append(slots[slot][idx]) - del slots[slot][idx] - used = [] - uncertain = [] - for slot in slots: - if slot in used_slots: - used.extend(slots[slot]) - else: - uncertain.extend(slots[slot]) - for atom in multislot_atoms: - matched = False - for pkg in used[:]: - if atom.match(pkg): - matched = True - break - if matched: - continue - for pkg in uncertain: - if atom.match(pkg): - uncertain.remove(pkg) - used.append(pkg) - matched = True - break - if not matched: - unmatched.append(atom) - unused.extend(uncertain) - elif self.pkgrec[key][4][0]: - used = allpkgs - else: - unused = allpkgs - return (used, unused, unmatched) - - def _promote_pkg(self, pkg): - key = pkg.key - checks = {} - self.pkgrec[key][1].remove(pkg) - self.pkgrec[key][0].append(pkg) - if not pkg.rdeps.preferential: - for atom in pkg.rdeps.elements: - if atom.cpv.key not in self.pkgrec: - self.pkgrec[atom.cpv.key] = ([], [], [atom], [], [False]) - else: - self.pkgrec[atom.cpv.key][2].append(atom) - if atom.cpv.key not in checks: - checks[atom.cpv.key] = True - else: - preflist = [pkg, []] - if isinstance(pkg.rdeps.elements[0], portage_syntax.Atom): - for atom in pkg.rdeps.elements: - preflist[1].append([atom]) - else: - for option in pkg.rdeps.elements: - preflist[1].append([]) - for atom in option.elements: - preflist[1][-1].append(atom) - for option in preflist[1]: - for atom in option: - if atom.cpv.key not in self.pkgrec: - self.pkgrec[atom.cpv.key] = ([], [], [], [atom], [False]) - else: - self.pkgrec[atom.cpv.key][3].append(atom) - if atom.cpv.key not in self.reverse_preferentials: - self.reverse_preferentials[atom.cpv.key] = {} - if key not in self.reverse_preferentials[atom.cpv.key]: - self.reverse_preferentials[atom.cpv.key][key] = 1 - else: - self.reverse_preferentials[atom.cpv.key][key] += 1 - checks[atom.cpv.key] = True - if key not in self.preferential_atoms: - self.preferential_atoms[key] = [preflist] - else: - self.preferential_atoms[key].append(preflist) - self._check_preferentials(key) - if key in self.reverse_preferentials: - for parent in self.reverse_preferentials[key].keys(): - self._check_preferentials(parent) - for key in checks: - if key in self.pkgrec: - self._recheck(key) - - def _demote_pkg(self, pkg): - key = pkg.key - checks = {} - self.pkgrec[key][0].remove(pkg) - self.pkgrec[key][1].append(pkg) - if not pkg.rdeps.preferential: - for atom in pkg.rdeps.elements: - self.pkgrec[atom.cpv.key][2].remove(atom) - if not self.pkgrec[atom.cpv.key][0] and not self.pkgrec[atom.cpv.key][1] and not self.pkgrec[atom.cpv.key][2] and not self.pkgrec[atom.cpv.key][3]: - del self.pkgrec[atom.cpv.key] - if atom.cpv.key in self.unmatched_atoms: - del self.unmatched_atoms[atom.cpv.key] - else: - checks[atom.cpv.key] = True - else: - for idx in range(len(self.preferential_atoms[key])): - if self.preferential_atoms[key][idx][0] == pkg: - for atomlist in self.preferential_atoms[key][idx][1]: - for atom in atomlist: - self.pkgrec[atom.cpv.key][3].remove(atom) - self.reverse_preferentials[atom.cpv.key][key] -= 1 - if not self.reverse_preferentials[atom.cpv.key][key]: - del self.reverse_preferentials[atom.cpv.key][key] - if not self.reverse_preferentials[atom.cpv.key]: - del self.reverse_preferentials[atom.cpv.key] - checks[atom.cpv.key] = True - del self.preferential_atoms[key][idx] - if not self.preferential_atoms[key]: - del self.preferential_atoms[key] - if key in self.reverse_preferentials: - for parent in self.reverse_preferentials[key].keys(): - self._check_preferentials(parent) - for key in checks: - if key in self.pkgrec: - self._recheck(key) - - def _check_preferentials(self, key): - checks = {} - for preflist in self.preferential_atoms[key]: - if len(preflist[1]) == 1: - all_matched = True - for atom in preflist[1][0]: - matched = False - for pkg in self.pkgrec[atom.cpv.key][0]: - if atom.match(pkg): - matched = True - break - if not matched: - all_matched = False - break - if not all_matched: - pkg = preflist[0] - self._demote_pkg(pkg) - self._promote_pkg(pkg) - self._check_preferentials(key) - return - else: - for idx in range(len(preflist[1])): - all_matched = True - for atom in preflist[1][idx]: - matched = False - for pkg in self.pkgrec[atom.cpv.key][0]: - if atom.match(pkg): - matched = True - break - if not matched: - all_matched = False - break - if all_matched: - removable = preflist[1][:idx] + preflist[1][idx+1:] - preflist[1] = [preflist[1][idx]] - for option in removable: - for atom in option: - self.pkgrec[atom.cpv.key][3].remove(atom) - self.reverse_preferentials[atom.cpv.key][key] -= 1 - if not self.reverse_preferentials[atom.cpv.key][key]: - del self.reverse_preferentials[atom.cpv.key][key] - if not self.reverse_preferentials[atom.cpv.key]: - del self.reverse_preferentials[atom.cpv.key] - checks[atom.cpv.key] = True - break - for key in checks: - self._recheck(key) diff --git a/pym/portage_exception.py b/pym/portage_exception.py deleted file mode 100644 index 82a0895..0000000 --- a/pym/portage_exception.py +++ /dev/null @@ -1,170 +0,0 @@ -# Copyright 1998-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/pym/portage_exception.py,v 1.10 2005/02/26 06:35:20 jstubbs Exp $ -cvs_id_string="$Id: portage_exception.py,v 1.10 2005/02/26 06:35:20 jstubbs Exp $"[5:-2] - -class PortageException(Exception): - """General superclass for portage exceptions""" - def __init__(self,value): - self.value = value[:] - def __str__(self): - return repr(self.value) - -class UnknownCondition(PortageException): - """Corruption indication""" - def __init__(self,value): - self.value = value[:] - def __str__(self): - return repr(self.value) - -class CorruptionError(PortageException): - """Corruption indication""" - def __init__(self,value): - self.value = value[:] - def __str__(self): - return repr(self.value) - -class InvalidDependString(PortageException): - """An invalid depend string has been encountered""" - def __init__(self,value): - self.value = value[:] - def __str__(self): - return repr(self.value) - -class InvalidVersionString(PortageException): - """An invalid version string has been encountered""" - def __init__(self,value): - self.value = value[:] - def __str__(self): - return repr(self.value) - -class SecurityViolation(PortageException): - """An incorrect formatting was passed instead of the expected one""" - def __init__(self,value): - self.value = value[:] - def __str__(self): - return repr(self.value) - -class IncorrectParameter(PortageException): - """An parameter of the wrong type was passed""" - def __init__(self,value): - self.value = value[:] - def __str__(self): - return repr(self.value) - -class MissingParameter(PortageException): - """An parameter is required for the action requested but was not passed""" - def __init__(self,value): - self.value = value[:] - def __str__(self): - return repr(self.value) - - -class InvalidData(PortageException): - """An incorrect formatting was passed instead of the expected one""" - def __init__(self,value): - self.value = value[:] - def __str__(self): - return repr(self.value) - -class InvalidDataType(PortageException): - """An incorrect type was passed instead of the expected one""" - def __init__(self,value): - self.value = value[:] - def __str__(self): - return repr(self.value) - - - - -class InvalidLocation(PortageException): - """Data was not found when it was expected to exist or was specified incorrectly""" - def __init__(self,value): - self.value = value[:] - def __str__(self): - return repr(self.value) - -class FileNotFound(InvalidLocation): - """A file was not found when it was expected to exist""" - def __init__(self,value): - self.value = value[:] - def __str__(self): - return repr(self.value) - -class DirectoryNotFound(InvalidLocation): - """A directory was not found when it was expected to exist""" - def __init__(self,value): - self.value = value[:] - def __str__(self): - return repr(self.value) - - - -class CommandNotFound(PortageException): - """A required binary was not available or executable""" - def __init__(self,value): - self.value = value[:] - def __str__(self): - return repr(self.value) - - - -class PortagePackageException(PortageException): - """Malformed or missing package data""" - def __init__(self,value): - self.value = value[:] - def __str__(self): - return repr(self.value) - -class PackageNotFound(PortagePackageException): - """Missing Ebuild or Binary""" - def __init__(self,value): - self.value = value[:] - def __str__(self): - return repr(self.value) - -class InvalidPackageName(PortagePackageException): - """Malformed package name""" - def __init__(self,value): - self.value = value[:] - def __str__(self): - return repr(self.value) - - - - -class SignatureException(PortageException): - """Signature was not present in the checked file""" - def __init__(self,value): - self.value = value[:] - def __str__(self): - return repr(self.value) - -class DigestException(SignatureException): - """A problem exists in the digest""" - def __init__(self,value): - self.value = value[:] - def __str__(self): - return repr(self.value) - -class MissingSignature(SignatureException): - """Signature was not present in the checked file""" - def __init__(self,value): - self.value = value[:] - def __str__(self): - return repr(self.value) - -class InvalidSignature(SignatureException): - """Signature was checked and was not a valid, current, nor trusted signature""" - def __init__(self,value): - self.value = value[:] - def __str__(self): - return repr(self.value) - -class UntrustedSignature(SignatureException): - """Signature was not certified to the desired security level""" - def __init__(self,value): - self.value = value[:] - def __str__(self): - return repr(self.value) - diff --git a/pym/portage_exec.py b/pym/portage_exec.py deleted file mode 100644 index 4daa259..0000000 --- a/pym/portage_exec.py +++ /dev/null @@ -1,382 +0,0 @@ -# portage.py -- core Portage functionality -# Copyright 1998-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/pym/portage_exec.py,v 1.21 2005/02/26 06:41:48 ferringb Exp $ -cvs_id_string="$Id: portage_exec.py,v 1.21 2005/02/26 06:41:48 ferringb Exp $"[5:-2] - -import os,types,string,sys -import signal -import portage_data -import portage_util -import portage_const - -selinux_capable = False -sandbox_capable = os.path.exists(portage_const.SANDBOX_BINARY) -userpriv_capable = (os.getuid() == 0) -fakeroot_capable = False - - -try: - import resource - max_fd_limit=resource.getrlimit(RLIMIT_NOFILE) -except SystemExit, e: - raise -except: - # hokay, no resource module. - max_fd_limit=256 - -# pids this process knows of. -spawned_pids = [] - -def cleanup(pids,block_exceptions=True): - """function to go through and reap the list of pids passed to it""" - global spawned_pids - if type(pids) == int: - pids = [pids] - for x in pids: - try: - os.kill(x,signal.SIGTERM) - if os.waitpid(x,os.WNOHANG)[1] == 0: - # feisty bugger, still alive. - os.kill(x,signal.SIGKILL) - os.waitpid(x,0) - - except OSError, oe: - if block_exceptions: - pass - if oe.errno not in (10,3): - raise oe - except SystemExit: - raise - except Exception: - if block_exceptions: - pass - try: spawned_pids.remove(x) - except IndexError: pass - -from portage_const import BASH_BINARY,SANDBOX_BINARY,SANDBOX_PIDS_FILE - -def spawn_bash(mycommand,env={},debug=False,opt_name=None,**keywords): - """spawn mycommand as an arguement to bash""" - args=[BASH_BINARY] - if not opt_name: - opt_name=mycommand.split()[0] - if not env.has_key("BASH_ENV"): - env["BASH_ENV"] = "/etc/spork/is/not/valid/profile.env" - if debug: - args.append("-x") - args.append("-c") - args.append(mycommand) - return spawn(args,env=env,opt_name=opt_name,**keywords) - -def spawn_sandbox(mycommand,uid=None,opt_name=None,**keywords): - """spawn mycommand as an arguement to the sandbox binary. - basically, LD_PRELOAD="libsandbox.so" mycommand""" - args=[SANDBOX_BINARY] - if not opt_name: - opt_name=mycommand.split()[0] - args.append(mycommand) - if not uid: - uid=os.getuid() - try: - os.chown(SANDBOX_PIDS_FILE,uid,portage_data.portage_gid) - os.chmod(SANDBOX_PIDS_FILE,0664) - except SystemExit, e: - raise - except: - pass - return spawn(args,uid=uid,opt_name=opt_name,**keywords) - -def find_binary(myc): - """look through the environmental path for an executable file named whatever myc is""" - # this sucks. badly. - p=os.getenv("PATH") - if p == None: - return None - for x in p.split(":"): - #if it exists, and is executable - if os.path.exists("%s/%s" % (x,myc)) and os.stat("%s/%s" % (x,myc))[0] & 0x0248: - return "%s/%s" % (x,myc) - return None - - -def spawn_func(func,args=[],kwargs={},exit_func=None,**keywords): - """spawn a python function in a fork - func: python function - args: positional args to positionally expand for the function - kwargs: optional args to expand for the function call - exit_func: optional function for parsing the return of func, and - returning the desired exit code - note exit_func should handle applicable exceptions. Unhandled exemptions are caught, - and the process exits with a code of 1.""" - if exit_func: - return spawn((func,args,kwargs,exit_func), func_call=True,**keywords) - return spawn((func,args,kwargs), func_call=True,**keywords) - -# base spawn function -def spawn(mycommand,env={},raw_exit_code=False,opt_name=None,fd_pipes=None,returnpid=False,\ - uid=None,gid=None,groups=None,umask=None,logfile=None,path_lookup=True, selinux_context=None, - raise_signals=False, func_call=False): - """base fork/execve function. - mycommand is the desired command- if you need a command to execute in a bash/sandbox/fakeroot - environment, use the appropriate spawn call. This is a straight fork/exec code path. - Can either have a tuple, or a string passed in. If uid/gid/groups/umask specified, it changes - the forked process to said value. If path_lookup is on, a non-absolute command will be converted - to an absolute command, otherwise it returns None. - - selinux_context is the desired context, dependant on selinux being available. - opt_name controls the name the processor goes by. - fd_pipes controls which file descriptor numbers are left open in the forked process- it's a dict of - current fd's raw fd #, desired #. - - func_call is a boolean for specifying to execute a python function- use spawn_func instead. - raise_signals is questionable. Basically throw an exception if signal'd. No exception is thrown - if raw_input is on. - - logfile overloads the specified fd's to write to a tee process which logs to logfile - returnpid returns the relevant pids (a list, including the logging process if logfile is on). - - non-returnpid calls to spawn will block till the process has exited, returning the exitcode/signal - raw_exit_code controls whether the actual waitpid result is returned, or intrepretted.""" - myc='' - if not func_call: - if type(mycommand)==types.StringType: - mycommand=mycommand.split() - myc = mycommand[0] - if not os.access(myc, os.X_OK): - if not path_lookup: - return None - myc = find_binary(myc) - if myc == None: - return None - mypid=[] - if logfile: - pr,pw=os.pipe() - mypid.extend(spawn(('tee','-i','-a',logfile),returnpid=True,fd_pipes={0:pr,1:1,2:2})) - retval=os.waitpid(mypid[-1],os.WNOHANG)[1] - if retval != 0: - # he's dead jim. - if raw_exit_code: - return retval - return process_exit_code(retval) - - if fd_pipes == None: - fd_pipes={} - fd_pipes[0] = 0 - fd_pipes[1]=pw - fd_pipes[2]=pw - - if not opt_name: - opt_name = mycommand[0] - myargs=[opt_name] - myargs.extend(mycommand[1:]) - global spawned_pids - mypid.append(os.fork()) - if mypid[-1] != 0: - #log the bugger. - spawned_pids.extend(mypid) - - if mypid[-1] == 0: - if func_call: - spawned_pids = [] - - # this may look ugly, but basically it moves file descriptors around to ensure no - # handles that are needed are accidentally closed during the final dup2 calls. - trg_fd=[] - if type(fd_pipes)==types.DictType: - src_fd=[] - k=fd_pipes.keys() - k.sort() - - #build list of which fds will be where, and where they are at currently - for x in k: - trg_fd.append(x) - src_fd.append(fd_pipes[x]) - - # run through said list dup'ing descriptors so that they won't be waxed - # by other dup calls. - for x in range(0,len(trg_fd)): - if trg_fd[x] == src_fd[x]: - continue - if trg_fd[x] in src_fd[x+1:]: - new=os.dup2(trg_fd[x],max(src_fd) + 1) - os.close(trg_fd[x]) - try: - while True: - src_fd[s.index(trg_fd[x])]=new - except SystemExit, e: - raise - except: - pass - - # transfer the fds to their final pre-exec position. - for x in range(0,len(trg_fd)): - if trg_fd[x] != src_fd[x]: - os.dup2(src_fd[x], trg_fd[x]) - else: - trg_fd=[0,1,2] - - # wax all open descriptors that weren't requested be left open. - for x in range(0,max_fd_limit): - if x not in trg_fd: - try: - os.close(x) - except SystemExit, e: - raise - except: - pass - - # note this order must be preserved- can't change gid/groups if you change uid first. - if selinux_capable and selinux_context: - import selinux - selinux.setexec(selinux_context) - if gid: - os.setgid(gid) - if groups: - os.setgroups(groups) - if uid: - os.setuid(uid) - if umask: - os.umask(umask) - - try: - #print "execing", myc, myargs - if func_call: - # either use a passed in func for interpretting the results, or return if no exception. - # note the passed in list, and dict are expanded. - if len(mycommand) == 4: - os._exit(mycommand[3](mycommand[0](*mycommand[1],**mycommand[2]))) - try: - mycommand[0](*mycommand[1],**mycommand[2]) - except Exception,e: - print "caught exception",e," in forked func",mycommand[0] - sys.exit(0) - - os.execve(myc,myargs,env) - except SystemExit, e: - raise - except Exception, e: - if not func_call: - raise str(e)+":\n "+myc+" "+string.join(myargs) - print "func call failed" - - # If the execve fails, we need to report it, and exit - # *carefully* --- report error here - os._exit(1) - sys.exit(1) - return # should never get reached - - # if we were logging, kill the pipes. - if logfile: - os.close(pr) - os.close(pw) - - if returnpid: - return mypid - - # loop through pids (typically one, unless logging), either waiting on their death, or waxing them - # if the main pid (mycommand) returned badly. - while len(mypid): - retval=os.waitpid(mypid[-1],0)[1] - if retval != 0: - cleanup(mypid[0:-1],block_exceptions=False) - # at this point we've killed all other kid pids generated via this call. - # return now. - if raw_exit_code: - return retval - return process_exit_code(retval,throw_signals=raise_signals) - else: - mypid.pop(-1) - cleanup(mypid) - return 0 - -def process_exit_code(retval,throw_signals=False): - """process a waitpid returned exit code, returning exit code if it exit'd, or the - signal if it died from signalling - if throw_signals is on, it raises a SystemExit if the process was signaled. - This is intended for usage with threads, although at the moment you can't signal individual - threads in python, only the master thread, so it's a questionable option.""" - if (retval & 0xff)==0: - return retval >> 8 # return exit code - else: - if throw_signals: - #use systemexit, since portage is stupid about exception catching. - raise SystemExit() - return (retval & 0xff) << 8 # interrupted by signal - -def spawn_get_output(mycommand,spawn_type=spawn,raw_exit_code=False,emulate_gso=True, \ - collect_fds=[1],fd_pipes=None,**keywords): - """call spawn, collecting the output to fd's specified in collect_fds list - emulate_gso is a compatability hack to emulate commands.getstatusoutput's return, minus the - requirement it always be a bash call (spawn_type controls the actual spawn call), and minus the - 'lets let log only stdin and let stderr slide by'. - - emulate_gso was deprecated from the day it was added, so convert your code over. - spawn_type is the passed in function to call- typically spawn_bash, spawn, spawn_sandbox, or spawn_fakeroot""" - global selinux_capable - pr,pw=os.pipe() - - if type(spawn_type) not in [types.FunctionType, types.MethodType]: - s="spawn_type must be passed a function, not",type(spawn_type),spawn_type - raise Exception,s - - if fd_pipes==None: - fd_pipes={} - fd_pipes[0] = 0 - - for x in collect_fds: - fd_pipes[x] = pw - keywords["returnpid"]=True - - mypid=spawn_type(mycommand,fd_pipes=fd_pipes,**keywords) - os.close(pw) - if type(mypid) != types.ListType: - os.close(pr) - return [mypid, "%s: No such file or directory" % mycommand.split()[0]] - - fd=os.fdopen(pr,"r") - mydata=fd.readlines() - fd.close() - if emulate_gso: - mydata=string.join(mydata) - if len(mydata) and mydata[-1] == "\n": - mydata=mydata[:-1] - retval=os.waitpid(mypid[0],0)[1] - cleanup(mypid) - if raw_exit_code: - return [retval,mydata] - retval=process_exit_code(retval) - return [retval, mydata] - -def spawn_fakeroot(mycommand, save_file, env={}, opt_name=None,**keywords): - """spawn a fakerooted process, saving/loading from save_file""" - if opt_name == None: - opt_name = "fakeroot %s" % mycommand - myc=[portage_const.FAKEROOT_PATH,"-u","-b","20","-s","%s" % save_file] - if not save_file: - import traceback - traceback.print_stack() - print "save_file=",save_file - print "this is invalid" - sys.exit(1) - - if os.path.exists(save_file): - myc.extend(["-i","%s" % save_file]) - myc.extend(["--"]) - mycl = mycommand.split() - if not os.path.exists(mycl[0]): - mycl[0] = find_binary(mycl[0]) - if mycl[0] == None: - return None - myc.extend(mycl) - return spawn(myc,env=env,opt_name=opt_name,**keywords) - -if os.path.exists(portage_const.FAKEROOT_PATH): - r,s=spawn_get_output((portage_const.FAKEROOT_PATH, "--version"),emulate_gso=False, - fd_pipes={1:1,2:2}) - if r == 0: - if len(s) == 1 and "version 1." in s[0]: - fakeroot_capable = True - else: - print "fakeroot not available, need at least version 1.0" - diff --git a/pym/portage_file.py b/pym/portage_file.py deleted file mode 100644 index 061501d..0000000 --- a/pym/portage_file.py +++ /dev/null @@ -1,119 +0,0 @@ -# portage_file.py -- general fs stuff. I think. -# Copyright 1998-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/pym/portage_file.py,v 1.5 2005/03/07 04:00:30 ferringb Exp $ -cvs_id_string="$Id: portage_file.py,v 1.5 2005/03/07 04:00:30 ferringb Exp $"[5:-2] - -import os -import portage_data -import portage_exception -import orig_dict_cache -from portage_localization import _ - -def normpath(mypath): - newpath = os.path.normpath(mypath) - if len(newpath) > 1: - if newpath[:2] == "//": - newpath = newpath[1:] - return newpath - - -def makedirs(path, perms=0755, uid=None, gid=None, must_chown=False): - old_umask = os.umask(0) - if(uid == None): - uid = portage_data.portage_uid - if(gid == None): - gid = portage_data.portage_gid - if not path: - raise portage_exception.InvalidParameter, _("Invalid path: type: '%(type)s' value: '%(path)s'") % {"path": path, "type": type(path)} - if(perm > 1535) or (perm == 0): - raise portage_exception.InvalidParameter, _("Invalid permissions passed. Value is octal and no higher than 02777.") - - mypath = normpath(path) - dirs = string.split(path, "/") - - mypath = "" - if dirs and dirs[0] == "": - mypath = "/" - dirs = dirs[1:] - for x in dirs: - mypath += x+"/" - if not os.path.exists(mypath): - os.mkdir(mypath, perm) - try: - os.chown(mypath, uid, gid) - except SystemExit, e: - raise - except: - if must_chown: - os.umask(old_umask) - raise - portage_util.writemsg(_("Failed to chown: %(path)s to %(uid)s:%(gid)s\n") % {"path":mypath,"uid":uid,"gid":gid}) - - os.umask(old_umask) - -def listdir(mypath, recursive=False, filesonly=False, ignorecvs=False, ignorelist=[], - followSymlinks=True, cacheObject=None): - - if cacheObject: - cfunc = cacheObject.cacheddir - else: - cfunc = orig_dict_cache.cacheddir - try: - list, ftype = cfunc(mypath) - except SystemExit: - raise - except Exception: - return [] - - if list is None: - list=[] - if ftype is None: - ftype=[] - - if ignorecvs or len(ignorelist): - x=0 - while x < len(list): - #we're working with first level entries, no os.path.basename requirement - if (ignorecvs and (list[x] in ('CVS','.svn') or list[x].startswith(".#"))) and not \ - list[x] in ignorelist: - list.pop(x) - ftype.pop(x) - continue - x += 1 - - if not filesonly and not recursive: - return list - - if recursive: - x=0 - while x<len(ftype): - b=os.path.basename(list[x]) - # if it was cvs, it was filtered already. - if ftype[x] == 1 or (followSymlinks and ftype[x] == 3): - - l,f = cfunc(mypath+"/"+list[x]) - - y=0 - while y < len(l): - # use list comprehension here. - if not (ignorecvs and (l[y] in ('CVS','.svn') or l[y].startswith(".#"))) \ - and not l[y] in ignorelist: - l[y]=list[x]+"/"+l[y] - y += 1 - else: - l.pop(y) - f.pop(y) - - list=list+l - ftype=ftype+f - x+=1 - if filesonly: - rlist=[] - for x in range(0,len(ftype)): - if ftype[x]==0: - rlist=rlist+[list[x]] - else: - rlist=list - - return rlist diff --git a/pym/portage_gpg.py b/pym/portage_gpg.py deleted file mode 100644 index 1deb1a1..0000000 --- a/pym/portage_gpg.py +++ /dev/null @@ -1,155 +0,0 @@ -# portage_gpg.py -- core Portage functionality -# Copyright 2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/pym/portage_gpg.py,v 1.11 2005/02/26 06:35:20 jstubbs Exp $ -cvs_id_string="$Id: portage_gpg.py,v 1.11 2005/02/26 06:35:20 jstubbs Exp $"[5:-2] - -import os -import copy -import types -import portage_exception -import portage_checksum -import portage_exec - -GPG_BINARY = "/usr/bin/gpg" -GPG_OPTIONS = ["--lock-never","--no-random-seed-file", - "--no-greeting", "--no-sig-cache"] -GPG_VERIFY_FLAGS = ["--verify"] - -GPG_KEYDIR = "--homedir" -GPG_KEYRING = "--keyring" - -UNTRUSTED = 0 -EXISTS = UNTRUSTED + 1 -MARGINAL = EXISTS + 1 -TRUSTED = MARGINAL + 1 - -def fileStats(filepath): - mya = [] - for x in os.stat(filepath): - mya.append(x) - mya.append(portage_checksum.perform_checksum(filepath)) - return mya - - -class FileChecker: - def __init__(self,keydir=None,keyring=None,requireSignedRing=False,minimumTrust=EXISTS): - self.minimumTrust = TRUSTED # Default we require trust. For rings. - self.keydir = None - self.keyring = None - self.keyringPath = None - self.keyringStats = None - self.keyringIsTrusted = False - - if (keydir != None): - # Verify that the keydir is valid. - if type(keydir) != types.StringType: - raise portage_exception.InvalidDataType, "keydir argument: %s" % keydir - if not os.path.isdir(keydir): - raise portage_exception.DirectoryNotFound, "keydir: %s" % keydir - self.keydir = copy.deepcopy(keydir) - - if (keyring != None): - # Verify that the keyring is a valid filename and exists. - if type(keyring) != types.StringType: - raise portage_exception.InvalidDataType, "keyring argument: %s" % keyring - if keyring.find("/") != -1: - raise portage_exception.InvalidData, "keyring: %s" % keyring - pathname = "" - if keydir: - pathname = keydir + "/" + keyring - if not os.path.isfile(pathname): - raise portage_exception.FileNotFound, "keyring missing: %s (dev.gentoo.org/~carpaski/gpg/)" % pathname - - keyringPath = keydir+"/"+keyring - - if not keyring or not keyringPath and requireSignedRing: - raise portage_exception.MissingParameter - - self.keyringStats = fileStats(keyringPath) - self.minimumTrust = TRUSTED - if not self.verify(keyringPath, keyringPath+".asc"): - self.keyringIsTrusted = False - if requireSignedRing: - raise portage_exception.InvalidSignature, "Required keyring verification: "+keyringPath - else: - self.keyringIsTrusted = True - - self.keyring = copy.deepcopy(keyring) - self.keyringPath = self.keydir+"/"+self.keyring - self.minimumTrust = minimumTrust - - def _verifyKeyring(self): - if self.keyringStats and self.keyringPath: - new_stats = fileStats(self.keyringPath) - if new_stats != self.keyringStats: - raise portage_exception.SecurityViolation, "GPG keyring changed!" - - def verify(self, filename, sigfile=None): - """Uses minimumTrust to determine if it is Valid/True or Invalid/False""" - self._verifyKeyring() - - if not os.path.isfile(filename): - raise portage_exception.FileNotFound, filename - - if sigfile and not os.path.isfile(sigfile): - raise portage_exception.FileNotFound, sigfile - - if self.keydir and not os.path.isdir(self.keydir): - raise portage_exception.DirectoryNotFound, filename - - if self.keyringPath: - if not os.path.isfile(self.keyringPath): - raise portage_exception.FileNotFound, self.keyringPath - - if not os.path.isfile(filename): - raise portage_exception.CommandNotFound, filename - - command = [GPG_BINARY] + GPG_VERIFY_FLAGS + GPG_OPTIONS - if self.keydir: - command += [GPG_KEYDIR] + [self.keydir] - if self.keyring: - command += [GPG_KEYRING] + [self.keyring] - - if sigfile: - command += [sigfile] - command += [filename] - - result,output = portage_exec.spawn_get_output(command,raw_exit_code=True,collect_fds=[1,2]) - - signal = result & 0xff - result = (result >> 8) - - if signal: - raise SignalCaught, "Signal: %d" % (signal) - - trustLevel = UNTRUSTED - - if len(output) == 0: - raise portage_exception.UnknownCondition, "GPG generated no output: exited with %d" % (result) - - if result == 0: - trustLevel = TRUSTED - #if output.find("WARNING") != -1: - # trustLevel = MARGINAL - if output.find("BAD") != -1: - raise portage_exception.InvalidSignature, filename - elif result == 1: - trustLevel = EXISTS - if output.find("BAD") != -1: - raise portage_exception.InvalidSignature, filename - elif result == 2: - trustLevel = UNTRUSTED - if output.find("could not be verified") != -1: - raise portage_exception.MissingSignature, filename - if output.find("public key not found") != -1: - if self.keyringIsTrusted: # We trust the ring, but not the key specifically. - trustLevel = MARGINAL - else: - raise portage_exception.InvalidSignature, filename+" (Unknown Signature)" - else: - raise portage_exception.UnknownCondition, "GPG returned unknown result: %d" % (result) - - if trustLevel >= self.minimumTrust: - return True - return False diff --git a/pym/portage_localization.py b/pym/portage_localization.py deleted file mode 100644 index edcd94b..0000000 --- a/pym/portage_localization.py +++ /dev/null @@ -1,22 +0,0 @@ -# portage_localization.py -- Code to manage/help portage localization. -# Copyright 2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/pym/portage_localization.py,v 1.3 2005/02/26 06:35:20 jstubbs Exp $ -cvs_id_string="$Id: portage_localization.py,v 1.3 2005/02/26 06:35:20 jstubbs Exp $"[5:-2] - - -# We define this to make the transition easier for us. -def _(mystr): - return mystr - - -def localization_example(): - # Dict references allow translators to rearrange word order. - print _("You can use this string for translating.") - print _("Strings can be formatted with %(mystr)s like this.") % {"mystr": "VALUES"} - - a_value = "value.of.a" - b_value = 123 - c_value = [1,2,3,4] - print _("A: %(a)s -- B: %(b)s -- C: %(c)s") % {"a":a_value,"b":b_value,"c":c_value} - diff --git a/pym/portage_locks.py b/pym/portage_locks.py deleted file mode 100644 index f96c3ad..0000000 --- a/pym/portage_locks.py +++ /dev/null @@ -1,373 +0,0 @@ -# portage: Lock management code -# Copyright 2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/pym/portage_locks.py,v 1.23 2005/02/26 06:35:20 jstubbs Exp $ -cvs_id_string="$Id: portage_locks.py,v 1.23 2005/02/26 06:35:20 jstubbs Exp $"[5:-2] - -import atexit -import errno -import os -import stat -import string -import time -import types -import portage_exception -import portage_file -import portage_util -import portage_data -from portage_localization import _ - -HARDLINK_FD = -2 - -hardlock_path_list = [] -def clean_my_hardlocks(): - for x in hardlock_path_list: - hardlock_cleanup(x) -def add_hardlock_file_to_cleanup(path): - mypath = portage_file.normpath(path) - if os.path.isfile(mypath): - mypath = os.path.dirname(mypath) - if os.path.isdir(mypath): - hardlock_path_list = mypath[:] - -atexit.register(clean_my_hardlocks) - -def lockdir(mydir): - return lockfile(mydir,wantnewlockfile=1) -def unlockdir(mylock): - return unlockfile(mylock) - -def lockfile(mypath,wantnewlockfile=0,unlinkfile=0,verbosity=0): - """Creates all dirs upto, the given dir. Creates a lockfile - for the given directory as the file: directoryname+'.portage_lockfile'.""" - import fcntl - - if not mypath: - raise portage_exception.InvalidData, "Empty path given" - - if type(mypath) == types.StringType and mypath[-1] == '/': - mypath = mypath[:-1] - - if type(mypath) == types.FileType: - mypath = mypath.fileno() - if type(mypath) == types.IntType: - lockfilename = mypath - wantnewlockfile = 0 - unlinkfile = 0 - elif wantnewlockfile: - lockfilename = mypath+".portage_lockfile" - unlinkfile = 1 - else: - lockfilename = mypath - - if type(mypath) == types.StringType: - if not os.path.exists(os.path.dirname(mypath)): - raise portage_exception.DirectoryNotFound, os.path.dirname(mypath) - if not os.path.exists(lockfilename): - old_mask=os.umask(000) - myfd = os.open(lockfilename, os.O_CREAT|os.O_RDWR,0660) - try: - if os.stat(lockfilename).st_gid != portage_data.portage_gid: - os.chown(lockfilename,os.getuid(),portage_data.portage_gid) - except SystemExit, e: - raise - except OSError, e: - if e[0] == 2: #XXX: No such file or directory - return lockfile(mypath,wantnewlockfile,unlinkfile) - else: - portage_util.writemsg("Cannot chown a lockfile. This could cause inconvenience later.\n",verbosity) - os.umask(old_mask) - else: - myfd = os.open(lockfilename, os.O_CREAT|os.O_RDWR,0660) - - elif type(mypath) == types.IntType: - myfd = mypath - - else: - raise ValueError, "Unknown type passed in '%s': '%s'" % (type(mypath),mypath) - - # try for a non-blocking lock, if it's held, throw a message - # we're waiting on lockfile and use a blocking attempt. - locking_method = None - link_success=False - for locking_method in (fcntl.flock, fcntl.lockf): - try: - locking_method(myfd,fcntl.LOCK_EX|fcntl.LOCK_NB) - link_success=True - break - except IOError, e: - if "errno" not in dir(e): - raise - if e.errno == errno.EAGAIN: - # resource temp unavailable; eg, someone beat us to the lock. - if type(mypath) == types.IntType: - portage_util.writemsg("waiting for lock on fd %i\n" % myfd,verbosity) - else: - portage_util.writemsg("waiting for lock on %s\n" % lockfilename,verbosity) - # try for the exclusive lock now. - locking_method(myfd,fcntl.LOCK_EX) - elif e.errno == errno.ENOLCK: - pass - else: - raise - - - if not link_success: - # We're not allowed to lock on this FS. - os.close(myfd) - link_success = False - if lockfilename == str(lockfilename): - if wantnewlockfile: - try: - if os.stat(lockfilename)[stat.ST_NLINK] == 1: - os.unlink(lockfilename) - except Exception, e: - pass - link_success = hardlink_lockfile(lockfilename) - if not link_success: - raise - locking_method = None - myfd = HARDLINK_FD - - - - if type(lockfilename) == types.StringType and not os.path.exists(lockfilename): - # The file was deleted on us... Keep trying to make one... - os.close(myfd) - portage_util.writemsg("lockfile recurse\n",verbosity+1) - lockfilename,myfd,unlinkfile,locking_method,verbosity = lockfile(mypath,wantnewlockfile,unlinkfile,verbosity) - - portage_util.writemsg(str((lockfilename,myfd,unlinkfile))+"\n",verbosity+1) - return (lockfilename,myfd,unlinkfile,locking_method,verbosity) - -def unlockfile(mytuple): - import fcntl - - #XXX: Compatability hack. - if len(mytuple) == 3: - lockfilename,myfd,unlinkfile = mytuple - locking_method = fcntl.flock - verbosity=0 - elif len(mytuple) == 4: - lockfilename,myfd,unlinkfile,locking_method = mytuple - verbosity=0 - elif len(mytuple) == 5: - lockfilename,myfd,unlinkfile,locking_method,verbosity = mytuple - else: - raise - - if(myfd == HARDLINK_FD): - unhardlink_lockfile(lockfilename) - return True - - if type(lockfilename) == types.StringType and not os.path.exists(lockfilename): - portage_util.writemsg("lockfile does not exist '%s'\n" % lockfilename,1) - if (myfd != None) and type(lockfilename) == types.StringType: - os.close(myfd) - return False - - try: - if myfd == None: - myfd = os.open(lockfilename, os.O_WRONLY,0660) - unlinkfile = 1 - locking_method(myfd,fcntl.LOCK_UN) - except SystemExit, e: - raise - except Exception, e: - if type(lockfilename) == types.StringType: - os.close(myfd) - raise IOError, "Failed to unlock file '%s'\n" % lockfilename - - try: - # This sleep call was added to allow other processes that are - # waiting for a lock to be able to grab it before it is deleted. - # lockfile() already accounts for this situation, however, and - # the sleep here adds more time than is saved overall, so am - # commenting until it is proved necessary. - #time.sleep(0.0001) - if unlinkfile: - locking_method(myfd,fcntl.LOCK_EX|fcntl.LOCK_NB) - # We won the lock, so there isn't competition for it. - # We can safely delete the file. - portage_util.writemsg("Got the lockfile...\n",1) - #portage_util.writemsg("Unlinking...\n") - os.unlink(lockfilename) - portage_util.writemsg("Unlinked lockfile...\n",1) - locking_method(myfd,fcntl.LOCK_UN) - except SystemExit, e: - raise - except Exception, e: - # We really don't care... Someone else has the lock. - # So it is their problem now. - portage_util.writemsg("Failed to get lock... someone took it.\n",1) - portage_util.writemsg(str(e)+"\n",1) - - # why test lockfilename? because we may have been handed an - # fd originally, and the caller might not like having their - # open fd closed automatically on them. - if type(lockfilename) == types.StringType: - os.close(myfd) - - return True - - - - -def hardlock_name(path): - return path+".hardlock-"+os.uname()[1]+"-"+str(os.getpid()) - -def hardlink_active(lock): - if not os.path.exists(lock): - return False - # XXXXXXXXXXXXXXXXXXXXXXXXXX - -def hardlink_is_mine(link,lock): - try: - myhls = os.stat(link) - mylfs = os.stat(lock) - except SystemExit, e: - raise - except: - myhls = None - mylfs = None - - if myhls: - if myhls[stat.ST_NLINK] == 2: - return True - if mylfs: - if mylfs[stat.ST_INO] == myhls[stat.ST_INO]: - return True - return False - -def hardlink_lockfile(lockfilename, max_wait=14400): - """Does the NFS, hardlink shuffle to ensure locking on the disk. - We create a PRIVATE lockfile, that is just a placeholder on the disk. - Then we HARDLINK the real lockfile to that private file. - If our file can 2 references, then we have the lock. :) - Otherwise we lather, rise, and repeat. - We default to a 4 hour timeout. - """ - - add_hardlock_file_to_cleanup(lockfilename) - - start_time = time.time() - myhardlock = hardlock_name(lockfilename) - reported_waiting = False - - while(time.time() < (start_time + max_wait)): - # We only need it to exist. - myfd = os.open(myhardlock, os.O_CREAT|os.O_RDWR,0660) - os.close(myfd) - - if not os.path.exists(myhardlock): - raise portage_exception.FileNotFound, _("Created lockfile is missing: %(filename)s") % {"filename":myhardlock} - - try: - res = os.link(myhardlock, lockfilename) - except SystemExit, e: - raise - except Exception, e: - #print "lockfile(): Hardlink: Link failed." - #print "Exception: ",e - pass - - if hardlink_is_mine(myhardlock, lockfilename): - # We have the lock. - if reported_waiting: - print - return True - - if reported_waiting: - portage_util.writemsg(".") - else: - reported_waiting = True - print - print "Waiting on (hardlink) lockfile: (one '.' per 3 seconds)" - print "This is a feature to prevent distfiles corruption." - print "/usr/lib/portage/bin/clean_locks can fix stuck locks." - print "Lockfile: " + lockfilename - time.sleep(0.1) - - os.unlink(myhardlock) - return False - -def unhardlink_lockfile(lockfilename): - myhardlock = hardlock_name(lockfilename) - try: - if os.path.exists(myhardlock): - os.unlink(myhardlock) - if os.path.exists(lockfilename): - os.unlink(lockfilename) - except SystemExit, e: - raise - except: - portage_util.writemsg("Something strange happened to our hardlink locks.\n") - -def hardlock_cleanup(path, remove_all_locks=False): - mypid = str(os.getpid()) - myhost = os.uname()[1] - mydl = os.listdir(path) - - results = [] - mycount = 0 - - mylist = {} - for x in mydl: - if os.path.isfile(path+"/"+x): - parts = string.split(x, ".hardlock-") - if len(parts) == 2: - filename = parts[0] - hostpid = string.split(parts[1],"-") - host = string.join(hostpid[:-1], "-") - pid = hostpid[-1] - - if not mylist.has_key(filename): - mylist[filename] = {} - if not mylist[filename].has_key(host): - mylist[filename][host] = [] - mylist[filename][host].append(pid) - - mycount += 1 - - - results.append("Found %(count)s locks" % {"count":mycount}) - - for x in mylist.keys(): - if mylist[x].has_key(myhost) or remove_all_locks: - mylockname = hardlock_name(path+"/"+x) - if hardlink_is_mine(mylockname, path+"/"+x) or \ - not os.path.exists(path+"/"+x) or \ - remove_all_locks: - for y in mylist[x].keys(): - for z in mylist[x][y]: - filename = path+"/"+x+".hardlock-"+y+"-"+z - if filename == mylockname: - continue - try: - # We're sweeping through, unlinking everyone's locks. - os.unlink(filename) - results.append(_("Unlinked: ") + filename) - except SystemExit, e: - raise - except Exception,e: - pass - try: - os.unlink(path+"/"+x) - results.append(_("Unlinked: ") + path+"/"+x) - os.unlink(mylockname) - results.append(_("Unlinked: ") + mylockname) - except SystemExit, e: - raise - except Exception,e: - pass - else: - try: - os.unlink(mylockname) - results.append(_("Unlinked: ") + mylockname) - except SystemExit, e: - raise - except Exception,e: - pass - - return results - diff --git a/pym/portage_metadata.py b/pym/portage_metadata.py deleted file mode 100644 index e266d63..0000000 --- a/pym/portage_metadata.py +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/python -O -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/pym/portage_metadata.py,v 1.2 2004/11/07 21:34:51 ferringb Exp $ - -from xml.sax import saxutils, make_parser, handler -from xml.sax.handler import feature_namespaces - -class Metadata_XML(handler.ContentHandler): - _inside_herd="No" - _inside_maintainer="No" - _inside_email="No" - _inside_longdescription="No" - - _herds = [] - _maintainers = [] - _longdescription = "" - - def startElement(self, tag, attr): - if tag == "herd": - self._inside_herd="Yes" - if tag == "longdescription": - self._inside_longdescription="Yes" - if tag == "maintainer": - self._inside_maintainer="Yes" - if tag == "email": - self._inside_email="Yes" - - def endElement(self, tag): - if tag == "herd": - self._inside_herd="No" - if tag == "longdescription": - self._inside_longdescription="No" - if tag == "maintainer": - self._inside_maintainer="No" - if tag == "email": - self._inside_email="No" - - def characters(self, contents): - if self._inside_herd == "Yes": - self._herds.append(contents) - - if self._inside_longdescription == "Yes": - self._longdescription = contents - - if self._inside_maintainer=="Yes" and self._inside_email=="Yes": - self._maintainers.append(contents) diff --git a/pym/portage_syntax.py b/pym/portage_syntax.py deleted file mode 100644 index 475d3ad..0000000 --- a/pym/portage_syntax.py +++ /dev/null @@ -1,758 +0,0 @@ -import re - -from copy import * - - -pkg_regexp = re.compile("^[a-zA-Z0-9]([-_+a-zA-Z0-9]*[+a-zA-Z0-9])?$") -ver_regexp = re.compile("^(cvs\\.)?(\\d+)((\\.\\d+)*)([a-z]?)((_(pre|p|beta|alpha|rc)\\d*)*)(-r(\\d+))?$") -suffix_regexp = re.compile("^(alpha|beta|rc|pre|p)(\\d*)$") -suffix_value = {"pre": -2, "p": 0, "alpha": -4, "beta": -3, "rc": -1} - -class CPV(object): - - """ - Attributes - - str category - str package - str key (cat/pkg) - str version - int revision - - Methods - - int __hash__() - str __repr__() - int __cmp__(CPV) - """ - - def __init__(self, cpvstr): - if not isinstance(cpvstr, str): - raise ValueError(cpvstr) - self.__dict__["cpvstr"] = cpvstr - self.__dict__["hash"] = hash(cpvstr) - - def __hash__(self): - return self.hash - - def __repr__(self): - return self.cpvstr - - def __setattr__(self, name, value): - raise Exception() - - def __getattr__(self, name): - - if name == "category": - myparts = self.cpvstr.split("/") - if len(myparts) >= 2: - if not pkg_regexp.match(myparts[0]): - raise ValueError(self.cpvstr) - self.__dict__["category"] = myparts[0] - else: - self.__dict__["category"] = None - return self.category - - if name == "package": - if self.category: - myparts = self.cpvstr[len(self.category)+1:].split("-") - else: - myparts = self.cpvstr.split("-") - if ver_regexp.match(myparts[0]): - raise ValueError(self.cpvstr) - pos = 1 - while pos < len(myparts) and not ver_regexp.match(myparts[pos]): - pos += 1 - pkgname = "-".join(myparts[:pos]) - if not pkg_regexp.match(pkgname): - raise ValueError(self.cpvstr) - self.__dict__["package"] = pkgname - return self.package - - if name == "key": - if self.category: - self.__dict__["key"] = self.category +"/"+ self.package - else: - self.__dict__["key"] = self.package - return self.key - - if name == "version" or name == "revision": - if self.category: - myparts = self.cpvstr[len(self.category+self.package)+2:].split("-") - else: - myparts = self.cpvstr[len(self.package)+1:].split("-") - - if not myparts[0]: - self.__dict__["version"] = None - self.__dict__["revision"] = None - - else: - if myparts[-1][0] == "r" and myparts[-1][1:].isdigit(): - self.__dict__["revision"] = int(myparts[-1][1:]) - myparts = myparts[:-1] - else: - self.__dict__["revision"] = 0 - - for x in myparts: - if not ver_regexp.match(x): - raise ValueError(self.mycpv) - - self.__dict__["version"] = "-".join(myparts) - - if name == "version": - return self.version - else: - return self.revision - - raise AttributeError(name) - - def __cmp__(self, other): - - if self.cpvstr == other.cpvstr: - return 0 - - if self.category and other.category and self.category != other.category: - return cmp(self.category, other.category) - - if self.package and other.package and self.package != other.package: - return cmp(self.package, other.package) - - if self.version != other.version: - - if self.version is None: - raise ValueError(self) - - if other.version is None: - raise ValueError(other) - - match1 = ver_regexp.match(self.version) - match2 = ver_regexp.match(other.version) - - # shortcut for cvs ebuilds (new style) - if match1.group(1) and not match2.group(1): - return 1 - elif match2.group(1) and not match1.group(1): - return -1 - - # building lists of the version parts before the suffix - # first part is simple - list1 = [int(match1.group(2))] - list2 = [int(match2.group(2))] - - # this part would greatly benefit from a fixed-length version pattern - if len(match1.group(3)) or len(match2.group(3)): - vlist1 = match1.group(3)[1:].split(".") - vlist2 = match2.group(3)[1:].split(".") - for i in range(0, max(len(vlist1), len(vlist2))): - if len(vlist1) <= i or len(vlist1[i]) == 0: - list1.append(0) - list2.append(int(vlist2[i])) - elif len(vlist2) <= i or len(vlist2[i]) == 0: - list1.append(int(vlist1[i])) - list2.append(0) - # Let's make life easy and use integers unless we're forced to use floats - elif (vlist1[i][0] != "0" and vlist2[i][0] != "0"): - list1.append(int(vlist1[i])) - list2.append(int(vlist2[i])) - # now we have to use floats so 1.02 compares correctly against 1.1 - else: - list1.append(float("0."+vlist1[i])) - list2.append(float("0."+vlist2[i])) - - # and now the final letter - if len(match1.group(5)): - list1.append(ord(match1.group(5))) - if len(match2.group(5)): - list2.append(ord(match2.group(5))) - - for i in range(0, max(len(list1), len(list2))): - if len(list1) <= i: - return -1 - elif len(list2) <= i: - return 1 - elif list1[i] != list2[i]: - return list1[i] - list2[i] - - # main version is equal, so now compare the _suffix part - list1 = match1.group(6).split("_")[1:] - list2 = match2.group(6).split("_")[1:] - - for i in range(0, max(len(list1), len(list2))): - if len(list1) <= i: - s1 = ("p","0") - else: - s1 = suffix_regexp.match(list1[i]).groups() - if len(list2) <= i: - s2 = ("p","0") - else: - s2 = suffix_regexp.match(list2[i]).groups() - if s1[0] != s2[0]: - return suffix_value[s1[0]] - suffix_value[s2[0]] - if s1[1] != s2[1]: - # it's possible that the s(1|2)[1] == '' - # in such a case, fudge it. - try: r1 = int(s1[1]) - except ValueError: r1 = 0 - try: r2 = int(s2[1]) - except ValueError: r2 = 0 - return r1 - r2 - - return cmp(self.revision, other.revision) - - -class Atom(object): - - """ - Attributes - - bool blocks - str operator - bool glob_match - CPV cpv - - Methods - int __hash__() - str __str__() - str __repr__() - bool match(CPV) - """ - - def __init__(self, atomstr): - if not isinstance(atomstr, str): - raise ValueError(atomstr) - self.__dict__["atomstr"] = atomstr - self.__dict__["hash"] = hash(atomstr) - - def __hash__(self): - return self.hash - - def __str__(self): - return self.atomstr - - def __repr__(self): - return "Atom('" + self.atomstr + "')" - - def __setattr__(self, name, value): - raise Exception() - - def __eq__(self, other): - if isinstance(other, Atom): - return hash(self) == other.hash - return False - - def __copy__(self): - return self - - def __getattr__(self, name): - - if "operator" not in self.__dict__: - - myatom = self.atomstr - - if myatom[0] == "!": - self.__dict__["blocks"] = True - myatom = myatom[1:] - else: - self.__dict__["blocks"] = False - - if myatom[0:2] in ["<=", ">="]: - self.__dict__["operator"] = myatom[0:2] - myatom = myatom[2:] - elif myatom[0] in ["<", ">", "=", "~"]: - self.__dict__["operator"] = myatom[0] - myatom = myatom[1:] - else: - self.__dict__["operator"] = None - - if myatom[-1] == "*": - self.__dict__["glob_match"] = True - myatom = myatom[:-1] - else: - self.__dict__["glob_match"] = False - - self.__dict__["cpv"] = CPV(myatom) - - if self.operator != "=" and self.glob_match: - raise ValueError(self.atomstr) - - if self.operator and not self.cpv.version: - raise ValueError(self.atomstr) - - if not self.operator and self.cpv.version: - raise ValueError(self.atomstr) - - if self.operator == "~" and self.cpv.revision: - raise ValueError(self.atomstr) - - if self.glob_match and self.cpv.revision: - raise ValueError(self.atomstr) - - if not self.__dict__.has_key(name): - return self.cpv.__getattr__(name) - - return self.__dict__[name] - - def match(self, cpv): - - if self.cpv.category and cpv.category and self.cpv.category != cpv.category: - return False - - if self.cpv.package and cpv.package and self.cpv.package != cpv.package: - return False - - if not self.operator: - return True - - if self.operator == "=": - if self.glob_match and cpv.version.startswith(self.cpv.version): - return True - if self.cpv.version != cpv.version: - return False - if self.cpv.revision != cpv.revision: - return False - return True - - if self.operator == "~" and self.cpv.version == cpv.version: - return True - - diff = cmp(self.cpv, cpv) - - if not diff: - if self.operator == "<=" or self.operator == ">=": - return True - else: - return False - - if diff > 0: - if self.operator[0] == "<": - return True - else: - return False - - #if diff < 0: - if self.operator[0] == ">": - return True - #else: - return False - - def with_key(self, key): - return Atom(self.atomstr.replace(self.cpv.key, key)) - - def intersects(self, atom): - if self == atom: - return True - if self.cpv.key != atom.cpv.key: - return False - if self.blocks != atom.blocks: - return False - if not self.operator or not atom.operator: - return True - if self.cpv == other.cpv: - if self.operator == atom.operator: - return True - if self.operator == "<": - return (atom.operator[0] == "<") - if self.operator == ">": - return (other.operator[0] == ">" or other.operator == "~") - if self.operator == "=": - return (other.operator != "<" and other.operator != ">") - if self.operator == "~" or self.operator == ">=": - return (other.operator != "<") - return (other.operator != ">") - elif self.cpv.version == other.cpv.version: - if self.cpv > other.cpv: - if self.operator == "=" and other.operator == "~": - return True - elif self.operator == "~" and other.operator == "=": - return True - if self.operator in ["=","~"] and other.operator in ["=","~"]: - return False - if self.cpv > other.cpv: - if self.operator in ["<","<="]: - return True - if other.operator in [">",">="]: - return True - return False - if self.operator in [">",">="]: - return True - if other.operator in ["<","<="]: - return True - return False - - def encapsulates(self, atom): - if not self.intersects(atom): - return False - - if self.operator and not atom.operator: - return False - if not self.operator: - return True - - if self.cpv == atom.cpv: - if self.operator == other.operator: - return True - if other.operator == "=": - return True - if self.operator == "<=" and other.operator == "<": - return True - if self.operator == ">=" and other.operator == ">": - return True - return False - elif self.cpv.version == other.cpv.version: - if self.cpv < other.cpv and self.operator == "~": - return true - if self.cpv > other.cpv: - if self.operator in ["<","<="] and other.operator not in [">",">="]: - return True - return False - if self.operator in [">",">="] and other.operator not in ["<","<="]: - return True - return False - - - - - -class UseCondition(object): - - _use_regex = re.compile("^!?[\\w-]+\?$") - - def can_parse(cls, condition_str): - return (cls._use_regex.match(condition_str) is not None) - can_parse = classmethod(can_parse) - - def __init__(self, condition_str): - condition_str = condition_str[:-1] - self.__dict__["_hash"] = hash(condition_str) - self.__dict__["negated"] = (condition_str[0] == "!") - if self.negated: - self.__dict__["flag"] = condition_str[1:] - else: - self.__dict__["flag"] = condition_str - - def __setattr__(self, name, value): - raise TypeError("UseCondition has only read-only attributes (assign to "+name+")") - - def __hash__(self): - return self._hash - - def __eq__(self, other): - return (isinstance(other, UseCondition) and self._hash == other._hash) - - def __copy__(self): - return self - - def conflicts_with(self, other): - return (self.flag == other.flag and self.negated != other.negated) - - -class ParseError(Exception): - pass - - -class DependSpec(object): - - def __init__(self, dependstr="", element_class=str): - dependstr = " ( ".join(dependstr.split("(")) - dependstr = " ) ".join(dependstr.split(")")) - dependstr = " ".join(dependstr.split()) - self.__dict__["_origstr"] = dependstr - self.__dict__["_str"] = None - self.__dict__["_element_class"] = element_class - self.__dict__["_needs_brackets"] = True - self.__dict__["_specials"] = [] - self.__dict__["condition"] = None - - def __copy__(self): - dependspec = self.__class__() - dependspec.__dict__["_element_class"] = self._element_class - dependspec.__dict__["_specials"] = self._specials[:] - dependspec.__dict__["condition"] = copy(self.condition) - dependspec.__dict__["_needs_brackets"] = self._needs_brackets - self._parsed - dependspec.__dict__["_elements"] = self._elements[:] - dependspec.__dict__["_parsed"] = True - return dependspec - - def __setattr__(self, name, value): - raise TypeError("DependSpec has only read-only attributes (assign to "+name+")") - - def __str__(self): - if self._str is not None: - return self._str - self._parsed - mystr = [] - for element in self._elements: - x = str(element) - if x: - if isinstance(element, DependSpec) and element._needs_brackets: - x = "( "+x+" )" - mystr.append(x) - mystr = " ".join(mystr) - if self.condition: - mystr = str(self.condition)+" ( "+mystr+" )" - self.__dict__["_str"] = mystr - return mystr - - def _needs_brackets(self): - return True - - def __hash__(self): - return hash(str(self)) - - def __eq__(self, other): - return (isinstance(other, DependSpec) and str(self) == str(other)) - - def __getattr__(self, name): - if "_parsed" not in self.__dict__: - self._parse() - return self.__dict__[name] - - def __getitem__(self, idx): - self._parsed - return self._elements[idx] - - def __len__(self): - self._parsed - return len(self._elements) - - def _parse(self): - dependstr = self._origstr - if dependstr.count("(") != dependstr.count(")"): - raise ParseError(dependstr) - self.__dict__["_elements"] = [] - specials_found = [] - condition = None - strlen = len(dependstr) - pos = 0 - while pos != strlen: - if dependstr[pos] == " ": - pos += 1 - continue - if dependstr[pos] == ")": - raise ParseError(dependstr) - if dependstr[pos] == "(": - pos += 1 - bracket_count = 1 - nextpos = pos - while bracket_count: - nextpos_d = {} - nextpos_d[dependstr.find("(", nextpos)] = True - nextpos_d[dependstr.find(")", nextpos)] = True - if -1 in nextpos_d: - del nextpos_d[-1] - nextpos = min(nextpos_d.keys()) - if dependstr[nextpos] == "(": - bracket_count += 1 - else: - bracket_count -= 1 - nextpos += 1 - element = self.__class__(dependstr[pos:nextpos-1]) - element.__dict__["_element_class"] = self._element_class - if condition: - element.__dict__["condition"] = condition - condition = None - pos = nextpos - self._elements.append(element) - continue - nextpos_d = {strlen:True} - nextpos_d[dependstr.find(" ", pos)] = True - nextpos_d[dependstr.find("(", pos)] = True - nextpos_d[dependstr.find(")", pos)] = True - if -1 in nextpos_d: - del nextpos_d[-1] - nextpos = min(nextpos_d.keys()) - element = dependstr[pos:nextpos] - if element in self._specials: - specials_found += [(element, len(self._elements))] - elif UseCondition.can_parse(element): - if condition: - raise ParseError(dependstr) - condition = UseCondition(element) - else: - if condition: - raise ParseError(dependstr) - self._elements.append(self._element_class(element)) - pos = nextpos - if condition: - raise ParseError(dependstr) - for special in specials_found: - if special[1] == len(self._elements): - raise ParseError(dependstr) - try: - self._do_special(special[0], special[1]) - except ParseError: - raise ParseError(dependstr) - self.__dict__["_parsed"] = True - - def all_conditions(self): - cond_d = {} - if self.condition: - cond_d[self.condition] = True - yield self.condition - - self._parsed - for element in self._elements: - if isinstance(element, DependSpec): - for cond in element.all_conditions(): - if cond not in cond_d: - cond_d[cond] = True - yield cond - - def with_only_conditions(self, conditions): - if self.condition and self.condition not in conditions: - return self.__class__() - self._parsed - dependspec = copy(self) - dependspec.__dict__["condition"] = None - for idx in range(len(dependspec._elements)): - if isinstance(dependspec._elements[idx], DependSpec): - dependspec._elements[idx] = dependspec._elements[idx].with_only_conditions(conditions) - return dependspec - - def _can_combine_with(self, other): - return self.condition == other.condition - - def compacted(self): - elements = [] - element_d = {} - self._parsed - for element in self._elements: - if element in element_d: - continue - if isinstance(element, DependSpec): - element = element.compacted() - if not len(element._elements): - continue - if self._can_combine_with(element): - for element in element._elements: - if element in element_d: - continue - elements.append(element) - element_d[element] = True - else: - elements.append(element) - element_d[element] = True - else: - elements.append(element) - element_d[element] = True - if not elements: - return self.__class__() - dependspec = copy(self) - dependspec.__dict__["_elements"] = elements - return dependspec - - -class AtomDependSpec(DependSpec): - - def create_from(atoms, preferential=False): - dependstr = [] - for atom in atoms: - dependstr.append(str(atom)) - dependstr = " ".join(dependstr) - if preferential: - dependstr = "|| ( "+dependstr+" )" - return AtomDependSpec(dependstr) - create_from = staticmethod(create_from) - - def __init__(self, dependstr=""): - super(self.__class__, self).__init__(dependstr, element_class=Atom) - self.__dict__["preferential"] = False - self.__dict__["_specials"] = ["||"] - - def __copy__(self): - atomdependspec = super(self.__class__, self).__copy__() - atomdependspec.__dict__["preferential"] = self.preferential - return atomdependspec - - def __str__(self): - if self._str is not None: - return self._str - mystr = super(self.__class__, self).__str__() - if self.preferential: - mystr = "|| ( "+mystr+" )" - self.__dict__["_str"] = mystr - return mystr - - def _do_special(self, special, idx): - if not isinstance(self._elements[idx], AtomDependSpec) or self._elements[idx].preferential: - raise ParseError() - self._elements[idx].__dict__["preferential"] = True - self._elements[idx].__dict__["_needs_brackets"] = False - - def _can_combine_with(self, other): - if self.preferential != other.preferential: - return False - return super(self.__class__, self)._can_combine_with(other) - - def compacted(self): - atomdependspec = super(self.__class__, self).compacted() - if atomdependspec.preferential and len(atomdependspec._elements) <= 1: - atomdependspec.__dict__["preferential"] = False - atomdependspec.__dict__["_needs_brackets"] = True - atomdependspec = atomdependspec.compacted() - return atomdependspec - - def with_keys_transformed(self, key_map): - atomdependspec = copy(self) - atomdependspec._parsed - for x in range(len(atomdependspec._elements)): - if isinstance(atomdependspec._elements[x], AtomDependSpec): - atomdependspec._elements[x] = atomdependspec._elements[x].with_keys_transformed() - elif atomdependspec._elements[x].key in key_map: - elements = [] - for newkey in key_map[atomdependspec._elements[x].key]: - elements.append(atomdependspec._elements[x].with_key(newkey)) - atomdependspec._elements[x] = AtomDependSpec.create_from(elements, preferential=True) - atomdependspec.__dict__["_str"] = None - return atomdependspec - - def combinations(self): - if not self._elements: - return [] - - if self.condition: - raise NotImplementedError() - - combinations = [] - - if self.preferential: - for element in self._elements: - if isinstance(element, AtomDependSpec): - combinations += element.combinations() - else: - combinations += [[element]] - else: - singles = [] - others = [] - for element in self._elements: - if isinstance(element, AtomDependSpec): - others += [element.combinations()] - else: - singles += [element] - if others: - indexes = [] - endindex = len(others) - for x in range(endindex): - indexes.append(0) - index = 0 - while index != endindex: - if indexes[index] >= len(others[index]): - index += 1 - if index == endindex: - continue - for x in range(index): - indexes[x] = 0 - indexes[index] += 1 - continue - else: - index = 0 - newcomb = singles[:] - for x in range(endindex): - if others[x]: - newcomb.extend(others[x][indexes[x]]) - combinations.append(newcomb) - indexes[index] += 1 - else: - combinations = [singles] - return combinations diff --git a/pym/portage_util.py b/pym/portage_util.py deleted file mode 100644 index 89114f0..0000000 --- a/pym/portage_util.py +++ /dev/null @@ -1,647 +0,0 @@ -# Copyright 2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/pym/portage_util.py,v 1.22 2005/06/11 09:20:36 ferringb Exp $ -cvs_id_string="$Id: portage_util.py,v 1.22 2005/06/11 09:20:36 ferringb Exp $"[5:-2] - -import sys,string,shlex,os.path,stat,types -import shutil - -try: - #XXX: This should get renamed to bsd_chflags, I think. - import chflags - bsd_chflags = chflags -except SystemExit, e: - raise -except: - # XXX: This should get renamed to bsd_chflags, I think. - bsd_chflags = None - -noiselimit = 0 -def writemsg(mystr,noiselevel=0): - """Prints out warning and debug messages based on the noiselimit setting""" - global noiselimit - if noiselevel <= noiselimit: - sys.stderr.write(mystr) - sys.stderr.flush() - -def grabfile(myfilename, compat_level=0): - """This function grabs the lines in a file, normalizes whitespace and returns lines in a list; if a line - begins with a #, it is ignored, as are empty lines""" - - try: - myfile=open(myfilename,"r") - except IOError: - return [] - mylines=myfile.readlines() - myfile.close() - newlines=[] - for x in mylines: - #the split/join thing removes leading and trailing whitespace, and converts any whitespace in the line - #into single spaces. - myline=string.join(string.split(x)) - if not len(myline): - continue - if myline[0]=="#": - # Check if we have a compat-level string. BC-integration data. - # '##COMPAT==>N<==' 'some string attached to it' - mylinetest = string.split(myline, "<==", 1) - if len(mylinetest) == 2: - myline_potential = mylinetest[1] - mylinetest = string.split(mylinetest[0],"##COMPAT==>") - if len(mylinetest) == 2: - if compat_level >= int(mylinetest[1]): - # It's a compat line, and the key matches. - newlines.append(myline_potential) - continue - else: - continue - newlines.append(myline) - return newlines - -def stack_dictlist(original_dicts, incremental=0, incrementals=[], ignore_none=0): - """Stacks an array of dict-types into one array. Optionally merging or - overwriting matching key/value pairs for the dict[key]->list. - Returns a single dict. Higher index in lists is preferenced.""" - final_dict = None - kill_list = {} - for mydict in original_dicts: - if mydict == None: - continue - if final_dict == None: - final_dict = {} - for y in mydict.keys(): - if not final_dict.has_key(y): - final_dict[y] = [] - if not kill_list.has_key(y): - kill_list[y] = [] - - mydict[y].reverse() - for thing in mydict[y]: - if thing and (thing not in kill_list[y]) and ("*" not in kill_list[y]): - if (incremental or (y in incrementals)) and thing[0] == '-': - if thing[1:] not in kill_list[y]: - kill_list[y] += [thing[1:]] - else: - if thing not in final_dict[y]: - final_dict[y].append(thing[:]) - mydict[y].reverse() - if final_dict.has_key(y) and not final_dict[y]: - del final_dict[y] - return final_dict - -def stack_dicts(dicts, incremental=0, incrementals=[], ignore_none=0): - """Stacks an array of dict-types into one array. Optionally merging or - overwriting matching key/value pairs for the dict[key]->string. - Returns a single dict.""" - final_dict = None - for mydict in dicts: - if mydict == None: - if ignore_none: - continue - else: - return None - if final_dict == None: - final_dict = {} - for y in mydict.keys(): - if mydict[y]: - if final_dict.has_key(y) and (incremental or (y in incrementals)): - final_dict[y] += " "+mydict[y][:] - else: - final_dict[y] = mydict[y][:] - mydict[y] = string.join(mydict[y].split()) # Remove extra spaces. - return final_dict - -def stack_lists(lists, incremental=1): - """Stacks an array of list-types into one array. Optionally removing - distinct values using '-value' notation. Higher index is preferenced.""" - new_list = [] - for x in lists: - for y in x: - if y: - if incremental and y[0]=='-': - while y[1:] in new_list: - del new_list[new_list.index(y[1:])] - else: - if y not in new_list: - new_list.append(y[:]) - return new_list - -def grab_multiple(basename, locations, handler, all_must_exist=0): - mylist = [] - for x in locations: - mylist.append(handler(x+"/"+basename)) - return mylist - -def grabdict(myfilename,juststrings=0,empty=0): - """This function grabs the lines in a file, normalizes whitespace and returns lines in a dictionary""" - newdict={} - try: - myfile=open(myfilename,"r") - except IOError,e: - return newdict - mylines=myfile.readlines() - myfile.close() - for x in mylines: - #the split/join thing removes leading and trailing whitespace, and converts any whitespace in the line - #into single spaces. - if x[0] == "#": - continue - myline = x.split() - if len(myline)<2 and empty==0: - continue - if len(myline)<1 and empty==1: - continue - if juststrings: - newdict[myline[0]]=" ".join( myline[1:] ) - else: - newdict[myline[0]]=myline[1:] - return newdict - -def grabdict_package(myfilename,juststrings=0): - from portage_dep import isvalidatom - pkgs=grabdict(myfilename, juststrings, empty=1) - for x in pkgs.keys(): - if not isvalidatom(x): - del(pkgs[x]) - writemsg("--- Invalid atom in %s: %s\n" % (myfilename, x)) - return pkgs - -def grabfile_package(myfilename,compatlevel=0): - from portage_dep import isvalidatom - pkgs=grabfile(myfilename,compatlevel) - for x in range(len(pkgs)-1,-1,-1): - pkg = pkgs[x] - if pkg[0] == "-": - pkg = pkg[1:] - if pkg[0] == "*": # Kill this so we can deal the "packages" file too - pkg = pkg[1:] - if not isvalidatom(pkg): #XXX: isvalidatom is not available from this context - writemsg("--- Invalid atom in %s: %s\n" % (myfilename, pkgs[x])) - del(pkgs[x]) - return pkgs - -def grabints(myfilename): - newdict={} - try: - myfile=open(myfilename,"r") - except IOError: - return newdict - mylines=myfile.readlines() - myfile.close() - for x in mylines: - #the split/join thing removes leading and trailing whitespace, and converts any whitespace in the line - #into single spaces. - myline=x.split() - if len(myline)!=2: - continue - newdict[myline[0]]=int(myline[1]) - return newdict - -def writeints(mydict,myfilename): - try: - myfile=open(myfilename,"w") - except IOError: - return 0 - for x in mydict.keys(): - myfile.write(x+" "+`mydict[x]`+"\n") - myfile.close() - return 1 - -def writedict(mydict,myfilename,writekey=1): - """Writes out a dict to a file; writekey=0 mode doesn't write out - the key and assumes all values are strings, not lists.""" - try: - myfile=open(myfilename,"w") - except IOError: - writemsg("Failed to open file for writedict(): "+str(myfilename)+"\n") - return 0 - if not writekey: - for x in mydict.values(): - myfile.write(x+"\n") - else: - for x in mydict.keys(): - myfile.write(x+" ") - for y in mydict[x]: - myfile.write(y+" ") - myfile.write("\n") - myfile.close() - return 1 - -def getconfig(mycfg,tolerant=0,allow_sourcing=False): - mykeys={} - try: - f=open(mycfg,'r') - except IOError: - return None - try: - lex=shlex.shlex(f) - lex.wordchars=string.digits+string.letters+"~!@#$%*_\:;?,./-+{}" - lex.quotes="\"'" - if allow_sourcing: - lex.source="source" - while 1: - key=lex.get_token() - if (key==''): - #normal end of file - break; - equ=lex.get_token() - if (equ==''): - #unexpected end of file - #lex.error_leader(self.filename,lex.lineno) - if not tolerant: - writemsg("!!! Unexpected end of config file: variable "+str(key)+"\n") - raise Exception("ParseError: Unexpected EOF: "+str(mycfg)+": on/before line "+str(lex.lineno)) - else: - return mykeys - elif (equ!='='): - #invalid token - #lex.error_leader(self.filename,lex.lineno) - if not tolerant: - writemsg("!!! Invalid token (not \"=\") "+str(equ)+"\n") - raise Exception("ParseError: Invalid token (not '='): "+str(mycfg)+": line "+str(lex.lineno)) - else: - return mykeys - val=lex.get_token() - if (val==''): - #unexpected end of file - #lex.error_leader(self.filename,lex.lineno) - if not tolerant: - writemsg("!!! Unexpected end of config file: variable "+str(key)+"\n") - raise portage_exception.CorruptionError("ParseError: Unexpected EOF: "+str(mycfg)+": line "+str(lex.lineno)) - else: - return mykeys - mykeys[key]=varexpand(val,mykeys) - except SystemExit, e: - raise - except Exception, e: - raise e.__class__, str(e)+" in "+mycfg - return mykeys - -#cache expansions of constant strings -cexpand={} -def varexpand(mystring,mydict={}): - """ - new variable expansion code. Removes quotes, handles \n, etc. - This code is used by the configfile code, as well as others (parser) - This would be a good bunch of code to port to C. - """ - mystring=" "+mystring - if mystring in cexpand: - return cexpand[mystring] - numvars=0 - #in single, double quotes - insing=0 - indoub=0 - pos=1 - newstring=" " - while (pos<len(mystring)): - if (mystring[pos]=="'") and (mystring[pos-1]!="\\"): - if (indoub): - newstring=newstring+"'" - else: - insing=not insing - pos=pos+1 - continue - elif (mystring[pos]=='"') and (mystring[pos-1]!="\\"): - if (insing): - newstring=newstring+'"' - else: - indoub=not indoub - pos=pos+1 - continue - if (not insing): - #expansion time - if (mystring[pos]=="\n"): - #convert newlines to spaces - newstring=newstring+" " - pos=pos+1 - elif (mystring[pos]=="\\"): - #backslash expansion time - if (pos+1>=len(mystring)): - newstring=newstring+mystring[pos] - break - else: - a=mystring[pos+1] - pos=pos+2 - if a=='a': - newstring=newstring+chr(007) - elif a=='b': - newstring=newstring+chr(010) - elif a=='e': - newstring=newstring+chr(033) - elif (a=='f') or (a=='n'): - newstring=newstring+chr(012) - elif a=='r': - newstring=newstring+chr(015) - elif a=='t': - newstring=newstring+chr(011) - elif a=='v': - newstring=newstring+chr(013) - elif a!='\n': - #remove backslash only, as bash does: this takes care of \\ and \' and \" as well - newstring=newstring+mystring[pos-1:pos] - continue - elif (mystring[pos]=="$") and (mystring[pos-1]!="\\"): - pos=pos+1 - if mystring[pos]=="{": - pos=pos+1 - braced=True - else: - braced=False - myvstart=pos - validchars=string.ascii_letters+string.digits+"_" - while mystring[pos] in validchars: - if (pos+1)>=len(mystring): - if braced: - cexpand[mystring]="" - return "" - else: - pos=pos+1 - break - pos=pos+1 - myvarname=mystring[myvstart:pos] - if braced: - if mystring[pos]!="}": - cexpand[mystring]="" - return "" - else: - pos=pos+1 - if len(myvarname)==0: - cexpand[mystring]="" - return "" - numvars=numvars+1 - if mydict.has_key(myvarname): - newstring=newstring+mydict[myvarname] - else: - newstring=newstring+mystring[pos] - pos=pos+1 - else: - newstring=newstring+mystring[pos] - pos=pos+1 - if numvars==0: - cexpand[mystring]=newstring[1:] - return newstring[1:] - -def pickle_write(data,filename,debug=0): - import cPickle,os - try: - myf=open(filename,"w") - cPickle.dump(data,myf,cPickle.HIGHEST_PROTOCOL) - myf.close() - writemsg("Wrote pickle: "+str(filename)+"\n",1) - os.chown(myefn,uid,portage_gid) - os.chmod(myefn,0664) - except SystemExit, e: - raise - except Exception, e: - return 0 - return 1 - -def pickle_read(filename,default=None,debug=0): - import cPickle,os - if not os.access(filename, os.R_OK): - writemsg("pickle_read(): File not readable. '"+filename+"'\n",1) - return default - data = None - try: - myf = open(filename) - mypickle = cPickle.Unpickler(myf) - mypickle.find_global = None - data = mypickle.load() - myf.close() - del mypickle,myf - writemsg("pickle_read(): Loaded pickle. '"+filename+"'\n",1) - except SystemExit, e: - raise - except Exception, e: - writemsg("!!! Failed to load pickle: "+str(e)+"\n",1) - data = default - return data - -class ReadOnlyConfig: - def __init__(self,filename,strict_keys=0): - self.__filename = filename[:] - self.__strict_keys = strict_keys - self.__mydict = {} - self.__dict_was_loaded = False - if os.path.isfile(self.__filename): - self.__mydict = getconfig(self.__filename) - self.__dict_was_loaded = True - - def isLoaded(): - return self.__dict_was_loaded - - def __getitem__(self,key): - if self.__mydict.has_key(key): - return self.__mydict[key][:] - if self.__strict_keys: - raise KeyError("%s not found in config: '%s'" % (key,self.__filename)) - return "" - - def __setitem__(self,key,value): - raise KeyError("This class is not modifiable.") - - def keys(self): - return self.__mydict.keys() - - def has_key(self,key): - return self.__mydict.has_key(key) - -def unique_array(array): - """Takes an array and makes sure each element is unique.""" - newarray = [] - for x in array: - if x not in newarray: - newarray.append(x) - return newarray - -def movefile(src,dest,newmtime=None,sstat=None,mysettings=None): - """moves a file from src to dest, preserving all permissions and attributes; mtime will - be preserved even when moving across filesystems. Returns true on success and false on - failure. Move is atomic.""" - #print "movefile("+str(src)+","+str(dest)+","+str(newmtime)+","+str(sstat)+")" - global lchown - from portage_exec import selinux_capable - if selinux_capable: - import selinux - from portage_data import lchown - try: - if not sstat: - sstat=os.lstat(src) - if bsd_chflags: - sflags=bsd_chflags.lgetflags(src) - if sflags < 0: - # Problem getting flags... - print "!!! Couldn't get flags for "+dest+"\n" - return None - - except SystemExit, e: - raise - except Exception, e: - print "!!! Stating source file failed... movefile()" - print "!!!",e - return None - - destexists=1 - try: - dstat=os.lstat(dest) - except SystemExit, e: - raise - except: - dstat=os.lstat(os.path.dirname(dest)) - destexists=0 - - if bsd_chflags: - # Check that we can actually unset schg etc flags... - # Clear the flags on source and destination; we'll reinstate them after merging - if(destexists): - if bsd_chflags.lchflags(dest, 0) < 0: - print "!!! Couldn't clear flags on file being merged: \n" - # We might have an immutable flag on the parent dir; save and clear. - pflags=bsd_chflags.lgetflags(os.path.dirname(dest)) - bsd_chflags.lchflags(os.path.dirname(dest), 0) - - # Don't bother checking the return value here; if it fails then the next line will catch it. - bsd_chflags.lchflags(src, 0) - - if bsd_chflags.lhasproblems(src)>0 or (destexists and bsd_chflags.lhasproblems(dest)>0) or bsd_chflags.lhasproblems(os.path.dirname(dest))>0: - # This is bad: we can't merge the file with these flags set. - print "!!! Can't merge file "+dest+" because of flags set\n" - return None - - if destexists: - if stat.S_ISLNK(dstat[stat.ST_MODE]): - try: - os.unlink(dest) - destexists=0 - except SystemExit, e: - raise - except Exception, e: - pass - - if stat.S_ISLNK(sstat[stat.ST_MODE]): - try: - target=os.readlink(src) - if mysettings and mysettings["D"]: - if target.find(mysettings["D"])==0: - target=target[len(mysettings["D"]):] - if destexists and not stat.S_ISDIR(dstat[stat.ST_MODE]): - os.unlink(dest) - if selinux_capable: - sid = selinux.get_lsid(src) - selinux.secure_symlink(target,dest,sid) - else: - os.symlink(target,dest) - lchown(dest,sstat[stat.ST_UID],sstat[stat.ST_GID]) - if bsd_chflags: - # Restore the flags we saved before moving - if bsd_chflags.lchflags(dest, sflags) < 0 or bsd_chflags.lchflags(os.path.dirname(dest), pflags) < 0: - writemsg("!!! Couldn't restore flags ("+str(flags)+") on " + dest+":\n") - writemsg("!!! %s\n" % str(e)) - return None - return os.lstat(dest)[stat.ST_MTIME] - except SystemExit, e: - raise - except Exception, e: - print "!!! failed to properly create symlink:" - print "!!!",dest,"->",target - print "!!!",e - return None - - renamefailed=1 - if sstat[stat.ST_DEV]==dstat[stat.ST_DEV] or selinux_capable: - try: - if selinux_capable: - ret=selinux.secure_rename(src,dest) - else: - ret=os.rename(src,dest) - renamefailed=0 - except SystemExit, e: - raise - except Exception, e: - import errno - if e[0]!=errno.EXDEV: - # Some random error. - print "!!! Failed to move",src,"to",dest - print "!!!",e - return None - # Invalid cross-device-link 'bind' mounted or actually Cross-Device - if renamefailed: - didcopy=0 - if stat.S_ISREG(sstat[stat.ST_MODE]): - try: # For safety copy then move it over. - if selinux_capable: - selinux.secure_copy(src,dest+"#new") - selinux.secure_rename(dest+"#new",dest) - else: - shutil.copyfile(src,dest+"#new") - os.rename(dest+"#new",dest) - didcopy=1 - except SystemExit, e: - raise - except Exception, e: - print '!!! copy',src,'->',dest,'failed.' - print "!!!",e - return None - else: - #we don't yet handle special, so we need to fall back to /bin/mv - if selinux_capable: - a=portage_exec.spawn_get_output(MOVE_BINARY+" -c -f '%s' '%s'" % (src,dest)) - else: - a=portage_exec.spawn_get_output(MOVE_BINARY+" -f '%s' '%s'" % (src,dest)) - if a[0]!=0: - print "!!! Failed to move special file:" - print "!!! '"+src+"' to '"+dest+"'" - print "!!!",a - return None # failure - try: - if didcopy: - lchown(dest,sstat[stat.ST_UID],sstat[stat.ST_GID]) - os.chmod(dest, stat.S_IMODE(sstat[stat.ST_MODE])) # Sticky is reset on chown - os.unlink(src) - except SystemExit, e: - os.unlink(src) - except SystemExit, e: - raise - except Exception, e: - print "!!! Failed to chown/chmod/unlink in movefile()" - print "!!!",dest - print "!!!",e - return None - - if newmtime: - os.utime(dest,(newmtime,newmtime)) - else: - os.utime(dest, (sstat[stat.ST_ATIME], sstat[stat.ST_MTIME])) - newmtime=sstat[stat.ST_MTIME] - - if bsd_chflags: - # Restore the flags we saved before moving - if bsd_chflags.lchflags(dest, sflags) < 0 or bsd_chflags.lchflags(os.path.dirname(dest), pflags) < 0: - writemsg("!!! Couldn't restore flags ("+str(sflags)+") on " + dest+":\n") - return None - - return newmtime - -def flatten(mytokens): - """this function now turns a [1,[2,3]] list into - a [1,2,3] list and returns it.""" - newlist=[] - for x in mytokens: - if type(x)==list: - newlist.extend(flatten(x)) - else: - newlist.append(x) - return newlist - - -def abssymlink(symlink): - """ - This reads symlinks, resolving the relative symlinks, and returning the absolute. - """ - mylink=os.readlink(symlink) - if mylink[0] != '/': - mydir=os.path.dirname(symlink) - mylink=mydir+"/"+mylink - return os.path.normpath(mylink) - diff --git a/pym/portage_versions.py b/pym/portage_versions.py deleted file mode 100644 index 5d8f84f..0000000 --- a/pym/portage_versions.py +++ /dev/null @@ -1,221 +0,0 @@ -import re,string - -ver_regexp = re.compile("^(cvs\\.)?(\\d+)((\\.\\d+)*)([a-z]?)((_(pre|p|beta|alpha|rc)\\d*)*)(-r(\\d+))?$") -suffix_regexp = re.compile("^(alpha|beta|rc|pre|p)(\\d*)$") -suffix_value = {"pre": -2, "p": 0, "alpha": -4, "beta": -3, "rc": -1} - -def ververify(myver, silent=1): - if ver_regexp.match(myver): - return 1 - else: - if not silent: - print "!!! syntax error in version: %s" % myver - return 0 - -vercmp_cache = {} -def vercmp(ver1, ver2, silent=1): - if ver1 == ver2: - return 0 - mykey=ver1+":"+ver2 - result = vercmp_cache.get(mykey) - if result is not None: - return result - match1 = ver_regexp.match(ver1) - match2 = ver_regexp.match(ver2) - - # checking that the versions are valid - if not match1 or not match1.groups(): - if not silent: - print "!!! syntax error in version: %s" % ver1 - return None - if not match2 or not match2.groups(): - if not silent: - print "!!! syntax error in version: %s" % ver2 - return None - - # shortcut for cvs ebuilds (new style) - if match1.group(1) and not match2.group(1): - vercmp_cache[mykey] = 1 - return 1 - elif match2.group(1) and not match1.group(1): - vercmp_cache[mykey] = -1 - return -1 - - # building lists of the version parts before the suffix - # first part is simple - list1 = [int(match1.group(2))] - list2 = [int(match2.group(2))] - - # this part would greatly benefit from a fixed-length version pattern - if len(match1.group(3)) or len(match2.group(3)): - vlist1 = match1.group(3)[1:].split(".") - vlist2 = match2.group(3)[1:].split(".") - for i in range(0, max(len(vlist1), len(vlist2))): - if len(vlist1) <= i or len(vlist1[i]) == 0: - list1.append(0) - list2.append(int(vlist2[i])) - elif len(vlist2) <= i or len(vlist2[i]) == 0: - list1.append(int(vlist1[i])) - list2.append(0) - # Let's make life easy and use integers unless we're forced to use floats - elif (vlist1[i][0] != "0" and vlist2[i][0] != "0"): - list1.append(int(vlist1[i])) - list2.append(int(vlist2[i])) - # now we have to use floats so 1.02 compares correctly against 1.1 - else: - list1.append(float("0."+vlist1[i])) - list2.append(float("0."+vlist2[i])) - - # and now the final letter - if len(match1.group(5)): - list1.append(ord(match1.group(5))) - if len(match2.group(5)): - list2.append(ord(match2.group(5))) - - for i in range(0, max(len(list1), len(list2))): - if len(list1) <= i: - vercmp_cache[mykey] = -1 - return -1 - elif len(list2) <= i: - vercmp_cache[mykey] = 1 - return 1 - elif list1[i] != list2[i]: - vercmp_cache[mykey] = list1[i] - list2[i] - return list1[i] - list2[i] - - # main version is equal, so now compare the _suffix part - list1 = match1.group(6).split("_")[1:] - list2 = match2.group(6).split("_")[1:] - - for i in range(0, max(len(list1), len(list2))): - if len(list1) <= i: - s1 = ("p","0") - else: - s1 = suffix_regexp.match(list1[i]).groups() - if len(list2) <= i: - s2 = ("p","0") - else: - s2 = suffix_regexp.match(list2[i]).groups() - if s1[0] != s2[0]: - return suffix_value[s1[0]] - suffix_value[s2[0]] - if s1[1] != s2[1]: - # it's possible that the s(1|2)[1] == '' - # in such a case, fudge it. - try: r1 = int(s1[1]) - except ValueError: r1 = 0 - try: r2 = int(s2[1]) - except ValueError: r2 = 0 - return r1 - r2 - - # the suffix part is equal to, so finally check the revision - if match1.group(10): - r1 = int(match1.group(10)) - else: - r1 = 0 - if match2.group(10): - r2 = int(match2.group(10)) - else: - r2 = 0 - vercmp_cache[mykey] = r1 - r2 - return r1 - r2 - -def pkgcmp(pkg1, pkg2): - if pkg1[0] != pkg2[0]: - return None - mycmp=vercmp(pkg1[1],pkg2[1]) - if mycmp>0: - return 1 - if mycmp<0: - return -1 - r1=float(pkg1[2][1:]) - r2=float(pkg2[2][1:]) - if r1>r2: - return 1 - if r2>r1: - return -1 - return 0 - - -pkgcache={} - -def pkgsplit(mypkg,silent=1): - """ - This function can be used as a package verification function, i.e. - pkgsplit('foo-1.2-1') will return None if foo-1.2-1 isn't a valid - package (with version) name. If it is a valid name, pkgsplit will - return a list containing: [ pkgname, pkgversion(norev), pkgrev ]. - For foo-1.2-1, this list would be [ "foo", "1.2", "1" ]. For - Mesa-3.0, this list would be [ "Mesa", "3.0", "0" ]. - """ - if mypkg in pkgcache: - return pkgcache[mypkg] - myparts=mypkg.split('-') - - if len(myparts)<2: - if not silent: - print "!!! Name error in",mypkg+": missing a version or name part." - pkgcache[mypkg]=None - return None - for x in myparts: - if len(x)==0: - if not silent: - print "!!! Name error in",mypkg+": empty \"-\" part." - pkgcache[mypkg]=None - return None - - #verify rev - revok=0 - myrev=myparts[-1] - if len(myrev) and myrev[0]=="r": - try: - int(myrev[1:]) - revok=1 - except ValueError: - pass - if revok: - verPos = -2 - revision = myparts[-1] - else: - verPos = -1 - revision = "r0" - - if ververify(myparts[verPos]): - if len(myparts)== (-1*verPos): - pkgcache[mypkg]=None - return None - else: - for x in myparts[:verPos]: - if ververify(x): - pkgcache[mypkg]=None - return None - #names can't have versiony looking parts - myval=("-".join(myparts[:verPos]),myparts[verPos],revision) - pkgcache[mypkg]=myval - return myval - else: - pkgcache[mypkg]=None - return None - -catcache={} -def catpkgsplit(mydata,silent=1): - "returns (cat, pkgname, version, rev )" - if mydata in catcache: - return catcache[mydata] - mysplit=mydata.split("/") - p_split=None - if len(mysplit)==1: - retval=("null",) - p_split = pkgsplit(mydata,silent=silent) - elif len(mysplit)==2: - retval=(mysplit[0],) - p_split=pkgsplit(mysplit[1],silent=silent) - if not p_split: - catcache[mydata]=None - return None - retval = retval + p_split - catcache[mydata]=retval - return retval - -def catsplit(mydep): - return mydep.split("/", 1) - diff --git a/pym/portageq.py b/pym/portageq.py deleted file mode 100644 index ad6b721..0000000 --- a/pym/portageq.py +++ /dev/null @@ -1,205 +0,0 @@ -#!/usr/bin/python -O -# Copyright 1999-2003 Gentoo Technologies, Inc. -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/pym/portageq.py,v 1.2 2004/12/05 13:35:59 ferringb Exp $ - -# this is the core portageq functionality, stuck in a module so ebuild_daemon can use it. -# bin/portageq doesn't currently use this, but should for the sake of reduction of code -# duplication. - -import portage,types,string - - -#----------------------------------------------------------------------------- -# -# To add functionality to this tool, add a function below. -# -# The format for functions is: -# -# def function(argv): -# """<list of options for this function> -# <description of the function> -# """ -# <code> -# -# "argv" is an array of the command line parameters provided after the command. -# -# Make sure you document the function in the right format. The documentation -# is used to display help on the function. -# -# You do not need to add the function to any lists, this tool is introspective, -# and will automaticly add a command by the same name as the function! -# - - -def has_version(argv): - """<root> <category/package> - Return code 0 if it's available, 1 otherwise. - """ - if (len(argv) < 2): - print "ERROR: insufficient parameters!" - raise Exception - try: - mylist=portage.db[argv[0]]["vartree"].dbapi.match(argv[1]) - if mylist: - return 0, "" - else: - return 1, "" - except KeyError: - return 1, "" - - -def best_version(argv): - """<root> <category/package> - Returns category/package-version (without .ebuild). - """ - if (len(argv) < 2): - print "ERROR: insufficient parameters!" - raise Exception - try: - mylist=portage.db[argv[0]]["vartree"].dbapi.match(argv[1]) - return 0, portage.best(mylist) - except KeyError: - return 1, "" - - -def mass_best_version(argv): - """<root> [<category/package>]+ - Returns category/package-version (without .ebuild). - """ - if (len(argv) < 2): - print "ERROR: insufficient parameters!" - raise Exception - try: - s='' - for pack in argv[1:]: - mylist=portage.db[argv[0]]["vartree"].dbapi.match(pack) - s += "%s:%s\n" % (pack, portage.best(mylist)) - return 0, s - except KeyError: - return 1, "" - - -def best_visible(argv): - """<root> [<category/package>]+ - Returns category/package-version (without .ebuild). - """ - if (len(argv) < 2): - raise Exception("insufficient parameters") - try: - mylist=portage.db[argv[0]]["porttree"].dbapi.match(argv[1]) - return 0, portage.best(mylist) - except KeyError: - return 1, "" - - -def mass_best_visible(argv): - """<root> [<category/package>]+ - Returns category/package-version (without .ebuild). - """ - if (len(argv) < 2): - print "ERROR: insufficient parameters!" - raise Exception - try: - s='' - for pack in argv[1:]: - mylist=portage.db[argv[0]]["porttree"].dbapi.match(pack) - s += "%s:%s\n" % (pack, portage.best(mylist)) - return 0,s - except KeyError: - return 1, '' - - -def all_best_visible(argv): - """<root> - Returns all best_visible packages (without .ebuild). - """ - if (len(argv) < 1): - print "ERROR: insufficient parameters!" - raise Exception("ERROR: insufficient parameters!") - - #print portage.db[argv[0]]["porttree"].dbapi.cp_all() - s='' - for pkg in portage.db[argv[0]]["porttree"].dbapi.cp_all(): - mybest=portage.best(portage.db[argv[0]]["porttree"].dbapi.match(pkg)) - if mybest: - s += mybest +"\n" - return 0,s - -def match(argv): - """<root> <category/package> - Returns \n seperated list of category/package-version - """ - if (len(argv) < 2): - print "ERROR: insufficient parameters!" - raise Exception - try: - return 0, string.join(portage.db[argv[0]]["vartree"].dbapi.match(argv[1]),"\n") - except KeyError: - return 1,'' - - -def vdb_path(argv): - """ - Returns the path used for the var(installed) package database for the - set environment/configuration options. - """ - return 0, portage.root+portage.VDB_PATH+"\n" - -def gentoo_mirrors(argv): - """ - Returns the mirrors set to use in the portage configuration. - """ - return 0,portage.settings["GENTOO_MIRRORS"]+"\n" - - -def portdir(argv): - """ - Returns the PORTDIR path as defined in the portage configuration. - """ - return 0, portage.settings["PORTDIR"]+"\n" - - -def config_protect(argv): - """ - Returns the CONFIG_PROTECT paths as defined in the portage configuration. - """ - return 0, portage.settings["PORTDIR"]+"\n" - - -def config_protect_mask(argv): - """ - Returns the CONFIG_PROTECT_MASK paths as defined in the portage configuration. - """ - return 0, portage.settings["CONFIG_PROTECT_MASK"]+"\n" - - -def portdir_overlay(argv): - """ - Returns the PORTDIR_OVERLAY path as defined in the portage configuration. - """ - return 0, portage.settings["PORTDIR_OVERLAY"]+"\n" - - -def pkgdir(argv): - """ - Returns the PKGDIR path as defined in the portage configuration. - """ - return 0, portage.settings["PKGDIR"]+"\n" - - -def distdir(argv): - """ - Returns the DISTDIR path as defined in the portage configuration. - """ - return 0, portage.settings["DISTDIR"]+"\n" - - -def envvar(argv): - """<variable> - Returns a specific environment variable as exists prior to ebuild.sh. - Similar to: emerge --verbose --info | egrep '^<variable>=' - """ - return 0, portage.settings[argv[0]]+"\n" - - diff --git a/pym/set_modules/.gitignore b/pym/set_modules/.gitignore deleted file mode 100644 index 52e4e61..0000000 --- a/pym/set_modules/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -*.pyc -*.pyo diff --git a/pym/set_modules/__init__.py b/pym/set_modules/__init__.py deleted file mode 100644 index 921d98e..0000000 --- a/pym/set_modules/__init__.py +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/python - -class BaseSet: - - TARGET_UPDATABLE = 1 - - def __init__(self, name): - pass - - def _sync(self, mode): - # mode == "r": read entry list - # mode == "w": write entry list - # mode == "rw": write and reread entry list - pass - - def addEntry(self, newentry): - if not self.isCapable(self.TARGET_UPDATABLE): - return - self._sync(mode="r") - if not newentry in self._entries: - self._entries.add(newentry) - self._sync(mode="rw") - - def removeEntry(self, entry): - if not self.isCapable(self.TARGET_UPDATABLE): - return - self._sync(mode="r") - if entry in self._entries: - self._entries.remove(entry) - self._sync(mode="rw") - - def getList(self): - self._sync(mode="r") - return self._entries - - def isCapable(self, capability): - return (self.__capabilities & capability) diff --git a/pym/set_modules/mod_filelist.py b/pym/set_modules/mod_filelist.py deleted file mode 100644 index a9bde8b..0000000 --- a/pym/set_modules/mod_filelist.py +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/python - -import sets - -class FileList(sets.BaseSet): - def __init__(self, name, path): - self.__path = path - self._name = name - self._capabilities = sets.BaseSet.TARGET_UPDATABLE - self._entries = [] - - def _sync(self, mode): - # mode == "r": update internal entry list from file - # mode == "w": write internal entry list to file - # mode == "rw": write internal entry list to file and reread it - if mode not in ["r", "w", "rw"]: - return - myfile = open(self.__path, mode) - if mode in ["w", "rw"]: - myfile.writelines([x+'\n' for x in self.__entries]) - if mode == "rw": - # reopening the file to make sure we're in a consistent state - myfile.close() - myfile = open(self.__path, mode) - if mode in ["r", "rw"]: - self._entries = [x[:-1] for x in myfile.readlines()] - myfile.close() diff --git a/pym/set_modules/mod_security.py b/pym/set_modules/mod_security.py deleted file mode 100644 index 5b20a31..0000000 --- a/pym/set_modules/mod_security.py +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/python - -import sets -import sys, os -sys.path.insert(0, "/usr/lib/gentoolkit/pym") -import glsa - -class GLSAList(sets.BaseSet): - def __init__(self, name, glsaconfig): - self.__config = glsaconfig - self._name = name - self._capabilities = 0 - self._entries = [] - - def _sync(self, mode): - if mode != "r": - return - # build glsa lists - completelist = glsa.get_glsa_list(self.__config["GLSA_DIR"], self.__config) - - if os.access(self.__config["CHECKFILE"], os.R_OK): - checklist = [line.strip() for line in open(self.__config["CHECKFILE"], "r").readlines()] - else: - checklist = [] - glsalist = [e for e in completelist if e not in checklist] - for g in glsalist: - myglsa = glsa.Glsa(g, self.__config) - for x in myglsa.getMergeList(): - if not "="+x in self._entries: - self._entries.append("="+x) diff --git a/pym/set_modules/mod_system.py b/pym/set_modules/mod_system.py deleted file mode 100644 index 835a36f..0000000 --- a/pym/set_modules/mod_system.py +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/python - -import sets -import os.path - -class SystemList(sets.BaseSet): - def __init__(self, profilelist): - self.__profiles = profilelist - self._name = "system" - self._capabilities = 0 - self._entries = [] - - def _sync(self, mode): - if mode != "r": - return - for p in self.__profiles: - if os.path.exists(p+"/packages"): - packages = open(p+"/packages", "r").read().split("\n") - else: - continue - for pkg in [x[1:] for x in packages if len(x) > 1 and x[0] == "*"]: - if not pkg in self._entries: - self._entries.append(pkg) - for pkg in [x[2:] for x in packages if len(x) > 2 and x[:2] == "-*"]: - if pkg in self._entries: - self._entries.remove(pkg) diff --git a/pym/sync/.gitignore b/pym/sync/.gitignore deleted file mode 100644 index 52e4e61..0000000 --- a/pym/sync/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -*.pyc -*.pyo diff --git a/pym/sync/__init__.py b/pym/sync/__init__.py deleted file mode 100644 index c8a3ed8..0000000 --- a/pym/sync/__init__.py +++ /dev/null @@ -1,10 +0,0 @@ -# sync/__init__.py; sync module namespace initialization -# Copyright 2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -#$Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/pym/sync/__init__.py,v 1.3 2004/11/07 14:38:39 ferringb Exp $ - -import rsync -import cvs -import snapshot -from parseuri import parseSyncUri - diff --git a/pym/sync/cvs.py b/pym/sync/cvs.py deleted file mode 100644 index 38faf90..0000000 --- a/pym/sync/cvs.py +++ /dev/null @@ -1,95 +0,0 @@ -# cvs.py; provides cvs sync capabilities, encapsulates the necessary cvs binary calls -# Copyright 2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -#$Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/pym/sync/cvs.py,v 1.3 2004/11/07 14:38:39 ferringb Exp $ - -import os,portage_exec,stat -#import sync -import portage_const -import portage_exception - -import sync.syncexceptions -class CVSIOError(sync.syncexceptions.SyncException): - def __init__(self,errmsg,command): - self.errmsg=errmsg - self.command=command - def __str__(self): - return "cvs error: command %s, %s" % (self.command, self.errmsg) - -class CvsHost: - def __init__(self,host_uri,cvs_binary=portage_const.CVS_BIN): - if not os.access(cvs_binary, os.X_OK): - raise portage_exception.CommandNotFound(cvs_binary) - self.__binary=cvs_binary - #parse the bugger. - #new format. - #cvs://[CVS_RSH binary:]user@host:cvs_root:module - #example - #cvs://ssh:ferringb@dev.gentoo.org:/var/cvsroot:gentoo-x86 - #old format - #cvs://user@host:cvsroot - #implicit gentoo-x86 module, and ext w/ ssh. - #here we go. :/ - - if host_uri.count(":") >= 2: - self.__init_new_host_uri(host_uri) - else: - self.__init_deprecated_uri(host_uri) - - def __init_new_host_uri(self,host): - #cvs://ssh:ferringb@dev.gentoo.org:/var/cvsroot:gentoo-x86 - s=host.split(":") - if len(s) == 4: - self.__ext=s.pop(0) - s[0] = ":ext:" + s[0] - else: - self.__ext=None - self.__cvsroot=s[0]+":"+s[1] - self.__cvsmodule=s[2] - - def __init_deprecated_uri(self,host): - self.__ext="ssh" - self.__cvsmodule="gentoo-x86" - self.__cvsroot=host - - def sync(self,local_path,verbosity=1,compress=False): - while local_path[-1] == "/": - local_path = local_path[:-1] - if compress: - c_arg='-z9' - else: - c_arg='' - - env={} - if self.__ext: - env = {"CVS_RSH":self.__ext} - - l=len(self.__cvsmodule) - if not os.path.exists(local_path): - newdir=os.path.basename(local_path) - basedir=local_path[:-len(newdir)] - if os.path.exists(basedir+"/"+self.__cvsmodule): - raise Exception("unable to checkout to %s, module directory %s exists already" % \ - (basedir, self.__cvsmodule)) - elif os.path.exists(basedir+"/CVS"): - raise Exception("unable to checkout to %s, a CVS directory exists w/in already" % basedir) - command="cd '%s' ; %s %s -d %s co -P %s" % \ - (basedir, self.__binary, c_arg, self.__cvsroot, self.__cvsmodule) - - ret=portage_exec.spawn_bash(command,env=env,opt_name="cvs co") - if ret: - raise CVSIOError("failed checkout",command) - if newdir != self.__cvsmodule: - ret = portage_exec.spawn(('mv','%s/%s' % (basedir,self.__cvsmodule),local_path)) - if ret: - raise Exception("failed moving %s/%s to %s" % (basedir,self.__cvsmodule,local_path)) - elif stat.S_ISDIR(os.stat(local_path).st_mode): - - command="cd '%s'; %s %s -d %s up" % (local_path, self.__binary, c_arg,self.__cvsroot) - ret = portage_exec.spawn_bash(command, env=env,opt_name="cvs up") - if ret: - raise CVSIOError("failed updated", command) - else: - raise Exception("%s exists, and is not a directory. rectify please" % local_path) - return True - diff --git a/pym/sync/parseuri.py b/pym/sync/parseuri.py deleted file mode 100644 index 7f82aea..0000000 --- a/pym/sync/parseuri.py +++ /dev/null @@ -1,24 +0,0 @@ -# parseuri.py; parses a SYNC uri, returning protocol/host_uri -# Copyright 2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -#$Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/pym/sync/parseuri.py,v 1.3 2004/11/07 14:38:39 ferringb Exp $ - -import portage_const - -def parseSyncUri(uri): - """parse a SYNC uri, returning a tuple of protocol,host_uri""" - u=uri.lower() - if u.startswith("rsync") or len(u) == 0: - if len(u) <= 5: - return ('rsync',portage_const.RSYNC_HOST) - return ('rsync',u[8:]) - elif u.startswith("cvs://"): - u=u[6:] - return ('cvs',u) - elif u.startswith("snapshot"): - if len(u)==8: - # the caller gets to randomly crapshoot a mirror for it. - return ('snapshot',None) - return ('snapshot',u[9:]) - else: - return (None,None) diff --git a/pym/sync/rsync.py b/pym/sync/rsync.py deleted file mode 100644 index ceecdc4..0000000 --- a/pym/sync/rsync.py +++ /dev/null @@ -1,161 +0,0 @@ -# rsync.py; module providing an abstraction over the rsync binary -# Copyright 2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -#$Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/pym/sync/rsync.py,v 1.3 2004/11/07 14:38:39 ferringb Exp $ - -from portage_const import RSYNC_BIN, RSYNC_HOST -import os, portage_exec -import portage_exception,socket - -import sync.syncexceptions - -class RSyncSyntaxError(sync.syncexceptions.SyncException): - """Exception thrown when generated rsync syntax is invalid""" - def __init__(self,command): - self.command=command - def __str__(self): - return "Invalid rsync syntax: %s" % str(self.command) - -class RsyncHost: - """abstraction over the rsync binary""" - - def __init__(self,host_uri,local_host=False,rsync_binary=RSYNC_BIN): - """self explanatory""" - if not os.access(rsync_binary,os.X_OK): - raise portage_exceptions.CommandNotFound(rsync_binary) - - self.__binary = rsync_binary - self.__host = host_uri - self.__ips = [] - - self.__local = local_host - if self.__local: - self.__host_name='' - self.__remote_path = host_uri - self.__host_uri='' - return - - f=host_uri.split("/",1) - if len(f) == 1: - #deprecated, assume /gentoo-portage - self.__remote_path = "/gentoo-portage" - else: - self.__remote_path = "/"+f[1] - host_uri = f[0] - - f=host_uri.find("@") - if f != -1: - host_uri=host_uri[f+1:] - f=host_uri.find(":") - if f != -1: - host_uri=host_uri[:f] - - self.__host_name = host_uri - - def get_remote_path(self): - return self.__remote_path - - def get_ips(self): - if self.__local: - return None - try: - self.__ips = socket.gethostbyname_ex(self.__host_name)[2] - except socket.error,e: - print "caught exception for %s" % self.__host_name,e - return None - return self.__ips - - def sync(self,settings, local_path,remote_path=None,verbosity=1,excludes=[],compress=True, \ - timeout=180,ip=None,cleanup=True): - """sync up local_path with remote_path on host - settings is a portage.config, at some point hopefully removed and specific options - passed in instead. - verbosity ranges 0-4 - 0 is absolutely quiet, 1 is quiet, 2 is normal, 3 is noisy. - ip is used to control which ip of the host is used. - cleanup controls deletion.""" - - args=[self.__binary, - "--recursive", # Recurse directories - "--links", # Consider symlinks - "--safe-links", # Ignore links outside of tree - "--perms", # Preserve permissions - "--times", # Preserive mod times - "--force", # Force deletion on non-empty dirs - "--whole-file", # Don't do block transfers, only entire files - "--stats", # Show final statistics about what was transfered - "--timeout="+str(timeout), # IO timeout if not done in X seconds - ] - - if cleanup: - args.append("--delete")# # Delete files that aren't in the master tree - args.append("--delete-after") # Delete only after everything else is done - - if compress: - args.append("--compress") - for x in excludes: - args.append("--exclude=%s" % str(x)) - if verbosity >=3: - args.append("--progress") - args.append("--verbose") - elif verbosity == 2: - args.append("--progress") - elif verbosity == 1: - args.append("--quiet") - else: - args.append("--quiet") - args.remove("--stats") - - if verbosity: - fd_pipes={1:1,2:2} - else: - fd_pipes={} - - #why do this if has_key crap? cause portage.config lacks a get function - #this allows dicts to be passed in and used. - if settings.has_key("RSYNC_INCLUDE"): - for x in settings["RSYNC_INCLUDE"].split(): - args.append("--include=%s" % x) - if settings.has_key("RSYNC_INCLUDEFROM"): - for x in settings["RSYNC_INCLUDEFROM"].split(): - args.append("--include-from=%s" % x) - if settings.has_key("RSYNC_EXCLUDE"): - for x in settings["RSYNC_EXCLUDE"].split(): - args.append("--exclude=%s" % x) - if settings.has_key("RSYNC_EXCLUDEFROM"): - for x in settings["RSYNC_EXCLUDEFROM"].split(): - args.append("--exclude-from=%s" % x) - - if settings.has_key("RSYNC_RATELIMIT"): - args.append("--bwlimit=%s" % settings["RSYNC_RATELIMIT"]) - - prefix="rsync://" - if remote_path == None: - if self.__local: - host=self.__remote_path - prefix='' - else: - host=self.__host - else: - if remote_path[0] != "/": - host = self.__host_name + '/' + remote_path - else: - host = self.__host_name + remote_path - - if ip: - args.append("%s%s" % (prefix,host.replace(self.__host_name,ip))) - else: - args.append("%s%s" % (prefix,host)) - args.append(local_path) - - # tie a debug option into this - #print "options are",args - - ret=portage_exec.spawn(args,fd_pipes=fd_pipes) - if ret == 0: - return True - elif ret == 1: - raise RSyncSyntaxError(args) - elif ret == 11: - raise IOError("Rsync returned exit code 11; disk space remaining?") - return ret diff --git a/pym/sync/snapshot.py b/pym/sync/snapshot.py deleted file mode 100644 index 0e74f61..0000000 --- a/pym/sync/snapshot.py +++ /dev/null @@ -1,143 +0,0 @@ -# snapshot.py; provides the capability of fetching a portage tree snapshot, and syncing a tree with it. -# Copyright 2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -#$Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/pym/sync/snapshot.py,v 1.3 2004/11/07 14:38:39 ferringb Exp $ - -import os -import time -import portage_checksum, portage_exec -import shutil -import sync.rsync - -"""snapshot-http://gentoo.chem.wisc.edu/gentoo""" -class SnapshotHost: - def __init__(self,host_uri,snapshots_dir,tmp_dir,fetcher=None,use_md5=True): - if fetcher==None: - import transports.bundled_lib - fetcher=transports.bundled_lib.BundledConnection() - self.__fetcher=fetcher - self.__host_uri=host_uri - self.__tmpdir = tmp_dir - self.__snapshots_dir = snapshots_dir - self.__use_md5 = use_md5 - - def sync(self, local_path,verbosity=1): - attempts=0 - downloaded=False - while attempts < 40 and not downloaded: - file="portage-%s.tar.bz2" % time.strftime("%Y%m%d", - time.localtime(time.time() - (attempts*24*60*60))) - loc=self.__snapshots_dir+"/"+file - rem=self.__host_uri+"/"+file - downloaded=self.__fetch_snapshot(file,loc,rem,verbosity) - attempts += 1 - - if not downloaded: - # no snapshot, no syncy-poo. - return False - - return self.__apply_snapshot(loc,local_path,verbosity) - - def __apply_snapshot(self,snapshot,local_tree,verbosity): - """apply the actual snapshot. for different methods of this, inherit this class - and overload this function - current it untars to a temp location, and rsync's it over to local_path.""" - - #this should be checked - portage_exec.spawn(("tar","-jxf",snapshot,"-C",self.__tmpdir)) - syncer=sync.rsync.RsyncHost("%s/portage/" % self.__tmpdir,local_host=True) - try: - ret = syncer.sync({},local_tree,excludes=("/distfiles","/local","/packages"),verbosity=verbosity) - except sync.rsync.RSyncSyntaxError,e: - print "caught rsync syntax exception:",e - return False - except IOError, ie: - print "issue: ",ie - return False - if verbosity: - print "cleaning tempoary snapshot directory- %s/portage" % self.__tmpdir - shutil.rmtree(self.__tmpdir+"/portage") - - #nuke all other return codes. - if ret != True: - return False - return ret - - def __fetch_snapshot(self,file,loc,rem,verbosity): - grab_md5=True - hash=None - md5=None - md5_existed=False - ret=False - if self.__use_md5 and os.path.exists(loc+".md5sum"): - hash=self.__read_md5sum(loc+".md5sum") - if hash==None: - os.remove(loc+".md5sum") - else: - md5_existed=True - grab_md5=False - - if self.__use_md5 and grab_md5: - ret=self.__fetcher.fetch(rem+".md5sum",file_name=loc+".md5sum",verbose=(verbosity==1)) - if not ret: - hash=self.__read_md5sum(loc+".md5sum") - - if ret: - if verbosity: - print "!!! failed to fetch md5 for %s" % file - return False - - # at this point we have the md5, and know the image *should* exist. - ret = False - if os.path.exists(loc): - if self.__use_md5: - md5=portage_checksum.perform_md5(loc) - if hash == md5 or not self.__use_md5: - if verbosity: - print ">>> reusing %s" % loc - return True - else: - if verbosity: - print ">>> resuming %s" % rem - ret=self.__fetcher.resume(rem,file_name=loc,verbose=(verbosity==1)) - else: - if verbosity: - print ">>> fetching %s" % rem - ret=self.__fetcher.fetch(rem,file_name=loc,verbose=(verbosity==1)) - - if ret: - if verbosity: - print "!!! failed %s" % file - return False - - if self.__use_md5 and md5==None: - md5=portage_checksum.perform_md5(loc) - - if self.__use_md5 and md5_existed and md5!= hash: - print ">>> re-grabbing the hash" - # grab the md5 anew to be safe. - os.remove(loc+".md5sum") - if not self.__fetcher.fetch(rem+".md5sum",file_name=loc+".md5sum",verbose=True): - hash=self.__read_md5sum(loc+".md5sum") - - if md5!=hash and self.__use_md5: - if verbosity: - print "!!! snapshots correct md5: %s" % hash - print "!!! snapshots actual md5 : %s" % md5 - print "!!! cycling to next candidate." - print - return False - # if this point has been reached, things are sane. - return True - - - def __read_md5sum(self,file): - try: - myf=open(file,"r") - hash=myf.readline().split()[0] - if len(hash)!=32: - return None - return hash - except (OSError,IOError,IndexError),e: - print e - return None diff --git a/pym/sync/syncexceptions.py b/pym/sync/syncexceptions.py deleted file mode 100644 index dce2fb8..0000000 --- a/pym/sync/syncexceptions.py +++ /dev/null @@ -1,11 +0,0 @@ -# syncexceptions.py: base sync exception class. not used currently (should be though) -# Copyright 2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -#$Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/pym/sync/syncexceptions.py,v 1.3 2004/11/07 14:38:39 ferringb Exp $ - -class SyncException(Exception): - """base sync exception""" - def __init__(self,value): - self.value=value - def __str__(self): - return value diff --git a/pym/transports/.gitignore b/pym/transports/.gitignore deleted file mode 100644 index 52e4e61..0000000 --- a/pym/transports/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -*.pyc -*.pyo diff --git a/pym/transports/__init__.py b/pym/transports/__init__.py deleted file mode 100644 index 3f00d3d..0000000 --- a/pym/transports/__init__.py +++ /dev/null @@ -1,9 +0,0 @@ -# transports/__init__.py; worthless file to keep python happy. -# Copyright 2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -#$Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/pym/transports/__init__.py,v 1.3 2004/11/07 14:38:39 ferringb Exp $ - -# worthless comment so diff creates this file. -# yay. -# this will ultimately hold the 'preferred fetcher' in the transport namespace, -# along with default options for fetchers (chunk size fex) diff --git a/pym/transports/bundled_lib.py b/pym/transports/bundled_lib.py deleted file mode 100644 index 5e9c624..0000000 --- a/pym/transports/bundled_lib.py +++ /dev/null @@ -1,363 +0,0 @@ -# bundled_lib.py; implementation of a fetcher class useing httplib and ftplib. -# Copyright 2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -#$Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/pym/transports/bundled_lib.py,v 1.3 2004/11/07 14:38:39 ferringb Exp $ - -import httplib, ftplib, urlparse, base64, re, sys, os - -class BundledConnection: - """a fetcher abstraction using httplib and ftplib. - offers api access to specify the specific window/chunk of a uri you want""" - def __init__(self, persistant=False,chunk_size=8192,verbose=True): - self.__persistant = persistant - self.__chunk_size = chunk_size - self.__verbose = verbose - - # lifting the connection caching from check_src_uri's code- combine them if possible - self._http_conn = {} - self._https_conn = {} - self._ftp_conn = {} - - def __get_connection(self, uri): - """internal function to raid from the instances cache of connections, or return a new one""" - proto,host,con_dict,url,hash = self.__process_uri(uri) - cons = getattr(self,"_%s_conn" % proto) - if not self.__persistant or not cons.has_key(hash): - if proto in ('http','https'): - con = httpConnection(host,**con_dict) - else: - con = ftpConnection(host,chunk_size=self.__chunk_size,**con_dict) - if self.__persistant: - cons[hash] = con - else: - con = cons[hash] - return proto, con, url - - def fetch(self,uri, file_name=None,verbose=None): - """fetch uri, storing it in file_name""" - if verbose==None: - verbose=self.__verbose - proto, con, url = self.__get_connection(uri) - if not file_name: - x= url.find("/") - if x == -1: - raise Exception,"Unable to deterimine file_name from %s" % uri - file_name = url[x+1:] - try: - myf=open(file_name,"w",0) - - except (IOError, OSError), e: - sys.stderr.write("Failed opening file %s for saving:\n%s\n" % (file_name,str(e))) - return True - if verbose: - print "fetching '%s' -> '%s'" % (uri, file_name) - if proto in ('http','https'): - try: - ret= self.__execute_transfer(con, url, myf, 0) - except UnableToAccess,ua: - if verbose: - print ua - myf.close() - os.remove(file_name) - return True - else: - ret = con.request(url, callback=myf.write) - myf.close() - return not ret - - def resume(self, uri, file_name=None,verbose=None): - """resume uri into file_name""" - if verbose==None: - verbose=self.__verbose - proto, con, url = self.__get_connection(uri) - if not file_name: - x= url.find("/") - if x == -1: - raise Exception,"Unable to deterimine file_name from %s" % uri - file_name = url[x+1:] - try: - pos = os.stat(file_name).st_size - - # open it manually, since open(file_name,"a") has the lovely feature of - # ignoring _all_ previous seek requests the minute a write is issued. - fd=os.open(file_name, os.O_WRONLY) - myf = os.fdopen(fd,"w",0) - if pos > self.__chunk_size: - pos -= self.__chunk_size - myf.seek(pos, 0) - else: - pos=0 - - except OSError, e: - if e.errno == 2: - # file not found - pos = 0 - myf = open(file_name, "w",0) - else: - sys.stderr.write("Failed opening file %s for saving:\n%s\n" % (file_name,str(e))) - return True - - if verbose: - print "resuming '%s' -> '%s'" % (uri, file_name) - if proto in ('http','https'): - try: - ret = self.__execute_transfer(con, url, myf, pos) - except UnableToAccess,ua: - if verbose: - print ua - myf.close() - return True - else: - ret = con.request(url, callback=myf.write, start=pos) - myf.close() - return not ret - - def __execute_transfer(self, con, url, fd, pos): - """internal http(|s) function for looping over requests storing to fd""" - rc=1 - redirect_max = 10 - while rc: -# print "fetching %i-%i" % (pos, pos + (self.__chunk_size *8) -1) - try: - data,rc=con.request(url,start=pos, end=(pos+(self.__chunk_size*8) -1)) - except MovedLocation, ml: - sys.stderr.write(str(ml)+"\n") - url = ml.location - redirect_max -= 1 - if redirect_max <= 0: - print "we've been redirected too many times- bailing" - return False - else: - continue - except UnhandledError, ue: - print ue - return False - fd.write(data) - pos += len(data) - return True - - default_ports = {'http':80, 'https':443, 'ftp':21} - - def __process_uri(self, uri): - """internal function to determine the proto, host, uri, options for - __get_connection, and a hash representing this host's specific options. - username, password, port, ssl, etc""" - con_dict = {} - proto,parts,url = urlparse.urlparse(uri)[0:3] - if not self.default_ports.has_key(proto): -# port = self.default_ports[proto] -# else: - raise Exception, "unknown protocol %s for uri %s" % (proto,uri) - - parts = parts.split("@") - if len(parts) > 1: - con_dict["user"] = parts.pop(0) - - r=re.compile(":\d+$").search(parts[0]) - if r: - # found a port - con_dict["port"] = parts[0][r.start() + 1:] - parts[0] = parts[0][0:r.start()] - del r - - #grab the pass. - parts = parts[0].split(":") - if len(parts) > 1: - con_dict["passwd"] = parts.pop(0) - - hash='' - k=con_dict.keys() - k.sort() - for x in k: - hash += '%s:%s\n' % (x, str(con_dict[x])) - hash += "host:%s" % parts[0] - return [proto, parts[0], con_dict, url,hash] - -class ftpConnection: - """higher level interface over ftplib""" - def __init__(self,host,ssl=False,port=21,user=None,passwd=None,passive=True, chunk_size=8192,debug=0): - """ssl is currently not supported - debug flips on a bit of extra info - chunk_size controls the size of chunks transferred per callback- useful for performance tweaking - - note a ftpConnection instance *must not* be called in a threaded/parallel manner- - the connection can handle one, and only one request, and is currently not smart - enough to lock itself for protection""" - self.__chunk = chunk_size - self.__pos = 0 - self.__end = 0 - self.__endlimit = False - if ssl: - raise Exception, "sftp isn't support atm" - args=[] - self.__con = ftplib.FTP() - self.__con.set_debuglevel(debug) - self.__con.connect(host,port) - if user and passwd: - self.__con.login(user,passwd) - else: - self.__con.login() - self.__con.set_pasv(passive) - - def request(self, file, start=0, end=0, callback=None): - """make a request of file, with optional start/end - callback is used for processing data- if callback, then callback is called, and the return - is true/false depending on success - - if no callback, then the requested window is returned, eg string. - - technical note: do to the way the protocol works, the remote host may send more then what - was specified via start/end. Despite this, only that window is processed/returned. - Just worth noting since it means if you're requested 3 bytes from a file, depending on how - quickly the server disconnects, 13k may've been sent by that point (still, only the 3 bytes - are actually processed by callback/returned).""" - - self.__pos = start - self.__end = end - self.__callback = callback - self.__data = '' - self.__aborted = False - - if end: - self.__endlimit = True - if end: - block = end - start - else: - block = self.__chunk - if block > self.__chunk: - block = self.__chunk - - try: - d=self.__con.retrbinary("retr %s" % file, self.__transfer_callback, block, start) - except ftplib.all_errors: - self.__data = '' - return False - - if callback == None: - d = self.__data - self.__data = '' - return d - - - def __transfer_callback(self, data): - """internal callback function used with ftplib. This either appends the returned data, - or passes it off to the requested callback function""" - if self.__aborted: - return - - l=len(data) - - if self.__endlimit and self.__pos + l >= self.__end: - data = data[:self.__end - l] - l = self.__end - self.__pos - self.__aborted = True - self.__con.abort() - - self.__pos += l - if self.__callback: - self.__callback(data) - else: - self.__data += data - return - -class httpConnection: - """higher level abstraction over httplib allowing window level access to a remote uri""" - def __init__(self,host,ssl=False,port=None,user=None,passwd=None): - """options for this host connection, sent to the server via the headers - note you cannot just specify the port as 443 and assume it'll do ssl- - you must flip on ssl to enable descryption/encryption of the protocol - - just like with ftpConnection, instances *must not* be called in a parallel/threaded - manner without external locking. - This class isn't smart enough to protect itself, although it will be made so at - some point.""" - - self.__headers = {} - self.__host = host - if user and passwd: - self.__headers.extend({"Authorization": "Basic %s" % - base64.encodestring("%s:%s" % (user,passwd)).replace("\012","") - }) - - if port == None: - if ssl: - self.__port = httplib.HTTPS_PORT - else: - self.__port = httplib.HTTP_PORT - else: - self.__port = port - if ssl: - self.__conn = httplib.HTTPSConnection(self.__host, self.__port) - else: - self.__conn = httplib.HTTPConnection(self.__host, self.__port) - - def request(self,uri,start=None,end=None): - """returns httpconnection.response, our chucks an exception.""" - if end==None and start: - end += 3000 - size = None - if not (start == None or end == None): - size = end - start - self.__headers["Range"]="bytes=%i-%i" % (start, end) - try: - self.__conn.request("GET",uri,{},self.__headers) - except httplib.HTTPException, e: - print "caught exception %s" % str(e) - if start and end: - del self.__headers["Range"] - return None,False - if start and end: - del self.__headers["Range"] - response = self.__conn.getresponse() - rc = response.status - if rc in (301,302): - response.read() - for x in str(response.msg).split("\n"): - p = x.split(":") - # assume the remote server is dumb, and ignore case. - if x[0].lower() == "location": - raise MovedLocation(rc, x[1]) - - # if we hit this point, the server is stupid. - raise Exception,"received %i, but no location" % rc - - if rc in (404,403): - response.read() - raise UnableToAccess(rc,response.reason) - elif rc not in (200,206): - response.read() - raise UnhandledError(rc,response.reason) - data=response.read() - if size != None: - return data,(rc==206 and len(data) -1 == size) - return data,(rc==206) - - -class UnhandledError(Exception): - """basically an unknown state/condition was encountered, so control is being relinquished""" - def __init__(self, status, reason): - self.status = status - self.reason = str(reason) - def __str__(self): - return "Unhandled Status code: %i: %s" % (self.status, self.reason) - -class UnableToAccess(Exception): - """404's and 403's""" - def __init__(self,status,reason): - self.status = status - self.reason = str(reason) - def __str__(self): - return "%s code: %s" % (self.status,self.reason) - -class MovedLocation(Exception): - """http 301/302 exception""" - def __init__(self,status,new_loc): - self.status=status - self.location = str(new_loc) - - def __str__(self): - if self.status == 301: - return "301: Location has moved: %s" % self.location - else: - return "302: Location has temporarily moved: %s" % self.location - diff --git a/pym/transports/fetchcommand.py b/pym/transports/fetchcommand.py deleted file mode 100644 index dd8231d..0000000 --- a/pym/transports/fetchcommand.py +++ /dev/null @@ -1,72 +0,0 @@ -# fetchcommand.py; fetcher class encapsulating make.conf FETCHCOMMAND/RESUMECOMMAND, and the ensueing spawn calls -# Copyright 2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -#$Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/pym/transports/fetchcommand.py,v 1.5 2004/11/23 01:26:44 ferringb Exp $ - -import urlparse,types -import portage_exec - -class CustomConnection: - """abstraction representing a portage.config instances FETCHCOMMAND and RESUMECOMMAND""" - def __init__(self,mysettings,selinux_context=None, verbose=True): - """selinux_context should always be passed in, actual control of whether or not - the context is switched is based upon if it's a selinux capable system - verbose controls whether this instance makes noise or not""" - self.__fc = mysettings["FETCHCOMMAND"] - self.__rc = mysettings["RESUMECOMMAND"] - self.__verbose = verbose - self.__cfc = {} - self.__crc = {} - self.__selinux_context = selinux_context - self.__distdir=mysettings["DISTDIR"] - for k in mysettings.environ().keys(): - if k.startswith("FETCHCOMMAND_"): - self.__cfc[k[13:]] = mysettings[k] - elif k.startswith("RESUMECOMMAND_"): - self.__crc[k[14:]] = mysettings[k] - - - def fetch(self, uri, file_name=None, verbose=None): - """fetch uri, storing it to file_name""" - return self.__execute(uri,file_name,False,verbose) - - def resume(self, uri, file_name=None,verbose=None): - """resume uri into file_name""" - return self.__execute(uri,file_name,True,verbose) - - def __execute(self, uri, file_name, resume,verbose): - """internal function doing the actual work of fetch/resume""" - if verbose==None: - verbose=self.__verbose - - proto = urlparse.urlparse(uri)[0].upper() - - if not file_name: - x = uri.rfind("/") - distdir=self.__distdir - if x == -1: - raise Exception,"Unable to deterimine file_name from %s" % uri - file_name = uri[x+1:] - else: - x = file_name.rfind("/") - if x == -1: - distdir=self.__distdir - else: - distdir=file_name[:x] - file_name=file_name[x+1:] - - if resume: - f = self.__crc.get(proto, self.__rc) - else: - f = self.__cfc.get(proto, self.__fc) - - - f=f.replace("${DISTDIR}", distdir) - f=f.replace("${URI}",uri) - f=f.replace("${FILE}",file_name) - if verbose: - fd_pipes={1:1,2:2} - else: - fd_pipes={} - return portage_exec.spawn_bash(f,fd_pipes=fd_pipes,selinux_context=self.__selinux_context) - diff --git a/pym/xpak.py b/pym/xpak.py deleted file mode 100644 index 2beda5f..0000000 --- a/pym/xpak.py +++ /dev/null @@ -1,375 +0,0 @@ -# Copyright 2001-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/pym/xpak.py,v 1.15 2005/02/26 06:35:20 jstubbs Exp $ -cvs_id_string="$Id: xpak.py,v 1.15 2005/02/26 06:35:20 jstubbs Exp $"[5:-2] - -# The format for a tbz2/xpak: -# -# tbz2: tar.bz2 + xpak + (xpak_offset) + "STOP" -# xpak: "XPAKPACK" + (index_len) + (data_len) + index + data + "XPAKSTOP" -# index: (pathname_len) + pathname + (data_offset) + (data_len) -# index entries are concatenated end-to-end. -# data: concatenated data chunks, end-to-end. -# -# [tarball]XPAKPACKIIIIDDDD[index][data]XPAKSTOPOOOOSTOP -# -# (integer) == encodeint(integer) ===> 4 characters (big-endian copy) -# '+' means concatenate the fields ===> All chunks are strings - -import sys,os,string -from stat import * - -def addtolist(mylist,curdir): - """(list, dir) --- Takes an array(list) and appends all files from dir down - the directory tree. Returns nothing. list is modified.""" - for x in os.listdir("."): - if os.path.isdir(x): - os.chdir(x) - addtolist(mylist,curdir+x+"/") - os.chdir("..") - else: - if curdir+x not in mylist: - mylist.append(curdir+x) - -def encodeint(myint): - """Takes a 4 byte integer and converts it into a string of 4 characters. - Returns the characters in a string.""" - part1=chr((myint >> 24 ) & 0x000000ff) - part2=chr((myint >> 16 ) & 0x000000ff) - part3=chr((myint >> 8 ) & 0x000000ff) - part4=chr(myint & 0x000000ff) - return part1+part2+part3+part4 - -def decodeint(mystring): - """Takes a 4 byte string and converts it into a 4 byte integer. - Returns an integer.""" - myint=0 - myint=myint+ord(mystring[3]) - myint=myint+(ord(mystring[2]) << 8) - myint=myint+(ord(mystring[1]) << 16) - myint=myint+(ord(mystring[0]) << 24) - return myint - -def xpak(rootdir,outfile=None): - """(rootdir,outfile) -- creates an xpak segment of the directory 'rootdir' - and under the name 'outfile' if it is specified. Otherwise it returns the - xpak segment.""" - try: - origdir=os.getcwd() - except SystemExit, e: - raise - except: - os.chdir("/") - origdir="/" - os.chdir(rootdir) - mylist=[] - - addtolist(mylist,"") - mylist.sort() - - #Our list index has been created - - indexglob="" - indexpos=0 - dataglob="" - datapos=0 - for x in mylist: - a=open(x,"r") - newglob=a.read() - a.close() - mydatasize=len(newglob) - indexglob=indexglob+encodeint(len(x))+x+encodeint(datapos)+encodeint(mydatasize) - indexpos=indexpos+4+len(x)+4+4 - dataglob=dataglob+newglob - datapos=datapos+mydatasize - os.chdir(origdir) - if outfile: - outf=open(outfile,"w") - outf.write("XPAKPACK"+encodeint(len(indexglob))+encodeint(len(dataglob))) - outf.write(indexglob) - outf.write(dataglob) - outf.write("XPAKSTOP") - outf.close() - else: - myret="XPAKPACK"+encodeint(len(indexglob))+encodeint(len(dataglob)) - myret=myret+indexglob+dataglob+"XPAKSTOP" - return myret - -def xsplit(infile): - """(infile) -- Splits the infile into two files. - 'infile.index' contains the index segment. - 'infile.dat' contails the data segment.""" - myfile=open(infile,"r") - mydat=myfile.read() - myfile.close() - - splits = xsplit_mem(mydat) - if not splits: - return - - myfile=open(infile+".index","w") - myfile.write(splits[0]) - myfile.close() - myfile=open(infile+".dat","w") - myfile.write(splits[1]) - myfile.close() - return - -def xsplit_mem(mydat): - if mydat[0:8]!="XPAKPACK": - return None - if mydat[-8:]!="XPAKSTOP": - return None - indexsize=decodeint(mydat[8:12]) - datasize=decodeint(mydat[12:16]) - return (mydat[16:indexsize+16], mydat[indexsize+16:-8]) - -def getindex(infile): - """(infile) -- grabs the index segment from the infile and returns it.""" - myfile=open(infile,"r") - myheader=myfile.read(16) - if myheader[0:8]!="XPAKPACK": - myfile.close() - return - indexsize=decodeint(myheader[8:12]) - myindex=myfile.read(indexsize) - myfile.close() - return myindex - -def getboth(infile): - """(infile) -- grabs the index and data segments from the infile. - Returns an array [indexSegment,dataSegment]""" - myfile=open(infile,"r") - myheader=myfile.read(16) - if myheader[0:8]!="XPAKPACK": - myfile.close() - return - indexsize=decodeint(myheader[8:12]) - datasize=decodeint(myheader[12:16]) - myindex=myfile.read(indexsize) - mydata=myfile.read(datasize) - myfile.close() - return [myindex,mydata] - -def listindex(myindex): - """Print to the terminal the filenames listed in the indexglob passed in.""" - for x in getindex_mem(myindex): - print x - -def getindex_mem(myindex): - """Returns the filenames listed in the indexglob passed in.""" - myindexlen=len(myindex) - startpos=0 - myret=[] - while ((startpos+8)<myindexlen): - mytestlen=decodeint(myindex[startpos:startpos+4]) - myret=myret+[myindex[startpos+4:startpos+4+mytestlen]] - startpos=startpos+mytestlen+12 - return myret - -def searchindex(myindex,myitem): - """(index,item) -- Finds the offset and length of the file 'item' in the - datasegment via the index 'index' provided.""" - mylen=len(myitem) - myindexlen=len(myindex) - startpos=0 - while ((startpos+8)<myindexlen): - mytestlen=decodeint(myindex[startpos:startpos+4]) - if mytestlen==mylen: - if myitem==myindex[startpos+4:startpos+4+mytestlen]: - #found - datapos=decodeint(myindex[startpos+4+mytestlen:startpos+8+mytestlen]); - datalen=decodeint(myindex[startpos+8+mytestlen:startpos+12+mytestlen]); - return [datapos,datalen] - startpos=startpos+mytestlen+12 - -def getitem(myid,myitem): - myindex=myid[0] - mydata=myid[1] - myloc=searchindex(myindex,myitem) - if not myloc: - return None - return mydata[myloc[0]:myloc[0]+myloc[1]] - -def xpand(myid,mydest): - myindex=myid[0] - mydata=myid[1] - try: - origdir=os.getcwd() - except SystemExit, e: - raise - except: - os.chdir("/") - origdir="/" - os.chdir(mydest) - myindexlen=len(myindex) - startpos=0 - while ((startpos+8)<myindexlen): - namelen=decodeint(myindex[startpos:startpos+4]) - datapos=decodeint(myindex[startpos+4+namelen:startpos+8+namelen]); - datalen=decodeint(myindex[startpos+8+namelen:startpos+12+namelen]); - myname=myindex[startpos+4:startpos+4+namelen] - dirname=os.path.dirname(myname) - if dirname: - if not os.path.exists(dirname): - os.makedirs(dirname) - mydat=open(myname,"w") - mydat.write(mydata[datapos:datapos+datalen]) - mydat.close() - startpos=startpos+namelen+12 - os.chdir(origdir) - -class tbz2: - def __init__(self,myfile): - self.file=myfile - self.filestat=None - self.index="" - self.infosize=0 - self.xpaksize=0 - self.indexsize=None - self.datasize=None - self.indexpos=None - self.datapos=None - self.scan() - - def decompose(self,datadir,cleanup=1): - """Alias for unpackinfo() --- Complement to recompose() but optionally - deletes the destination directory. Extracts the xpak from the tbz2 into - the directory provided. Raises IOError if scan() fails. - Returns result of upackinfo().""" - if not self.scan(): - raise IOError - if cleanup and os.path.exists(datadir): - # XXX: Potentially bad - os.system("rm -Rf "+datadir+"/*") - if not os.path.exists(datadir): - os.makedirs(datadir) - return self.unpackinfo(datadir) - def compose(self,datadir,cleanup=0): - """Alias for recompose().""" - return recompose(datadir,cleanup) - def recompose(self,datadir,cleanup=0): - """Creates an xpak segment from the datadir provided, truncates the tbz2 - to the end of regular data if an xpak segment already exists, and adds - the new segment to the file with terminating info.""" - self.scan() # Don't care about condition... We'll rewrite the data anyway. - myfile=open(self.file,"a+") - if not myfile: - raise IOError - myfile.seek(-self.xpaksize,2) # 0,2 or -0,2 just mean EOF. - myfile.truncate() - xpdata=xpak(datadir) - myfile.write(xpdata+encodeint(len(xpdata))+"STOP") - myfile.flush() - myfile.close() - if cleanup: - # XXX: Potentially bad - os.system("rm -Rf "+datadir) - return 1 - - def scan(self): - """Scans the tbz2 to locate the xpak segment and setup internal values. - This function is called by relevant functions already.""" - try: - mystat=os.stat(self.file) - if self.filestat: - changed=0 - for x in [ST_SIZE, ST_MTIME, ST_CTIME]: - if mystat[x] != self.filestat[x]: - changed=1 - if not changed: - return 1 - self.filestat=mystat - a=open(self.file,"r") - a.seek(-16,2) - trailer=a.read() - self.infosize=0 - self.xpaksize=0 - if trailer[-4:]!="STOP": - a.close() - return 0 - if trailer[0:8]!="XPAKSTOP": - a.close() - return 0 - self.infosize=decodeint(trailer[8:12]) - self.xpaksize=self.infosize+8 - a.seek(-(self.xpaksize),2) - header=a.read(16) - if header[0:8]!="XPAKPACK": - a.close() - return 0 - self.indexsize=decodeint(header[8:12]) - self.datasize=decodeint(header[12:16]) - self.indexpos=a.tell() - self.index=a.read(self.indexsize) - self.datapos=a.tell() - a.close() - return 2 - except SystemExit, e: - raise - except: - return 0 - - def filelist(self): - """Return an array of each file listed in the index.""" - if not self.scan(): - return None - return getindex_mem(self.index) - - def getfile(self,myfile,mydefault=None): - """Finds 'myfile' in the data segment and returns it.""" - if not self.scan(): - return None - myresult=searchindex(self.index,myfile) - if not myresult: - return mydefault - a=open(self.file,"r") - a.seek(self.datapos+myresult[0],0) - myreturn=a.read(myresult[1]) - a.close() - return myreturn - - def getelements(self,myfile): - """A split/array representation of tbz2.getfile()""" - mydat=self.getfile(myfile) - if not mydat: - return [] - return string.split(mydat) - - def unpackinfo(self,mydest): - """Unpacks all the files from the dataSegment into 'mydest'.""" - if not self.scan(): - return 0 - try: - origdir=os.getcwd() - except SystemExit, e: - raise - except: - os.chdir("/") - origdir="/" - a=open(self.file,"r") - if not os.path.exists(mydest): - os.makedirs(mydest) - os.chdir(mydest) - startpos=0 - while ((startpos+8)<self.indexsize): - namelen=decodeint(self.index[startpos:startpos+4]) - datapos=decodeint(self.index[startpos+4+namelen:startpos+8+namelen]); - datalen=decodeint(self.index[startpos+8+namelen:startpos+12+namelen]); - myname=self.index[startpos+4:startpos+4+namelen] - dirname=os.path.dirname(myname) - if dirname: - if not os.path.exists(dirname): - os.makedirs(dirname) - mydat=open(myname,"w") - a.seek(self.datapos+datapos) - mydat.write(a.read(datalen)) - mydat.close() - startpos=startpos+namelen+12 - a.close() - os.chdir(origdir) - return 1 - - - - diff --git a/qa/iuse/iuse.sh b/qa/iuse/iuse.sh deleted file mode 100644 index 3b30d25..0000000 --- a/qa/iuse/iuse.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -cd /usr/portage/ -for x in `find -name '*.ebuild'` -do - echo $x - bn=${x##*/} - dn=${x%/*} - fn=.use-${bn/.ebuild/} - myout=${dn}/${fn} - - #massive pipeline follows - sed -e 's/^\([^#]*\)#.*$/\1/' -e '/^pkg_/q' $x | \ - grep -e 'use [[:alnum:]]*' | \ - grep -v DESCRIPTION | \ - sed -e 's/^.*use \([[:alnum:]]*\).*$/\1/' | \ - sed -e '/^$/d' | \ - sort | \ - uniq > $myout - -done diff --git a/qa/iuse/iuse2.py b/qa/iuse/iuse2.py deleted file mode 100755 index 7944b93..0000000 --- a/qa/iuse/iuse2.py +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/python2.2 -import portage,sys -portdir=portage.settings["PORTDIR"] -for cp in portage.portdb.cp_all(): - for cpv in portage.portdb.cp_list(cp): - try: - myaux=portage.portdb.aux_get(cpv,["DEPEND","RDEPEND","SRC_URI"]) - except KeyError: - pass - myuse={} - for str in myaux: - mysplit=str.split() - for part in mysplit: - if part[-1]=="?": - if part[0]=="!": - if not myuse.has_key(part[1:-1]): - myuse[part[1:-1]]=None - else: - if not myuse.has_key(part[:-1]): - myuse[part[:-1]]=None - if not myuse: - continue - cpsplit=cpv.split("/") - mypath=portdir+"/"+cp+"/.use-"+cpsplit[1] - print mypath - myfile=open(mypath,"r") - for x in myfile.readlines(): - if x[:-1]: - if not myuse.has_key(x[:-1]): - myuse[x[:-1]]=None - print myuse.keys() - myfile.close() - if not myuse.keys(): - #no IUSE to add - continue - myepath=portdir+"/"+cp+"/"+cpsplit[1]+".ebuild" - myefile=open(myepath,"r") - mylines=myefile.readlines() - myefile.close() - mynewlines=[] - pos=0 - while (pos<len(mylines)) and (mylines[pos][0]=="#"): - mynewlines.append(mylines[pos]) - pos += 1 - myuses=myuse.keys() - iuseline="\nIUSE=\""+myuses[0] - for x in myuses[1:]: - iuseline=iuseline+" "+x - iuseline=iuseline+"\"\n" - mynewlines.append(iuseline) - while (pos<len(mylines)): - mynewlines.append(mylines[pos]) - pos += 1 - - myefile=open(myepath,"w") - for x in mynewlines: - myefile.write(x) - myefile.close() diff --git a/rewrite-misc/ChangeLog b/rewrite-misc/ChangeLog deleted file mode 100644 index 46c62ae..0000000 --- a/rewrite-misc/ChangeLog +++ /dev/null @@ -1,16 +0,0 @@ -06/07/05: harring: config.{repo,cache,domain,sync} works fine, new dict type. portage.util.dicts holds the dict variants, including - IndexableSequence. added portage.util.currying. Use it. it rocks. -06/07/05: harring: config instantation of repo works now. config.repo is a bit screwed up, but will be fixed. -06/06/05: harring: ebuild depends works now. config instantiation should work for base configurations, but nothing complex. - cache and location basically, nothing like package.* wrappers (which will be via a config callable) -06/03/05: harring: changelog addition. portage.ebuild.processor work namely, eclass_cache inclusive. -More additions to intro, specifically re: avoiding race condition of gpg verification then using a file with open perms -(short version, abuse preloaded_eclass type trick). -Yanked *ROOTPATH. it's a kludge, a bad one at that. Will break uclibc profile, but it's a kludge to cover up portages shitty path handling. -portage.ebuild.processor.processor.generic_handler is of note, generic waiting loop structure. basically, any ebd interaction after setup -is handled here, with command:callable dict handed in, etc. -ebuild sourcing for metadata should be finished end of day, since I broke it all apart via namespace and killing off old ebuild.py. -ebuild*.sh no longer has /usr/lib/portage/bin/ hardcoded in, if unset and not daemonize ebuild.sh sets it to the usual. ebd requests it -from the processor, which returns portage.const.PORTAGE_BIN_PATH -Broke inherit into two funcs, basically breaking the core of inherit out (the source call/semantics). defaults to old behaviour, -but ebd will override it (look at eclass_cache.get_eclass_* and you'll understand, ellucidates in the intro ebd section) diff --git a/rewrite-misc/HORKED b/rewrite-misc/HORKED deleted file mode 100644 index d525812..0000000 --- a/rewrite-misc/HORKED +++ /dev/null @@ -1,32 +0,0 @@ -list what's horked, note your name by it if you want dibs. -This ain't complete either. - -namespace fixes required, plus potentially a bit of rewrite -portage.sync -portage.transports # transports needs to be unified behind fetcher design. - # need a fetchable class also. - -not finished- -portage.cache.multiplex # should be a master/slave class, master for querying, both for updates/deletions -portage.restrictions -potage.config.central # need's to be renamed, and needs new.instancemethod hacks, read intro for explanation. - -portage.vdb # consult harring if you're after this, since this is a helluva lot more complex then just a repo -portage.binpkg # bind it to portage.ebuild whereever possible - -not started -portage.config.domain # consult intro doc if you attempt it, and collect feedback from jason/brian regarding it please - # harring will want it one way which probably slightly conflicts with what jason wants (and vice versa), - # so be aware it's probably going to be a shifting class definition. - # still need a prototype though. - - -not started -portage.ebuild.repository.gpgtree -# ebuild repository derivative, bind gpg verification within metadata creation. including manifest verification (not just signed). -# need a design for having gpg trust mapped into repositories (overkill? really need multiple trust rings?) - -not even a scratched out yet -portage.*.fetchable # find a place for this. simple one however. -portage.*.(merge|build)operation -# no base class defined yet, see intro diff --git a/rewrite-misc/conf_default_types b/rewrite-misc/conf_default_types deleted file mode 100644 index c8dfc13..0000000 --- a/rewrite-misc/conf_default_types +++ /dev/null @@ -1,132 +0,0 @@ -# so what the hell does this all mean? It's section type definitions. -# defaults specifies the name of default settings, which much exist in the section definition. -# required specifies what settings are required in any user config for that section. -# incrementals specifies what settings are stacked, orig_setting + new_setting. not limited to list types only, but probably should be -# list, str, bool are lists of settings, stating "this setting is of this type", so at runtime any config settings processed are -# automatically converted to that type. -# section_ref are a _special_ type of setting type. must reference another section, and can be multiple (specified via list). -# not possible to do incrementals on section types, so don't attempt it (it will not act as you expect). -# note defaults get passed through the setting type conversion mechanism also. -# instantiate is the python namespace addie of a callable that does instantiation of that section (rather then a generic handler). -# generic handler ignores any settings that don't fall aren't addressed/fscked with via default mangling mentioned above -# (change this later?) -# -# any defined section setting types that are in the config are verified to exist during config collapsing. -# if a custom instantiation func is defined for that section type, the instantiation func is required to instantiate the sections -# (config.instantiate_section(section) effectively). Otherwise, the generic handler does the instantiation are substition for -# callable instantiation on it's own. -# -# positional specifies positional args (which all must be required), only actually used if generic instantiator is used. -# label is special setting name, akin to __name__ (literally, that's it value), *only* when stated as a default -# -# iow, if you have your own instantiation func for a section, you have to instantiate any section types you define. it's verified -# to exist, but type is not verified (class type verification within specified callable should suffice however). -# -# custom instantiation func prototype (the actual instantiation handler): -# def handler(config, callable, section_label, section_config) -# -# config == portage.config.central.config instance, -# callable == class definition for that section, -# section_label == section's label/name (hard one I know). -# section_config == collapsed section's config as a dict. -# -# -# potential extensions: -# -# types are limited to what the generic parser knows of. that should be extended. -# -# inter-section references should be handled (instantiation) via the generic parser also. -# ex: instantiation of domain should be given instantiated repos/profiles instead of section names. -# -# there is no way to have defaults represented at the config level for specialized callables. -# decide if this is good or bad. in effect, require's are generalized for a section type, which may not apply -# -# there isn't any mechanism for noting what supports interop (think sync + repo), aside from instantiating -# and having it bitch. fluid design/intention of the final parsing of user config, but this is a drawback of -# said design. -# think about ways to curb that, lest users get too annoying with tracebacks ;) -# -# right now, there is now way to specify that a callable requires certain settings beyond section requirements. -# there _should_ be an automated way to get that info, so that the generic parser can carry that load. -# -# this file also will be 'fun' for doing per keyword defaults as per the portage norm. -# probably need to support exec within this file, with a default exec section pointing at -# a location on the fs that defines further defaults, although that makes parsing this file fun. -# -# short version, with the rules established, you would need to define a metasection, and apply the -# inherit/incrementals crap to constructing at run time the section definitions. -# or you need a smarter parser/generator for this file. -# leave that to the schmuck who writes the autotools integration for this -# (why oh why do I suspect that's going to be my stupid ass? :) -# ~harring -# -# ps. a dpkg repo (fex) _should_ be a different section type imo, and whatever checks are done for -# assembling a domain should do isinstance checks on a repo base, rather then (potentially) enforcing -# type restriction in the config specification (repositories = section label, and verifying that label's type) -# or not. think about it... -# -# pps: any such isinstance check _must_ do the check after an instantiation attempt. remember that class is in reality -# a callable, which can include functions that are _not_ classes, but return objects via whatever screwed up logic internal -# to the func (think static factory func for accessing a singleton, although bad example since you can implement singleton -# within the class definition via __new__, but I digress)... -# -# ppps: if it's required, state it. don't assume just cause it is a default, that not listing a setting in required is valid -# it's anal, but it _will_ help to catch screwups in section definition changes. -# -# pppps: Fairly sure at some point the town folk will come around with the pitchforks, torches and that special glimmer in their eyes -# if positional args for initialization isn't supported in someway (regardless of the fun of implementing it), so think about -# possibilities for pulling it off (required ordering lifted from section def and/or callable?) - - -[profile] -incrementals = USE FEATURES ACCEPT_KEYWORDS ACCEPT_LICENSE CONFIG_PROTECT_MASK CONFIG_PROTECT PRELINK_PATH PRELINK_PATH_MASK -list = USE FEATURES ACCEPT_KEYWORDS ACCEPT_LICENSE CONFIG_PROTECT_MASK CONFIG_PROTECT PRELINK_PATH PRELINK_PATH_MASK - package.keywords package.use package.unmask package.mask -defaults = class -class = portage.ebuild.profiles.oldstyle -required = class - -[domain] -instantiate = portage.config.parser.domain -required = repositories profile root class -section_ref = repositories profile -pre = config repositories -incrementals = USE FEATURES ACCEPT_KEYWORDS ACCEPT_LICENSE CONFIG_PROTECT_MASK CONFIG_PROTECT PRELINK_PATH PRELINK_PATH_MASK -list = USE FEATURES ACCEPT_KEYWORDS ACCEPT_LICENSE CONFIG_PROTECT_MASK CONFIG_PROTECT PRELINK_PATH PRELINK_PATH_MASK - package.keywords package.use package.unmask package.mask repositories -defaults = class root -class = portage.config.domain -root = / - -[repo] -#instantiate = portage.config.instantiation.repo -required = class location -defaults = class -class = portage.ebuild.repository -section_ref = cache sync sync_cache -#list = cache -package.keywords = portage.config.handler.keywords -package.mask = portage.config.handler.mask -package.unmask = portage.config.handler.unmask - -[cache] -required = class location label auxdbkeys -defaults = class auxdbkeys location label -class = portage.cache.flat_list.database -auxdbkeys = %(metadata_keys)s -location = %(cache_base_loc)s -list = auxdbkeys -positional = location label auxdbkeys - -[exec] -autoexec = true - -[sync] -required = class url -defaults = class -class = portage.sync.rsync - -[DEFAULT] -metadata_keys = DEPEND RDEPEND SLOT SRC_URI RESTRICT HOMEPAGE LICENSE DESCRIPTION KEYWORDS INHERITED IUSE CDEPEND - PDEPEND PROVIDE -cache_base_loc = /var/cache/edb/dep/ diff --git a/rewrite-misc/config b/rewrite-misc/config deleted file mode 100644 index 2e6eabf..0000000 --- a/rewrite-misc/config +++ /dev/null @@ -1,45 +0,0 @@ -[/usr/portage] -type = cache - -[rsync repo] -type = repo -class = portage.ebuild.repository -location = /usr/portage -cache = '/usr/portage' - -#[vdb] -#type = repo -#class = portage.installed_pkg.repository -#location = /var/db/pkg - -[base config] -type = config -USE = nptl nptlonly -gnome -oss mad matroska faad mpg avi -arts mmx mmxext flac bidi dvd ssl sdl xvid 3dnow 3dnowext - sse sse2 mythtv rtc -svga -ipv6 win32codecs -esd -DISTDIR = "/space/distfiles" -FEATURES = confcache parallel-fetch -#package.use = %(CONFDIR)/package.use -#package.mask = %(CONFDIR)/package.mask -#package.unmask = %(CONFDIR)/package.unmask -#package.keywords = %(CONFDIR)/package.keywords - -[profile] -type = profile -base_repo = 'rsync repo' -profile = default-linux/x86/2005.0 - -[x86] -CFLAGS = "-O2 -march=pentium4 -pipe" -CHOST = "i686-pc-linux-gnu" -profile = profile -inherit = 'base config' -ACCEPT_KEYWORDS = "x86" -inherit = 'base config' - -[livefs domain] -inherit = x86 -type = domain -default = yes -repositories = "rsync repo" -#vdb - diff --git a/rewrite-misc/config.txt b/rewrite-misc/config.txt deleted file mode 100644 index ea360ed..0000000 --- a/rewrite-misc/config.txt +++ /dev/null @@ -1,155 +0,0 @@ -===NOTE=== -If you're _truly_ interested in what config does/supports currently, look at conf_default_types. lot of info there. -This is kept for historical reasons, and cause it explains the idea/layout a bit more -That said, it _is_ out of date (sorry, shit moves fast), config section no longer exists, it was merged into domain - -make.conf backwards compatibility bit still applies, and is pretty straightforward/easy to pull off actually. -~harring -===BACK TO YOUR PREVIOUSLY SCHEDULED PROGRAMMING=== - -win.ini style format (yay). - -sections that define type are acted upon. no type definition, and the section is ignored unless explicitly inherited -if type is defined, exempting configs type, class must be defined. -extra options are handed off to the class for initialization - -repository for example, - -[rsync repo] -type = repo -class = portage.ebuild.repository -location = /usr/portage - -each section is capable of specifying inherit targets. inherit's specify the base section to pull in, and override. -can still access the original value via similar bash trick- -CFLAGS = %(CFLAGS) -g -for example. - -few words on each section (note the type of the section is declareed explicitly, otherwise it's just a config 'group' that is only -used by inherit's) - -[repo] - must specify class - REPO_LABEL is automatically defined for all cache instances. - frozen is a boolean, specifies if cache staleness is corrected, or errored out. - can (and is advisable for rsync) specify a sync_cache. - this cache is instantiated after a sync, the normal cache's cloned (contents) to it on sync. - if repo is sync'd, it must drop it's assumptions about the current tree. In other words, you update it, it forgets what it knows, - and starts mapping things out again. Repo must be _totally_ live, no "pardon, reinstantiate it after syncing". - Shouldn't be hard via IndexableSequence; just add a method (forget?) that wipes any internal caches to the repo. - remote repo's, unless caching, shouldn't suffer this and should just set .forget to lambda : True - -[sync] - can only be bound to a repo. - must specify class - -[cache] - must specify class - REPO_LABEL is available; it's the repo 'label' (section, really) that the cache is associated with (repo specifies this) - if no path is specified, assumed path is %(CONFIG_PATH)/%(REPO_LABEL) (# change in behaviour, but not user visible) - can only be bound to a repo - -[config] - if a class is specified, the class must be a callable, and will be handed that sections config. - the config section that defines a class is removed, and the config(s?) returned by the callable are inserted into the global - config. returned types are marked as configs (eg, can't slip a domain in via this route). - -[domain] - config(s?) specified must be type=config - class is optional. if it's not specified, it's assumed to be a stand alone domain (think root="/", normal keywords). - if class is specified, it's passed the remaining config options, with the global config passed as the first arg (positional) - why allow class? cause it can be used to setup/specify interdomain dependencies, requiring the toolchain for ppc on an x86 - system for example, or being abused for doing interdomain deps for chroot domains. - - obviously that stuff needs to be worked out, but this 'hook' should allow it. fun fun. - -[exec] - the fun one. - post parsing the config file that holds a type=exec section, _all_ exec sections are one by one removed and executed. - valid 'commands' is - include = some-other-file - - don't try including a file multiple times. cyclic detection will need to be implemented at some point. - if class is specified for an exec type, it's the path to a callable that returns a global level config, and the existing - global level config is updated with the returned config (iow, exec can override what's defined in the file) - - -Instantiating repos/caches/syncs/etc occurs on demand, as needed, with the exception of exec sections. -In other words, the config *could* have errors in it, but they won't be hit till the config is totally initialized. - -Secondary tool (simple bugger) that just requests all domains/repos from the config would handle this; would force full parsing -of the config (including all package.*), and would chuck errors if encountered. -Otherwise, for sanity/speed sake, config is executed/instantiated as needed determined by caller requests. - - -What does the class see for instantiation? - -dependant on the type of the section. config parser knows to remove -package.use, package.keywords, package.mask, package.unmask, and allowed_merges, which name file(s) that are parsed, and used for -a visibility wrapper of the repo. Any slaving of repo's to a repo that defines visibility wrappers gets the wrapped repo, not the -raw repo. All package.* are effectively location types, meaning they're (currently) file paths, with %(CONFIG_PATH)/ assumed -That assumption may change however. - -remaining options after any mangling above are handed to the class type specified for a section. -so portage.ebuild.repository.__init__ will get basedir="/usr/portage" for a dict arg. (Example above) - - -allowed_merges file - -Specifies atoms that control what can be merged. Think of it as either the uber "you ain't merging this bubba" for vdb (not very useful), -or, bit more useful, list of atoms that are binpkg'd, specifiable per merge_target repo. can't apply it to an ebuild repo, can -apply it to a binpkg/rpm repo though. - - -package.*, visibility wrappers. - -A repo class *also* can, and likely will define it's own visibility wrappers, as will the config (ACCEPT_KEYWORDS). -Minor design note; wrappers take away from repo.match's capabilities to hand off crap to a potentially faster resolver remotely -(consider situation where the repo is a rdbms; visibility filter can be handed off to pl/sql funcs or massive where clause) - -determination of whether or not a repo defines it's own global visibility filter is done via inspection of the repo class- -repo.visibility_config -If set to False, niadda, otherwise it is either a callable that returns, or is already, a config object. -In other words, the repo on initialization is _raw_, callers must instantiate the visibility wrapper (this is a candidate for api wrapping) - -The wrapper is given an instantiated repository instance (or possibly a callable that returns it, this isn't set in stone however) as -first arg, -Wrapper should/will be smart enough to filter out restrictions that don't apply to that repo. - -possibly after category is mapped, drop restrictions that don't match categories. Debatable. -Not debatable, filter out restrictions that are domain/repo specific, eg, don't hold onto a restriction for repo xyz when you're -wrapping abc. - -visibility wrappers are *not* added if repo.allow_visibility_filtering exists, and is true. -VDB doesn't need a visibility wrapper, and shouldn't be allowed wrapped. Config should/will know not to attempt this, but checks within -the visibility wrapper should assert this also. - - -profiles - -if profile is specified, creates repo visibility wrappers to work with it. -implicit implication is that you can specify a profile per actual repository. not sure about this. -can also specify it per config, and per domain. - -profile is specified per config. all sections can specify an 'inherit' target(s), which is a section to pull values from, and override. - - - -MAKE.CONF BACKWARDS COMPATIBILITY - -assumes /etc/make.profile points at a valid profile , which is used to define the profile for the config. -make.conf is read, and converted into a config section, all of this is bound under a default domain with root="/". -PORTDIR is removed and used for ebuild repo's location -PORTDIR_OVERLAY is removed, and sections are created for each, slaving them to PORTDIR, creating a final repositorySet that binds them -together. -/etc/portage/package.* is used as a visibility wrapper on repositorySet. - -if FEATURES="binpkg" is defined, then a binpkg repository section is generated, and PKGDIR is removed and used as location for the -repository. - -defaults are lifted from /usr/share/portage/defaults.config ; basically make.global, but in the new config format, and treated as a -non-modifiable data file, and stored elsewhere - -Note that effectively make.conf's existance just serves to mangle defaults.config. it's a mapping of old options into new, with all -unknown options being used as config fodder (literally, default config section gets 'em). - diff --git a/rewrite-misc/default.config b/rewrite-misc/default.config deleted file mode 100644 index d870dcc..0000000 --- a/rewrite-misc/default.config +++ /dev/null @@ -1,40 +0,0 @@ -#unused atm, bind it in somehow. - -[rsync cache] -type = cache -class = portage.cache.flat_list -path = %(CACHE_PATH) - -[rsync repo] -type = repo -class = portage.ebuild.repository -path = /usr/portage -cache = 'rsync cache' - -[vdb] -type = repo -class = portage.installed_pkg.repository -path = - -[x86] -type = config -USE="nptl nptlonly -gnome -oss mad matroska faad mpg avi -arts mmx mmxext flac bidi dvd ssl sdl xvid 3dnow 3dnowext -sse sse2 mythtv rtc -svga -ipv6 win32codecs -esd" -DISTDIR = "/space/distfiles" -FEATURES = "confcache parallel-fetch" -package.use = %(CONFDIR)/package.use -package.mask = %(CONFDIR)/package.mask -package.unmask = %(CONFDIR)/package.unmask -package.keywords = %(CONFDIR)/package.keywords -CFLAGS = "-O2 -march=pentium4 -pipe" -CHOST = "i686-pc-linux-gnu" -profile = "rsync repo/profiles/default-linux/x86/2005.0" -inherit = 'base config' -ACCEPT_KEYWORSD = "x86" - -[default domain] -type = domain -root = "/" -repositories = 'rsync repo' vdb -config = x86 - diff --git a/rewrite-misc/example-complex.config b/rewrite-misc/example-complex.config deleted file mode 100644 index 618297f..0000000 --- a/rewrite-misc/example-complex.config +++ /dev/null @@ -1,55 +0,0 @@ -# note this is no longer a valid config. just exists for information/example of domain flexibility/intentions. -# ~harring - -[rsync cache] -type = cache -class = portage.cache.flat_list -basedir = %(VDB_PATH) - -[rsync repo] -type = repo -class = portage.ebuild.repository -basedir = /usr/portage -cache = 'rsync cache' - -[vdb] -type = repo -class = portage.installed_pkg.repository - -[base config] -type = config -USE="nptl nptlonly -gnome -oss mad matroska faad mpg avi -arts mmx mmxext flac bidi dvd ssl sdl xvid 3dnow 3dnowext -sse sse2 mythtv rtc -svga -ipv6 win32codecs -esd" -DISTDIR = "/space/distfiles" -FEATURES = "confcache parallel-fetch" -package.use = %(CONFDIR)/package.use -package.mask = %(CONFDIR)/package.mask -package.unmask = %(CONFDIR)/package.unmask -package.keywords = %(CONFDIR)/package.keywords - -[x86] -type = config -CFLAGS = "-O2 -march=pentium4 -pipe" -CHOST = "i686-pc-linux-gnu" -profile = "rsync repo/profiles/default-linux/x86/2005.0" -inherit = 'base config' -ACCEPT_KEYWORSD = "x86" - -[ppc config] -type = config -CFLAGS = "-O2 -march=ppc -pipe" -CHOST = "darwin7.4" -inherit 'base config' -ACCEPT_KEYWORDS = "ppc" - -[default domain] -type = domain -root = "/" -repositories = 'rsync repo' vdb -config = x86 - -[ppc target] -type = domain -repositories = 'rsync repo' ppc-vdb -config = 'ppc config' -root = "/home/targets/ppc" diff --git a/rewrite-misc/intro b/rewrite-misc/intro deleted file mode 100644 index 06812a0..0000000 --- a/rewrite-misc/intro +++ /dev/null @@ -1,417 +0,0 @@ -e'yo. General description of layout/goals/info/etc, and semi sortta api. - -That and aggregator of random ass crazy quotes should people get bored. - -[DISCLAIMER] -This ain't the code. -In other words, the actual design/code may be radically different, and this document probably will trail any major -overhauls of the design/code (speaking from past experience). - -Updates welcome, as are suggestions and questions- please dig through all documentations in the dir this doc is in however, since -there is a lot of info (both current and historical) related to it. Collapsing info into this doc is attempted, but explanation of the -full restriction protocol (fex) is a _lot_ of info, and original idea is from previous redesign err... designs. -Short version, historical, but still relevant info for restriction is in layout.txt. -Other subsystems/design choices have their basis quite likely from other docs in this directory, so do your homework please :) - - -[FURTHER DISCLAIMER] -If this is implemented, which is being attempted, this is going to break the hell out of backwards compatibility api wise. -Writing a translation layer doesn't really seem possible either, since things are pretty radically different (imho) - -Sorry, but thems the breaks. Feel free to attempt it, but this docs author doesn't view it as possible/viable - - -[Terminology] -cp = category/package -cpv = category/package-version -ROOT = livefs merge point, fex /home/bharring/embedded/arm-target or more commonly, root=/ -vdb = /var/db/pkg , installed packages database. -domain = combination of repositories, root, and build information (use flags, cflags, etc). config data + repositories effectively -repository = tree's. ebuild tree (/usr/portage), binpkg tree, vdb tree, etc. -protocol = python name for design/api. iter() fex, is a protocol; it calls .next() on the passed in sequence, or wraps the sequence... - hesitate to call it defined hook on a class/instance, but this (crappy) description should suffice. - -[General design/idea/approach] -So... this round of "lets take another stab at gutting portage" seems to be proceeding, and not killed off by design flaws *again* -(famous last words I assure you), but general jist. All pythonic components installed by portage *must* be within portage.* namespace. - -No more polluting python's namespace, plain and simple. Third party plugins to portage aren't bound by this however (their mess, not ours). - -API flows from the config definitions, *everything* internal is effectively the same. Basically, config crap gives you your starter objects -which from there, you dig deeper into the innards as needed action wise. - -The general design is intended to heavily abuse OOP, something portage has lacked thus far aside from the cache subsystem (cache was -pretty much only subsystem that used inheritance rather then duplication). Further, delegation of actions down to components _must_ -be abided by, example being repo + cache interaction. repo does what it can, but for searching the cache, let the cache do it. -Assume what you're delegating to knows what the hell it's doing, and probably can do it's job better then some external caller (essentially). - -Actual configuration is pretty heavily redesigned. Look at conf_default_types (likely renamed at some point). -It's the meta-definition of the config... sort of. Basically the global config class knows jack, is generic, and is configured by the -conf_default_type. The intention is that the on disk configuration format is encapsulated, so it can be remote or completely different -from the win.ini format advocated by harring (mainly cause it's easiest since a functional and mostly not completely fricking -obnoxious parser exists already). - -Encapsulation, extensibility/modularity, delegation, and allowing parallelizing of development should be key focuses in -implementing/refining this high level design doc. -Realize parallelizing is a funky statement, but it's apt; work on the repo implementations can proceed without being held up by -cache work, and vice versa. Config is the central hold up, but that's mainly cause it instantiates everything, so the protocol for it -needs to be nailed down so that you know what positiona/optional args your class/callable will be receiving (that said, positiona/optional -is configurable via section definitions too). - -Final comment re: design goals, defining chunks of callable code and plugging it into the framework is another bit of a goal. -Think twisted, just not quite as prevalent (their needs/focus is much different from ours, twisted is the app, your code is the lib, -vice versa for portage). - -Back to config. Here's general notion of config 'chunks' (these map out to run time objects) - -domain--------------\ -| | -repository profile - -domain is configuration data, accept_(license|keywords), use, cflags, chost, features, etc. -profile, dependant on the profile class you choose is either bound to a repository, or to user defined location on disk -(/etc/portage/profile fex). Domain knows to do incremental crap upon profile settings, lifting package.* crap for visibility -wrappers for repositories also. - -repositories is pretty straightforward. portdir, binpkg, vdb, etc. - -Back to domain. Domain's are you definition of pretty much what can be done. Can't do jack without a domain, period. -Can have multiple domains also, and domains do *not* have to be local (remote domains being a different class type). -Clarifying, think of 500 desktop boxes, and a master box that's responsible for managing them. Define an appropriate domain class, -and appropriate repository classes, and have a config that holds the 500 domains (representing each box), and you can push updates out -via standard api trickery. In other words, the magic is hidden away, just define remote classes that match defined class rules -(preferably inheriting from the base class, since isinstance sanity checks will become the norm), and you could do -emerge --domain some-remote-domain -u glsa -on the master box. Emerge won't know it's doing remote crap. Portagelib won't even. It'll just load what you define in the config. - -Ambitious? Yeah, a bit. Thing to note, the remote class additions will exist outside of portage proper most likely. Develop the -code needed in parallel to fleshing portage proper out. - -Meanwhile, the remote bit + multiple domains + class overrides in config definition is _explicitly_ for the reasons above. That -and x-compile/embedded target building, which is a bit funkier. - -Currently, portage has DEPEND and RDEPEND. How do you know what needs be native to that box to build the package? -Literally, how do you know which atoms, say the toolchain, must be native vs what package's headers/libs must exist to build it? -We need an additional metadata key, BDEPEND (build depends). - -If you have BDEPEND, you know what actually is ran locally in building a package, vs what headers/libs are required. -Subtle differance, but BDEPEND would allow (with a sophisticated depresolver) toolchain to be represented in deps, rather then -the current unstated dep approach profiles allow. - -Aside from that, BDEPEND could be used for x-compile via inter-domain deps; a ppc target domain on a x86 box would require BDEPEND -from the default domain (x86). So... that's useful. - -Not yet proposed to dev ml, and adds to developer workload slightly, although it's a worthwhile sell. - - -[Config design] -Portage thus far (<=2.0.51*) has had variable ROOT (livefs merge point), but no way to vary configuration data aside from via a buttload of -env vars. Further, there has been only one repository allowed (overlays are just that, extensions of the 'master' repository). -Addition of support of any new format is mildly insane due to hardcoding up the wing wang in the code, and extension/modification -of existing formats (ebuild) has some issues (namely the doebuild block of code). - -Goal is to address all of this crap. Format agnosticism at the repository level is via an abstracted repository design that should -supply generic inspection attributes to match other formats. Specialized searching is possible via match, thus extending the -extensibility of the prototype repository design. - -Format agnosticism for building/merging is somewhat reliant on the repo, namely package abstraction, and abstraction of building/merging -operations. - -On disk configurations for alternatives formats is extensible via changing section types, and plugging them into the domain definition. - -Note alt. formats quite likely will never be implemented in portage proper, that's kind of the domain of portage addons. In other words, -dpkg/rpm/whatever quite likely won't be worked on by portage developers, at least not in the near future (too many other things to do). - -The intention is to generalize the framework so it's possible for others to do so if they choose however. - -Why is this good? Ebuild format has issues, as does our profile implementation. At some point, alternative formats/non-backwards -compatible tweaks to the formats (ebuild or profile) will occur, and then people will be quite happy that the framework is generalized -(seriously, nothing is lost from a proper abstracted design, and flexibility/power is gained). - - -[config's actions/operation] -portage.config.load_config() is the entrance point, returns to you a config object (portage.config.central). -This object gives you access to the user defined configs, although only interest/poking at it should be to get a domain object from it. - -domain object is instantiated by config object via user defined configuration (/etc/portage/config namely). domains hold instantiated -repositories, bind profile + user prefs (use/accept_keywords) together, and _should_ simplify this data into somewhat user friendly methods. -(define this better). - -Normal/default domain doesn't know about other domains, nor give a damn. Embedded targets are domains, and _will_ need to know about the -livefs domain (root=/), so buildplan creation/handling may need to be bound into domains. - - -[Objects/subsystems/stuff] -So... this is general naming of pretty much top level view of things, stuff emerge would be interested in (and would fool with). -hesitate to call it a general api, but it probably will be as such, exempting any abstraction layer/api over all of this -(good luck on that one }:] ). - - -:IndexableSequence: -functions as a set and dict, with caching and on the fly querying of info. -mentioned due to use in repository and other places... (it's a useful lil sucker) - - -:global config object (from portage.config.load_config()): -#simple bugger. -.get_types() # get the section types. -.get_object() # return instantiated section -.list_objects(type) # iterable, given a type, yield section names of that type. -# and, just to make it damn fun, you can also access types via (fex, domain being a type) -.domains # IndexableSequence, iterating == section labels, index == instantiate and return that section type - -convenience function in portage.config.* (somewhere) -default_domain(config_obj) -returns instantiated domain object of the default domain from config_obj. -Nothing incredibly fancy, finds default domain via config._cparser.defaults().get("domain"), or -via iterating over config.domain, returning the first domain that is root="/" -what does the cparser bit map out to in the config? -[DEFAULT] -domain = some-section-label -#the iterating route sucks, and will be a bit slower. default approach is recommended. - - -:domain object: -# bit of debate on this one I expect. -# any package.{mask,unmask,keywords} mangling is instantiating as a wrapper around repository instances upon domain instantiation. -# code _should_ be smart and lift any package.{mask,unmask,keywords} wrappers from repositoriy instances and collapse it, pointing -# at the raw repo (basically don't have N wrappers, collapse it into a single wrapper). Not worth implementing until the wrapper is -# a faster implementation then the current portage.repository.visibility hack though (currently O(N) for each pkg instance, N being -# visibility restrictions/atoms). Once it's O(1), collapsing makes a bit more sense (can be done in parallel however). -# a word on inter repository dependencies... simply put, if the repository only allows satisfying deps from the same repository, -# the package instance's *DEPEND atom conversions should include that restriction. Same trickery for keeping ebuilds from depping on -# rpm/dpkg (and vice versa). -.repositories # in the air somewhat on this one. either indexablesequence, or a repositorySet. - # nice aspect of the latter is you can just use .match with appropriate restrictions. very simply interface - # imo, although should provide a way to pull individual repositories/labels of said repos from the set though. - # basically, mangle a .raw_repo indexablesequence type trick (hackish, but nail it down when reach that bridge) -.configure_package() # the contentious one. either a package instance returned from repositories is configured already, or it's returned - # unconfigured, and passed through configure_package to get a configured_package. - # it's slightly uglier for the resolver to have to do the .configure_package route, but note that the configuration - # data _should not_ be bound to the repo (repo is just packages), it's bound to the domain. so... either that config - # data is shoved down into some repo wrapper, or handled at this level. - # that said, if it's at this level, it makes the .repositories.match() with use restrictions a bit funky in terms of - # the "is it configured?" special casing... - # debate and flesh this one out... - - -:build plan creation: -# Jason kindly chuck some details in here, lest harring makes a fool of himself trying to write out info on it himself... - - -:sets: -# Marius, kindly chuck in some details here. probably defined via user config and/or profile, although what's it define? -# atoms/restrictions? itermatch might be useful for a true set - - -:build/setup operation: -(need a good name for this; dpkg/rpm/binpkg/ebuild's 'prepping' for livefs merge should all fall under this, with varying use of the hooks) -.build() # do everything, calling all steps as needed -.setup() # whatever tmp dirs required, create 'em. -.req_files() # (fetchables, although not necessarily with url (restrict="fetch"...) -.unpack() # guess. -.configure() # unused till ebuild format version two (ya know, that overhaul we've been kicking around? :) -.compile() # guess. -.test() # guess. -.install() # install to tmp location. may not be used dependant on the format. -.finalize() # good to go. generate (jit?) contents/metadata attributes, or returns a finalized instance - - -:repo change operation: -# base class. -.package # package instance of what the action is centering around. -.start() # notify repo we're starting (locking mainly, although prerm/preinst hook also) -.finish() # notify repo we're done. -.run() # high level, calls whatever funcs needed. individual methods are mainly for ui, this is if you don't display - # "doing install now... done... doing remove now... done" stuff. - -:remove operation: -# derivative of repo change operation -.remove() # guess. -.package # package instance of what's being yanked. - - -:install operation: -# derivative of repo change operation -.package # what's being installed. -.install() # install it baby. - - -:merge operation: -# derivative of repo remove and install (so it has .remove and .install, which must be called in .install and .remove order) -.replacing # package instance of what's being replaced. -.package # what's being installed - - -:fetchables: -# basically a dict of stuff jammed together, just via attribute access (think c struct equiv) -.filename -.url # tuple/list of url's. -.chksums # dict of chksum:val - - -:fetcher: -# hey hey. take a guess. -# worth noting, if fetchable lacks .chksums["size"], it'll wipe any existing file. if size exists, and existing file is bigger, -# wipe file, and start anew, otherwise resume. -# mirror expansion occurs here, also. -.fetch(fetchable, verifier=None) # if verifier handed in, does verification. - - -:verifier: -# note this is basically lifted conceptually from mirror_dist. if wondering about the need/use of it, look at that source. -verify() # handed a fetchable, either False or True - - -:repository: -# this should be format agnostic, and hide any remote bits of it. -# this is general info for using it, not designing a repository class -.mergable() # true/false. pass a pkg to it, and it reports whether it can merge that or not. -.livefs # boolean, indicative of whether or not it's a livefs target- this is useful for resolver, shop it to other repos, binpkg fex - # prior to shopping it to the vdb for merging to the fs. Or merge to livefs, then binpkg it while continuing further building - # dependant on that package (ui app's choice really). -.raw_repo # either it weakref's self, or non-weakref refs another repo. why is this useful? visibility wrappers... - # this gives ya a way to see if p.mask is blocking usable packages fex. useful for the UI, not too much for - # portagelib innards. -.frozen # boolean. basically, does it account for things changing without it's knowledge, or does it not. frozen=True is faster - # for ebuild trees for example, single check for cache staleness. frozen=False is slower, and is what portage does now - # (meaning every lookup of a package, and instantiation of a package instance requires mtime checks for staleness) -.categories # IndexableSequence, if iterated over, gives ya all categories, if getitem lookup, sub-category category lookups. - # think media/video/mplayer -.packages # IndexableSequence, if iterated over, all package names. if getitem (with category as key), packages of that category. -.versions # IndexableSequence, if iterated over, all cpvs. if getitem (with cat/pkg as key), versions for that cp -.itermatch() # iterable, given an atom/restriction, yields matching package instances. -.match() # def match(self, atom): return list(self.itermatch(atom)) # voila. -.__iter__() # in other words, repository is iterable. yields package instances. -.sync() # sync, if the repo swings that way. - # flesh it out a bit, possibly handing in/back ui object for getting updates... - -digressing for a moment... - -note you can group repositories together, think portdir + portdir_overlay1 + portdir_overlay2. -Creation of a repositoryset basically would involve passing multiple instantiating repo's, and depending on that classes semantics, -it internally handles the stacking (right most positional arg repo overrides 2nd right most, ... overriding left most) -So... stating it again/clearly if it ain't obvious, everything is configuration/instantiating of objects, chucked around/mangled by the -portagelib framework. - -What _isn't_ obvious is that since a repository set gets handed instantiated repositories, each repo, _including_ the set instance, can -should eb able to have it's own cache (this is assuming it's ebuild repos through and through). Why? -Cache data doesn't change for the most part exempting which repo a cpv is from, and the eclass stacking. Handled individually, a cache -bound to portdir _should_ be valid for portdir alone, it shouldn't carry data that is a result of eclass stacking from another overlay + -that portdir. That's the business of the repositoryset. -Consequence of this is that the repositoryset needs to basically reach down into the repository it's wrapping, get the pkg data, _then_ -rerequest the keys from that ebuild with a different eclass stack. -This would be a bit expensive, although once inherit is converted to a pythonic implementation (basically handing the path to the requested -eclass down the pipes to ebuild*.sh), it should be possible to trigger a fork in the inherit, and note python side that multiple sets of -metadata are going to be coming down the pipe. That should alleviate the cost a bit, but it also makes multiple levels of cache reflecting -each repository instance a bit nastier to pull off till it's implemented. - -So... short version. Harring is a perfectionist, and says it should be this way. reality of the situation makes it a bit trickier. -Anyone interested in attempting the mod, feel free, otherwise harring will take a crack at it since he's being anal about having it work -in such a fashion. - -Or... could do thus. repo + cache as a layer, wrapped with a 'regen' layer that handles cache regeneration as required. -Via that, would give the repositoryset a way to override and use it's own specialized class that ensures each repo gets what's proper -for it's layer. Think raw_repo type trick. - -continuing on... - - -:cache: -# ebuild centric, although who knows (binpkg cache ain't insane ya know). -# short version, it's functionally a dict, with sequence properties (iterating over all keys). -.keys() # return every cpv/package in the db. -.readonly # boolean. is it modifiable? -.match() # flesh this out. either handed a metadata restriction (or set of 'em), or handed dict with equiv info (like the former). - # ebuild caches most likely *should* return mtime information alongside, although maybe dependant on readonly. - # purpose of this? Gives you a way to hand off metadata searching to the cache db, rather then the repo having to resort - # to pulling each cpv from the cache and doing the check itself. - # This is what will make rdbms cache backends finally stop sucking and seriously rocking, properly implemented at least. :) - # clarification, you don't call this directly, repo.match delegates off to this for metadata only restrictions - - -:restriction: -# see layout.txt for more fleshed out examples of the idea. -# note, match and pmatch have been reversed namewise. -.match() # handed package instance, will return bool of whether or not this restriction matches. -.pmatch() # 'optimized' interface. basically, you hand it the data it tests, rather then a package instance. - # basically, for a category restriction (fex), def match(self, p): return self.pmatch(p.category) - # get the jist? it holds the actual test, if the restriction can be collapsed down to a test of a single value. - # .pmatch calling should only be done by self, or code that does isinstance checks and hands off data itself rather then - # doing an instantion. .pmatch is exposing a bit of the match protocol so that optimizations are potentially possible in - # executing match checks (think repo.match). -.itermatch() # new one, debatable. short version, giving a sequence of package instances, yields true/false for them. - # why might this be desirable? if setup of matching is expensive, this gives you a way to amoritize the cost. - # jason/marius/alec, thoughts? - # might have use for glsa set target. define a restriction that limits to installed pkgs, yay/nay if update is avail... - -:restrictionSet: -# mentioning it merely cause it's a grouping (boolean and/or) of individual restrictions -# an atom, which is in reality a category restriction, package restriction, and/or version restriction is a -# boolean and set of restrictions - - -:ContentsRestriction: -# whats this you say? a restriction for searching the vdb's contents db? Perish the thought! ;) - - -:metadataRestriction: -Mentioning this for the sake of pointing out a subclass of it, DescriptionRestriction- this will be a -class representing matching against description data. See repo.match and cache.match above. -The short version is that it encapsulates the description search (a *very* slow search right now) so that -repo.match can hand off to the cache (delegation), and the cache can do the search itself, however it sees fit. - -So... for the default cache, flat_list (19500 ebuilds == 19500 files to read for a full searchDesc), still is slow unless flat_list -gets some desc. cache added to it internally. If it's a sql based cache, the sql_template should translate the query into -the appropriate select statement, which should make it *much* faster. - -Restating that, delegation is *absolutely* required. There have been requests to add intermediate caches to the tree, or move data -(whether collapsing metadata.xml or moving data out of ebuilds) so that the form it is stored is in quicker to search. -These approaches are wrong. Should be clear from above that a repository can, and likely will be remote on some boxes. Such a shift -of metadata does nothing but make repository implementations that harder, and shift power away from what knows best how to use it. -Delegation is a massively more powerful approach, allowing for more extensibility, flexibility and *speed*. - -Final restating- searchDesc is matching against cache data. The cache (whether flat_list, anydbm, sqlite, or a remote sql based cache) -is the *authority* about the fastest way to do searches of it's data. -Programmers get pist off when users try and tell them how something internally should be implemented- it's fundamentally the same scenario. -The cache class the user chooses knows how to do it's job the best, provide methods of handing control down to it, and let it do it's -job (delegation). Otherwise you've got a backseat driver situation, which doesn't let those in the know, do the deciding (cache knows, -repo doesn't). - -Mind you not trying to be harsh here. If in reading through the full doc you disagree, question it; if after speeding up current -cache implementation, note that any such change must be backwards compatible, and not screw up the possibilities of encapsulation/delegation -this design aims for. - - -:logging: -flesh this out (define this basically). -short version, no more writemsg type trickery, use a proper logging framework. - - -[ebuild-daemon.sh] -Hardcoded paths *have* to go. /usr/lib/portage/bin == kill it. -Upon initial loadup of ebuild.sh, dump the default/base path down to the daemon, *including* a setting for /usr/lib/portage/bin . -Likely declare -xr it, then load the actual ebuild*.sh libs. -Backwards compatibility for that is thus, ebuild.sh defines the var itself in global scope if it's undefined. Semblence of backwards -compatibility (which is actually somewhat pointless since I'm about to blow it out of the water). - -Ebuild-daemon.sh needs a function for dumping a _large_ amount of data into bash, more then just a line or two. - -For the ultra paranoid, we load up eclasses, ebuilds, profile.bashrc's into python side, pipe that to gpg for verification, then -pipe that data straight into bash. No race condition possible for files used/transferred in this manner. - -A thought. The screw around speed up hack preload_eclasses added in ebd's heyday of making it as fast as possible would be one route; -Basically, after verification of an elib/eclass, preload the eclass into a func in the bash env. and declare -r the func after the fork. -This protects the func from being screwed with, and gives a way to (at least per ebd instance) cache the verified bash code in memory. - -It could work surprisingly enough (the preload_eclass command already works), and probably be fairly fast versus the alternative. -So... the race condition probably can be flat out killed off without massive issues. Still leaves a race for perms on any files/*, but neh. -A) That stuff shouldn't be executed, B) security is good, but we can't cover every possibility (we can try, but dimishing returns) - -A lesser, but still tough version of this is to use the indirection for actual sourcing to get paths instead. -No EBUILD_PATH, query python side for the path, which returns either '' (which ebd interprets as "err, something is whacked, time to -scream"), or the actual path. - -In terms of timing, gpg verification of ebuilds probably should occur prior to even spawning ebd.sh. profile, eclass, and elib -sourcing should use this technique to do on the fly verification though. -Object interaction for that one is going to be *really* fun, as will be mapping config settings to instantiation of objs. diff --git a/rewrite-misc/layout.txt b/rewrite-misc/layout.txt deleted file mode 100644 index 66a1683..0000000 --- a/rewrite-misc/layout.txt +++ /dev/null @@ -1,273 +0,0 @@ -===NOTE=== -This was written _way_ the hell back in the past, it may not map to the current iteration of design/goals. -Some goofy/interesting/good ideas in it, good for historical info. - -Rewrite this once the sucker is actually fleshed out. -"In our next episode of hellsing, we finally bring peace and quiet to our fair london town, -our final episode... -Hellfire! -do do doo da... -Sweet, baby..." -===Harring was bored, continue about your business=== - -specification of subsystems/relevant classes. -this isn't a concrete "it must be this way", this is a guideline of the various subsystems/import classes, -and how they interact. - -The intention being that you can read this, see the important aspects of portage at a single glass, -and be aware of where/which subsystems touch up, and how things fit together - -sync subsystem/class: - #sync'ing method. - #potentially limited to a specific tree type. detection/complaints regarding this should be - #detected/bailed upon during tree initialization (?) - boolean sync() - -cachedb subsystem/class: - #metadata cache. non structure caching, just metadata caching (for instances where it's - #ass slow getting the keys, eg bash based formats) - #format agnostic, state the keys stored up front at initialization, and that's what stored. - #this conflicts with portage_db_flat. course that format sucks, so neh. - #note, not necessarily required, and is a property of the defined repository/overlay - #additionally, note the cache is a db. it doesn't update itself, it just retrieves/stores - #data. - functions as a dict. - __getitem__ - __setitem__ - __delitem__ - get_matches(SearchRestrictions): - #assuming the cache can be stated upto date, or never drifts from the tree - #or, just using the cache to handle the bulk of the cpv's. - -class src_format: - #abstract class representing a package to be acted upon. - #this is not a cpv, which is just (really) some random string a tree/cache spits - #this instance is basically a handler. - #note these are high level definitions. individual formats are free to define - #what ever phases they want w/in the high level format. - get_src_uri - #stuff to fetch for this to be used - build - #high level represenation of building a src based package. - #note binpkgs just return - merge - #actual transferrance/installation to either the livefs to an externally - #specified location - unmerge - #high level representation of any potential commands to execute prior to - #removing this format's files. prerm/postrm fex. - get_metadata (currently ebuild.py:ebuild_handler.get_keys) - #get metadata. *all* available metadata. if the format allows for undefined values, - #return None if the metadata is undefined. - # - #formerly ebuild.py:ebuild_handler.get_keys - -class Package: - # this is an atomic package returned from a repository. JIT binding of metadata attributes, category/package/name/version - # are attributes additionally presuming the underlying format supports it - - unique_id - # each derivative *must* define a unique_id that represents that versioned pkg; this is used for caching of instances. - - pkg_id - # each derivative *must* define a pkg_id representing the category/package, non versioned (if the repository supports - # multiple package/versions/slots- dpkg, fex would define package-version as the key, due to their namespace - # layout) - # key must be an immutable instance, due to potential for hashing. - - version_cmp(other-instance) - # each derivative *must* define this; it's for comparing instances when the key is the same (cpv is the same). - # used by the depresolver to determine the 'highest' version package instance. - # for dpkg (again, fex), version_cmp would be basically a key compare. - # for ebuilds, it would compare slot, then version - # returns either -1, 0, or 1 to indicate if the instance (instance.version_cmp) is lt/eq/gt the passed in version - - get_handler - # this should be bound to the src repository, via that the src_format- the instance should be able to return - # an instance of the src_format handler class, for doing building/installing/etc - - data - #attribute, functions as a dict. don't care how it's implemented, whether via descriptors (going that route for JIT), - #or a customized dict derivative. - #fex, for ebuildPackageInstance, holds (currently) - #category, package, version, SLOT, DESCRIPTION, DEPENDS, RDEPENDS, CDEPENDS, PDEPENDS, SRC_URI, KEYWORDS, RESTRICT, - #HOMEPAGE, etc. auxdbkeys. - #attributes *should* be access via lowercase. - # - #This is debatable. - #mostly I just hate the uppercase for auxdbkeys. - - _get_metadata - # access the handed in repository, and get metadata - -# immediate derivatives -class ebuildPackageInstance(Package): - this is a common derivative of PackageInstance that holds the key attribute setting, and version_cmp logic. - get_handler being defined here, or required handled in derivates will be defined at the time of implementation - the crystal ball is sometimes a bit foggy, additionally genbot's 8ball functionally seems not too random :/ - - -class indexable sequence: #stating it here - either can iterate over it ala list, or access it via a hashable object - example, using catpkg as key, and versions values - for x in instance: == cpv - instance[catpkg] == versions of that cp - -class protoTree - #base tree class. repository configuration file/specification is used in constructing this instance, - #namely specification of cacheing backend (if any), and sync'ing method (if any) - #cache isn't directly used by this class, although the update_cache method is a maintenance method - #for syncing the cache up with the tree (just as the sync function is used to sync the local tree - #to a remote tree) - - #note, not all repositories may have categories, or versions persay. - #flat namespaces of packages fex, won't. Probably need a special case then - # - # yes, special cases suck, but what other approach is there? - # we *have* to have a way for external code to inspect/walk the repository... custom attributes - # for walking the repository will only make things messier (inspect the instance to figure out how to inspect the instance? - # no thank you :) - categories = indexable sequence. for x in categories == walk all categories. categories[cat] == get subcategory - packages = indexable sequence. for x in packages == all cp. packages[category] == all packages in category - versions = indexable sequence. for x in versions == all cpv. versions[cp] == cat/packages versions - - - search(RestrictionSet) - = handed a RestrictionSet, returns PackageInstances that match the passed in Restrictions - - sync = sync this tree. the actual sync method is defined by the repository configuration, - and is a sync class instance. - - update_cache = cache update method, for walking the tree and cleansing/updating the cache. - if the repository config states update the cache on sync, this is called. - seperated due to the fact that the cache backend is variable, may not even be used - (eg no cache). - - #additionally, the instance itself functions as a indexable sequence for getting *all* packageInstances in this repository. - #so... you can either do for x in instance == get *package-cpv* of all cpv, or instance[cpv] to get a specific package-cpv - -class gentoo_ebuild_repository - # this is a derivative of protoTree that has the usual repository characteristics- categories, versions, packages, etc. - __get_categories(self, *optional_base_category) - = derivatives overload this to return categories, or if an optional - positional arg is specified, the sub-categories- non recursive. - returns a tuple of str - __get_versions(str package) - = derivatives overload this to return versions available for a package - returns a tuple of str - __get_packages(str category) - = derivatives overload this to return packages avaiable for a category - returns a tuple of str - - # note our current bintree, and ebuild tree should derive from this. - # this is just an intermediate derivative holding common code. - # remote binhost fex, would maintain a similar attribute layout, but wouldn't derive from this. - # why? cause it's method of access is *far* different from the common approach, despite maintaining similar - # notions of category/package/versions - -search subsystem/classes: - - # These are just the building blocks of other restrictions. - - class StrRestriction(object): - # these aren't really Restrictions persay; they're the building blocks of actual Restrictions. - match(str or instance that can be coerced to a str) - - class StrExactRestriction(StrRestriction): - __init__(value, CaseSensitive=True) - # class for seeing if two strings *are the exact same*, after accounting for case sensitivity. - match(str or instance that can be coerced to a str) - - class StrSubStringRestriction(StrRestriction): - __init__(value, CaseSensitive=True) - # class representing matching a substring in the handed in value. - match(str or instance that can be coerced to a str) - - class StrRegexRestriction(StrRestriction): - __init__(regex, CaseSensitive=True): - # take a guess. - match(str or instance that can be coerced to a str) - - - class BaseRestriction(object): - # all derivatives *should* be __slots__ based to decrease mem overhead (potentially creating a lot of these - # suckers) unless otherwise warranted. - # it's minor, but most restrictions are write once- using a new style class w/ __slots__ makes the write once/ - # error second write behaviour easily doable, and generalized in this base restriction. - pmatch(PackageInstance) - # general, high level non optimized match. - # requires a package instance, derivatives will look in PackageInstance.data to do their matching. - - - class AtomicRestriction(BaseRestriction): - # has the usual pmatch method, plus a direct access method - match(value) - # direct access matching. This should hold the actual implementation of the matching check. - # pmatch should just contain the code for getting at the actual value. - # this method exists to allow for code that deals w/ restrictions, to directly hand values to the check - # - # **NOTE** RestrictionSets lack this method. This method *should* be defined only for atomic Restrictions, - # eg, individual checks. - - - # the first real, package specific restriction. - class PackageDataRestriction(AtomicRestriction): - __init__(data_name, StrRestriction instance) - # data_name can be anything technically. - # typically either category, package, version, or one of the auxdbkeys. - # an initialized StrRestriction derivative is passed in, and used for matching. - match(value): - # again, the direct access method. all matching code should be here. - pmatch(PackageInstance): - # the non-specific route. handed a PackageInstance. - - class VersionRestriction(PackageDataRestriction): - # implements version specific restriction rules - - class RestrictionSet(BaseRestriction): - # abstraction over a set of individual restrictions. - # builds a list of derivatives of Restriction class- note I said *derivatives* - # RestrictionSet is a derivative of Restriction. - # In other words, you can nest these buggers. - - __init__(*initialRestrictions) - #initialRestrictions is optional. basically, all args are grouped into a list, and used as the initial - #list of Restrictions (non-finalized) - #basically is the equiv of getting the instance, then calling .addRestriction repeatedly - #must be a list. a RestrictionSet is a Restriction derivative, so it would be added as is. - - addRestriction(self, Restriction-Instance): - #append the passed in restriction to the current chain of restrictions. - - finalize(self): - # optimize this chain (if viable/possible). - # mostly just convert it from a list to a tuple, and do it recursively - # across all held RestrictionSets in this instance. - - pmatch(self, PackageInstance): - # run through the checks, returning true/false indicating if this set of restrictions matches, or doesn't. - - class AndRestrictionSet(RestrictionSet): - # run through the list of restrictions, and'ing their returns together. - - class OrRestrictionSet(RestrictionSet): - # run through the list of restrictions, or'ing their returns toegether. - - class PackageRestriction(AndRestrictionSet): - # this is basically an atom. - # for >=dev-util/diffball-0.6_pre4, holds - # (PackageDataRestriction('category',StrExactRestriction('dev-util')), - # PackageDataRestriction('name',StrExactRestriction('diffball')), - # PackageDataRestriction('version',StrExactRestriction('dev-util'))) - # - # basically just a simple, mostly non modifying AndRestrictionSet. It is a special class - # such that it can be easily identified by code via isintance checks, and will serve as the base - # for potentially deriving a custom (per format) variation, that has an optimized version of .finalize - - class ConfigRestriction: - # restrictions that apply to the systems configuration. eg, a package being built with a certain use flag enabled. - - -class depresolver: - #pluggable. - diff --git a/src/Makefile.am b/src/Makefile.am deleted file mode 100644 index 1e04f34..0000000 --- a/src/Makefile.am +++ /dev/null @@ -1,16 +0,0 @@ -SUBDIRS = - -bin_PROGRAMS = -if BUILD_TBZ2TOOL -bin_PROGRAMS += tbz2tool -endif - -if BUILD_FILTER_ENV -SUBDIRS += filter-env -endif - -if BUILD_MISSINGOS -SUBDIRS += python-missingos -endif - -tbz2tool_SOURCES = tbz2tool.c diff --git a/src/bsd-flags/PKG-INFO b/src/bsd-flags/PKG-INFO deleted file mode 100644 index f2cb5c5..0000000 --- a/src/bsd-flags/PKG-INFO +++ /dev/null @@ -1,10 +0,0 @@ -Metadata-Version: 1.0 -Name: bsd-chflags -Version: 0.1 -Summary: UNKNOWN -Home-page: UNKNOWN -Author: Stephen Bennett -Author-email: spb@gentoo.org -License: UNKNOWN -Description: UNKNOWN -Platform: UNKNOWN diff --git a/src/bsd-flags/chflags.c b/src/bsd-flags/chflags.c deleted file mode 100644 index a5893d4..0000000 --- a/src/bsd-flags/chflags.c +++ /dev/null @@ -1,161 +0,0 @@ -/* $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/src/bsd-flags/chflags.c,v 1.2 2005/02/26 07:23:49 jstubbs Exp $ */ - -#include "Python.h" - -#include <sys/stat.h> - -static char chflags_lchflags__doc__[]; -static PyObject * chflags_lchflags(PyObject *self, PyObject *args); -static char chflags_lgetflags__doc__[]; -static PyObject * chflags_lgetflags(PyObject *self, PyObject *args); -static char chflags_lhasproblems__doc__[]; -static PyObject * chflags_lhasproblems(PyObject *self, PyObject *args); - -static char chflags__doc__[] = "Provide some operations for manipulating" \ - "FreeBSD's filesystem flags"; - -static PyMethodDef chflags_methods[] = { - {"lchflags", chflags_lchflags, METH_VARARGS, chflags_lchflags__doc__}, - {"lgetflags", chflags_lgetflags, METH_VARARGS, chflags_lgetflags__doc__}, - {"lhasproblems", chflags_lhasproblems, METH_VARARGS, chflags_lhasproblems__doc__}, - {NULL, NULL} -}; - -static char chflags_lchflags__doc__[] = -"lchflags(path, flags) -> None\n\ -Change the flags on path to equal flags."; - -static char chflags_lgetflags__doc__[] = -"lgetflags(path) -> Integer\n\ -Returns the file flags on path."; - -static char chflags_lhasproblems__doc__[] = -"lhasproblems(path) -> Integer\n\ -Returns 1 if path has any flags set that prevent write operations;\n\ -0 otherwise."; - -static const unsigned long problemflags=0x00160016; - -#if defined __FreeBSD__ -static PyObject *chflags_lchflags(PyObject *self, PyObject *args) -{ - char *path = NULL; - int flags; - int res; - - if (!PyArg_ParseTuple(args, "eti:lchflags", - Py_FileSystemDefaultEncoding, &path, - &flags)) - { - return NULL; - } - - res = lchflags(path, flags); - - PyMem_Free(path); - return PyInt_FromLong((long)res); -} - -static PyObject *chflags_lhasproblems(PyObject *self, PyObject *args) -{ - char *path = NULL; - struct stat sb; - int res; - - if (!PyArg_ParseTuple(args, "et:lhasproblems", - Py_FileSystemDefaultEncoding, &path)) - { - return NULL; - } - - res = lstat(path, &sb); - - PyMem_Free(path); - - if (res < 0) - { - return PyInt_FromLong((long)res); - } - - if (sb.st_flags & problemflags) - return PyInt_FromLong(1); - else - return PyInt_FromLong(0); -} - -static PyObject *chflags_lgetflags(PyObject *self, PyObject *args) -{ - char *path = NULL; - struct stat sb; - int res; - - if (!PyArg_ParseTuple(args, "et:lgetflags", - Py_FileSystemDefaultEncoding, &path)) - { - return NULL; - } - - res = lstat(path, &sb); - - if (res < 0) - { - PyMem_Free(path); - return PyInt_FromLong((long)res); - } - - PyMem_Free(path); - - return PyInt_FromLong((long)sb.st_flags); -} - -#else -#warning Not on FreeBSD; building dummy lchflags - -static PyObject *chflags_lgetflags(PyObject *self, PyObject *args) -{ - /* Obviously we can't set flags if the OS/filesystem doesn't support them. */ - return PyInt_FromLong(0); -} - -static PyObject *chflags_lchflags(PyObject *self, PyObject *args) -{ - /* If file system flags aren't supported, just return 0, - as the effect is basically the same. */ - return PyInt_FromLong(0); -} - -static PyObject *chflags_lhasproblems(PyObject *self, PyObject *args) -{ - return PyInt_FromLong(0); -} - -#endif - -static int ins(PyObject *m, char *symbolname, int value) -{ - return PyModule_AddIntConstant(m, symbolname, value); -} - -DL_EXPORT(void) initchflags(void) -{ - PyObject *m; - m = Py_InitModule4("chflags", chflags_methods, chflags__doc__, - (PyObject*)NULL, PYTHON_API_VERSION); - - ins(m, "UF_SETTABLE", 0x0000ffff); - ins(m, "UF_NODUMP", 0x00000001); - ins(m, "UF_IMMUTABLE", 0x00000002); - ins(m, "UF_APPEND", 0x00000004); - ins(m, "UF_OPAQUE", 0x00000008); - ins(m, "UF_NOUNLINK", 0x00000010); - - ins(m, "SF_SETTABLE", 0xffff0000); - ins(m, "SF_NODUMP", 0x00010000); - ins(m, "SF_IMMUTABLE", 0x00020000); - ins(m, "SF_APPEND", 0x00040000); - ins(m, "SF_OPAQUE", 0x00080000); - ins(m, "SF_NOUNLINK", 0x00100000); - ins(m, "SF_SNAPSHOT", 0x00200000); - - ins(m, "PROBLEM_FLAGS", 0x00160016); -} diff --git a/src/bsd-flags/setup.cfg b/src/bsd-flags/setup.cfg deleted file mode 100644 index f92c494..0000000 --- a/src/bsd-flags/setup.cfg +++ /dev/null @@ -1,6 +0,0 @@ -# bsd-flags -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/src/bsd-flags/setup.cfg,v 1.2 2005/02/26 07:23:49 jstubbs Exp $ - -[bdist_rpm] -release = 1 -python=python2 diff --git a/src/bsd-flags/setup.py b/src/bsd-flags/setup.py deleted file mode 100644 index 23bdc7c..0000000 --- a/src/bsd-flags/setup.py +++ /dev/null @@ -1,24 +0,0 @@ -#! /usr/bin/env python -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/src/bsd-flags/setup.py,v 1.2 2005/02/26 07:23:49 jstubbs Exp $ - -from os import chdir, stat -from distutils.core import setup, Extension - -setup (# Distribution meta-data - name = "bsd-chflags", - version = "0.1", - description = "", - author = "Stephen Bennett", - author_email = "spb@gentoo.org", - license = "", - long_description = \ - '''''', - ext_modules = [ Extension( - "chflags", - ["chflags.c"], - libraries=[], - ) - ], - url = "", - ) - diff --git a/src/filter-env/Makefile.am b/src/filter-env/Makefile.am deleted file mode 100644 index 3c3ed13..0000000 --- a/src/filter-env/Makefile.am +++ /dev/null @@ -1,3 +0,0 @@ -bin_PROGRAMS = filter-env -filter_env_SOURCES = posix.c bmh_search.c bmh_search.h - diff --git a/src/filter-env/bmh_search.c b/src/filter-env/bmh_search.c deleted file mode 100644 index 4d9f74c..0000000 --- a/src/filter-env/bmh_search.c +++ /dev/null @@ -1,21 +0,0 @@ -/* raided from http://www.dcc.uchile.cl/~rbaeza/handbook/algs/7/713b.srch.c.html -aparently distributed by Addison-Wesley Publishing Co. Inc, http://aw.com/ -*/ - -#include <string.h> -#define MAXCHAR 256 - -const char *bmh_search( const char *pat, const char *text, int n ) -{ int i, j, k, m, skip[MAXCHAR]; - - m = strlen(pat); - if( m==0 ) return( text ); - for( k=0; k<MAXCHAR; k++ ) skip[k] = m; - for( k=0; k<m-1; k++ ) skip[pat[k]] = m-k-1; - - for( k=m-1; k < n; k += skip[text[k] & (MAXCHAR-1)] ) { - for( j=m-1, i=k; j>=0 && text[i] == pat[j]; j-- ) i--; - if( j == (-1) ) return( text+i+1 ); - } - return( NULL ); -} diff --git a/src/filter-env/bmh_search.h b/src/filter-env/bmh_search.h deleted file mode 100644 index e44fdff..0000000 --- a/src/filter-env/bmh_search.h +++ /dev/null @@ -1,5 +0,0 @@ -/* raided from http://www.dcc.uchile.cl/~rbaeza/handbook/algs/7/713b.srch.c.html -aparently distributed by Addison-Wesley Publishing Co. Inc, http://aw.com/ -*/ - -const char *bmh_search(const char *pat, const char *text, int n ); diff --git a/src/filter-env/posix.c b/src/filter-env/posix.c deleted file mode 100644 index 2ca2aba..0000000 --- a/src/filter-env/posix.c +++ /dev/null @@ -1,547 +0,0 @@ -#include <sys/types.h> -#include <sys/stat.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <fcntl.h> -#include <getopt.h> -#include <regex.h> -#include <unistd.h> -#include <ctype.h> -#include <assert.h> -#include "bmh_search.h" - -#define USAGE_FAIL 1 -#define MEM_FAIL 2 -#define IO_FAIL 3 -#define PARSE_FAIL 4 - -#define SPACE_PARSING 4 -#define ESCAPED_PARSING 3 -#define COMMAND_PARSING 2 -#define DOLLARED_QUOTE_PARSING 1 -#define NO_PARSING 0 - -void init_regexes(); -void free_regexes(); -int regex_matches(regex_t *re, const char *buff); -const char *process_scope(FILE *out_fd, const char *buff, const char *end, regex_t *var_re, regex_t *func_re, char endchar); -int append_to_filter_list(char ***list, int *count, int *alloced, const char *string); -const char *build_regex_string(const char **list, int count); -const char *walk_command(const char *p, const char *end, char endchar, const char interpret_level); - - -#define d1printf(expr...) dprintf(1,expr) -#define d2printf(expr...) dprintf(2,expr) -#define dprintf(level,expr...) \ - if(debugging>=level) \ - fprintf(stderr,expr); - -static int debugging; - -int -main(int argc, char *const *argv) -{ - FILE *file_in = NULL; - FILE *file_out = NULL; - char **funcs = NULL; char **vars = NULL; - char *file_buff=NULL; - const char *end = NULL; - int funcs_count = 0; int vars_count = 0; - int funcs_alloced = 0; int vars_alloced = 0; - int c; - size_t file_size=0, buff_alloced = 0; - regex_t vre, *pvre=NULL; - regex_t fre, *pfre=NULL; - const char *fsr, *vsr; - char *temp = NULL; - struct stat st; - debugging = 0; - funcs = (char **)malloc(sizeof(char *)*10); - vars = (char **)malloc(sizeof(char *)*10); - if(funcs == NULL || vars == NULL) { - fprintf(stderr,"failure allocing needed memory\n"); - exit(MEM_FAIL); - } - while((c = getopt(argc, argv, "i:f:v:d")) != EOF) { -// fprintf(stderr,"c=%i\n",c); - switch(c){ - case 'd': - debugging++; - break; - case 'i': - if(file_in != NULL) { - fprintf(stderr,"-i cannot be specified twice. bailing\n"); - exit(USAGE_FAIL); - } - if(stat(optarg, &st)){ - fprintf(stderr,"error stating file %s, bailing\n", optarg); - exit(IO_FAIL); - } - file_size=st.st_size; - file_in=fopen(optarg, "r"); - if(file_in == NULL) { - fprintf(stderr,"error opening file %s, bailing\n", optarg); - exit(IO_FAIL); - } - break; - case 'f': -// fprintf(stderr,"wassube. opt_art=%s\n",optarg); - if(append_to_filter_list(&funcs, &funcs_count, &funcs_alloced,optarg)) { - fprintf(stderr,"-f arg '%s', isn't valid. must be comma delimited\n", - optarg); - exit(USAGE_FAIL); - } - break; - case 'v': - if(append_to_filter_list(&vars, &vars_count, &vars_alloced,optarg)) { - fprintf(stderr,"-v arg '%s', isn't valid. must be comma delimited\n", optarg); - exit(USAGE_FAIL); - } - break; - default: - fprintf(stderr,"Usage [-i file] [-f func1,func2,func3 ] [-v func1,func2,func3 ]\n"); - exit(USAGE_FAIL); - } - } - if(file_size==0) { - file_in = stdin; - } else { - fclose(stdin); - } - file_out = stdout; - - fsr = build_regex_string((const char **)funcs, funcs_count); - d1printf("fsr buffer=%s\n", fsr); - vsr = build_regex_string((const char **)vars, vars_count); - d1printf("vsr buffer=%s\n", vsr); - if(fsr) { - // prefix ^ - if((temp = (char *)malloc(strlen(fsr) + 3)) == NULL) { - fprintf(stderr, "failed allocing needed memory for regex patterns.\n"); - exit(MEM_FAIL); - } - temp[0]='^'; temp[1] = '\0'; - temp = strcat(temp,fsr); - temp = strcat(temp,"$"); - d1printf("fsr pattern is %s\n", temp); - regcomp(&fre, temp, REG_EXTENDED); - free(temp); temp = NULL; - pfre=&fre; - free((void*)fsr); fsr = NULL; - } else - pfre=NULL; - if(vsr) { - if((temp = (char *)malloc(strlen(vsr) + 3)) == NULL) { - fprintf(stderr, "failed allocing needed memory for regex patterns.\n"); - exit(MEM_FAIL); - } - temp[0]='^'; temp[1] = '\0'; - temp = strcat(temp,vsr); - temp = strcat(temp,"$"); - d1printf("vsr pattern is %s\n", temp); - regcomp(&vre, temp, REG_EXTENDED); - free(temp); temp = NULL; - pvre=&vre; - free((void*)vsr); vsr = NULL; - } else - pvre=NULL; - - - if(file_size) { - file_buff = (char *)malloc(file_size + 1); - if(file_buff == NULL) { - fprintf(stderr, "failed allocing needed memory for file.\n"); - exit(MEM_FAIL); - } - if(file_size != fread(file_buff, 1, file_size, file_in)) { - fprintf(stderr, "failed reading file\n"); - exit(IO_FAIL); - } - } else { - if((file_buff = (char *)malloc(4096)) == NULL) { - fprintf(stderr, "failed allocing needed memory for file.\n"); - exit(MEM_FAIL); - } - buff_alloced = 4096; - c=4096; - while(c > 0) { - c=fread(file_buff+file_size, 1, 4096, file_in); - file_size += c; - // realloc +1 for null termination. - if(buff_alloced < file_size + 4096) { - if((file_buff = (char *)realloc(file_buff, buff_alloced + 4096)) == NULL) { - fprintf(stderr, "failed allocing needed memory for file.\n"); - exit(MEM_FAIL); - } - buff_alloced += 4096; - } - } - d1printf("read %i bytes\n", file_size); - } - file_buff[file_size] = '\0'; - fclose(file_in); - - init_regexes(); - end=process_scope(file_out,file_buff, file_buff + file_size,pvre, pfre, '\0'); - d1printf("%i == %i\n", end - file_buff, file_size); - - fflush(file_out); - fclose(file_out); - free_regexes(); - free((void*)fsr); free((void*)vsr); - free(file_buff); - exit(0); -} - -int -append_to_filter_list(char ***list, int *count, int *alloced, const char *string) -{ - char *d = NULL; - char **l = *list; - char *s = NULL; - s = strdup(string); - d = strtok(s, ","); - if(d == NULL) - return 1; - while(d != NULL) { - if(*alloced == *count) { - if( (l=(char **)realloc(l, sizeof(char*) * (*alloced + 10))) == NULL) { - return 1; - } - *alloced+=10; - } - l[*count] = d; - (*count)++; - d=strtok(NULL,","); - } - *list=l; - return 0; -} - -const char * -build_regex_string(const char **list, int count) -{ - char *buff, *p; - const char *p2; - int l = 0, x = 0, escaped = 0; - - for(x=0; x< count; x++) { - l += strlen(list[x]) + 1; - p2=list[x]; - // if it's ., substitute a [^ =] internally. - while(*p2!='\0'){ - if(*p2=='.') - l+=4; - p2++; - } - } - if(l == 0) - return NULL; - //shave off the extra '|' char, add in '(...)'. hence, 3. - buff = malloc(l + 5); - memset(buff,0,l+4); - buff[0] = '('; - p=buff + 1; - for(x=0; x < count; x++) { - p2=list[x]; - escaped=0; - while(*p2 != '\0') { - if(*p2=='.' && escaped==0) { - strcat(p,"[^= ]"); - p += 4; - } else if(*p2 == '\\') { - *p = *p2; - p2++; p++; - if(escaped == 1) - escaped=0; - else - escaped=1; - continue; - } else { - *p = *p2; - } - p++; - p2++; - escaped=0; - } - *p = '|'; - p++; - } - p[-1] = ')'; - p[0] = '\0'; - return buff; -} - -regex_t func_r; -regex_t var_r; - -void -init_regexes() -{ - regcomp(&func_r,"^(function[[:space:]]+|)([^\"'()=[:space:]]+)[[:space:]]*\\(\\)[[:space:]]*\\{",REG_EXTENDED); - regcomp(&var_r,"^([^=[:space:]$(]+)=",REG_EXTENDED); -} -void -free_regexes() -{ - regfree(&func_r); - regfree(&var_r); -} - -/* -fprintf(stderr,"REG_BADRPT:%i\nREG_BADBR:%i\nREG_EBRACE:%i\nREG_EBRACK:%i\nREG_ERANGE:%i\nREG_ECTYPE:%i\nREG_EPAREN:%i\nREG_ESUBREG:%i\nREG_EEND:%i\nREG_EESCAPE:%i\nREG_BADPAT:%i\nREG_ESIZE:%i\nREG_ESPACE:%i\n", -REG_BADRPT,REG_BADBR,REG_EBRACE,REG_EBRACK,REG_ERANGE,REG_ECTYPE,REG_EPAREN,REG_ESUBREG,REG_EEND,REG_EESCAPE, -REG_BADPAT,REG_ESIZE,REG_ESPACE); -*/ - -// zero for doesn't match, !0 for matches. -int -regex_matches(regex_t *re, const char *buff) -{ - regmatch_t match[1]; - match[0].rm_so = match[0].rm_eo = -1; - assert(buff != NULL); - assert(re != NULL); - regexec(re, buff, 1, match, 0); -// fprintf(stderr,"result was %i for %s, returning %i\n", match[0].rm_so, buff,i); - return match[0].rm_so != -1 ? 1 : 0; -} - -const char * -process_scope(FILE *out_fd, const char *buff, const char *end, regex_t *var_re, regex_t *func_re, char endchar) -{ - const char *p = NULL; - const char *window_start = NULL, *window_end = NULL; - const char *new_p = NULL; - const char *com_start = NULL; - const char *s = NULL, *e = NULL; - char *temp_string = NULL; - int x; - - regmatch_t matches[3]; - p=buff; - for(x=0; x < 3; x++) - matches[x].rm_so = -1; - - window_start = buff; - window_end = NULL; - while(p < end && *p != endchar) { - // wander forward to the next non space. - if(window_end != NULL) { - if(out_fd != NULL) - fwrite(window_start, window_end - window_start, 1, out_fd); - window_start = p; - window_end = NULL; - } - com_start = p; - if(isspace(*p)) { - p++; continue; - } - // ignore comments - if(*p == '#') { - while(p < end && *p != '\n') { - p++; - } -// window_end = p; - continue; - } - // actual text. - regexec(&func_r, p, 3, matches, 0); - if(matches[0].rm_so != -1){ - //got us a func match. - if(matches[2].rm_so != -1) { - s = p + matches[2].rm_so; e = p + matches[2].rm_eo; - } else { - s = p; e = p + matches[1].rm_eo; - } - temp_string = (char*)malloc(e - s + 1); - memset(temp_string,0,e - s + 1); - memcpy(temp_string,s, e - s); - d1printf("matched func name '%s'\n", temp_string); - //output it if it doesn't match. - - new_p=process_scope(NULL,p + matches[0].rm_eo, end, NULL, NULL, '}'); - d1printf("ended processing '%s'\n", temp_string); - if(func_re!=NULL && regex_matches(func_re, temp_string)) { - //well, it matched. so it gets skipped. - d1printf("filtering func '%s'\n", temp_string); - window_end = com_start; - } - - p = new_p; -// p += matches[0].rm_eo; - free(temp_string); - temp_string = NULL; - for(x=0; x < 3; x++) - matches[x].rm_so = -1; - - } else { - // check for env assignment - regexec(&var_r, p, 2, matches, 0); - if(matches[0].rm_so == -1) { - //exactly as it sounds, non env assignment. - p=walk_command(p,end,'\0',COMMAND_PARSING); - } else { - //env assignment - temp_string=(char*)malloc(matches[1].rm_eo + 1); - memset(temp_string,0,matches[1].rm_eo + 1); - memcpy(temp_string,p, matches[1].rm_eo); - d1printf("matched env assign '%s'\n", temp_string); - p += matches[0].rm_eo; - for(x=0; x < 3; x++) - matches[x].rm_so = -1; - - if(p >= end) - return p; - if('\''==*p) - p=walk_command(p + 1,end,*p,NO_PARSING); - else if('"' == *p || '`' == *p) - p=walk_command(p + 1,end,*p,ESCAPED_PARSING); - else if('(' == *p) - p=walk_command(p + 1,end,')',ESCAPED_PARSING); - else if(isspace(*p)) { - while(p < end && isspace(*p) && *p != '\n') - p++; - } else if('$' == *p) { - if(p + 1 >= end) { - p++; - continue; - } - if('(' == p[1]) { - p=walk_command(p + 2,end, ')',ESCAPED_PARSING); - } else if('\'' == p[1]) { - p=walk_command(p + 2,end, '\'', DOLLARED_QUOTE_PARSING); - } else if('{' == p[1]) { - p=walk_command(p + 2,end, '}', ESCAPED_PARSING); - } else { - x=0; - while(p < end && (!isspace(*p) || x)) { - if('\\' == *p) - x=1; - else - x=0; - p++; - } - } - p++; - } else { - // blah=cah ; single word. - p=walk_command(p + 1,end, ' ',SPACE_PARSING); - } - if(var_re!=NULL && regex_matches(var_re, temp_string)) { - //this would be filtered. - window_end = com_start; - } - free(temp_string); - temp_string=NULL; - } - } - p++; -// fprintf(stderr,"at byte %i of %i\n", p - buff, strchr(buff,'\0') - buff); - } -// fprintf(stderr, "returning %x\n", p); - if(out_fd != NULL) { - if(window_end == NULL) - window_end = p; - if(window_end > end) - window_end = end; - fwrite(window_start, window_end - window_start, 1,out_fd); - } - return p; -} - -// interpret level == 0, no interprettation (no escaping), 1 == normal command limiting, 2 == wait strictly for -// endchar -const char * -walk_command(const char *p, const char *end, char endchar, const char interpret_level) -{ - int escaped = 0; - int dollared = 0; - int here_count = 0; - regex_t here_re; - char *here_pattern; - regmatch_t match[1]; - char *temp_string = NULL; - const char *end_here; - int x; - while(p < end) { - if(*p == endchar || - (interpret_level == COMMAND_PARSING && (';'==*p || '\n'==*p)) || - (interpret_level == SPACE_PARSING && isspace(*p))) { - if(!escaped) - return p; - } else if(NO_PARSING==interpret_level) { - p++; - continue; - } else if('\\' == *p && !escaped) { - escaped = 1; p++; continue; - } else if(escaped) { - escaped = 0; - } else if(DOLLARED_QUOTE_PARSING == interpret_level) { - p++; - continue; - } else if('<' == *p) { - here_count++; - if(2 == here_count && interpret_level == COMMAND_PARSING) { - p++; - if(p >= end) { - fprintf(stderr, "bailing\n"); - return p; - } - while(p < end && (isspace(*p) || '-' == *p)) - p++; - if('\'' == *p || '"' == *p) { - end_here = walk_command(p + 1,end,*p,NO_PARSING); - p++; - } else { - end_here = walk_command(p,end,' ',SPACE_PARSING); - } -// d1printf("end_here=%.5s\n",end_here); - d2printf("matched '%.*s' for a here word\n", end_here -p, p); - temp_string = malloc(end_here -p + 1); - memcpy(temp_string, p, end_here - p); - temp_string[end_here - p] = '\0'; - // XXX watch this. potential for horkage. need to do the quote removal thing. - //this sucks. - - end_here++; - if(end_here >= end) { - return end_here; - } - end_here = bmh_search(temp_string, end_here, end - end_here); - d1printf("bmh returned %i\n", end_here); - if(end_here) { - d2printf("bmh = %.10s\n", end_here); - p=end_here + strlen(temp_string) -1 ; - d2printf("continuing on at %.10s\n", p); - } else { - p = end; - } - free(temp_string); - here_count = 0; - } else { - d2printf("noticed '<', interpret_level=%i\n", interpret_level); - p++; continue; - } - } else if('$' == *p && !dollared && !escaped) { - dollared = 1; p++; continue; - } else if('{' == *p) { - //process_scope. this gets fun. -// fprintf(stderr,"process_scope called for %.10s\n", p - 10); -// p=process_scope(NULL,p+1,end,NULL,NULL,'}'); - p=walk_command(p+1,end, '}', ESCAPED_PARSING); - // kind of a hack. - } else if('(' == *p && interpret_level == COMMAND_PARSING) { - p=walk_command(p + 1, end, ')',ESCAPED_PARSING); - } else if('`' == *p || '"' == *p) { - p=walk_command(p + 1, end, *p, ESCAPED_PARSING); - } else if('\'' == *p && '"' != endchar) { - p=walk_command(p + 1, end, '\'', NO_PARSING); - } - p++; - escaped=0; - dollared=0; - } - return p; -} diff --git a/src/python-missingos/ChangeLog b/src/python-missingos/ChangeLog deleted file mode 100644 index 2bea75d..0000000 --- a/src/python-missingos/ChangeLog +++ /dev/null @@ -1,16 +0,0 @@ -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/src/python-missingos/ChangeLog,v 1.4 2003/03/22 14:24:38 carpaski Exp $ - -python-missingos ChangeLog -Jonathon D Nelson <jnelson@gentoo.org> -2 April 2002 - - 2 April 2002 14:15 jnelson - * Add optional 'mode' parameter to mknod - * Change from missingosmodule to missingos. - * Add some __doc__ entries - * Remove stupid hack for Python 1.5.2 support, - 1.5.2 doesn't have Py_FileSystemDefaultEncoding anyway. - * Return description of error when mode not p,b,c,u in mknod - - 2 April 2002 12:10 jnelson - * Populate files diff --git a/src/python-missingos/Makefile.in b/src/python-missingos/Makefile.in deleted file mode 100755 index e368143..0000000 --- a/src/python-missingos/Makefile.in +++ /dev/null @@ -1,25 +0,0 @@ -INSTALL = @INSTALL@ - -all: - setup.py build - -install: - setup.py install --root $(DESTDIR) - -DISTFILES = setup.py \ - Makefile.in \ - PKG-INFO \ - README \ - missingos.c \ - setup.cfg \ - ChangeLog -distdir: - for x in $(DISTFILES); do \ - $(INSTALL) -D $$x $(distdir)/$$x; \ - done - chmod 755 $(distdir)/setup.py - - -clean: -.PHONY: clean install all distdir - diff --git a/src/python-missingos/PKG-INFO b/src/python-missingos/PKG-INFO deleted file mode 100644 index cb8087f..0000000 --- a/src/python-missingos/PKG-INFO +++ /dev/null @@ -1,10 +0,0 @@ -Metadata-Version: 1.0 -Name: python-missingos -Version: 0.2 -Summary: UNKNOWN -Home-page: UNKNOWN -Author: Jonathon D Nelson -Author-email: jnelson@gentoo.org -License: UNKNOWN -Description: UNKNOWN -Platform: UNKNOWN diff --git a/src/python-missingos/README b/src/python-missingos/README deleted file mode 100644 index 1b6a384..0000000 --- a/src/python-missingos/README +++ /dev/null @@ -1,15 +0,0 @@ -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/src/python-missingos/README,v 1.5 2003/11/10 08:30:55 carpaski Exp $ - -python-missingos -Jonathon D Nelson <jnelson@gentoo.org> -2 April 2002 - -INTRO -===== -This module provides some missing file operations that don't -seem to be provided by the standard os and posix modules. -This list currently includes lchown and mknod. - -COPYRIGHT -========= -GPL diff --git a/src/python-missingos/missingos.c b/src/python-missingos/missingos.c deleted file mode 100644 index 005407d..0000000 --- a/src/python-missingos/missingos.c +++ /dev/null @@ -1,120 +0,0 @@ -/* $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/src/python-missingos/missingos.c,v 1.5 2003/03/22 14:24:38 carpaski Exp $ */ - -#include "Python.h" - -#include <sys/types.h> -#include <sys/stat.h> -#include <fcntl.h> -#include <unistd.h> - -static char missingos_lchown__doc__[]; -static PyObject * missingos_lchown(PyObject *self, PyObject *args); -static char missingos_mknod__doc__[]; -static PyObject * missingos_mknod(PyObject *self, PyObject *args); - -static char missingos__doc__[] = "Provide some operations that\ - are missing from the standard os / posix modules."; - -static PyMethodDef missingos_methods[] = { - {"lchown", missingos_lchown, METH_VARARGS, missingos_lchown__doc__}, - {"mknod", missingos_mknod, METH_VARARGS, missingos_mknod__doc__}, - {NULL, NULL} /* sentinel */ -}; - -static PyObject * -posix_error_with_allocated_filename(char* name) -{ - PyObject *rc = PyErr_SetFromErrnoWithFilename(PyExc_OSError, name); - PyMem_Free(name); - return rc; -} - -static char missingos_lchown__doc__[] = -"lchown(path, uid, gid) -> None\n\ -Change the owner and group id of path to the numeric uid and gid."; - -static PyObject * -missingos_lchown(PyObject *self, PyObject *args) { - char *path = NULL; - int uid, gid; - int res; - if (!PyArg_ParseTuple(args, "etii:lchown", - Py_FileSystemDefaultEncoding, &path, - &uid, &gid)) - return NULL; - res = lchown(path, (uid_t) uid, (gid_t) gid); - if (res < 0) - return posix_error_with_allocated_filename(path); - PyMem_Free(path); - Py_INCREF(Py_None); - return Py_None; -} - -static char missingos_mknod__doc__[] = -"mknod(path, type, major, minor [, mode=0600 ]) -> None\n\ -Create a special file. Mode fixed at 0600.\ -Note that for type 'p' major and minor are ignored.\ -"; - -static PyObject * -missingos_mknod(PyObject *self, PyObject *args) { - char *path = NULL; - char *type = NULL; - int major = 0; - int minor = 0; - mode_t real_mode; - dev_t real_dev; - int mode = 0600; - - int res; - if (!PyArg_ParseTuple(args, "etsii|i:mknod", - Py_FileSystemDefaultEncoding, &path, - &type, &major, &minor, &mode)) - return NULL; - /* type can be *one* of b, c, u, p */ - /* major/minor are forbidden for p, reqd otherwise */ - if (!strcmp(type, "p")) { - /* pipe */ - if (major != 0 || minor != 0) { - return NULL; - } - real_mode = S_IFIFO; - major = 0; - minor = 0; - } else if (!strcmp(type, "b")) { - /* block */ - real_mode = S_IFBLK; - } else if (!strcmp(type, "c")) { - real_mode = S_IFCHR; - /* char */ - } else if (!strcmp(type, "u")) { - real_mode = S_IFCHR; - /* unbuffered char */ - } else { - /* error */ - PyErr_SetString(PyExc_ValueError, "type must be one of p,b,c,u"); - return NULL; - } - - real_mode |= mode; - real_dev = (major << 8) | minor; - - /* use mode to modify real_mode */ - - res = mknod(path, real_mode, real_dev); - if (res < 0) - return posix_error_with_allocated_filename(path); - PyMem_Free(path); - Py_INCREF(Py_None); - return Py_None; -} - - -DL_EXPORT(void) -initmissingos(void) { - PyObject *m; - - m = Py_InitModule4("missingos", missingos_methods, - missingos__doc__, (PyObject *)NULL, - PYTHON_API_VERSION); -} diff --git a/src/python-missingos/setup.cfg b/src/python-missingos/setup.cfg deleted file mode 100644 index 1afd1fc..0000000 --- a/src/python-missingos/setup.cfg +++ /dev/null @@ -1,8 +0,0 @@ -# python-missingos -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/src/python-missingos/setup.cfg,v 1.4 2003/03/22 14:24:38 carpaski Exp $ - -[bdist_rpm] -release = 1 -doc_files = ChangeLog - README -python=python2 diff --git a/src/python-missingos/setup.py b/src/python-missingos/setup.py deleted file mode 100755 index a1c16ae..0000000 --- a/src/python-missingos/setup.py +++ /dev/null @@ -1,24 +0,0 @@ -#! /usr/bin/env python2.2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/src/python-missingos/setup.py,v 1.5 2003/03/22 14:24:38 carpaski Exp $ - -from os import chdir, stat -from distutils.core import setup, Extension - -setup (# Distribution meta-data - name = "python-missingos", - version = "0.2", - description = "", - author = "Jonathon D Nelson", - author_email = "jnelson@gentoo.org", - license = "", - long_description = \ - '''''', - ext_modules = [ Extension( - "missingos", - ["missingos.c"], - libraries=[], - ) - ], - url = "", - ) - diff --git a/src/tbz2tool.c b/src/tbz2tool.c deleted file mode 100644 index e279e18..0000000 --- a/src/tbz2tool.c +++ /dev/null @@ -1,228 +0,0 @@ -/* $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/src/tbz2tool.c,v 1.4 2004/11/05 13:51:09 jstubbs Exp $ */ - -#include <stdio.h> -#include <stdlib.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <unistd.h> -#include <errno.h> -#include <string.h> - -/*buffered reading/writing size*/ -#define BUFLEN 262144 -char *myname="tbz2tool"; -struct stat *mystat=NULL; -void *mybuf; -FILE *datafile, *dbfile, *outfile, *infile; -unsigned char endbuf[8]; -long seekto,insize; - -int exists(const char *myfile) { - int result; - result=stat(myfile,mystat); - if (result==-1) - return 0; - return 1; -} - -void writefile(FILE *src, FILE *dest) { - int count=1; - while (count) { - count=fread(mybuf, 1, BUFLEN, src); - fwrite(mybuf, 1, count, dest); - } -} - -void writefileto(FILE *src, FILE *dest, int endpos) { - int pos=ftell(src); - int thiscount; - while (pos < endpos) { - /* thiscount=how much to read */ - thiscount=endpos-pos; - if (thiscount>BUFLEN) - thiscount=BUFLEN; - thiscount=fread(mybuf, 1, thiscount , src); - /* thiscount=how much we actually did read */ - if (thiscount==0) - /* eof -- shouldn't happen */ - break; - /* update internal position counter */ - pos+=thiscount; - fwrite(mybuf, 1, thiscount, dest); - } -} - -int main(int argc, char **argv) { - if ((argc==2) && (!(strcmp(argv[1],"--help")))) - goto usage; - if (argc!=5) { - printf("%s: four arguments expected\n",myname); - goto error; - } - if (!(mystat=(struct stat *) malloc(sizeof(struct stat)))) - goto memalloc; - - if (!(mybuf=(void *) malloc(BUFLEN))) { - free(mystat); - goto memalloc; - } - - /* JOIN MODE */ - if (!(strcmp(argv[1],"join"))) { - - /* check if datafile exists */ - if (!(exists(argv[2]))) { - printf("%s: %s doesn't exist\n",myname,argv[2]); - free(mystat); - goto error; - } - - /* check if dbfile exists */ - if (!(exists(argv[3]))) { - printf("%s: %s doesn't exist\n",myname,argv[3]); - free(mystat); - goto error; - } - /* create end buffer for later use */ - endbuf[0]=((mystat->st_size) & 0xff000000) >> 24; - endbuf[1]=((mystat->st_size) & 0x00ff0000) >> 16; - endbuf[2]=((mystat->st_size) & 0x0000ff00) >> 8; - endbuf[3]=(mystat->st_size) & 0x000000ff; - endbuf[4]='S'; - endbuf[5]='T'; - endbuf[6]='O'; - endbuf[7]='P'; - - /* if outfile exists, unlink first (safer) */ - if (exists(argv[4])) - unlink(argv[4]); - - /* open datafile for reading */ - if ((datafile=fopen(argv[2],"r"))==NULL) { - free(mybuf); - free(mystat); - printf("%s: Error opening %s\n",myname,argv[2]); - goto error; - } - - /* open dbfile for reading */ - if ((dbfile=fopen(argv[3],"r"))==NULL) { - fclose(datafile); - free(mybuf); - free(mystat); - printf("%s: Error opening %s\n",myname,argv[3]); - goto error; - } - - /* open outfile for writing */ - if ((outfile=fopen(argv[4],"a"))==NULL) { - fclose(dbfile); - fclose(datafile); - free(mybuf); - free(mystat); - printf("%s: Error opening %s\n",myname,argv[4]); - goto error; - } - - writefile(datafile,outfile); - writefile(dbfile,outfile); - fwrite(endbuf,1,8,outfile); - fclose(outfile); - fclose(dbfile); - fclose(datafile); - free(mybuf); - free(mystat); - exit(0); - - /* SPLIT MODE */ - } else if (!(strcmp(argv[1],"split"))) { - - /* check if infile exists */ - if (!(exists(argv[2]))) { - printf("%s: %s doesn't exist\n",myname,argv[2]); - free(mystat); - goto error; - } - - /* store infile size for later use */ - - insize=mystat->st_size; - - /* if datafile exists, unlink first (safer) */ - if (exists(argv[3])) - unlink(argv[3]); - - /* if dbfile exists, unlink first (safer) */ - if (exists(argv[4])) - unlink(argv[4]); - - /* open infile for reading */ - if ((infile=fopen(argv[2],"r"))==NULL) { - free(mybuf); - free(mystat); - printf("%s: Error opening %s\n",myname,argv[2]); - goto error; - } - - /* read in end buffer */ - fseek(infile,-8,SEEK_END); - fread(endbuf,1,8,infile); - /* quick end buffer read and verification */ - if ( (endbuf[4]!='S') || (endbuf[5]!='T') || (endbuf[6]!='O') || (endbuf[7]!='P') ) { - fclose(infile); - free(mybuf); - free(mystat); - printf("%s: %s appears to be corrupt (end buffer invalid)\n",myname,argv[2]); - goto error; - } - - seekto=0; - seekto=seekto+endbuf[0]*256*256*256; - seekto=seekto+endbuf[1]*256*256; - seekto=seekto+endbuf[2]*256; - seekto=seekto+endbuf[3]; - - /* open datafile for writing */ - if ((datafile=fopen(argv[3],"a"))==NULL) { - fclose(infile); - free(mybuf); - free(mystat); - printf("%s: Error opening %s\n",myname,argv[3]); - goto error; - } - - /* open dbfile for writing */ - if ((dbfile=fopen(argv[4],"a"))==NULL) { - fclose(datafile); - fclose(infile); - free(mybuf); - free(mystat); - printf("%s: Error opening %s\n",myname,argv[4]); - goto error; - } - - rewind(infile); - writefileto(infile,datafile,insize-(seekto+8)); - fseek(infile,-(seekto+8),SEEK_END); - writefileto(infile,dbfile,insize-8); - fclose(infile); - fclose(dbfile); - fclose(datafile); - free(mybuf); - free(mystat); - exit(0); - - } else { - free(mybuf); - free(mystat); - goto usage; - } - - usage: - printf("Usage: %s join DATAFILE DBFILE OUTFILE (datafile + dbfile -> outfile)\n %s split INFILE DATAFILE DBFILE (infile -> datafile + dbfile)\n",myname,myname); -error: - exit(1); -memalloc: - printf("%s: memory allocation error\n",myname); - exit(2); -} diff --git a/tabcheck.py b/tabcheck.py deleted file mode 100755 index 1699e98..0000000 --- a/tabcheck.py +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/python -O - -import tabnanny,sys - -for x in sys.argv: - tabnanny.check(x) diff --git a/test/vertest b/test/vertest deleted file mode 100755 index 6a704d2..0000000 --- a/test/vertest +++ /dev/null @@ -1,143 +0,0 @@ -#!/usr/bin/env python - -import portage -import sys -import sys -import commands -import popen2 - - -# eliminate duplicates -def uniq(list): - list.sort() - old = '' - tmp = [] - for x in list: - if x != old: - tmp += [x] - old = x - return tmp - - -cmd = "/bin/ls /usr/portage/*/*/*.ebuild | cut -d/ -f 6- | sed 's:.ebuild$::'" -cmd += r"|sed -e 's:-r[0-9]$::' -e 's:\(.*\)-\([^-]*\):\1 \2:' | sort" - -# get list of all used version pairs -def get_versions(): - - # this will get a list of "pkg_name version" - res = commands.getoutput(cmd).split('\n') - - # group by package name - d = {} - for p in res: - if not p.strip(): - continue - n,v = p.strip().split() - d.setdefault(n, []).append(v) - - # for every package with multiple versions available - # build all possible unordered pairs of versions - res = [] - for n in d.keys(): - if len(d[n]) > 1: - for i in range(len(d[n])-1): - for j in range(i, len(d[n])): - if d[n][i] != d[n][j]: - res += [[d[n][i], d[n][j]]] - #res += ["%s %s %s" % (n, d[n][i], d[n][j])] - - return uniq(res) - -def sign(x): - if x > 0: - return 1 - elif x < 0: - return -1 - return 0 - - - -def readlist(filename): - file = open(filename) - res = file.readlines() - file.close() - return [ x.split() for x in res if x] - -def writelist(filename, list): - file = open(filename, "w") - list = [" ".join(x) for x in list] - file.write("\n".join(list) + '\n') - file.close() - - - - -# runs comparing func on every pair from the list -# returns list of [x,y,sign(foo(x,y))] -def compare(list, func): - res = [] - for test in list: - r = func(test[0], test[1]) - if r != - func(test[1], test[0]): - print 'ERROR not simmetric:', test - sys.exit(1) - res += [[test[0], test[1], str(sign(r))]] - - return res - - - - - -if len(sys.argv) != 2: - print """ -Usage: vertest create|update|verify -create create vlist -update update vlist -verify compare portage results to vlist -compare get a list of pairs from stdin and produce - results in format of create - """ - sys.exit(1) - -p = sys.argv[1] - -if p == "create": - tmp = compare(get_versions(), portage.vercmp) - writelist("vlist", tmp) - -elif p == "update": - list = readlist("vlist") - list += compare(get_versions(), portage.vercmp) - writelist("vlist.new", uniq(list)) - -elif p == "verify": - list = readlist("vlist") - test = [[x,y] for (x,y,z) in list] - list2 = compare(test, portage.vercmp) - for i in range(len(list)): - if list[i][2] != list2[i][2]: - print list[i][0], list[i][1], list[i][2], list2[i][2] - -elif p == "compare": - list = sys.stdin.readlines() - list = [x.strip().split() for x in list if x.strip()] - list = compare(list, portage.vercmp) - list = [" ".join(x) for x in list] - print "\n".join(list) - - - - - - - - - - - - - - - diff --git a/test/vlist b/test/vlist deleted file mode 100644 index d48bc05..0000000 --- a/test/vlist +++ /dev/null @@ -1,541 +0,0 @@ -0.0.3.3 1.0.0 -1 -0.0.4 0.2.1 -1 -0.1.1 0.3.0 -1 -0.1.10 0.2.2 -1 -0.1.5 0.1.6 -1 -0.1.5 0.2.2 -1 -0.1.5 0.2.3 -1 -0.1.62 0.1.64 -1 -0.1.7 0.1.8 -1 -0.10.38 0.10.39 -1 -0.10.38 0.10.40 -1 -0.10.39 0.10.40 -1 -0.11 0.12 -1 -0.11.1.91 0.11.1.92 -1 -0.11.2 0.12 -1 -0.11.2 0.12.2 -1 -0.12 0.12.2 -1 -0.13.0 0.99.2 -1 -0.13.0 1.0 -1 -0.13.0 1.0.1 -1 -0.13.0b 0.14.2b -1 -0.14 0.15.2 -1 -0.16.1 1.0.0 -1 -0.16.1 1.0.1 -1 -0.17 0.18 -1 -0.18 0.18.1 -1 -0.18 0.19 -1 -0.18 0.50 -1 -0.18 0.60 -1 -0.18.1 0.19 -1 -0.2 0.2.1 -1 -0.2 0.2.1.1 -1 -0.2 0.3 -1 -0.2.1 0.3.1 -1 -0.2.1 0.3.3 -1 -0.2.2 0.2.3 -1 -0.2.2 20020124 -1 -0.2.22 0.2.23 -1 -0.2.3 0.2.4 -1 -0.2.8 0.3.8 -1 -0.2.83 0.2.90 -1 -0.2.83 0.2.91 -1 -0.2.90 0.2.91 -1 -0.25 0.26 -1 -0.25 0.27 -1 -0.26 0.27 -1 -0.26 0.27a -1 -0.3.0 0.3.1 -1 -0.3.1 0.3.3 -1 -0.3.1 0.3.4 -1 -0.3.3 0.3.4 -1 -0.32 0.34 -1 -0.32.6 0.33 -1 -0.32.6 0.33.7.1 -1 -0.33 0.33.7.1 -1 -0.4.21 0.4.24 -1 -0.4.3 2.0_beta1 -1 -0.4.3 2.0_beta2 -1 -0.4.3 2.0_beta3 -1 -0.40.0 0.40.2 -1 -0.49 0.51 -1 -0.5 0.6.1 -1 -0.5.0 0.5.1 -1 -0.5.11 0.5.12a -1 -0.5.11f 0.6.2 -1 -0.5.2 0.5.3 -1 -0.5.2 0.6.0 -1 -0.5.3 0.6.0 -1 -0.5.7 0.7.4 -1 -0.5.96.1 0.90 -1 -0.50 0.60 -1 -0.50 0.60.2 -1 -0.52 0.60 -1 -0.52 0.81 -1 -0.53.1 0.55.2 -1 -0.53.1 0.56.1 -1 -0.53.5 0.6.0.20010503 1 -0.53.5 0.6.0.20011003 1 -0.53.5 0.6.0.20011026 1 -0.53.5 0.6.0.20011109 1 -0.53.5 0.6.0.20011130 1 -0.55.2 0.56.1 -1 -0.6.0 0.8.0 -1 -0.6.0 0.8.2 -1 -0.6.0.20010503 0.6.0.20011003 -1 -0.6.0.20010503 0.6.0.20011026 -1 -0.6.0.20010503 0.6.0.20011109 -1 -0.6.0.20010503 0.6.0.20011130 -1 -0.6.0.20011003 0.6.0.20011026 -1 -0.6.0.20011003 0.6.0.20011109 -1 -0.6.0.20011003 0.6.0.20011130 -1 -0.6.0.20011026 0.6.0.20011109 -1 -0.6.0.20011026 0.6.0.20011130 -1 -0.6.0.20011109 0.6.0.20011130 -1 -0.6.1 0.6.2 -1 -0.6.2 0.6.3 -1 -0.6.2 0.6.4 -1 -0.6.2 0.6.5 -1 -0.6.2 0.6.6 -1 -0.6.2 0.7.0 -1 -0.6.3 0.6.4 -1 -0.6.3 0.6.5 -1 -0.6.3 0.6.6 -1 -0.6.3 0.7.0 -1 -0.6.4 0.6.5 -1 -0.6.4 0.6.6 -1 -0.6.4 0.7.0 -1 -0.6.5 0.6.6 -1 -0.6.5 0.7.0 -1 -0.6.6 0.7 -1 -0.6.6 0.7.0 -1 -0.60 0.81 -1 -0.7 0.7.6 -1 -0.7 0.8 -1 -0.7 20010313 -1 -0.7.5 0.7.7 -1 -0.70 0.76 -1 -0.70.0 0.80.0 -1 -0.7004 0.7008 -1 -0.75 0.76 -1 -0.75 1.0.1 -1 -0.75 1.0.2 -1 -0.76 1.0.1 -1 -0.76 1.0.2 -1 -0.8.0 0.8.2 -1 -0.8.10 0.9 -1 -0.8.10 0.9.1 -1 -0.8.11 0.8.3 1 -0.8.18 0.8.20 -1 -0.8.18 0.9.0 -1 -0.8.20 0.9.0 -1 -0.8.5 0.8.6 -1 -0.8.5_pre3 0.8.6 -1 -0.9 0.9.1 -1 -0.9.3 0.9.4 -1 -0.9.3 0.9.5 -1 -0.9.3 0.9.6.1 -1 -0.9.3_beta 0.9.5_beta -1 -0.9.4 0.9.5 -1 -0.9.4 0.9.6.1 -1 -0.9.5 0.9.6 -1 -0.9.5 0.9.6.1 -1 -0.9.5 0.9.7 -1 -0.9.5 0.9.9 -1 -0.9.6 0.9.7 -1 -0.9.6b 0.9.6c -1 -0.9.7.2 0.9.7.3 -1 -0.92 0.93 -1 -0.92 1.0_pre1 -1 -0.94.11 0.94.12_pre3 -1 -0.95 0.96 -1 -0.96.1 0.98 -1 -0.99 1.00 -1 -0.99 1.0_rc1 -1 -0.99.1a 1.0.8_beta -1 -0.99.2 1.0 -1 -0.99.2 1.0.1 -1 -0.99.4 0.99.6 -1 -054 070 -1 -1.0 1.0.1 -1 -1.0 1.0.20010309 -1 -1.0.0 1.0.1 -1 -1.0.1 1.0.10 -1 -1.0.1 1.0.2 -1 -1.0.1 1.0.7 -1 -1.0.1 1.0.9 -1 -1.0.1 1.1.0 -1 -1.0.1 1.1.1 -1 -1.0.1 1.3 -1 -1.0.10 1.0.7 1 -1.0.10 1.0.9 1 -1.0.11 1.0.12 -1 -1.0.11 1.1.0_beta10 -1 -1.0.12 1.0.13 -1 -1.0.15 1.0.17 -1 -1.0.15 1.0.18 -1 -1.0.1541 1.0.2313 -1 -1.0.17 1.0.18 -1 -1.0.2 1.1.2 -1 -1.0.2a 1.0703 -1 -1.0.3 1.0.4 -1 -1.0.3 1.0.5 -1 -1.0.3 1.0.6 -1 -1.0.4 1.0.5 -1 -1.0.4 1.0.6 -1 -1.0.5 1.0.6 -1 -1.0.5 1.5.2 -1 -1.0.7 1.0.9 -1 -1.0.7a 1.0.9 -1 -1.0.8.6 1.0.9.2 -1 -1.00 1.01 -1 -1.00 1.0_rc1 1 -1.0_beta4 1.0_rc1 -1 -1.0_beta4 1.0_rc2 -1 -1.0_beta4 1.0_rc3 -1 -1.0_rc1 1.0_rc2 -1 -1.0_rc1 1.0_rc3 -1 -1.0_rc2 1.0_rc3 -1 -1.1 1.1.1 -1 -1.1.1 1.3 -1 -1.1.1 2.0.0 -1 -1.1.3 1.2 -1 -1.1.3 20020124 -1 -1.1.6.2 1.1.6.3 -1 -1.1.6.2 1.1.6.4 -1 -1.1.6.3 1.1.6.4 -1 -1.1.7 20020124 -1 -1.1.91 1.1.92 -1 -1.11 1.11.11 -1 -1.11 1.11.12 -1 -1.11 1.21 -1 -1.11.11 1.11.12 -1 -1.13.18 1.13.19 -1 -1.13.18 1.13.25 -1 -1.13.19 1.13.25 -1 -1.16.1 1.17.2 -1 -1.19.3 1.19.6 -1 -1.2.0 1.2.1 -1 -1.2.0 1.2.2 -1 -1.2.0 1.2.3 -1 -1.2.0_rc2 1.2.2 -1 -1.2.1 1.2.2 -1 -1.2.1 1.2.3 -1 -1.2.12 1.2.13 -1 -1.2.12 2.0.11 -1 -1.2.12 2.0.18 -1 -1.2.12 2.0.21 -1 -1.2.13 2.0.11 -1 -1.2.13 2.0.18 -1 -1.2.13 2.0.21 -1 -1.2.13.1 1.2.8.1 1 -1.2.2 1.2.3 -1 -1.2.2 1.3.0 -1 -1.2.2 1.3.1 -1 -1.2.2 1.3.6 -1 -1.2.3 1.2.4 -1 -1.2.3 1.3 -1 -1.2.4 1.2.5 -1 -1.2.4a 1.3.2 -1 -1.2.5 1.2.6 -1 -1.2.5 1.3.22 -1 -1.2.5 1.3.22.1 -1 -1.2.5 1.3.25 -1 -1.23 1.26 -1 -1.28 1.30 -1 -1.29 1.30 -1 -1.29 1.45 -1 -1.3 1.4 -1 -1.3 1.4.1 -1 -1.3.0 1.3.1 -1 -1.3.1 1.4 -1 -1.3.1 1.4.1 -1 -1.3.1 1.4.4 -1 -1.3.1 1.4.5 -1 -1.3.1 2.0 -1 -1.3.1 2.0.1 -1 -1.3.1 2.0.5 -1 -1.3.10 1.3_alpha5 1 -1.3.12 1.3.16 -1 -1.3.12 1.3.20 -1 -1.3.12 1.3.21 -1 -1.3.13 20020124 -1 -1.3.16 1.3.20 -1 -1.3.16 1.3.21 -1 -1.3.20 1.3.21 -1 -1.3.22 1.3.22.1 -1 -1.3.22 1.3.25 -1 -1.3.22.1 1.3.25 -1 -1.3.4 1.3.5 -1 -1.3.4 1.3.8 -1 -1.3.4 1.3.9 -1 -1.3.5 1.3.5.1 -1 -1.3.5 1.3.5.2 -1 -1.3.5 1.3.6 -1 -1.3.5 1.3.8 -1 -1.3.5 1.3.9 -1 -1.3.5.1 1.3.5.2 -1 -1.3.5.1 1.3.6 -1 -1.3.5.2 1.3.6 -1 -1.3.8 1.3.9 -1 -1.3.8 1.4.0 -1 -1.3.8 1.4.1 -1 -1.34 1.43 -1 -1.38 1.40 -1 -1.3_alpha8 1.4_alpha15 -1 -1.4 1.4.1 -1 -1.4 1.4.2 -1 -1.4 1.4.4 -1 -1.4 1.4.5 -1 -1.4 1.4_p5 -1 -1.4 1.5 -1 -1.4 1.5.4 -1 -1.4 1.5b -1 -1.4.0 1.4.1 -1 -1.4.0 1.4.3 -1 -1.4.0.4 1.4.0.5 -1 -1.4.1 1.4.2 -1 -1.4.1 1.4.4 -1 -1.4.1 1.4.5 -1 -1.4.1 2.0.2 -1 -1.4.1.2 1.4.1.3 -1 -1.4.14 1.4.17 -1 -1.4.14 1.4.21 -1 -1.4.17 1.4.21 -1 -1.4.2 1.4.3 -1 -1.4.4 1.4.5 -1 -1.4.99.0.20001108 1.5_pre6 -1 -1.4_p5 1.5 -1 -1.4_p5 1.5b -1 -1.5 1.5b -1 -1.5.20011214 1.5.20011611 -1 -1.6 1.8 -1 -1.6.3_p7 1.6.5_p1 -1 -1.6.4 1.6.5 -1 -1.7 1.8.1 -1 -1.7 1.8.3 -1 -1.7.15 1.7.7 1 -1.8 1.8.2 -1 -1.8.5 1.8.6 -1 -1.8.5 1.8.7 -1 -1.8.5 1.9.0_pre1 -1 -1.8.6 1.8.7 -1 -1.8.6 1.9.0_pre1 -1 -1.85 3.2.3h -1 -1.85 3.2.9 -1 -1.85 3.3.11 -1 -1.9.10 1.9.11 -1 -1.9.10 1.9.8 1 -123 174 -1 -134 82 1 -15.1 15.3 -1 -19.0.0 20.3 -1 -2.0 2.1.1 -1 -2.0 2.2 -1 -2.0.1 2.0.5 -1 -2.0.1 2.0_pre2 1 -2.0.10 2.0.11 -1 -2.0.10 2.0.8 1 -2.0.10 2.2.2 -1 -2.0.11 2.0.18 -1 -2.0.11 2.0.21 -1 -2.0.11 2.0.8 1 -2.0.18 2.0.21 -1 -2.0.3 2.0.4 -1 -2.0.6 2.0.7 -1 -2.0.6 2.0.8 -1 -2.0.8 2.1.0 -1 -2.0.8 2.1.3 -1 -2.0.8 2.2.1 -1 -2.04 2.05a -1 -2.0_beta1 2.0_beta2 -1 -2.0_beta1 2.0_beta3 -1 -2.0_beta2 2.0_beta3 -1 -2.0_beta3 20010313 -1 -2.1 2.2 -1 -2.1 2.2.1 -1 -2.1 2.2.2 -1 -2.1.0 2.1.1 -1 -2.1.0 2.1.3 -1 -2.1.0 2.2.1 -1 -2.1.1 2.2 -1 -2.1.1 2.2.1 -1 -2.1.1 2.2.2 -1 -2.1.2 2.2 -1 -2.1.2 2.2.1 -1 -2.1.2 2.2.2 -1 -2.1.3 2.2.1 -1 -2.10.4 2.11.1 -1 -2.11.90.0.27 2.11.90.0.31 -1 -2.11.90.0.27 2.11.90.0.7 1 -2.11.90.0.27 2.11.92.0.12.3 -1 -2.11.90.0.27 2.11.92.0.7 -1 -2.11.90.0.31 2.11.90.0.7 1 -2.11.90.0.31 2.11.92.0.12.3 -1 -2.11.90.0.31 2.11.92.0.7 -1 -2.11.90.0.7 2.11.92.0.12.3 -1 -2.11.90.0.7 2.11.92.0.7 -1 -2.11.92.0.12.3 2.11.92.0.7 1 -2.12 2.13 -1 -2.12 2.14 -1 -2.12 2.22 -1 -2.13 2.50 -1 -2.13 2.50c -1 -2.13 2.52 -1 -2.14 2.22 -1 -2.2 2.2.1 -1 -2.2 2.2.2 -1 -2.2.1 2.2.2 -1 -2.2.4 2.4.0 -1 -2.2.5.1 2.2.5.2 -1 -2.2.5.1 2.2.5.4 -1 -2.2.5.2 2.2.5.4 -1 -2.3.1 3.0.1 -1 -2.3.11 2.4.3 -1 -2.3.11 2.4.8 -1 -2.3.4s 2.4.2s -1 -2.4 3.0 -1 -2.4.10 2.4.12 -1 -2.4.10 2.4.13 -1 -2.4.12 2.4.13 -1 -2.4.12 2.4.9 1 -2.4.13 2.4.16 -1 -2.4.13 2.4.17 -1 -2.4.13 2.4.18_pre3 -1 -2.4.16 2.4.17 -1 -2.4.16 2.4.18_pre3 -1 -2.4.17 2.4.18_pre3 -1 -2.4.3 2.4.8 -1 -2.4.6 2.5.0 -1 -2.4.6 2.5.1 -1 -2.5.0 2.5.1 -1 -2.50 2.50c -1 -2.50 2.52 -1 -2.50c 2.52 -1 -2.7 2.7.5 -1 -2.95.3 3.0 -1 -2.95.3 3.0.0.20010514 -1 -2.95.3 3.0.0.20010521 -1 -2.95.3 3.0.2 -1 -2.95.3 3.0.3 -1 -2.98.2 2.98.3 -1 -20.7 21.1 -1 -20001016 4.0.1 1 -20010326 20010418 -1 -20010326 20010824 -1 -20010326 20011004 -1 -20010418 20010824 -1 -20010418 20011004 -1 -20010824 20011004 -1 -20011010 20011025 -1 -21.1.14 21.4.5 -1 -21.7.5 22.1 -1 -3.0 3.0.0.20010514 -1 -3.0 3.0.0.20010521 -1 -3.0 3.0.2 -1 -3.0 3.0.3 -1 -3.0 3.1 -1 -3.0 3.3 -1 -3.0 4.0 -1 -3.0 4.1 -1 -3.0.0.20010514 3.0.0.20010521 -1 -3.0.0.20010514 3.0.2 -1 -3.0.0.20010514 3.0.3 -1 -3.0.0.20010521 3.0.2 -1 -3.0.0.20010521 3.0.3 -1 -3.0.2 3.0.3 -1 -3.0.6 3.1.0 -1 -3.0_p7 3.0_p8 -1 -3.1 3.3 -1 -3.1 4.0 -1 -3.1 4.1 -1 -3.1.28 3.1.29 -1 -3.1.28 3.1.31 -1 -3.1.29 3.1.31 -1 -3.14 3.22 -1 -3.15.1 3.22 -1 -3.2.1 3.2.2 -1 -3.2.1 4.0.1 -1 -3.2.2 4.0.1 -1 -3.2.3h 3.2.9 -1 -3.2.3h 3.3.11 -1 -3.2.9 3.3.11 -1 -3.32 3.33 -1 -3.32 3.34 -1 -3.32 4.00 -1 -3.33 3.34 -1 -3.33 3.37 -1 -3.34 4.00 -1 -3.4.2 3.5 -1 -3.5 3.7 -1 -3.5.1 3.5.4 -1 -3.5.6_beta 3.5.7 -1 -3.6 3.6.2 -1 -3.64 3.65 -1 -3.8.11 3.8.7 1 -3.89b 3.91 -1 -3.9 4.6 -1 -303 304 -1 -358 371 -1 -4.0 4.1 -1 -4.0 4.5 -1 -4.0.12 5.0.47 -1 -4.0.3 4.1.0 -1 -4.0.3 4.2.0 -1 -4.0.6 4.1.1 -1 -4.1 4.1.7 -1 -4.1 4.2 -1 -4.1 4.2a -1 -4.1.0 4.2.0 -1 -4.1.1 4.1.2 -1 -4.1.3 4.1.4 -1 -4.1.7 4.1.99_beta3 -1 -4.1.7 4.1.99_beta4 -1 -4.1.71 4.1.72 -1 -4.1.99_beta3 4.1.99_beta4 -1 -4.2 4.2a -1 -4.33 4.44 -1 -4.5.2 4.5.8 -1 -4.56 4.57 -1 -4.56 4.60 -1 -4.57 4.60 -1 -4.77 4.78 -1 -407e 414e -1 -5.0 6.0_pre1 -1 -5.0 6.0_pre2 -1 -5.0 6.0_pre3 -1 -5.01.2 5.02 -1 -5.03 5.1 -1 -5.1.4 5.1.5 -1 -5.3.4 5.4.0 -1 -5.3.4 5.4.1 -1 -5.4.0 5.4.1 -1 -5.41 5.42 -1 -5.8.11 5.8.13 -1 -5.8.11 5.8.2 1 -5.8.11 5.9.0 -1 -5.8.11 5.9.6 -1 -5.8.13 5.8.2 1 -5.8.13 5.9.0 -1 -5.8.13 5.9.6 -1 -5.8.2 5.9.0 -1 -5.8.2 5.9.6 -1 -5.9.0 5.9.6 -1 -6.0_pre1 6.0_pre2 -1 -6.0_pre1 6.0_pre3 -1 -6.0_pre2 6.0_pre3 -1 -6.50 7.00 -1 -7.0.3 7.1 -1 -7.0.3 7.1.3 -1 -7.1 7.1.3 -1 -7.9.1 7.9.3 -1 -8.0.5 8.1.1 -1 -8.0.5 8.3.3 -1 -8.0.5 8.4.2 -1 -8.1.1 8.3.3 -1 -8.1.1 8.4.2 -1 -8.2.3 9.1.3 -1 -8.3.3 8.4.2 -1 -9.2p 9.2r -1 -1.0_p1 1.0.1 -1 -1.0_pre5 1.0_p1 -1 |