diff --git a/tags/pisi-1.1_beta13/AUTHORS b/tags/pisi-1.1_beta13/AUTHORS deleted file mode 100644 index 56def86e..00000000 --- a/tags/pisi-1.1_beta13/AUTHORS +++ /dev/null @@ -1,15 +0,0 @@ -Authors and contributors ------------------------- - -Eray Özkural -Barış Metin -S. Çağlar Onur -A. Murat Eren -Faik Uygur -Gürer Özen -İsmail Dönmez -Görkem Çetin -Bahadır Kandemir -Ahmet Aygun -Onur Küçük -Furkan Duman diff --git a/tags/pisi-1.1_beta13/CODING b/tags/pisi-1.1_beta13/CODING deleted file mode 100644 index d47b9e41..00000000 --- a/tags/pisi-1.1_beta13/CODING +++ /dev/null @@ -1,150 +0,0 @@ -Like every serious project, there are guidelines. -"Coding Standards" for serious. - -Guidelines ----------- - -0. Before reading any further please observe - PEP 8: Style Guide for Python Code - http://www.python.org/peps/pep-0008.html - - In particular this means no lameCaps - -1. When using dirnames, don't expect the dir to end - with a trailing slash, and please use the dirnames - in pisiconfig. Use util.join_path instead of os.path.join -2. Python indentation is usually 4 spaces. -3. Follow python philosophy of 'batteries included' -4. Use exceptions, don't return error codes -5. Don't make the PISI code have runtime dependencies on - a particular distribution (as much as possible). -6. Don't assume narrow use cases. Allow for a mediocre - amount of generalization in your code, for pieces that - will be required later. -7. If you are changing something, check if that change - breaks anything and fix breakage. For instance a - name. Running the tests is not always enough! -8. A good design ensures separation of concerns. Every module - has a specific documented responsibility. Don't make the - horse clean your windows. -9. To ensure readability avoid nesting python constructs - more than 3 levels deep. Python is a good language (unlike C), - so you can define inner functions in a convenient way, use - such decomposition techniques to break down your code into - manageable chunks. The worst code you can write is one huge - procedure that goes on for 1000 (or more) lines. -10. Use a particular abstraction like a class or function only - if it makes sense. Don't just define things because they can - be defined. Define only things that will/may be used. -11. If you are doing an expensive task like searching through - 10000 text chunks, please use an efficient data structure - and algorithm. We are not MS engineers who know no data - structure beyond doubly linked lists and no algorithm beyond - quicksort. -12. Resist the temptation to develop kludges and workarounds in - response to pressure. Take your time to solve the problems by - the book. The payoff comes later. -13. Same thing goes for premature optimizations. Knuth and Dijkstra - are watching over your shoulder. :) - -Branches and SVN ----------------- - -There are two branches of pisi, one is called pisi-devel and -new features that are large enough to cause instability go -into that branch. The trunk version is supposed to be stable at -all times. This means that you *must* run unit tests and other -test scripts after committing any change that cannot be tested -in isolation. Run the unit tests periodically to catch unseen -bugs. A release from the stable branch *must not* break any tests -whatsoever, so extensive use of the test suite must precede any -release. - - -Unit testing ------------- - -Unit tests are located in unittests directory. Running the tests is -trivial. But you must synchronize your code and data with the test -code, which can be a tedious work if you lose discipline. - -Sample data files are located in the same directory with test modules. - -For running the entire test suite, use the following command: - -$ ./tests/run.py - -The following command will run tests in specfiletests and archivetests -in unittests dir: - -$ ./tests/run.py specfile archive - -Do not depend on the output of unittests. Instead of producing an -output message/data in your tests, check the data internally. By -definition, unittest should just report succeeding and failing cases. - -If you didn't, take a look at the links below for having an idea of -unit testing. -http://www.extremeprogramming.org/rules/unittests.html -http://www.extremeprogramming.org/rules/unittests2.html - - -Other tests ------------ - -There are a couple of nice test scripts for testing the basic -capabilities of the command line interface such as building and -upgrading. Unlike unit tests, you have to take a look at the output -to understand that the scripts are doing well :) - -Misc. Suggestions ------------------ - -1. Demeter's Law - -In OO programming, try to invoke Demeter's law. -One of the "rules" there is not directly accessing any -objects that are further than, 2/3 refs, away. So the -following code is OK. - destroy_system(a.system().name()) -but the following isn't as robust - destroy_system(object_store.root().a.system.name()) -As you can tell, this introduces too many implementation -dependencies. The rule of thumb is that, in these cases -this statement must have been elsewhere.... It may be a -good idea to not count the object scope in this case, -so in Python self.a means only one level of reference, -not two. - -One quibble with this: it may be preferable not to insist -on this where it would be inefficient. So if everything -is neatly packed into one object contained in another -object, why replicate everything in the upper level? If -the semantics prevents dependency changes, then chains -of 3 or even 4 could be acceptable. - -OTOH, in Python and C++, it's not always good to implement -accessor/modifier pairs for every property of an object. -It would be much simpler if you are not doing any special -processing on the property (e.g. if what the type system -does is sufficient). - -The main rule of thumb in Demeter's Law is avoiding -putting more than, say, 10 methods in a class. That works -really well in practice, forcing refactoring every now -and then. - -2. We all know, you're using LISP but didn't want to tell -us. Don't be scared, as a success story and for your encouragment -there are tens of people somewhere with LISP releated jobs. - -3. If you are studying Data structures and Algorithms, and if -your first assignment is to implement a basic FIFO queue, -don't implement it. Just show your teacher the syntax of LISP, -tell him how beautiful it is, and show how an autistic person -can count lots of parenthesis with a "one second" look, you'll -probably get A+. - -4. If you are interested in "Playstation 2 Linux Games Programming" -or "How to extend C programs with Guile", please don't exercise -your valuable skills in this project. diff --git a/tags/pisi-1.1_beta13/COPYING b/tags/pisi-1.1_beta13/COPYING deleted file mode 100644 index 059bf0ed..00000000 --- a/tags/pisi-1.1_beta13/COPYING +++ /dev/null @@ -1,346 +0,0 @@ -NOTE! The GPL below is copyrighted by the Free Software Foundation, but -the instance of code that it refers to (the kde programs) are copyrighted -by the authors who actually wrote it. - ---------------------------------------------------------------------------- - - 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. - - - Copyright (C) 19yy - - 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) 19yy 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. - - , 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/tags/pisi-1.1_beta13/INSTALL b/tags/pisi-1.1_beta13/INSTALL deleted file mode 100644 index 33a2f00c..00000000 --- a/tags/pisi-1.1_beta13/INSTALL +++ /dev/null @@ -1,16 +0,0 @@ -You can install PiSi on your system with a single command. - -# ./setup.py install - -If you are on a Pardus system, you should delete /usr/lib/pardus/pisi -when you are installing the SVN version - -PiSi requires piksemel XML processing library, the newest version -bsd bindings called "bsddb3" and Pardus configuration manager COMAR -in order to run. - -If you are upgrading from an old PiSi release you may have to -run the following command as root: - -# pisi rebuild-db - diff --git a/tags/pisi-1.1_beta13/MANIFEST.in b/tags/pisi-1.1_beta13/MANIFEST.in deleted file mode 100644 index e423d286..00000000 --- a/tags/pisi-1.1_beta13/MANIFEST.in +++ /dev/null @@ -1,7 +0,0 @@ -recursive-include po * -recursive-include tests *.py -recursive-include tools * -recursive-include doc * -include . *.dtd -include . README NEWS CODING COPYING - diff --git a/tags/pisi-1.1_beta13/NEWS b/tags/pisi-1.1_beta13/NEWS deleted file mode 100644 index 150f4e26..00000000 --- a/tags/pisi-1.1_beta13/NEWS +++ /dev/null @@ -1,55 +0,0 @@ -PISI 1.0.9 25 April 2006: - - * source index/database and remote builds by name - * "emerge" command, now we are just like gentoo :) - * performance and usability improvements. faster database access and - faster updates. index integrity, authenticity and compression. - smaller db files and simplification in db schema / less seeks. - correct use of berkeley DB cache. - * several other improvements and bugfixes - -PISI 1.0.2 25 December 2005: - - * some minor bugs were corrected - -PISI 1.0.1 24 December 2005: - - * bugfix release. one important improvement is preventing the accumulation - of inactive database logs (we handle catastrophic failure in - another way, by making all critical data available as xml) - -PISI 1.0 21 December 2005: - - * new command "check" - * a new tool "calc-build-order.py" to calculate build order - for the entire distro - * various bugfixes and improvements, no significant issues remain - -PISI release candidate 2 12 December 2005: - - * maintenance release for Pardus 1.0 RC1, various bugfixes - -PISI release candidate 1 9 December 2005: - - * a command to search package text - * better reliability through transaction support for berkeley db - * db version file - * loads of bugfixes - -PISI Beta 1/2 release 17/18 November 2005: - - * support for components, see the completed items in TODO - * a tool to find library dependencies - * various improvements and bugfixes - -PISI Alpha 9 release 13 November 2005: - - * new package: pisi.pxml - * first release of autoxml, a metaclass for high-level xml processing - * uses 4suite.org for fast xml processing - * supports multiple parsers: minidom, 4suite and in the future: piksemel - * all xml structures in PISI have been updated to use autoxml - * improvements in the ui interface - * significant fixes for Turkish translations - -previous PISI releases had too many things to mention :) diff --git a/tags/pisi-1.1_beta13/README b/tags/pisi-1.1_beta13/README deleted file mode 100644 index 6dfaa15f..00000000 --- a/tags/pisi-1.1_beta13/README +++ /dev/null @@ -1,16 +0,0 @@ -PISI - Packages Installed Succesfully as Intended - -PISI is a new package manager for the PARDUS -distribution. In Turkish PISI means "kitty", and -like a kitty, it is featureful and small. - -Some of its distinctive features: - - - Implemented in python - - Efficient and small - - Package sources are written in XML and python - - Fast database access implemented with berkeley DB - - Integrates low-level and high-level package operations (dependency resolution) - - Framework approach to build applications and tools upon - - Comprehensive CLI and a user-friendly qt GUI (distributed separately) - - Extremely simple package construction diff --git a/tags/pisi-1.1_beta13/README.upgrade b/tags/pisi-1.1_beta13/README.upgrade deleted file mode 100644 index a0577caa..00000000 --- a/tags/pisi-1.1_beta13/README.upgrade +++ /dev/null @@ -1,5 +0,0 @@ -For upgrading from pisi 1.0 and before - -You have to move the packages in /var/lib/pisi under /var/lib/pisi/package and remove /var/db/pisi/ directory. - -db version has changed, so a rebuild-db will be unfortunately necessary. diff --git a/tags/pisi-1.1_beta13/TODO b/tags/pisi-1.1_beta13/TODO deleted file mode 100644 index c29617cc..00000000 --- a/tags/pisi-1.1_beta13/TODO +++ /dev/null @@ -1,247 +0,0 @@ - - -PiSi TODO List -============== - -A list of tasks to accomplish, organized into priority sections - -Legend: - -- Todo -? Not determined if/how we have to do -/ In progress -+ Accomplished - -1. Pre-Alpha - - + reading spec file - + writing - + files - + metadata - + Actions API framework - + sample api modules (autotools) - + unit test - + source building - + package module - + extraction - + add file / compression - + package creation - + install database - + package database - + command line interface - + pisi-build - + pisi-install - + pisi-index - + pisi-updatedb - + single repository index - + simple dependency checking - + Package/Files - -2. Alpha - - + multi-package dependency analysis (eray) - + design a package operation planner - + install/remove operations (eray) - + command line interface: - + pisi remove - + svn-like CLI - + configuration file - + define the format of the configuration file - + extend Config module (config.py) accordingly - + define configuration keys (baris - meren) - + query - + list of installed packages (eray) - + refactor actionsAPI (caglar) - + fix xml indentation (meren) - + define file types (doc, executable, conf, etc...) (baris - meren) - + write specfile (eray) - + file locking for database access [not tested!] (eray) - + implement file uri - + extend the modules dealing with files accordingly - + ui module improvements - + methods for interaction (yes, no questions, etc.) - + implement source database (eray) - + easy package preparation - + convert ebuild to pisi - + COMAR interface - + what do we need to specify in a package. - + package install: register config script - + package remove: unregister config script - + internet installation - + support URI's whereever a filename is supported - + http server - + pisi updatedb over internet - -3. Beta - - + build cmd: installl build deps - + improve url support, it's a little dumb at the moment - + devise a File class that works with URLs - + add URL support to autoxml - + info cmd: reverse dependencies of a package - + a helper script for finding dependencies (eray) - + autoxml: automated xml processing (eray) - + design - + basic types - + list type - + class type - + localtext/text types - + revised interface - + improved error handling, check routines, hooks, format/print routines - + xmlfile support (read/write) - + string member, in addition to tag/attribute members - + replace specfile with new specfile using autoxml - + autoxmlize: metadata, index, dependency and related code paths - + inheritance support - + revise writing, error reporting, tests - + components (eray) - + requirements - + xml format, add to PSPEC - + index component.xml's and make use of them in build - + a database of components: - + query components by name - + query list of packages in a component - + index: update component database(s) - + bug fixing - + install/remove/upgrade components - + safety switch: preserve system.base, install system.devel for build, etc. - + info - + started documentation - + component dependencies - + multiple package repository (eray) - + decide how to implement - + support repo order - + refactor xml support and implement multiple backends - + 4suite support (initial patch by faik, completed by eray) - + piksemel support (eray) - + fix autoxml implementation to use 4suite by default - + partial caching and automatic resume for file download (meren) - + use a '.part' extension - + search-file command (eray) - + exception handling (eray) - + uniform exception hierarchy - + proper handling - + API: we even have application users (eray) - + a facade module pisi.api (eray) - + a library init command (eray) - + high-level package ops, index (eray) - + info/util commands (eray) - + build commands (baris) - + documentation - + actionsAPI documentation, unittests (caglar - meren) - + versioning information document (eray - baris) - + UI - + PISIMAT - + pykde GUI (cartman) - + improve interface (eray) - + refactor UI, reintroduce base class - + add an ack interface, start cleaning up a bit - + cli (eray) - + ask alternatives to choose from - + eliminate \n's from infos, what's the point? - + metaclass coolness for CLI command framework (eray) - + i18n support - + translations and correct language for summary, description (packagers) - + make pisi messages translatable (eray) - + .pot support for dist script (gurer) - + translate messages mesajların çevirisinin yapılması (pisi tr.po) (eray) - + proper unicode handling in code - tons of fixes (eray - baris) - + configure-pending (eray) - + proper commar connection (baris - gurer) - + ignore-deps (eray) - + more robust upgrade (eray) - + query (eray) - + comar OM information (Provides) - + find package by name, display summary/description - + info --files option (like rpm -ql, but better of course) - + implement missing unit tests - + sourcedb - + package (baris) - + configuration file (baris) - + upgrade (eray) - + upgrade operation - + test upgrade op - + system-wide upgrade (upgrade-all) komutu - + incremental build (eray) - + generate binary release number by comparing MD5s (eray) - + keep track of successfully completed configure, make, install - steps (necessary for large-scale builds?) (meren) - + database locking bugs (eray) - -4. Release - - * high priority - - + transaction stuff for database (eray) - + database version file - - * low priority - - + search command: (eray) - + implement an inverted index - + search in summary and description - -5. Post Release - - * high priority - - - package signing - - a flag to sign package after building - - code to check if the package has a valid signature - - cli improvements - - non interactive mode (similar to --auto in urpmi) - / high-level build commands - + an emerge command, just for fun - + make use of binary repo to satisfy dependencies in emerge - / build command enhancements: - + aware of repo sources - ? full dependency analysis like install/upgrade etc. - ? build-all (or build-distro) command, or as a separate tool - + make a package and sourcedb for each repo - + packagedb - + sourceb - ? improve url support: consider adding "other" protocols - - removable media: media:// - - * medium priority - - - UI impl: non-interactive use that selects defaults and logs output - - UI impl: a general purpose Qt UI - / multi-architecture support - + design decisions - + extend XML specs to support that - - cross-platform building support - - incremental build/fetch for repository index (pisi-index.xml) - / xdelta support (caglar) - - diffsets - - a command (check-repo) to check if repos are consistent wrt dep relations - - component improvements (optional) - - maintain a list of components each component has - - maintain a list of packages - - more support for categories: - - put categories into a database - - fast search for categories - - * low priority - - / overhaul installdb (try to merge its use with packagedb) (eray) - / verify metodlari - + SpecFile - + MetaData - + Files - - Index (somebody should write one :} ) - - autoxml: - - revise error checking, printing and tests - - uri type - - date type - - enum type - - make autoxml dependent on only xmlext and xmlfile interfaces - - search command: (eray) - - search components - - english stemming - - turkish stemming - - phonetic/syntactic fault tolerance (whichever works!) - - in particular evaluate soundex and metaphone - - research if there are language independent phonetic encodings - - implement as an option (or make it possible to turn it off if it works well :)) - - fault tolerant search in package names (somehow) diff --git a/tags/pisi-1.1_beta13/doc/algorithm.sty b/tags/pisi-1.1_beta13/doc/algorithm.sty deleted file mode 100644 index 843e3d5b..00000000 --- a/tags/pisi-1.1_beta13/doc/algorithm.sty +++ /dev/null @@ -1,79 +0,0 @@ -% ALGORITHM STYLE -- Released 8 April 1996 -% for LaTeX-2e -% Copyright -- 1994 Peter Williams -% E-mail Peter.Williams@dsto.defence.gov.au -\NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{algorithm} -\typeout{Document Style `algorithm' - floating environment} - -\RequirePackage{float} -\RequirePackage{ifthen} -\newcommand{\ALG@within}{nothing} -\newboolean{ALG@within} -\setboolean{ALG@within}{false} -\newcommand{\ALG@floatstyle}{ruled} -\newcommand{\ALG@name}{Algorithm} -\newcommand{\listalgorithmname}{List of \ALG@name s} - -% Declare Options -% first appearance -\DeclareOption{plain}{ - \renewcommand{\ALG@floatstyle}{plain} -} -\DeclareOption{ruled}{ - \renewcommand{\ALG@floatstyle}{ruled} -} -\DeclareOption{boxed}{ - \renewcommand{\ALG@floatstyle}{boxed} -} -% then numbering convention -\DeclareOption{part}{ - \renewcommand{\ALG@within}{part} - \setboolean{ALG@within}{true} -} -\DeclareOption{chapter}{ - \renewcommand{\ALG@within}{chapter} - \setboolean{ALG@within}{true} -} -\DeclareOption{section}{ - \renewcommand{\ALG@within}{section} - \setboolean{ALG@within}{true} -} -\DeclareOption{subsection}{ - \renewcommand{\ALG@within}{subsection} - \setboolean{ALG@within}{true} -} -\DeclareOption{subsubsection}{ - \renewcommand{\ALG@within}{subsubsection} - \setboolean{ALG@within}{true} -} -\DeclareOption{nothing}{ - \renewcommand{\ALG@within}{nothing} - \setboolean{ALG@within}{true} -} -\DeclareOption*{\edef\ALG@name{\CurrentOption}} - -% ALGORITHM -% -\ProcessOptions -\floatstyle{\ALG@floatstyle} -\ifthenelse{\boolean{ALG@within}}{ - \ifthenelse{\equal{\ALG@within}{part}} - {\newfloat{algorithm}{htbp}{loa}[part]}{} - \ifthenelse{\equal{\ALG@within}{chapter}} - {\newfloat{algorithm}{htbp}{loa}[chapter]}{} - \ifthenelse{\equal{\ALG@within}{section}} - {\newfloat{algorithm}{htbp}{loa}[section]}{} - \ifthenelse{\equal{\ALG@within}{subsection}} - {\newfloat{algorithm}{htbp}{loa}[subsection]}{} - \ifthenelse{\equal{\ALG@within}{subsubsection}} - {\newfloat{algorithm}{htbp}{loa}[subsubsection]}{} - \ifthenelse{\equal{\ALG@within}{nothing}} - {\newfloat{algorithm}{htbp}{loa}}{} -}{ - \newfloat{algorithm}{htbp}{loa} -} -\floatname{algorithm}{\ALG@name} - -\newcommand{\listofalgorithms}{\listof{algorithm}{\listalgorithmname}} - diff --git a/tags/pisi-1.1_beta13/doc/algorithmic.sty b/tags/pisi-1.1_beta13/doc/algorithmic.sty deleted file mode 100644 index 68f18aa0..00000000 --- a/tags/pisi-1.1_beta13/doc/algorithmic.sty +++ /dev/null @@ -1,158 +0,0 @@ -% ALGORITHMIC STYLE -- Released 8 APRIL 1996 -% for LaTeX version 2e -% Copyright -- 1994 Peter Williams -% E-mail PeterWilliams@dsto.defence.gov.au -\NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{algorithmic} -\typeout{Document Style `algorithmic' - environment} -% -\RequirePackage{ifthen} -\RequirePackage{calc} -\newboolean{ALC@noend} -\setboolean{ALC@noend}{false} -\newcounter{ALC@line} -\newcounter{ALC@rem} -\newlength{\ALC@tlm} -% -\DeclareOption{noend}{\setboolean{ALC@noend}{true}} -% -\ProcessOptions -% -% ALGORITHMIC -\newcommand{\algorithmicrequire}{\textbf{Require:}} -\newcommand{\algorithmicensure}{\textbf{Ensure:}} -\newcommand{\algorithmiccomment}[1]{\{#1\}} -\newcommand{\algorithmicend}{\textbf{end}} -\newcommand{\algorithmicif}{\textbf{if}} -\newcommand{\algorithmicthen}{\textbf{then}} -\newcommand{\algorithmicelse}{\textbf{else}} -\newcommand{\algorithmicelsif}{\algorithmicelse\ \algorithmicif} -\newcommand{\algorithmicendif}{\algorithmicend\ \algorithmicif} -\newcommand{\algorithmicfor}{\textbf{for}} -\newcommand{\algorithmicforall}{\textbf{for all}} -\newcommand{\algorithmicdo}{\textbf{do}} -\newcommand{\algorithmicendfor}{\algorithmicend\ \algorithmicfor} -\newcommand{\algorithmicwhile}{\textbf{while}} -\newcommand{\algorithmicendwhile}{\algorithmicend\ \algorithmicwhile} -\newcommand{\algorithmicloop}{\textbf{loop}} -\newcommand{\algorithmicendloop}{\algorithmicend\ \algorithmicloop} -\newcommand{\algorithmicrepeat}{\textbf{repeat}} -\newcommand{\algorithmicuntil}{\textbf{until}} -\def\ALC@item[#1]{% -\if@noparitem \@donoparitem - \else \if@inlabel \indent \par \fi - \ifhmode \unskip\unskip \par \fi - \if@newlist \if@nobreak \@nbitem \else - \addpenalty\@beginparpenalty - \addvspace\@topsep \addvspace{-\parskip}\fi - \else \addpenalty\@itempenalty \addvspace\itemsep - \fi - \global\@inlabeltrue -\fi -\everypar{\global\@minipagefalse\global\@newlistfalse - \if@inlabel\global\@inlabelfalse \hskip -\parindent \box\@labels - \penalty\z@ \fi - \everypar{}}\global\@nobreakfalse -\if@noitemarg \@noitemargfalse \if@nmbrlist \refstepcounter{\@listctr}\fi \fi -\sbox\@tempboxa{\makelabel{#1}}% -\global\setbox\@labels - \hbox{\unhbox\@labels \hskip \itemindent - \hskip -\labelwidth \hskip -\ALC@tlm - \ifdim \wd\@tempboxa >\labelwidth - \box\@tempboxa - \else \hbox to\labelwidth {\unhbox\@tempboxa}\fi - \hskip \ALC@tlm}\ignorespaces} -% -\newenvironment{algorithmic}[1][0]{ -\let\@item\ALC@item - \newcommand{\ALC@lno}{% -\ifthenelse{\equal{\arabic{ALC@rem}}{0}} -{{\footnotesize \arabic{ALC@line}:}}{}% -} -\let\@listii\@listi -\let\@listiii\@listi -\let\@listiv\@listi -\let\@listv\@listi -\let\@listvi\@listi -\let\@listvii\@listi - \newenvironment{ALC@g}{ - \begin{list}{\ALC@lno}{ \itemsep\z@ \itemindent\z@ - \listparindent\z@ \rightmargin\z@ - \topsep\z@ \partopsep\z@ \parskip\z@\parsep\z@ - \leftmargin 1em - \addtolength{\ALC@tlm}{\leftmargin} - } - } - {\end{list}} - \newcommand{\ALC@it}{\addtocounter{ALC@line}{1}\addtocounter{ALC@rem}{1}\ifthenelse{\equal{\arabic{ALC@rem}}{#1}}{\setcounter{ALC@rem}{0}}{}\item} - \newcommand{\ALC@com}[1]{\ifthenelse{\equal{##1}{default}}% -{}{\ \algorithmiccomment{##1}}} - \newcommand{\REQUIRE}{\item[\algorithmicrequire]} - \newcommand{\ENSURE}{\item[\algorithmicensure]} - \newcommand{\STATE}{\ALC@it} - \newcommand{\COMMENT}[1]{\algorithmiccomment{##1}} - \newenvironment{ALC@if}{\begin{ALC@g}}{\end{ALC@g}} - \newenvironment{ALC@for}{\begin{ALC@g}}{\end{ALC@g}} - \newenvironment{ALC@whl}{\begin{ALC@g}}{\end{ALC@g}} - \newenvironment{ALC@loop}{\begin{ALC@g}}{\end{ALC@g}} - \newenvironment{ALC@rpt}{\begin{ALC@g}}{\end{ALC@g}} - \renewcommand{\\}{\@centercr} - \newcommand{\IF}[2][default]{\ALC@it\algorithmicif\ ##2\ \algorithmicthen% -\ALC@com{##1}\begin{ALC@if}} - \newcommand{\ELSE}[1][default]{\end{ALC@if}\ALC@it\algorithmicelse% -\ALC@com{##1}\begin{ALC@if}} - \newcommand{\ELSIF}[2][default]% -{\end{ALC@if}\ALC@it\algorithmicelsif\ ##2\ \algorithmicthen% -\ALC@com{##1}\begin{ALC@if}} - \newcommand{\FOR}[2][default]{\ALC@it\algorithmicfor\ ##2\ \algorithmicdo% -\ALC@com{##1}\begin{ALC@for}} - \newcommand{\FORALL}[2][default]{\ALC@it\algorithmicforall\ ##2\ % -\algorithmicdo% -\ALC@com{##1}\begin{ALC@for}} - \newcommand{\WHILE}[2][default]{\ALC@it\algorithmicwhile\ ##2\ % -\algorithmicdo% -\ALC@com{##1}\begin{ALC@whl}} - \newcommand{\LOOP}[1][default]{\ALC@it\algorithmicloop% -\ALC@com{##1}\begin{ALC@loop}} - \newcommand{\REPEAT}[1][default]{\ALC@it\algorithmicrepeat% -\ALC@com{##1}\begin{ALC@rpt}} - \newcommand{\UNTIL}[1]{\end{ALC@rpt}\ALC@it\algorithmicuntil\ ##1} - \ifthenelse{\boolean{ALC@noend}}{ - \newcommand{\ENDIF}{\end{ALC@if}} - \newcommand{\ENDFOR}{\end{ALC@for}} - \newcommand{\ENDWHILE}{\end{ALC@whl}} - \newcommand{\ENDLOOP}{\end{ALC@loop}} - }{ - \newcommand{\ENDIF}{\end{ALC@if}\ALC@it\algorithmicendif} - \newcommand{\ENDFOR}{\end{ALC@for}\ALC@it\algorithmicendfor} - \newcommand{\ENDWHILE}{\end{ALC@whl}\ALC@it\algorithmicendwhile} - \newcommand{\ENDLOOP}{\end{ALC@loop}\ALC@it\algorithmicendloop} - } - \renewcommand{\@toodeep}{} - \begin{list}{\ALC@lno}{\setcounter{ALC@line}{0}\setcounter{ALC@rem}{0}% - \itemsep\z@ \itemindent\z@ \listparindent\z@% - \partopsep\z@ \parskip\z@ \parsep\z@% - \labelsep 0.5em \topsep 0.2em% -\ifthenelse{\equal{#1}{0}} - {\labelwidth 0.5em } - {\labelwidth 1.2em } -\leftmargin\labelwidth \addtolength{\leftmargin}{\labelsep} - \ALC@tlm\labelsep - } -} -{\end{list}} - - - - - - - - - - - - - - - diff --git a/tags/pisi-1.1_beta13/doc/dependency.pdf b/tags/pisi-1.1_beta13/doc/dependency.pdf deleted file mode 100644 index 7f9dd07f..00000000 Binary files a/tags/pisi-1.1_beta13/doc/dependency.pdf and /dev/null differ diff --git a/tags/pisi-1.1_beta13/doc/dependency.tex b/tags/pisi-1.1_beta13/doc/dependency.tex deleted file mode 100644 index 0cff823e..00000000 --- a/tags/pisi-1.1_beta13/doc/dependency.tex +++ /dev/null @@ -1,381 +0,0 @@ -%%% Local Variables: -%%% mode: latex -%%% TeX-master: t -%%% End: - -\documentclass[a4paper,11pt]{article} -\usepackage{graphicx} -\usepackage{algorithm} -\usepackage{algorithmic} -\usepackage{amsmath} -\usepackage{amstext} -\usepackage{amsfonts} -\usepackage{amsbsy} -\usepackage{amsthm} -\usepackage{prettyref} -%\newrefformat{alg}{Algorithm~\ref{#1}} -%\newrefformat{eq}{Equation~\ref{#1}} -%\newrefformat{lem}{Lemma~\ref{#1}} -%\newrefformat{thm}{Theorem~\ref{#1}} -%\newrefformat{chp}{Chapter~\ref{#1}} -%\newrefformat{sec}{Section~\ref{#1}} -%\newrefformat{apx}{Appendix~\ref{#1}} -%\newrefformat{tab}{Table~\ref{#1}} -%\newrefformat{fig}{Figure~\ref{#1}} -%usepackage[active]{srcltx} -\title{ Dependency Resolution in PISI} - -\author{Eray \"{O}zkural} - -\date{\today} - -\begin{document} - -\maketitle - -\section{Introduction} - -Dependency resolution in package management systems have a -significance in that they are the key to providing system stability -and internet upgrades. The scale of package databases requires the -dependency resolution mechanism to be efficient and correct, -motivating a closer look at the theory. - - -\section{Review} - -Dependency resolution has been taken in the most general setting as -the famous SAT problem of propositional logic. If we consider a system -$D$ of dependency statements $D_i$, each statement can be taken as a -proposition in propositional logic which states, for instance: - -$D_i$: if package $a$ is installed or package $b$ is installed, then -package $i$ is installable.\\ -... - -The system is thus understood as the conjunction of such facts, giving -us a logical programming formulation to determine installation -conditions. Note that for simplicity we do not consider the nuances in -upgrade and remove operations at the moment. - -However, using a SAT solver for this operation may be shooting a fly -with a bazooka. We observe that only certain forms of propositions -will be necessary for a dependency system. Furthermore, as we shall -see further constraints and optimizations may be required of the -system that are not modelled well with the SAT problem. - -We use a graph theoretic approach instead. A directed graph (digraph) -$G=(V,E)$ is formally a set of vertices $V$ and a set of edges $E$ -where each edge $(u,v)$ represents an edge from a vertex to another. -Accessor functions $V(G)$ and $E(G)$ yield the vertex and edge set of -the graph $G$. Topological sort of a graph gives a total ordering of -the vertices in which there are only forward edges. A vertex induced -subgraph of $G$ by vertex set $A$ contains only the vertex set $A$ and -edges incident to members of $A$. - -\section{Package operation planning} - -The dependency resolution problem may be viewed as a simple forward -chaining problem, where we would like to begin from an initial state -$S_0$ and by following allowable system transitions $t_i: S \to S$, -arrive at a desired system state $S_f$ (where $S$ is the set of all states). - -A system state $S_i$ is defined as the set of installed packages on -the system together with their versions, i.e. $S_i = \{ (x,v) : x -\text{ is installed}, v=version(x)\} $. An atomic system transition -$t_i$ chains one system state into another, making one ACID change on -the system. The usual atomic transitions are the single package -install, remove and reinstall (upgrade or downgrade) operations found -in low-level package management code of PISI. Note that in PISI, an -upgrade operation is identical to a remove operation followed by an -install operation (which sets it apart from some other packaging -systems). - -A package operation plan is thus naturally conceived of as a sequence -of atomic system transitions. Given an initial state and a final -state, the job of the package operation planner is to determine -whether there is a plan, and if so find the "best" one. - -Where there are no versions involved (e.g. upgrade/downgrade), we will -replace the pair $(x,v)$ with $x$ in the definitions for simplicity. - -\subsection{System consistency} - -It is worth mentioning here the concept of system consistency. As in a -database transaction, it is not acceptable that the system violates an -invariant afterwards. In the context of PISI, system consistency is -composed of two conditions for the current set of installed packages. -\begin{enumerate} -\item All package dependencies are satisfied (we may call this a - closed system) -\item No package conflicts are present. -\end{enumerate} - -Therefore, by atomic transition we also mean one that does not corrupt -system consistency. The system is thus never in an inconsistent -state. We will explain the conflicts later, for the present let us -look at the dependency condition. - -\subsection{Solving the simplest case with topological sorting} - -We will now concentrate on a simple form of the problem which can be -solved with topological sorting. This form is not concerned with -versions. Neither do we consider remote repositories. From an initial -set of packages $S_0$, we would like to install in addition a new set -$A$ of packages obtaining $S_f = S_0 \cup A$, for a static set of package -relations. - -The only relations considered are of the form: $a$ Depends on $b$, or -more briefly $aDb$. The graph of all such simple dependency relations -is a digraph $G$. For each dependency relation $aDb$, there is an -edge $a \to b$ in $G$. Accessing graph $G$ usually requires a database -operation and is therefore expensive. - -We now consider the digraph $G_A$ of the minimal set of simple -dependency relations which contains all information required to -construct a plan to install packages $A$. $G_A$ is a vertex induced -graph such that the fringe of $A$, e.g. vertices with out-degree $0$ -depend only on packages that are already installed (or none). Vertices -of $G_A$ are taken from $S_f$. First, let us explain the labelling -scheme. Already installed vertices are labelled with 'i'. Packages to -be added are labelled with 'a', and packages to be installed due to -dependencies are labelled with 'd'. We construct the graph as follows -\begin{algorithm} - \caption{$\textsc{Make-}G_A(G, A)$} - \label{alg:cons-graph} - \begin{algorithmic}[1] -\STATE $G_A \gets$ vertex induced subgraph of $G$ by $A$ labelled with 'a' -\REPEAT - \STATE done $\gets$ true - \FOR{each $u \in V(G_A)$ with out-degree $0$} - \FOR{ $v \in adj(u) $ of $G$} - \IF{$v \notin V(G_A)$} - \STATE done $\gets$ false - \IF{$v$ is installed} - \STATE label $v$ with 'i' - \ELSE - \STATE label $v$ with 'd' - \ENDIF - \STATE add $(u,v)$ to $G_A$ - \ENDIF - \ENDFOR - \ENDFOR -\UNTIL{done} -\end{algorithmic} -\end{algorithm} - -By this iterative expansion, we do a minimum number of database -accesses to $G$ and construct a dependency graph in memory. If the -$G_A$'s fringe has vertices with non 'i'-labels, then $A$ cannot be -installed. Otherwise, we find a topological sort $L$ of $G_A$, and in -the reverse order, install packages for vertices labelled with -'a' or 'd'. Observe that, by definition of a topological sort, -installing packages in the reverse order of a topological sort -guarantees that no package is installed before all of its dependencies -are installed. Thus, this yields a consistency-preserving plan. - -\subsection{Dependency conditions} - -In the PISI specification, we allow a dependency to specify a local -condition, for instance a program may require a dependency on -\texttt{libx} with pardus source release $3$ or greater. Another -program may require a dependency on a particular source release. These -conditions are local because they can be computed over the elements of -system state $S_i$, e.g. package (name, version) pairs. Let us denote this -condition by a predicate $P(b)$ such that $aDb$ iff $P(b)$. The -predicate $P$ for the dependency $aDb$ can be stored as edge data for -$(u,v)$ on the graph. -% thus when we say $P(u,v)$, this means the predicate stored on -%$(u,v)$ edge for vertex $v$. - -In this case, the vertices of the package dependency graph $G$ and the -planning graph $G_A$ retain the version information along with the -package name. The dependency relation thus holds between two pairs -$(p_1,v_1)$ and $(p_2,v_2)$, satisfying a given predicate -$P(p_2,v_2)$. When constructing the graph, we therefore take this -predicate into account and admit a new edge $(u,v)$, and thus a new -vertex $v$ into $G_A$ if and only if the target vertex satisfies -$P(v)$. - -\subsection{Conflicts and COMAR dependencies} - -The tags \texttt{Conflicts} and \texttt{Provides} in PISI are -inherited from Debian distribution. A conflict between two packages -($a$ conflicts with $b$) is a symmetric relation that prevents the -packages $a,b$ from being installed simultaneously (It is -sufficient that only one direction of the relation is declared, the -other direction is inferred). Provision in the form of $a$ provides $A$ -denotes that $a$ implements a virtual package abstraction $A$. - -In PISI, a package can provide an object of a COMAR Object Model (OM), -and is currently the only model of a ``virtual package''. In the -following example, let $a_1,a_2,\ldots,a_n$ provide the OM $A$. A package -can depend on another package's OM, for instance $b$ comar-depends on -$A$ (or in short form $bDA$) (Currently, conditions on virtual -dependencies are not supported). In this case, it is sufficient that -only one of the $a_i$ are installed. To resolve this, the user is -asked to choose from a list of alternatives immediately, since -otherwise there is unavoidable combinatorial explosion (in the form of -having to consider $\Pi_{bDA}num(A)$ graphs in the worst case where -$num(A)$ is the number of alternatives for comar OM $A$; the problem -is that there seems to be no simple solution to solve satisfiability -with arbitrary disjunctions in package dependency, short of a $SAT$ -solver). - -The resolution of conflicts to maintain system consistency condition -$2$ is easier to achieve. This can be satisfied by disallowing -installation of a package that would violate the condition, or -removing currently installed packages which conflict with the newly -installed package and its dependencies. In most package managers, the -second option is confirmed by the user for making it easier. In the -install operation, after constructing the partial dependency graph -$G_A$, we merely have to check whether any conflict appears among the -vertices of $G_A$. If so, then the operation is untenable, since $G_A$ -shows the future state of the installed system. Since a conflict is -symmetric, it is represented as a bidirectional edge $a \leftrightarrow b$. To -distinguish dependencies from conflicts, the edges would have to be -labelled in this case, for instance with 'd' and 'c'. The removal -option can be implemented by invoking a multi-package remove operation -on the packages in conflict. - -\subsection{Remove operation} - -Dependency resolution for remove operation is similar to install. The -only significant difference is that we remove the packages in the -topological order rather than installing packages in the reverse -topological order. - -\section{Remote repositories and upgrade operation} - - -The upgrade operation is more complicated. First of all, the system -has to distinguish between the current relation graph (e.g. -dependencies and conflicts), and the future relation graph which may -be different in rather important aspects. In theory, we allow any -dependency and conflict to change. Therefore, we have a $G_0$ which -represents the current relations (among installed packages) in the -system, and a $G_f$ which is probably taken from a remote package -repository. We begin by noting that $G_0$ and $G_f$ have to be -compatible. That is, to say, if a package $(p_1,v_1)$ is shared across -two graphs, then the declarations made by the package are one and the -same. - -$G_0$ can be calculated from the package information (e.g. metadata) -of the installed packages and is stored by PISI in a dedicated -database. $G_f$ is most likely constructed from a PISI Index file -corresponding to a particular package repository. Accessing both of -these entities is expensive and we should take care to minimize access -as in the previous section. - -To preserve consistency during individual transitions, the planner can -choose to remove a minimum number of packages from the system to bring -it to a clean state, and then install the new versions of these -packages in the correct order. Let us assume that it is indeed -possible to achieve this ``clean state''. Apparently, this is not -always possible because other packages may depend on the package(s) to -upgrade. At any rate, to achieve this, first we need to -calculate subgraphs of $G_0$ and $G_f$. We can calculate alternative -plans from these subgraphs if need be. - -Let $A$ be the set of packages to be upgraded from a given repository. -$G_{A,0}$ is the subgraph of $G_{0}$ induced by the ``upgrade -closure'' of $A$. The ``upgrade closure'' of a set $A$ of packages is -defined as a minimal set of packages $B \supseteq A$ such that there is no -package in $B$ that requires an upgrade for $A$ to be upgraded. This -is found by assuming that the current system state $S_0$ is -consistent, and by constructing a relation graph of the future state -of the system to detect the dependencies that have changed. - -Obviously, to make a plan, we must first know the goal state. In a -multi-package upgrade, the exact details of the goal state depend on -the graph $G_f$ of the repository. Thus, we construct a graph -$G_{A,f}$ that is a vertex-induced subgraph of $G_f$ such that it -contains all information relevant to upgrading packages $A$. We begin -by a vertex induced subgraph of $G_f$ by $A$. These are the packages -that will be upgraded in any case. Then, we make a pass on the -vertices, and look at all the outgoing edges, we compare whether this -edge has changed in any substantial way from the previous version. In -particular, we are interested in whether the predicate of the edge is -valid for the version of the same package in our current system. Every -compared vertex in this manner is marked done, and the edges not valid -for the current system pull new unmarked vertices into $G_f$, this -continues until there are no unmarked vertices left. Hence, the -vertices of $G_f$ are the packages that must be upgraded. - -To actually carry out the upgrade a strategy is to upgrade all the -packages in $G_{A,f}$ in some order. A good order is again the reverse -topological order order, in fact, the upgrade operation is merely a -special case of a multi-package installation code that can install -from a remote repository, since a multi-package installation can -contain upgrades in addition to new packages. However, in case no -package depends on the packages to be upgraded, then we can carry out -a completely consistency-preserving plan as discussed above. The -conflicts are resolved in the usual fashion, by removing those -packages in conflict with new packages that are installed. This can be -accomplished by invoking a remove operation prior to the upgrade -operation. - -\section{Examples} - -\subsection{A single package upgrade} - -goal: upgrade $(a,1)$ to $(a,2)$\\ -\\ -rules:\\ - $(a,1)$ depends on $(b,1), (c,1)$ \\ - $(a,1)$ conflicts with $(d,1)$\\ - $(a,2)$ depends on $(c,3), (d,2)$\\ - $(a,2)$ conflicts with $(b,1)$\\ -\\ -initial state:\\ - $(a,1), (b,1), (c,1)$ installed \\ - -In this case, we can find a consistency-preserving plan in terms of -install and remove operations. -\\ -plan:\\ - remove $(a,1)$\\ - remove $(b,1)$\\ - remove $(c,1)$\\ - install $(c,3)$\\ - install $(d,2)$\\ - install $(a,2)$\\ - -\subsection{Another upgrade} - -goal: upgrade $(b,1) \to (b,2)$\\ -\\ -current dep: $(a,1) \to[=1] (b,1) \to[=1] (c,1) \to[=1] (d,1)$\\ -repo dep: \nobreakspace{} \nobreakspace$(a,1) \to[=2] (b,2) \to[=2] (c,2) \to[=1] (d,1)$\\ - -In this case, we cannot remove $(b,1)$ because it's locked in the -chain. In fact, here there is no consistency-preserving plan in terms -of atomic single package transitions: install, remove, upgrade. In -these cases, it seems best to resort to upgrade in place, and in the -reverse topological order of dependencies. -\\ -plan:\\ - upgrade $(c,1) \to (c,2)$\\ - upgrade $(b,1) \to (b,2)$\\ - - -\subsection{A multi package remove} - -goal: remove $(a,2), (b,3), (c,2)$\\ -\\ -rules:\\ - $(c,2)$ depends $(a,2)$\\ - $(d,2)$ depends on $(b,3), (c,2)$\\ - $(e,1)$ depends on $(a,2)$\\ - $(f,2)$ depends on $(e,1)$\\ - $(g,2)$ depends on $(e,1)$\\\\ -plan:\\ - remove $(f,2)$\\ - remove $(g,2)$\\ - remove $(e,1)$\\ - remove $(d,2)$\\ - remove $(b,3)$\\ - remove $(c,2)$\\ - remove $(a,2)$\\ -\end{document} - diff --git a/tags/pisi-1.1_beta13/doc/notes/Dandik Fedora'nin component treesi.txt b/tags/pisi-1.1_beta13/doc/notes/Dandik Fedora'nin component treesi.txt deleted file mode 100644 index 44118606..00000000 --- a/tags/pisi-1.1_beta13/doc/notes/Dandik Fedora'nin component treesi.txt +++ /dev/null @@ -1,249 +0,0 @@ -From eray@uludag.org.tr Wed Sep 7 20:15:04 2005 -Return-Path: -X-Original-To: eray@uludag.org.tr -Delivered-To: eray@uludag.org.tr -Received: from liste.uludag.org.tr (pisi.uludag.org.tr [193.140.100.210]) - by uludag.org.tr (Postfix) with ESMTP id BE4C284D16; - Wed, 7 Sep 2005 20:15:15 +0300 (EEST) -Received: from pisi.uludag.org.tr (localhost [127.0.0.1]) - by liste.uludag.org.tr (Postfix) with ESMTP id 128A11878DE; - Wed, 7 Sep 2005 20:09:27 +0300 (EEST) -X-Original-To: cekirdek@liste.uludag.org.tr -Delivered-To: cekirdek@liste.uludag.org.tr -Received: from uludag.org.tr (comar.uludag.org.tr [193.140.100.220]) - by liste.uludag.org.tr (Postfix) with ESMTP id 8A1AD1878D6 - for ; - Wed, 7 Sep 2005 20:09:13 +0300 (EEST) -Received: by uludag.org.tr (Postfix) - id 56F5B908AE; Wed, 7 Sep 2005 20:15:02 +0300 (EEST) -Delivered-To: cekirdek@uludag.org.tr -Received: from [192.168.1.5] (unknown [85.97.87.38]) - by uludag.org.tr (Postfix) with ESMTP id 0057B84D16 - for ; Wed, 7 Sep 2005 20:15:01 +0300 (EEST) -From: Eray Ozkural -Organization: Pardus -To: cekirdek@uludag.org.tr -Date: Wed, 7 Sep 2005 20:15:04 +0300 -User-Agent: KMail/1.7.2 -MIME-Version: 1.0 -Message-Id: <200509072015.04792.eray@uludag.org.tr> -Cc: -Subject: [Cekirdek] [PISI Design] Dandik Fedora'nin component treesi -X-BeenThere: cekirdek@liste.uludag.org.tr -X-Mailman-Version: 2.1.5 -Precedence: list -Reply-To: cekirdek@uludag.org.tr -List-Id: cekirdek.liste.uludag.org.tr -List-Unsubscribe: , - -List-Archive: -List-Post: -List-Help: -List-Subscribe: , - -Content-Type: multipart/mixed; - boundary="===============1420878072==" -Sender: cekirdek-bounces@liste.uludag.org.tr -Errors-To: cekirdek-bounces@liste.uludag.org.tr -X-UID: 3643 -X-Length: 4136 - ---===============1420878072== -Content-Type: text/plain; - charset="us-ascii" -Content-Transfer-Encoding: 7bit -Content-Disposition: inline - -Bu aslinda mandrake'ye gore biraz daha akli basinda ve daha -onemlisi component mantigina uygun bir liste, bir iki degisiklik -disinda bu listeyle baslamakta fayda var. Bir de tabii gentoo'nun -kendi listesi var, onu da gentoo'cular gonderebilir mi listeye lutfen? - -Bu dedigim gibi iki seviyeli bir tree, oldukca iyi aslinda.... sadece -dedigim gibi component/category karisimi biraz onun disinda gayet -guzel... Bir de baktim "group" demisler, group da iyi bir sozcuk aslinda -degistirmeye gerek yok degil mi component lafini? - -Saygilar, - -Desktop - X11 - GNOME - KDE -Applications - Editors - Engineering and Scientific - Graphical Internet - Text-based Internet - Office/Productivity - Sound and Video - Authoring and Publishing - Graphics - Games and Entertainment -Servers - Server Configuration Tools - Web Server - Mail Server - Windows File Server - DNS Name Server - FTP Server - PostgreSQL Database - MySQL Database - News Server - Network Servers - Legacy Network Server -Development - Development Tools - X Software Development - GNOME "" - KDE "" - Legacy "" - Java Development - Eclipse -System - Language Support (includes fonts and input methods) - Administration Tools - System Tools - Printing Support - --- -Eray Ozkural (exa), Uludag Gelistiricisi -http://cekirdek.uludag.org.tr/~eray http://www.kde.org -http://www.cs.bilkent.edu.tr/~erayo http://www.malfunct.com - ---===============1420878072== -Content-Type: text/plain; charset="iso-8859-9" -MIME-Version: 1.0 -Content-Transfer-Encoding: quoted-printable -Content-Disposition: inline - -_______________________________________________ -Cekirdek mailing list -Cekirdek@uludag.org.tr -http://liste.uludag.org.tr/mailman/listinfo/cekirdek - ---===============1420878072==-- - -From gurer@uludag.org.tr Wed Sep 7 22:04:45 2005 -Return-Path: -X-Original-To: eray@uludag.org.tr -Delivered-To: eray@uludag.org.tr -Received: from liste.uludag.org.tr (pisi.uludag.org.tr [193.140.100.210]) - by uludag.org.tr (Postfix) with ESMTP id 00FBF380AA; - Wed, 7 Sep 2005 22:04:23 +0300 (EEST) -Received: from pisi.uludag.org.tr (localhost [127.0.0.1]) - by liste.uludag.org.tr (Postfix) with ESMTP id 4BEDB1878F8; - Wed, 7 Sep 2005 21:58:34 +0300 (EEST) -X-Original-To: cekirdek@liste.uludag.org.tr -Delivered-To: cekirdek@liste.uludag.org.tr -Received: from uludag.org.tr (comar.uludag.org.tr [193.140.100.220]) - by liste.uludag.org.tr (Postfix) with ESMTP id CBC0E159028 - for ; - Wed, 7 Sep 2005 21:58:32 +0300 (EEST) -Received: by uludag.org.tr (Postfix) - id 5EB758654F; Wed, 7 Sep 2005 22:04:21 +0300 (EEST) -Delivered-To: cekirdek@uludag.org.tr -Received: from cable73-96.anadolu.kablonet.com.tr (unknown [195.174.73.96]) - (using SSLv3 with cipher RC4-MD5 (128/128 bits)) - (No client certificate requested) - by uludag.org.tr (Postfix) with ESMTP id D92BD380AA - for ; Wed, 7 Sep 2005 22:04:20 +0300 (EEST) -From: =?ISO-8859-1?Q?G=FCrer_=D6zen?= -To: cekirdek@uludag.org.tr -In-Reply-To: <200509072015.04792.eray@uludag.org.tr> -References: <200509072015.04792.eray@uludag.org.tr> -Organization: TUBITAK - UEKAE -Date: Wed, 07 Sep 2005 22:04:45 +0300 -Message-Id: <1126119885.10981.13.camel@localhost> -Mime-Version: 1.0 -X-Mailer: Evolution 2.2.3 -Cc: -Subject: [Cekirdek] component hadisesi -X-BeenThere: cekirdek@liste.uludag.org.tr -X-Mailman-Version: 2.1.5 -Precedence: list -Reply-To: cekirdek@uludag.org.tr -List-Id: cekirdek.liste.uludag.org.tr -List-Unsubscribe: , - -List-Archive: -List-Post: -List-Help: -List-Subscribe: , - -Content-Type: multipart/mixed; - boundary="===============1294830247==" -Sender: cekirdek-bounces@liste.uludag.org.tr -Errors-To: cekirdek-bounces@liste.uludag.org.tr -X-UID: 3648 -X-Length: 4903 - ---===============1294830247== -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Kanalda meren, exa, çağlar, ben biraz fikir teatisinde bulunduk. Teati -dedim de çay çekti canım. Özetlen: - -Component bir görev için bir araya gelmiş ve görevin ayrı parçalarını -yapan paketler dedik. Kullanım amacı kullanıcının bir alt sistemi (kde, -tex) bir hamlede kurabilmesini sağlamak, gerektiğinde dependency olarak -kullanılmak. - -Aynı işi yapan farklı programların bir grubu (library, editor, archiver, -vs) kesinlikle component olmuyor. - -Temel olarak iki tipi var: - -KDE (kicker, kwm, kdm, kopete, vs) -burda aynı koddan türemiş ve bize masaüstü sağlayan paketlerin bir -componenti var. - -Base (kernel, grub, libc, bash, vs) -burda ayrı kodlardan gelen ve bize açılıp çalışabilen bir sistem -sağlayan paketlerin bir componenti var. - -Aynı paket birden fazla componente dahil olmuyor, bu component değil -bağımlılık ilişkisi. Örnek: -libxml2 is a part of Gnome -kopete (a partof KDE) depends on libxml2 (bunu uydurdum, kopete -libxml2 kullanmıyor olabilir) - -Yani componenti *asıl* olarak kod ilişkisi belirliyor, ama örneğin base -paketinde direk kod ilişkisi yoksa da, birbirleriyle çok içiçe iş yapan -programları bir component altında grupladık. İkincil kriter birlikte -çalışma. - -Karma bi örnek: -Tex componenti içinde aynı koddan gelen kpathsea, tetex,vs paketleri var -diyelim, ama farklı kodu olan hevea da buraya girebilir, çünkü html -generate edebilen bir tex sistemi için gerekli. - -Hiçbir componente ait olmayan, sadece dependency ve category ilişkileri -olan paketler olabilir. Bunlar mesela other diye bi dizinde -(componentler aynı zamanda paket deposundaki dizinler, bu şart değil ama -kolaylık) tutulur. - -Componentleri hiyerarşiye koymak kötü bi fikir değil, fedoranın ana -grupları bu konuda fena değil. - -Kafa karışıklığı kalmadı sanırım. Kategorileri konuşmadık daha :) - -Bu vesileyle yavaş yavaş pisi depomuzu a/ b/ c/ lerden kurtarıp -component bazlı dizinlere geçirmeye başlayalım dedik. - - - ---===============1294830247== -Content-Type: text/plain; charset="iso-8859-9" -MIME-Version: 1.0 -Content-Transfer-Encoding: quoted-printable -Content-Disposition: inline - -_______________________________________________ -Cekirdek mailing list -Cekirdek@uludag.org.tr -http://liste.uludag.org.tr/mailman/listinfo/cekirdek - ---===============1294830247==-- - diff --git a/tags/pisi-1.1_beta13/doc/notes/component-notes.txt b/tags/pisi-1.1_beta13/doc/notes/component-notes.txt deleted file mode 100644 index 10d9be84..00000000 --- a/tags/pisi-1.1_beta13/doc/notes/component-notes.txt +++ /dev/null @@ -1,167 +0,0 @@ -component'larla ilgili notlar - -1. Temel feature'lar (Eray) --------------------- - -Iki yerde component tag'i tanimladik simdiye kadar, bir -source'larda bir de binary'lerde. Binary'de tanimlanan component default -olarak source'daki tanimi inherit ediyor ve tanimlanan component'i override -edebiliyor. - -Bir component temel olarak bir meta-package, icerisinde paketler olan -bir paket. Bir component'in icerisinde bir takim source'lar ve bir takim -binary'ler bulunuyor diye bakabiliriz. Sanirim query'leri bu sekilde yapmak -mumkun olmali. - -$ pisi list-components -$ pisi info system.base - Source packages in system.base: - .... - .... - Binary packages in system.base: - .... - .... - -gibi ozellikler eklemeyi umit ediyorum. - -Source'larin component tag'leri de, gene sadece bir senaryo konusuyorum, -direkt olarak directory structure'indan inherit alinacak. Ayni zamanda o pspec -icin de bir tane component tanimlananack default olarak, ve bu component o -scope'da tanimlanmis olan butun binary package'lari icerecek. - -Ornegin diyelim ki a/b/c/pspec.xml var ve c1 c2 c3 seklinde uc tane paket -tanimliyor. Hic bir component tanimi yapilmadigi zaman otomatik olarak bir -a.b.c component'i olusturulacak, ve bu component'in icerisinde c1 c2 c3 -bulunacak. - -$ pisi info a.b.c - Source packages: - c - oldur beni yarim sen olmazsan biterim - Binary packages: - c1 - bu aksam demlenmemek sonum olur benim - c2 - sincaplarla konustum butun gece - c3 - her gul gordugumde icim kan aglar - -Bu varsayilan davranis, ama bunu degistirmek mumkun olacak. Burada yamuk -gozukebilecek bir sey var, o da tek bir paket oldugunda sanki biraz -redundancy olmasi, o takdirde bir optimizasyon olarak, diyelim ki -a/b/c/pspec.xml'in icerisinde tek bir paket tanimli c1 - -$ pisi info a.b - .... - c1 - dil dil dillerdeyim - -olabilir bu durumda, bu genel agac mantiginda bir sorun yaratmayacaktir. - - -2. Temel tanım (Barış) - -fiziksel aitlik: kdebase'den çıkan kcontrol gibi; grup aitliği: pdf -göstericileri gibi... - - -3. Database XML ayrımı (Barış) - -Component database'i ile component.xml ayrı olmalı. Component database, -pisi'nin pisi-index.xml dosyasını okuyarak oluşturacağı bir veritabanı. Hangi -paketler hangi componentlere dahil, vs. sorguları bu veritabanından -yapılacak. - -Pspec dosyasını hatırlayalım. İçerisinde bir diye bir tag var. -Oluşturulacak paketin hangi component'e ait olduğunu belirtiyor. Bu bilgi -pisi-index.xml dosyasına da koyulmalı. - -4. PL modüllerine benzerlik (Eray) - -component tag'leri Java ya da python'daki gibi -directory yapisindan cikiyor. Yani pisi bir programlama dili olsaydi -component'lar module'ler ya da package'larla es anlamli olacakti. - -5. Mereology ve Eray'ın açıklama çabaları (Eray) - -PartOf iliskisi hakkında su kadarini soylemek yeter: eger a b'nin bir parcasiysa, -a'nin fonksiyonu b'nin fonksiyonunun bir parcasidir. Bu da fiziksel sistemler -icin bir principle of compositionality'nin varligindan hareket eder [*] - -Genel olarak da software engineering ve AI camiasinda module'un tanimi gayet -iyi bilinir. Bir modul icerisindeki bagimliliklar yogundur. Moduller arasindaki -bagimliliklar zayiftir. - -Bu tanim sadece software engineering'de degil, nesneler arasindaki -benzerliklerin incelendigi bir cok disiplinde kullanilan informal bir tanim, -ama tabii ki formule dokulmus bir ton hali var.Sırf bu tanımı taban alarak -yazılmış başarılı kümeleme (clustering) algoritmaları var. - -Modulerlik tanimi verilen *fiziksel* modul ve parcasi olma iliskisiyle -birlesince birlikte install edilip remove edilme yahut ortak bağımlılıklara -sahip olma tanımlarına götürür. - -Bu tanımı analiz edebilmek için parcasi olma iliskisininin anlamini -korumamiz yeterli. Temel olarak - -  kol insanin parcasidir - -iliskisi burada yer aliyor.  Eger - -  a partof b - -turu iliskilerde a paket ya da component, ve b component ise, a ve b'nin -iliskisinin kol ve insan iliskisi gibi olmasini bekleriz. Eger bu parca-butun -iliskisini ihlal ediyorsa o zaman muhtemelen yanlis bir iliski bulunmus -demektir. - -Bunun turlu sonuclari da onem sirasina gore soyle dizilebilir: - -1. Fonksiyonlarin bolunebilmesi prensibinden: (basit bir sonuç) -   a's function is part-of b's function - - orneğin kolun fonksiyonu insanın total fonksiyonunun bir parçasıdır. - -paket ornegi: pisi'nin fonksiyonu olan paket yükleme/çıkarma system.base'in fonksiyonunun, yani temel pardus sisteminin fonksiyonunun bir parçasıdır. - -2. Karmasik sistemlerde birbirine dayanan ufak parcalarin kararli yapilar -meydana getirmesi prensibinden: (evrimsel sonuç) - -   if a is a part-of c, and b is a part-of c, then it follows that a and b -may: -     a. have many interdependencies -     b. share in their origins -  (which are about the same thing) - -2b. sonucunun bizim durumumuza uygulanması, source code'un aynı kaynaktan -çıkması, birlikte inşa edilmeleri gibi şartları getirir. Bunun oldukça -olasi, en azindan insa metodlarinin ve kaynaklarının birbirine benzemesini -bekleriz. Yalniz, 2.a'daki bagimliliklar sadece insa ile degil ayni zamanda -calisma ile de alakalidir. Kaynakları farklı parçaların birbirine bağımlı -hale gelebilecegini unutmamak gerekir. - -Fedora'nin yaklasiminin hos tarafi, boyle teknik ayrintilara girmeden "package -group" mantigini kullanmasiydi, ama bizim belli bir anlami olan parca-butun -iliskisini korumamiz daha mantikli bir yazilim ontology'si ortaya -cikaracaktir. Onlarin yaklasimi ise "anything goes", grup ile kategori'nin -temel bir farki yok cunku, herhangi bir bakis acisi olabilir "grup". - - -6. Modulleri test etmek (!!) (Eray) ------------------------------------- - -PISI'deki seçilen implementation detaylari bir tanima cok fazla commitment -yapmiyor, implementation'ın getirdiği tek şey paketleri bir ağaca koymak. -Component'ların seçiminin ne kadar kaliteli olduğunu belirleyemiyor. -Paketlerin ve componentlarin secimi yapiyor, ki kritik olan o. -Yalnız modulerlik tanimindan ve part-of iliskisinin -  if a is part of b, and b is part of c, then a is part of c. -  if a is part of b, and b is not part of c, then a is not part of c. -gibi sonuclari getirmesinden hareketle (ki bunlar klasik computational -ontology) kismen test edebilecegimiz bir sekil aliyor ornegin bagimlilik -graph'ini cluster ederek, ya da her modul icin bir modulerlik sayisi -hesaplayarak. Daha az formal olarak da bu sonuçları kafamızda yürüterek -yaptığımız componentların ne kadar akla yatkın olduğunu bulabiliriz. - - -7. Cagların frugalware önerisi ------------------------------- - -http://ftp.frugalware.org/pub/frugalware/frugalware-current/source/ -adresindeki yerleşimin hem source hem de binary depo için uygulanmasını ve -kategori, componentların da bundan çıkartılmasını öneriyorum. diff --git a/tags/pisi-1.1_beta13/doc/notes/mandrake component _ group tree.txt b/tags/pisi-1.1_beta13/doc/notes/mandrake component _ group tree.txt deleted file mode 100644 index f6edd70f..00000000 --- a/tags/pisi-1.1_beta13/doc/notes/mandrake component _ group tree.txt +++ /dev/null @@ -1,879 +0,0 @@ -From eray@uludag.org.tr Thu Jul 21 15:54:55 2005 -Return-Path: -X-Original-To: eray@uludag.org.tr -Delivered-To: eray@uludag.org.tr -Received: from liste.uludag.org.tr (pisi.uludag.org.tr [193.140.100.210]) - by uludag.org.tr (Postfix) with ESMTP id 351D885A97; - Thu, 21 Jul 2005 15:55:08 +0300 (EEST) -Received: from pisi.uludag.org.tr (localhost [127.0.0.1]) - by liste.uludag.org.tr (Postfix) with ESMTP id 0742810A659; - Thu, 21 Jul 2005 15:52:59 +0300 (EEST) -X-Original-To: cekirdek@liste.uludag.org.tr -Delivered-To: cekirdek@liste.uludag.org.tr -Received: from uludag.org.tr (comar.uludag.org.tr [193.140.100.220]) - by liste.uludag.org.tr (Postfix) with ESMTP id BABCC10A654 - for ; - Thu, 21 Jul 2005 15:52:56 +0300 (EEST) -Received: by uludag.org.tr (Postfix) - id 91D0C86099; Thu, 21 Jul 2005 15:55:05 +0300 (EEST) -Delivered-To: cekirdek@uludag.org.tr -Received: from [192.168.1.5] (unknown [85.99.19.56]) - by uludag.org.tr (Postfix) with ESMTP id 0143385A97 - for ; Thu, 21 Jul 2005 15:55:04 +0300 (EEST) -From: Eray Ozkural -Organization: Pardus -To: cekirdek@uludag.org.tr -Date: Thu, 21 Jul 2005 15:54:55 +0300 -User-Agent: KMail/1.7.2 -MIME-Version: 1.0 -Message-Id: <200507211554.55602.eray@uludag.org.tr> -Cc: -Subject: [Cekirdek] [PISI design] mandrake component / group tree -X-BeenThere: cekirdek@liste.uludag.org.tr -X-Mailman-Version: 2.1.5 -Precedence: list -Reply-To: cekirdek@uludag.org.tr -List-Id: cekirdek.liste.uludag.org.tr -List-Unsubscribe: , - -List-Archive: -List-Post: -List-Help: -List-Subscribe: , - -Content-Type: multipart/mixed; - boundary="===============2130999829==" -Sender: cekirdek-bounces@liste.uludag.org.tr -Errors-To: cekirdek-bounces@liste.uludag.org.tr -X-UID: 1651 -X-Length: 4961 - ---===============2130999829== -Content-Type: text/plain; - charset="us-ascii" -Content-Transfer-Encoding: 7bit -Content-Disposition: inline - -Mandrake'de "group" diye geciyor terim. Belki daha iyidir component'dan. Bu -component lafi akil mi karistiriyor diye killaniyorum hala. - -Bu arada, mandrake'nin bu olayini tam begenmedim. Tamam System'in alti -bizim dusundugumuz gibi, ama gerisi biraz daha category mantiginda, -debian'inki gibi yapilmis. Aslinda Archiving, Books, Cluster, Sciences, -Development, Networking fena degil ama bizim daha anlamli birseyler yapmamiz -gerekebilir, bu vizyonunuzu daraltmasin. Ornegin bizde OpenOffice bir -component olacak. Ya bizim componentlari en iyi python module'leri gibi -dusunun, "alt" notasyonu da bunu gostermek icin '.' olsun. - -apps.office partof apps -apps.office.openoffice partof apps.office - -openoffice-libs partof apps.office.openoffice -openoffice-bin partof apps.office.openoffice - -ornegin - -buradaki tabii ki onemli sey component hiyerarsisinin *birlikte install -edilen* adamlara ihtimam etmesi. Ornegin asagida System.Base aynen boyle, bu -da guzel birsey! - -Altlarindaki paketleri yazmiyorum. - -Mandrake Group Tree --------------------------------- - -Accessibility -Archiving - Backup - Cd burning - Compression - Other -Books - Computer books - Howtos - Literature - Other -Cluster - Message Passing - Queueing Services -Communications -Configuration -Databases -Development - C - C++ - Databases - Debug - Gnome and GTK+ - Java - KDE and Qt - Kernel - Libraries - Other - Perl - Python -Documentation -Editors -Education -Emulators -File Tools -Games - Adventure - Arcade - Boards - Cards - Other - Puzzles - Sports - Strategy -Graphical desktop - Enlightenment - FVWM based - GNOME - Icewm - KDE - Other - Sawfish - WindowMakes - Xfce -Graphics -Monitoring -Networking - Chat - File transfer - Instant messaging - Instant Messaging - IRC - Mail - News - Other - Remote access - WWW -Office -Publishing -Sciences - Astronomy - Biology - Chemistry - Computer science - Geosciences - Mathematics - Other - Physics -System - Base - Configuration - Cryptography - Deployment - Fonts - Internationalization - Kernel and hardware - Libraries - Servers - X11 - XFree86 -Shells -Sounds -System -Terminals -Text tools -Toys -Video - --- -Eray - ---===============2130999829== -Content-Type: text/plain; charset="iso-8859-9" -MIME-Version: 1.0 -Content-Transfer-Encoding: quoted-printable -Content-Disposition: inline - -_______________________________________________ -Cekirdek mailing list -Cekirdek@uludag.org.tr -http://liste.uludag.org.tr/mailman/listinfo/cekirdek - ---===============2130999829==-- - -From serdar@uludag.org.tr Thu Jul 21 16:10:37 2005 -Return-Path: -X-Original-To: eray@uludag.org.tr -Delivered-To: eray@uludag.org.tr -Received: from liste.uludag.org.tr (pisi.uludag.org.tr [193.140.100.210]) - by uludag.org.tr (Postfix) with ESMTP id 6010F85F66; - Thu, 21 Jul 2005 16:12:48 +0300 (EEST) -Received: from pisi.uludag.org.tr (localhost [127.0.0.1]) - by liste.uludag.org.tr (Postfix) with ESMTP id 7E52910A661; - Thu, 21 Jul 2005 16:10:39 +0300 (EEST) -X-Original-To: cekirdek@liste.uludag.org.tr -Delivered-To: cekirdek@liste.uludag.org.tr -Received: from uludag.org.tr (comar.uludag.org.tr [193.140.100.220]) - by liste.uludag.org.tr (Postfix) with ESMTP id 2FAA4950E8 - for ; - Thu, 21 Jul 2005 16:10:37 +0300 (EEST) -Received: by uludag.org.tr (Postfix) - id 5ECC486095; Thu, 21 Jul 2005 16:12:46 +0300 (EEST) -Delivered-To: cekirdek@uludag.org.tr -Received: from webmail.uludag.org.tr (pisi.uludag.org.tr [193.140.100.210]) - by uludag.org.tr (Postfix) with ESMTP id 5801F86094 - for ; Thu, 21 Jul 2005 16:12:46 +0300 (EEST) -Received: from 193.140.74.2 (SquirrelMail authenticated user serdar) - by webmail.uludag.org.tr with HTTP; - Thu, 21 Jul 2005 16:10:37 +0300 (EEST) -Message-ID: <51672.193.140.74.2.1121951437.squirrel@webmail.uludag.org.tr> -In-Reply-To: <200507211554.55602.eray@uludag.org.tr> -References: <200507211554.55602.eray@uludag.org.tr> -Date: Thu, 21 Jul 2005 16:10:37 +0300 (EEST) -Subject: Re: [Cekirdek] [PISI design] mandrake component / group tree -From: serdar@uludag.org.tr -To: cekirdek@uludag.org.tr -User-Agent: SquirrelMail/1.4.4 -MIME-Version: 1.0 -X-Priority: 3 (Normal) -Importance: Normal -Cc: -X-BeenThere: cekirdek@liste.uludag.org.tr -X-Mailman-Version: 2.1.5 -Precedence: list -Reply-To: cekirdek@uludag.org.tr -List-Id: cekirdek.liste.uludag.org.tr -List-Unsubscribe: , - -List-Archive: -List-Post: -List-Help: -List-Subscribe: , - -Content-Type: multipart/mixed; - boundary="===============1295726599==" -Sender: cekirdek-bounces@liste.uludag.org.tr -Errors-To: cekirdek-bounces@liste.uludag.org.tr -X-UID: 1655 -X-Length: 7560 - ---===============1295726599== -Content-Type: text/plain;charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Selamlar.. - -Benim görüşüm, kullanıcının karşısına ilk anda bu kadar çok -kategori çıkarsa, çabucak refüze olacağıdır. Kapsamları daraltıp, -işi 2 kademe yerine 3-4 kademeye yaymak daha kullanışlı olur -sanıyorum. - -İyi bir örnek değil ama, freshmeat.net'te ki kategorilere bir bakabiliriz. - -# Adaptive Technologies (51 projects) -# Artistic Software (165 projects) -# Communications (5684 projects) -# Database (2022 projects) -# Desktop Environment (2373 projects) -# Documentation (172 projects) -# Education (896 projects) -# freshmeat.net (28 projects) -# Games/Entertainment (2720 projects) -# Home Automation (80 projects) -# Information Management (1259 projects) -# Internet (10220 projects) -# Multimedia (6251 projects) -# Office/Business (2066 projects) -# Other/Nonlisted Topic (261 projects) -# Printing (227 projects) -# Religion (50 projects) -# Scientific/Engineering (2705 projects) -# Security (1591 projects) -# Software Development (10758 projects) -# System (10314 projects) -# Terminals (321 projects) -# Text Editors (647 projects) -# Text Processing (2416 projects) -# Utilities (3056 projects) - -Bu listeden çıkarılabilecek bir sürü şey olabilir. Hatta minor -şeyler birleştirilip bir alt seviyede detaylandırılabilir. Freshmeat -bunları upuzun uzatıyor, böylece aradığını bulmak daha kolay -oluyor. - -Yukarıdaki liste çok uygun değil. Örneğin, Text Editors ile Office -ayrımı çoğu için anlam ifade etmez. Database ile -development/business'in ayrık durması da anlamsız bence, Databases -development ve belki business altında listlenebilir. - -Liste ne kadar uzun olursa, o kadar bıkkınlık verici olacaktır -sanıyorum. Bu yüzden de laf gelimi, her kademede en fazla 10 girdi -olacak şekilde daha derin listeler hazırlanmasının faydalı -olacağını düşünüyorum.. - -Saygı ve sevgiler.. - -> Mandrake'de "group" diye geciyor terim. Belki daha iyidir component'dan. -> Bu -> component lafi akil mi karistiriyor diye killaniyorum hala. -> -> Bu arada, mandrake'nin bu olayini tam begenmedim. Tamam System'in alti -> bizim dusundugumuz gibi, ama gerisi biraz daha category mantiginda, -> debian'inki gibi yapilmis. Aslinda Archiving, Books, Cluster, Sciences, -> Development, Networking fena degil ama bizim daha anlamli birseyler -> yapmamiz -> gerekebilir, bu vizyonunuzu daraltmasin. Ornegin bizde OpenOffice bir -> component olacak. Ya bizim componentlari en iyi python module'leri gibi -> dusunun, "alt" notasyonu da bunu gostermek icin '.' olsun. -> -> apps.office partof apps -> apps.office.openoffice partof apps.office -> -> openoffice-libs partof apps.office.openoffice -> openoffice-bin partof apps.office.openoffice -> -> ornegin -> -> buradaki tabii ki onemli sey component hiyerarsisinin *birlikte install -> edilen* adamlara ihtimam etmesi. Ornegin asagida System.Base aynen boyle, -> bu -> da guzel birsey! -> -> Altlarindaki paketleri yazmiyorum. -> -> Mandrake Group Tree -> -------------------------------- -> -> Accessibility -> Archiving -> Backup -> Cd burning -> Compression -> Other -> Books -> Computer books -> Howtos -> Literature -> Other -> Cluster -> Message Passing -> Queueing Services -> Communications -> Configuration -> Databases -> Development -> C -> C++ -> Databases -> Debug -> Gnome and GTK+ -> Java -> KDE and Qt -> Kernel -> Libraries -> Other -> Perl -> Python -> Documentation -> Editors -> Education -> Emulators -> File Tools -> Games -> Adventure -> Arcade -> Boards -> Cards -> Other -> Puzzles -> Sports -> Strategy -> Graphical desktop -> Enlightenment -> FVWM based -> GNOME -> Icewm -> KDE -> Other -> Sawfish -> WindowMakes -> Xfce -> Graphics -> Monitoring -> Networking -> Chat -> File transfer -> Instant messaging -> Instant Messaging -> IRC -> Mail -> News -> Other -> Remote access -> WWW -> Office -> Publishing -> Sciences -> Astronomy -> Biology -> Chemistry -> Computer science -> Geosciences -> Mathematics -> Other -> Physics -> System -> Base -> Configuration -> Cryptography -> Deployment -> Fonts -> Internationalization -> Kernel and hardware -> Libraries -> Servers -> X11 -> XFree86 -> Shells -> Sounds -> System -> Terminals -> Text tools -> Toys -> Video -> -> -- -> Eray -> _______________________________________________ -> Cekirdek mailing list -> Cekirdek@uludag.org.tr -> http://liste.uludag.org.tr/mailman/listinfo/cekirdek -> - - - ---===============1295726599== -Content-Type: text/plain; charset="iso-8859-9" -MIME-Version: 1.0 -Content-Transfer-Encoding: quoted-printable -Content-Disposition: inline - -_______________________________________________ -Cekirdek mailing list -Cekirdek@uludag.org.tr -http://liste.uludag.org.tr/mailman/listinfo/cekirdek - ---===============1295726599==-- - -From eray@uludag.org.tr Wed Jul 27 13:02:17 2005 -Return-Path: -X-Original-To: eray@uludag.org.tr -Delivered-To: eray@uludag.org.tr -Received: from liste.uludag.org.tr (pisi.uludag.org.tr [193.140.100.210]) - by uludag.org.tr (Postfix) with ESMTP id AABE08584B; - Wed, 27 Jul 2005 13:02:30 +0300 (EEST) -Received: from pisi.uludag.org.tr (localhost [127.0.0.1]) - by liste.uludag.org.tr (Postfix) with ESMTP id EAF71E558D; - Wed, 27 Jul 2005 12:59:53 +0300 (EEST) -X-Original-To: cekirdek@liste.uludag.org.tr -Delivered-To: cekirdek@liste.uludag.org.tr -Received: from uludag.org.tr (comar.uludag.org.tr [193.140.100.220]) - by liste.uludag.org.tr (Postfix) with ESMTP id CF155E558D - for ; - Wed, 27 Jul 2005 12:59:52 +0300 (EEST) -Received: by uludag.org.tr (Postfix) - id 0B4998584E; Wed, 27 Jul 2005 13:02:29 +0300 (EEST) -Delivered-To: cekirdek@uludag.org.tr -Received: from [192.168.1.5] (unknown [85.99.19.56]) - by uludag.org.tr (Postfix) with ESMTP id 719658584B - for ; Wed, 27 Jul 2005 13:02:28 +0300 (EEST) -From: Eray Ozkural -Organization: Pardus -To: cekirdek@uludag.org.tr -Subject: Re: [Cekirdek] [PISI design] mandrake component / group tree -Date: Wed, 27 Jul 2005 13:02:17 +0300 -User-Agent: KMail/1.7.2 -References: <200507211554.55602.eray@uludag.org.tr> -In-Reply-To: <200507211554.55602.eray@uludag.org.tr> -MIME-Version: 1.0 -Message-Id: <200507271302.17641.eray@uludag.org.tr> -Cc: -X-BeenThere: cekirdek@liste.uludag.org.tr -X-Mailman-Version: 2.1.5 -Precedence: list -Reply-To: cekirdek@uludag.org.tr -List-Id: cekirdek.liste.uludag.org.tr -List-Unsubscribe: , - -List-Archive: -List-Post: -List-Help: -List-Subscribe: , - -Content-Type: multipart/mixed; - boundary="===============2058226043==" -Sender: cekirdek-bounces@liste.uludag.org.tr -Errors-To: cekirdek-bounces@liste.uludag.org.tr -X-UID: 1835 -X-Length: 5701 - ---===============2058226043== -Content-Type: text/plain; - charset="iso-8859-1" -Content-Transfer-Encoding: 7bit -Content-Disposition: inline - -Buna bakip dusundunuz mu? Bakiniz, mandrake'nin daha cok kategorik -bir ayrim, cok component mantigina uymuyor. Fedora daha uygun aslinda ama o da -cok basit yararli olmak icin. - -On Thursday 21 July 2005 03:54 pm, Eray Ozkural wrote: -> Mandrake'de "group" diye geciyor terim. Belki daha iyidir component'dan. Bu -> component lafi akil mi karistiriyor diye killaniyorum hala. -> -> Bu arada, mandrake'nin bu olayini tam begenmedim. Tamam System'in alti -> bizim dusundugumuz gibi, ama gerisi biraz daha category mantiginda, -> debian'inki gibi yapilmis. Aslinda Archiving, Books, Cluster, Sciences, -> Development, Networking fena degil ama bizim daha anlamli birseyler -> yapmamiz gerekebilir, bu vizyonunuzu daraltmasin. Ornegin bizde OpenOffice -> bir component olacak. Ya bizim componentlari en iyi python module'leri gibi -> dusunun, "alt" notasyonu da bunu gostermek icin '.' olsun. -> -> apps.office partof apps -> apps.office.openoffice partof apps.office -> -> openoffice-libs partof apps.office.openoffice -> openoffice-bin partof apps.office.openoffice -> -> ornegin -> -> buradaki tabii ki onemli sey component hiyerarsisinin *birlikte install -> edilen* adamlara ihtimam etmesi. Ornegin asagida System.Base aynen boyle, -> bu da guzel birsey! -> -> Altlarindaki paketleri yazmiyorum. -> -> Mandrake Group Tree -> -------------------------------- -> -> Accessibility -> Archiving -> Backup -> Cd burning -> Compression -> Other -> Books -> Computer books -> Howtos -> Literature -> Other -> Cluster -> Message Passing -> Queueing Services -> Communications -> Configuration -> Databases -> Development -> C -> C++ -> Databases -> Debug -> Gnome and GTK+ -> Java -> KDE and Qt -> Kernel -> Libraries -> Other -> Perl -> Python -> Documentation -> Editors -> Education -> Emulators -> File Tools -> Games -> Adventure -> Arcade -> Boards -> Cards -> Other -> Puzzles -> Sports -> Strategy -> Graphical desktop -> Enlightenment -> FVWM based -> GNOME -> Icewm -> KDE -> Other -> Sawfish -> WindowMakes -> Xfce -> Graphics -> Monitoring -> Networking -> Chat -> File transfer -> Instant messaging -> Instant Messaging -> IRC -> Mail -> News -> Other -> Remote access -> WWW -> Office -> Publishing -> Sciences -> Astronomy -> Biology -> Chemistry -> Computer science -> Geosciences -> Mathematics -> Other -> Physics -> System -> Base -> Configuration -> Cryptography -> Deployment -> Fonts -> Internationalization -> Kernel and hardware -> Libraries -> Servers -> X11 -> XFree86 -> Shells -> Sounds -> System -> Terminals -> Text tools -> Toys -> Video - --- -Eray Ozkural (exa), Uludag Gelistiricisi -http://cekirdek.uludag.org.tr/~eray http://www.kde.org -http://www.cs.bilkent.edu.tr/~erayo http://www.malfunct.com - ---===============2058226043== -Content-Type: text/plain; charset="iso-8859-9" -MIME-Version: 1.0 -Content-Transfer-Encoding: quoted-printable -Content-Disposition: inline - -_______________________________________________ -Cekirdek mailing list -Cekirdek@uludag.org.tr -http://liste.uludag.org.tr/mailman/listinfo/cekirdek - ---===============2058226043==-- - -From eray@uludag.org.tr Wed Sep 7 20:05:53 2005 -Return-Path: -X-Original-To: eray@uludag.org.tr -Delivered-To: eray@uludag.org.tr -Received: from liste.uludag.org.tr (pisi.uludag.org.tr [193.140.100.210]) - by uludag.org.tr (Postfix) with ESMTP id 8D2A084F4B; - Wed, 7 Sep 2005 20:06:04 +0300 (EEST) -Received: from pisi.uludag.org.tr (localhost [127.0.0.1]) - by liste.uludag.org.tr (Postfix) with ESMTP id 086A718789A; - Wed, 7 Sep 2005 20:00:16 +0300 (EEST) -X-Original-To: cekirdek@liste.uludag.org.tr -Delivered-To: cekirdek@liste.uludag.org.tr -Received: from uludag.org.tr (comar.uludag.org.tr [193.140.100.220]) - by liste.uludag.org.tr (Postfix) with ESMTP id F039818789A - for ; - Wed, 7 Sep 2005 20:00:02 +0300 (EEST) -Received: by uludag.org.tr (Postfix) - id 401CE8F9B9; Wed, 7 Sep 2005 20:05:51 +0300 (EEST) -Delivered-To: cekirdek@uludag.org.tr -Received: from [192.168.1.5] (unknown [85.97.87.38]) - by uludag.org.tr (Postfix) with ESMTP id A4EC084F4B - for ; Wed, 7 Sep 2005 20:05:50 +0300 (EEST) -From: Eray Ozkural -Organization: Pardus -To: cekirdek@uludag.org.tr -Subject: Re: [Cekirdek] [PISI design] mandrake component / group tree -Date: Wed, 7 Sep 2005 20:05:53 +0300 -User-Agent: KMail/1.7.2 -References: <200507211554.55602.eray@uludag.org.tr> -In-Reply-To: <200507211554.55602.eray@uludag.org.tr> -MIME-Version: 1.0 -Message-Id: <200509072005.53482.eray@uludag.org.tr> -Cc: -X-BeenThere: cekirdek@liste.uludag.org.tr -X-Mailman-Version: 2.1.5 -Precedence: list -Reply-To: cekirdek@uludag.org.tr -List-Id: cekirdek.liste.uludag.org.tr -List-Unsubscribe: , - -List-Archive: -List-Post: -List-Help: -List-Subscribe: , - -Content-Type: multipart/mixed; - boundary="===============1083705676==" -Sender: cekirdek-bounces@liste.uludag.org.tr -Errors-To: cekirdek-bounces@liste.uludag.org.tr -X-UID: 3642 -X-Length: 5765 - ---===============1083705676== -Content-Type: text/plain; - charset="iso-8859-1" -Content-Transfer-Encoding: 7bit -Content-Disposition: inline - -bunu gormus muydunuz? - -genelde iki seviye ana component'lari belirtmek icin yeterli -mandrake'nin kafasinin karismasi icin kategorilerle componentlari -karismasi yeterli olmus, yani asagidaki bircok sey aslinda component -*degil* kategori. - -On Thursday 21 July 2005 03:54 pm, Eray Ozkural wrote: -> Mandrake'de "group" diye geciyor terim. Belki daha iyidir component'dan. Bu -> component lafi akil mi karistiriyor diye killaniyorum hala. -> -> Bu arada, mandrake'nin bu olayini tam begenmedim. Tamam System'in alti -> bizim dusundugumuz gibi, ama gerisi biraz daha category mantiginda, -> debian'inki gibi yapilmis. Aslinda Archiving, Books, Cluster, Sciences, -> Development, Networking fena degil ama bizim daha anlamli birseyler -> yapmamiz gerekebilir, bu vizyonunuzu daraltmasin. Ornegin bizde OpenOffice -> bir component olacak. Ya bizim componentlari en iyi python module'leri gibi -> dusunun, "alt" notasyonu da bunu gostermek icin '.' olsun. -> -> apps.office partof apps -> apps.office.openoffice partof apps.office -> -> openoffice-libs partof apps.office.openoffice -> openoffice-bin partof apps.office.openoffice -> -> ornegin -> -> buradaki tabii ki onemli sey component hiyerarsisinin *birlikte install -> edilen* adamlara ihtimam etmesi. Ornegin asagida System.Base aynen boyle, -> bu da guzel birsey! -> -> Altlarindaki paketleri yazmiyorum. -> -> Mandrake Group Tree -> -------------------------------- -> -> Accessibility -> Archiving -> Backup -> Cd burning -> Compression -> Other -> Books -> Computer books -> Howtos -> Literature -> Other -> Cluster -> Message Passing -> Queueing Services -> Communications -> Configuration -> Databases -> Development -> C -> C++ -> Databases -> Debug -> Gnome and GTK+ -> Java -> KDE and Qt -> Kernel -> Libraries -> Other -> Perl -> Python -> Documentation -> Editors -> Education -> Emulators -> File Tools -> Games -> Adventure -> Arcade -> Boards -> Cards -> Other -> Puzzles -> Sports -> Strategy -> Graphical desktop -> Enlightenment -> FVWM based -> GNOME -> Icewm -> KDE -> Other -> Sawfish -> WindowMakes -> Xfce -> Graphics -> Monitoring -> Networking -> Chat -> File transfer -> Instant messaging -> Instant Messaging -> IRC -> Mail -> News -> Other -> Remote access -> WWW -> Office -> Publishing -> Sciences -> Astronomy -> Biology -> Chemistry -> Computer science -> Geosciences -> Mathematics -> Other -> Physics -> System -> Base -> Configuration -> Cryptography -> Deployment -> Fonts -> Internationalization -> Kernel and hardware -> Libraries -> Servers -> X11 -> XFree86 -> Shells -> Sounds -> System -> Terminals -> Text tools -> Toys -> Video - --- -Eray Ozkural (exa), Uludag Gelistiricisi -http://cekirdek.uludag.org.tr/~eray http://www.kde.org -http://www.cs.bilkent.edu.tr/~erayo http://www.malfunct.com - ---===============1083705676== -Content-Type: text/plain; charset="iso-8859-9" -MIME-Version: 1.0 -Content-Transfer-Encoding: quoted-printable -Content-Disposition: inline - -_______________________________________________ -Cekirdek mailing list -Cekirdek@uludag.org.tr -http://liste.uludag.org.tr/mailman/listinfo/cekirdek - ---===============1083705676==-- - diff --git a/tags/pisi-1.1_beta13/doc/notes/release hikayesi.txt b/tags/pisi-1.1_beta13/doc/notes/release hikayesi.txt deleted file mode 100644 index 9fb1b4e6..00000000 --- a/tags/pisi-1.1_beta13/doc/notes/release hikayesi.txt +++ /dev/null @@ -1,110 +0,0 @@ -From eray@uludag.org.tr Thu Jul 28 16:42:47 2005 -Return-Path: -X-Original-To: eray@uludag.org.tr -Delivered-To: eray@uludag.org.tr -Received: from liste.uludag.org.tr (pisi.uludag.org.tr [193.140.100.210]) - by uludag.org.tr (Postfix) with ESMTP id 0CE2C75758; - Thu, 28 Jul 2005 16:43:24 +0300 (EEST) -Received: from pisi.uludag.org.tr (localhost [127.0.0.1]) - by liste.uludag.org.tr (Postfix) with ESMTP id 2FD2D109DF1; - Thu, 28 Jul 2005 16:40:43 +0300 (EEST) -X-Original-To: cekirdek@liste.uludag.org.tr -Delivered-To: cekirdek@liste.uludag.org.tr -Received: from uludag.org.tr (comar.uludag.org.tr [193.140.100.220]) - by liste.uludag.org.tr (Postfix) with ESMTP id B4AAA109DDB - for ; - Thu, 28 Jul 2005 16:40:40 +0300 (EEST) -Received: by uludag.org.tr (Postfix) - id 5D432858B5; Thu, 28 Jul 2005 16:43:21 +0300 (EEST) -Delivered-To: cekirdek@uludag.org.tr -Received: from [192.168.1.5] (unknown [85.99.19.56]) - by uludag.org.tr (Postfix) with ESMTP id CC4ED75758 - for ; Thu, 28 Jul 2005 16:43:19 +0300 (EEST) -From: Eray Ozkural -Organization: Pardus -To: cekirdek@uludag.org.tr -Date: Thu, 28 Jul 2005 16:42:47 +0300 -User-Agent: KMail/1.7.2 -MIME-Version: 1.0 -Message-Id: <200507281642.47792.eray@uludag.org.tr> -Cc: -Subject: [Cekirdek] [PISI design] release hikayesi -X-BeenThere: cekirdek@liste.uludag.org.tr -X-Mailman-Version: 2.1.5 -Precedence: list -Reply-To: cekirdek@uludag.org.tr -List-Id: cekirdek.liste.uludag.org.tr -List-Unsubscribe: , - -List-Archive: -List-Post: -List-Help: -List-Subscribe: , - -Content-Type: multipart/mixed; - boundary="===============1945860385==" -Sender: cekirdek-bounces@liste.uludag.org.tr -Errors-To: cekirdek-bounces@liste.uludag.org.tr -X-UID: 1875 -X-Length: 4330 - ---===============1945860385== -Content-Type: text/plain; - charset="us-ascii" -Content-Transfer-Encoding: 7bit -Content-Disposition: inline - -selamlar, - -dun konustuklarimiz uzerine biraz yatip dusundum. bir ara haci -kuslugu yapmisim ben de ve bir durumu gozden kacirmisim. -dun caglar ve murat'in getirdigi 2. oneriyle karisik bir sey yapmamiz -gerekebilir. benim kafam mi dagilmis ne kusura bakmayin. ama -o kadar onemli degil. - -soyle bir sorun var. - -simdi bir source var x diye, 5. release'de - -icindeki sadece bir paketi ornegin x2'yi etkileyecek bir degisiklik yaptik. - -bu durumda x1 ve x3'un build numaralari artmiyor. ama source release -numaralari mi artiyor? tamam buraya kadar ok. ama build sistemi -bu paketlerden yeni bir paket dosyasi yapip repository'e koymuyor bu -durumda, yani source release'i arttigi halde build nosu degismedigi icin -yeni paket koyulmayacak ve indekslenmeyecek bu mantikli mi? mantikli -degilse nasil bir cozum bulunur? - -bunun yani sira, simdi bu source release degistiginde, eger paketi build -*edersek*, bir yerde metadata degismek zorunda degil mi? hangi source'un -hangi release'inden build edildigini kaydetmek zorundayiz yanlis mi -dusunuyorum. hemen kizmayin butun bu olaylari basimiza ben sarmadim, bir -sekilde evrimlesti :) - -not: galiba olay suna geliyor, tamam build no degismediyse ozunde bu paket -bir onceki source release'inde kalmistir deriz, yani yeni bir dosya kesinlikle -koymayiz repository'e cunku install dosyalari ve metadata, release numarasi -disinda ayni kalacak. offffff. - -su anda multiple repository olayinin ilkel versiyonunu kodluyorum bu arada. - -gorusuruz, - --- -Eray Ozkural (exa), Uludag Gelistiricisi -http://cekirdek.uludag.org.tr/~eray http://www.kde.org -http://www.cs.bilkent.edu.tr/~erayo http://www.malfunct.com - ---===============1945860385== -Content-Type: text/plain; charset="iso-8859-9" -MIME-Version: 1.0 -Content-Transfer-Encoding: quoted-printable -Content-Disposition: inline - -_______________________________________________ -Cekirdek mailing list -Cekirdek@uludag.org.tr -http://liste.uludag.org.tr/mailman/listinfo/cekirdek - ---===============1945860385==-- - diff --git a/tags/pisi-1.1_beta13/doc/notes/source release ve binary build numaralari.txt b/tags/pisi-1.1_beta13/doc/notes/source release ve binary build numaralari.txt deleted file mode 100644 index 345de3e2..00000000 --- a/tags/pisi-1.1_beta13/doc/notes/source release ve binary build numaralari.txt +++ /dev/null @@ -1,125 +0,0 @@ -From eray@uludag.org.tr Tue Jun 28 18:49:13 2005 -Return-Path: -X-Original-To: eray@uludag.org.tr -Delivered-To: eray@uludag.org.tr -Received: from uludag.org.tr (localhost [127.0.0.1]) - by uludag.org.tr (Postfix) with ESMTP id 80D2653C00C; - Tue, 28 Jun 2005 16:07:58 +0300 (EEST) -X-Original-To: cekirdek@uludag.org.tr -Delivered-To: cekirdek@uludag.org.tr -Received: from [192.168.3.131] (unknown [193.140.73.11]) - by uludag.org.tr (Postfix) with ESMTP id 0B6B753C00C - for ; Tue, 28 Jun 2005 16:07:57 +0300 (EEST) -From: Eray Ozkural -To: cekirdek@uludag.org.tr -Date: Tue, 28 Jun 2005 15:49:13 +0000 -User-Agent: KMail/1.8.1 -MIME-Version: 1.0 -Message-Id: <200506281549.13525.eray@uludag.org.tr> -Subject: [Cekirdek] source release ve binary build numaralari -X-BeenThere: cekirdek@liste.uludag.org.tr -X-Mailman-Version: 2.1.5 -Precedence: list -Reply-To: cekirdek@uludag.org.tr -List-Id: cekirdek.liste.uludag.org.tr -List-Unsubscribe: , - -List-Archive: -List-Post: -List-Help: -List-Subscribe: , - -Content-Type: multipart/mixed; - boundary="===============2126904290==" -Mime-version: 1.0 -Sender: cekirdek-bounces@liste.uludag.org.tr -Errors-To: cekirdek-bounces@liste.uludag.org.tr -X-UID: 865 -X-Length: 4347 - ---===============2126904290== -Content-Type: text/plain; - charset="us-ascii" -Content-Transfer-Encoding: 7bit -Content-Disposition: inline - -yigitler, - -bu post'da dun tartistigimiz bir konuyu ilgilendiren -paket versiyonu numaralarina tam bir aciklik getirmeye -calisacagim. - -Bir PISI source'u uc tane sayiyla belirlenir: - name, version, release - -Burada version "convenience" icin bulunur. name + release -ise her zaman *ayni* PISI source build islemine sebep olur. -Bundan kasit su. version ve release tamamen bagimsiz. -release 0 ile baslar. ornegin kdevelop - -ilk basta -name: kdevelop, version: 3.4.1, release: 0 -dir - -Bu paketin yeni versiyonlariyla biz ugrastikca, yaptigimiz -her update, en minikleri dahi, release'i arttirir, ve her zaman -bir arttirir (daha aciklayacagim), ama hic bir zaman geriye -gitmez (0'lanmaz ornegin). - -ileride: -name: kdevelop, version: 3.4.2, release: 3 -olabilir ornegin. - -Eger paketin gelistirildigi *distribution* source'u dahilinde -bir versiyon dallanmasi varsa, ancak bu durumda release'e -branch'ler eklenir. - -Diyelim ki yukaridaki paket pardus 1.0'in parcasiydi. simdi -pardus 1.0.1 diye bir branch olusturulmak istendi, ornegin -bu UEKAE overlay'ine karsilik gelsin. Bu durumda, versiyon -iliskisini eksiksiz bicimde belirtmek icin: -name: kdevelop, version: 3.4.2, release: 3.1 - -demek yeterli olacaktir. Ekledigimiz '.1' suffix'i bize butun -dal bilgisini verir. Boylece eksik hicbirsey olmaz. - -Binary package'lara gelince. Bir binary package dort -stringle her zaman bulunabilir. - name, version, build, architecture - -burada name + build, *bir binary distribution* dahilinde, -ornegin Pardus 1.0 x86 icin yapilmis tek ve tek bir paketi -her zaman gosterir. - -Build, o architecture icin, o paketin kacinci kere build -edildigini gosterir. Her paket release'inde en fazla bir -artar. - -Bunu daha once tartistigimiz gibi tamamen incremental -build script'inin buldugu md5'larla hesapliyoruz. - -Binary package'larin build numarasi icin bir dallanma/budaklanma -semasi henuz onermiyorum, ama bana su anda ayni -source package'lar gibi birsey yapilabilir geliyor. Bana buradaki -en kritik mesele source ve binary package'larini, ve upstream -version string'lerle kendi, SVN-tarzi version string'lerimizi -karistirmamamiz. - -Kaplan gunler, - --- -Eray - ---===============2126904290== -Content-Type: text/plain; charset="iso-8859-9" -MIME-Version: 1.0 -Content-Transfer-Encoding: quoted-printable -Content-Disposition: inline - -_______________________________________________ -Cekirdek mailing list -Cekirdek@uludag.org.tr -http://liste.uludag.org.tr/cgi-bin/mailman/listinfo/cekirdek - ---===============2126904290==-- - diff --git a/tags/pisi-1.1_beta13/doc/package_versions.pdf b/tags/pisi-1.1_beta13/doc/package_versions.pdf deleted file mode 100644 index 09228904..00000000 Binary files a/tags/pisi-1.1_beta13/doc/package_versions.pdf and /dev/null differ diff --git a/tags/pisi-1.1_beta13/doc/package_versions.tex b/tags/pisi-1.1_beta13/doc/package_versions.tex deleted file mode 100644 index 620e10a1..00000000 --- a/tags/pisi-1.1_beta13/doc/package_versions.tex +++ /dev/null @@ -1,187 +0,0 @@ -\documentclass[a4paper,11pt]{article} - -\title{P\.IS\.I Packages: Version Policy v0.2} -\date{\today} -\author{Eray \"Ozkural and T. Bar\i{}\c s Metin} - - -\begin{document} -\maketitle - -\section*{Revision History} -\begin{itemize} -\item v0.1: Bar\i\c s Metin wrote the first version preparing the outline, -detailed Source Version Section, and started the Section on Release Number. -\item v0.2: Eray \"Ozkural wrote a detailed introduction, added - explanations of release and build numbers, reorganized a bit. -\end{itemize} - -\section{Introduction} - -This document explains the \emph{version policy} that applies to -P\.IS\.I packages. Classically, the issue of distinguishing source and -binary distributions unambiguously has not received a rigorous -treatment in the context of LINUX distributions. We have identified -several shortcomings of the usual practices of extending the original -version with suffixes and prefixes, colorfully illustrated in the -following common problems. - -\begin{description} - -\item[The problem of future downgrades] -The distribution chooses to use a previous version of the package in -the next release. There is no way to indicate this, so ad-hoc -solutions such as version prefixes are used. It is -impossible to denote a future dependency that requires at least this -distribution source release in this case, either. - -\item[The problem of redundant distributions] -A trivial patch has been applied to the source. While few binary -packages have been affected by this change, all binary packages -built from the source are redistributed. - -\item[The problem of underdetermined rebuilds] -There have been rapid changes in the system, and although no -changes have been made to the package source, a new binary -distribution must be prepared. - -\end{description} - -We have devised a slightly new approach in order to alleviate these -problems. Our solution consists of encoding the history of source and -binary package developments in separate version strings we call release and -build numbers. - -Since the source version is usually used by the users and developers -to identify software, we retain the notion of a source version in -P\.IS\.I as a convenience. - -In the following sections, we explain the components of our -versioning scheme. - -\subsection{Source Version} - -Source version is the version number provided by the -upstream maintainer of the source archive used in package. It must -always be the same as the upstream version used. - -\textbf{Example}: If the upstream archive name is -\emph{bash-3.0.tar.gz} the version number of the package is \emph{3.0} - -\subsubsection{Version Suffixes} - -There is a pre-defined list of suffixes a package version can -take. - -\begin{itemize} - \item \textbf{alpha} Source/Package is in alpha state - \item \textbf{beta} Source/Package is in beta state - \item \textbf{pre} Source/Pacgage passed the beta state but stable - version is not relased yet. - \item \textbf{rc} Source/Package is a release-candidate. - \item \textbf{m} Source/Package is a milestone before stable version. - \item \textbf{p} Source/Package is released and some patches are - applied after the release. This is the patch level. -\end{itemize} - -The suffix should be written after the special separator -character \textbf{\_}. And there must allways be a number after a -suffix. \textbf{Example}: packagename-1.0\_beta1 - -The basic order of the priorities for suffixes is:\newline -\emph{p $>$ (no suffix) $>$ m $>$ rc $>$ pre $>$ beta $>$ alpha}. - -The scope of a source version string is global in the literal -sense. It shall not vary from repository to repository. - -The support for these special suffixes as well as usual alphanumeric -version string ordering has been implemented in P\.IS\.I. - -\section{Identifying Package Sources} - -A P\.IS\.I source has three identity elements written under -\texttt{SOURCE} tag: name, source version, and source release number. -We usually say just version and release number/release instead of -source version and source release number, respectively. Name is available in -the \texttt{} tag. Version and release are available in the last -\texttt{} element of \texttt{} tag of a \texttt{PSPEC}. - -The name of a source package is constant throughout its revision -history. The version is the original version, given by its -programmers. Release is a positive integer. Name and release -is sufficient to uniquely identify a particular PISI source revision. -That is, version and release are independent. - -\subsection{Release Number} - -Release number is the number of the changes that are made to the -package source since the initial version in the distribution source. A -change can be a patch applied to the source archive, modification in -the actions.py, pspec.xml or any file in the source package -directory. This change is indicated in \texttt{} tags manually -by the package maintainer. - -The initial release of a package is by default \texttt{1}. The release -number always increments by $1$ in each revision in the -\texttt{History}, even the slightest ones, but it never decrements. - -The scope of the release number is a given distribution, regardless of -its version, e.g. Pardus. - -In the future, PISI will have strict checks for release numbers. - -\subsection{Dependency Specifications} - -We allow a package to use both source version and release to identify -a particular version or a range of package versions. - -\section{Identifying Binary packages} - -A PISI binary package is produced from a PISI source package. It has a -name that is constant throughout the history of the source package, -and it inherits the source version and release number from the source -package. However, a binary package has in addition a binary build -number. Shortly, build number or just build. For each of the -architecture targets, e.g. particular binaries, it also has an -architecture tag. - -A binary package is uniquely identified by its name, build number, and -architecture regardless of the source version. - -\section{Build Number} - -Similarly to source release number, binary build number is the number -of changes that are made to a binary package. By change, we mean any -bit change. The existence of a change is tested by comparing the -cryptographic checksums in files.xml with those of the previous build, and the -build number is automatically determined by the P\.IS\.I build system. -The build number starts from $1$ as in release number, and increments -by one with each binary change. - -The user never interferes with the build number himself. However, if -the user fails to provide the previous build, then a package without -a build number is built. A package without a build number is evaluated -on the basis of release number, which is guaranteed to exist. - -The scope of a build number is a given distribution build environment -for a particular architecture, which may vary from repository to -repository. Therefore, it is not used in dependency -specifications. However, the system does assume that a build of a -given package and architecture is unique in a given repository. - -\section{Package File Names} - -A P\.IS\.I binary package file name contains all the components relevant -to its identification, separated by dashes: -\begin{verbatim} - ---.pisi -\end{verbatim} - -\section{Future Work} - -In the future, it may be necessary to extend the notion of release -number and build number to support branches and forks of a -distribution. A proposal was to have CVS-like branching, but it -was dismissed as unnecessary. - -\end{document} diff --git a/tags/pisi-1.1_beta13/doc/prettyref.sty b/tags/pisi-1.1_beta13/doc/prettyref.sty deleted file mode 100644 index 67940f3b..00000000 --- a/tags/pisi-1.1_beta13/doc/prettyref.sty +++ /dev/null @@ -1,37 +0,0 @@ -%% -%% This is file `prettyref.sty', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% prettyref.dtx (with options: `style') -%% -%% Copyright (c) 1995 Kevin Ruland -%% -%% -%% prettyref v3.0 -%% -%% Copyright 1995,1998. by Kevin Ruland kevin@rodin.wustl.edu -%% -\ProvidesPackage{prettyref}[1998/07/09 v3.0] -\def\newrefformat#1#2{% - \@namedef{pr@#1}##1{#2}} -\newrefformat{eq}{\textup{(\ref{#1})}} -\newrefformat{lem}{Lemma \ref{#1}} -\newrefformat{thm}{Theorem \ref{#1}} -\newrefformat{cha}{Chapter \ref{#1}} -\newrefformat{sec}{Section \ref{#1}} -\newrefformat{tab}{Table \ref{#1} on page \pageref{#1}} -\newrefformat{fig}{Figure \ref{#1} on page \pageref{#1}} -\def\prettyref#1{\@prettyref#1:} -\def\@prettyref#1:#2:{% - \expandafter\ifx\csname pr@#1\endcsname\relax% - \PackageWarning{prettyref}{Reference format #1\space undefined}% - \ref{#1:#2}% - \else% - \csname pr@#1\endcsname{#1:#2}% - \fi% -} -\endinput -%% -%% End of file `prettyref.sty'. diff --git a/tags/pisi-1.1_beta13/pisi-cli b/tags/pisi-1.1_beta13/pisi-cli deleted file mode 100755 index 5460427b..00000000 --- a/tags/pisi-1.1_beta13/pisi-cli +++ /dev/null @@ -1,81 +0,0 @@ -#!/usr/bin/python -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# - -import sys -import locale -import traceback -import exceptions -import signal -import bsddb3.db as db - -import pisi.ui -import pisi.context as ctx -import pisi.cli.pisicli as pisicli - -import gettext -__trans = gettext.translation('pisi', fallback=True) -_ = __trans.ugettext - -def exit(): - pisi.api.finalize() - sys.exit(1) - -def handle_exception(exception, value, tb): - signal.signal(signal.SIGINT, signal.SIG_IGN) # disable further interrupts - ui = pisi.cli.CLI() # make a temporary UI - show_traceback = False - if exception == exceptions.KeyboardInterrupt: - ui.error(_("Keyboard Interrupt: Exiting...")) - exit() - elif isinstance(value, pisi.Error): - ui.error(_("Program Terminated.")) - show_traceback = ctx.get_option('debug') - elif isinstance(value, db.DBRunRecoveryError): - ui.error(_("""A database operation has been aborted. You should run pisi -again for normal DB recovery procedure. Make sure you have free disk space. -You have to run rebuild-db only when there is file corruption and database upgrades.""")) - elif isinstance(value, pisi.Exception): - show_traceback = True - ui.error(_("""Unhandled internal exception. -Please file a bug report. (http://bugs.uludag.org.tr)""")) - else: - # For any other exception (possibly Python exceptions) show - # the traceback! - show_traceback = ctx.get_option('debug') - ui.error(_("System Error. Program Terminated.")) - - if ctx.get_option('debug'): - ui.error(u"%s: %s" % (exception, value)) - else: - ui.error(unicode(value)) - - ui.info(_("Please use 'pisi help' for general help.")) - - if show_traceback: - ui.info(_("Traceback:")) - traceback.print_tb(tb) - else: - if not exception is pisicli.Error: - ui.info(_("Use --debug to see a traceback.")) - - exit() - -if __name__ == "__main__": - - sys.excepthook = handle_exception - - locale.setlocale(locale.LC_ALL, '') - cli = pisicli.PisiCLI() - try: - cli.run_command() - except pisi.operations.PisiUpgradeException, e: - print _('PISI has been upgraded.') diff --git a/tags/pisi-1.1_beta13/pisi-spec.dtd b/tags/pisi-1.1_beta13/pisi-spec.dtd deleted file mode 100644 index 95bef334..00000000 --- a/tags/pisi-1.1_beta13/pisi-spec.dtd +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tags/pisi-1.1_beta13/pisi.e3p b/tags/pisi-1.1_beta13/pisi.e3p deleted file mode 100644 index e04c8d12..00000000 --- a/tags/pisi-1.1_beta13/pisi.e3p +++ /dev/null @@ -1,623 +0,0 @@ - - - - - - - Python - Console - The package management software of Pardus distribution. - - PiSi Development Team - - - - tests - popt - actions.py - - - tests - zip - actions.py - - - tests - unzip - actions.py - - - tests - configfiletests.py - - - tests - sourcedbtests.py - - - tests - utiltests.py - - - tests - installdbtests.py - - - tests - run.py - - - tests - metadatatests.py - - - tests - constantstests.py - - - tests - fetchertests.py - - - tests - archivetests.py - - - tests - versiontests.py - - - tests - actionsapitests.py - - - tests - specfiletests.py - - - tests - packagetests.py - - - tests - packagedbtests.py - - - tests - graphtests.py - - - pisi - actionsapi - get.py - - - pisi - actionsapi - shelltools.py - - - pisi - actionsapi - variables.py - - - pisi - actionsapi - autotools.py - - - pisi - actionsapi - pisitools.py - - - pisi - actionsapi - kde.py - - - pisi - actionsapi - __init__.py - - - pisi - actionsapi - libtools.py - - - pisi - actionsapi - coreutils.py - - - pisi - cli - pisicli.py - - - pisi - cli - __init__.py - - - pisi - cli - commands.py - - - pisi - lockeddbshelve.py - - - pisi - specfile.py - - - pisi - package.py - - - pisi - __init__.py - - - pisi - build.py - - - pisi - packagedb.py - - - pisi - files.py - - - pisi - config.py - - - pisi - index.py - - - pisi - repodb.py - - - pisi - ui.py - - - pisi - util.py - - - pisi - dependency.py - - - pisi - metadata.py - - - pisi - pgraph.py - - - pisi - operations.py - - - pisi - context.py - - - pisi - graph.py - - - pisi - sourcearchive.py - - - pisi - configfile.py - - - pisi - sourcedb.py - - - pisi - installdb.py - - - pisi - constants.py - - - pisi - fetcher.py - - - pisi - archive.py - - - pisi - version.py - - - setup.py - - - pisi - actionsapi - pisitoolsfunctions.py - - - pisi - uri.py - - - pisi - api.py - - - TODO - - - pisi - actionsapi - pythonmodules.py - - - pisi - actionsapi - scons.py - - - pisi - cli - colors.py - - - pisi-cli - - - pisi - actionsapi - perlmodules.py - - - pisi - comariface.py - - - po - tr.po - - - pisi - oo.py - - - tests - dependencytests.py - - - pisi - atomicoperations.py - - - tests - ootests.py - - - tests - testcase.py - - - tests - xmlexttests.py - - - tests - filestests.py - - - pisi - component.py - - - tests - autoxmltests.py - - - pisi - pxml - xmlextpiks.py - - - pisi - pxml - autoxml.py - - - pisi - pxml - xmlfilemdom.py - - - pisi - pxml - xmlextmdom.py - - - pisi - pxml - __init__.py - - - pisi - pxml - xmlfile.py - - - pisi - pxml - xmlext.py - - - pisi - pxml - xmlfilecdom.py - - - pisi - pxml - xmlextcdom.py - - - pisi - pxml - xmlfilepiks.py - - - tools - svndist.py - - - tests - filetests.py - - - pisi - file.py - - - pisi - search - invertedindex.py - - - pisi - search - tokenize.py - - - pisi - search - __init__.py - - - pisi - search - preprocess.py - - - tests - searchtests.py - - - pisi - dbshelve.py - - - tests - repodbtests.py - - - pisi - itembyrepodb.py - - - tests - buildtests.py - - - tools - pygettext.py - - - tests - conflicttests.py - - - pisi - environment.py - - - scripts - cat-db.py - - - scripts - rmcomp-source-repo.py - - - scripts - missing-binary.py - - - scripts - update-environ.py - - - scripts - convert_history.py - - - scripts - calc-build-order.py - - - scripts - fix_old_metadata_files.py - - - scripts - repo-diff.py - - - scripts - find-lib-deps.py - - - scripts - check-source-repo.py - - - scripts - fetchAll.py - - - scripts - repostats.py - - - tests - zip2 - actions.py - - - tests - unzip2 - actions.py - - - tests - stress - lang - de - actions.py - - - tests - stress - lang - ef - actions.py - - - tests - stress - comp - ab - actions.py - - - tests - stress - comp - ab - comar - package.py - - - tests - stress - comp - bc - actions.py - - - tests - stress - comp - cd - actions.py - - - tests - helloworld - actions.py - - - tests - pccts - actions.py - - - scripts - lspisi - - - scripts - pisish - - - scripts - pisimedia - - - - - - - - - - - pisi-cli - - - tests - beta-light.sh - - - tests - beta-upgrade.sh - - - tests - beta.sh - - - tests - sandbox - - - tests - beta-remoterepo.sh - - - - pisi-cli - - - Subversion - {'status': [], 'log': [], 'global': [], 'update': [], 'remove': [], 'add': [], 'tag': [], 'export': [], 'diff': [], 'commit': [], 'checkout': [], 'history': []} - {'standardLayout': 1} - - - - - - - - - diff --git a/tags/pisi-1.1_beta13/pisi/__init__.py b/tags/pisi-1.1_beta13/pisi/__init__.py deleted file mode 100644 index 6ad98b06..00000000 --- a/tags/pisi-1.1_beta13/pisi/__init__.py +++ /dev/null @@ -1,39 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# - -# PiSi version - -__version__ = "1.1_beta13" - -__dbversion__ = "1.1_beta8" -__filesdbversion__ = "1.0.5" # yes, this is the real bottleneck - -__all__ = [ 'api', 'config', 'packagedb', 'installdb', 'search' ] - -class Exception(Exception): - """Class of exceptions that must be caught and handled within PISI""" - def __str__(self): - s = u'' - for x in self.args: - if s != '': - s += '\n' - s += unicode(x) - return s - -class Error(Exception): - """Class of exceptions that lead to program termination""" - pass - -import pisi.api - -# FIXME: can't do this due to name clashes in config and other singletons booo -#pisi.api import * diff --git a/tags/pisi-1.1_beta13/pisi/actionsapi/__init__.py b/tags/pisi-1.1_beta13/pisi/actionsapi/__init__.py deleted file mode 100644 index eeba55a7..00000000 --- a/tags/pisi-1.1_beta13/pisi/actionsapi/__init__.py +++ /dev/null @@ -1,27 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# - -import pisi - -class Error(pisi.Error): - pass - -class Exception(pisi.Exception): - pass - -import pisi.context as ctx - -def error(msg): - if ctx.config.get_option('ignore_action_errors'): - ctx.ui.error(msg) - else: - raise Error(msg) diff --git a/tags/pisi-1.1_beta13/pisi/actionsapi/autotools.py b/tags/pisi-1.1_beta13/pisi/actionsapi/autotools.py deleted file mode 100644 index 46355072..00000000 --- a/tags/pisi-1.1_beta13/pisi/actionsapi/autotools.py +++ /dev/null @@ -1,164 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. - -# Standard Python Modules -import os - -import gettext -__trans = gettext.translation('pisi', fallback=True) -_ = __trans.ugettext - -# Pisi Modules -import pisi.context as ctx - -# ActionsAPI Modules -import pisi.actionsapi -import pisi.actionsapi.get as get -from pisi.actionsapi.shelltools import system -from pisi.actionsapi.shelltools import can_access_file -from pisi.actionsapi.shelltools import unlink -from pisi.actionsapi.libtools import gnuconfig_update - -class ConfigureError(pisi.actionsapi.Error): - def __init__(self, value=''): - pisi.actionsapi.Error.__init__(self, value) - self.value = value - ctx.ui.error(value) - if can_access_file('config.log'): - ctx.ui.error(_('Please attach the config.log to your bug report:\n%s/config.log') % os.getcwd()) - -class MakeError(pisi.actionsapi.Error): - def __init__(self, value=''): - pisi.actionsapi.Error.__init__(self, value) - self.value = value - ctx.ui.error(value) - -class InstallError(pisi.actionsapi.Error): - def __init__(self, value=''): - pisi.actionsapi.Error.__init__(self, value) - self.value = value - ctx.ui.error(value) - -class RunTimeError(pisi.actionsapi.Error): - def __init__(self, value=''): - pisi.actionsapi.Error.__init__(self, value) - self.value = value - ctx.ui.error(value) - -def configure(parameters = ''): - '''configure source with given parameters = "--with-nls --with-libusb --with-something-usefull"''' - if can_access_file('configure'): - gnuconfig_update() - - args = './configure \ - --prefix=/%s \ - --host=%s \ - --mandir=/%s \ - --infodir=/%s \ - --datadir=/%s \ - --sysconfdir=/%s \ - --localstatedir=/%s \ - %s' % (get.defaultprefixDIR(), \ - get.HOST(), get.manDIR(), \ - get.infoDIR(), get.dataDIR(), \ - get.confDIR(), get.localstateDIR(), parameters) - - if system(args): - raise ConfigureError(_('Configure failed.')) - else: - raise ConfigureError(_('No configure script found.')) - -def rawConfigure(parameters = ''): - '''configure source with given parameters = "--prefix=/usr --libdir=/usr/lib --with-nls"''' - if can_access_file('configure'): - gnuconfig_update() - - if system('./configure %s' % parameters): - raise ConfigureError(_('Configure failed.')) - else: - raise ConfigureError(_('No configure script found.')) - -def compile(parameters = ''): - #FIXME: Only one package uses this until now, hmmm - system('%s %s %s' % (get.CC(), get.CFLAGS(), parameters)) - -def make(parameters = ''): - '''make source with given parameters = "all" || "doc" etc.''' - if system('make %s %s' % (get.makeJOBS(), parameters)): - raise MakeError(_('Make failed.')) - -def fixInfoDir(): - infoDir = "%s/usr/share/info/dir" % get.installDIR() - if can_access_file(infoDir): - unlink(infoDir) - -def install(parameters = '', argument = 'install'): - '''install source into install directory with given parameters''' - if can_access_file('makefile') or can_access_file('Makefile') or can_access_file('GNUmakefile'): - args = 'make prefix=%(prefix)s/%(defaultprefix)s \ - datadir=%(prefix)s/%(data)s \ - infodir=%(prefix)s/%(info)s \ - localstatedir=%(prefix)s/%(localstate)s \ - mandir=%(prefix)s/%(man)s \ - sysconfdir=%(prefix)s/%(conf)s \ - %(parameters)s \ - %(argument)s' % {'prefix': get.installDIR(), - 'defaultprefix': get.defaultprefixDIR(), - 'man': get.manDIR(), - 'info': get.infoDIR(), - 'localstate': get.localstateDIR(), - 'conf': get.confDIR(), - 'data': get.dataDIR(), - 'parameters': parameters, - 'argument':argument} - - if system(args): - raise InstallError(_('Install failed.')) - else: - raise InstallError(_('No Makefile found.')) - - fixInfoDir() - -def rawInstall(parameters = '', argument = 'install'): - '''install source into install directory with given parameters = PREFIX=%s % get.installDIR()''' - if can_access_file('makefile') or can_access_file('Makefile') or can_access_file('GNUmakefile'): - if system('make %s %s' % (parameters, argument)): - raise InstallError(_('Install failed.')) - else: - raise InstallError(_('No Makefile found.')) - - fixInfoDir() - -def aclocal(parameters = ''): - '''generates an aclocal.m4 based on the contents of configure.in.''' - if system('aclocal %s' % parameters): - raise RunTimeError(_('Running aclocal failed.')) - -def autoconf(parameters = ''): - '''generates a configure script''' - if system('autoconf %s' % parameters): - raise RunTimeError(_('Running autoconf failed.')) - -def autoreconf(parameters = ''): - '''re-generates a configure script''' - if system('autoreconf %s' % parameters): - raise RunTimeError(_('Running autoconf failed.')) - -def automake(parameters = ''): - '''generates a makefile''' - if system('automake %s' % parameters): - raise RunTimeError(_('Running automake failed.')) - -def autoheader(parameters = ''): - '''generates templates for configure''' - if system('autoheader %s' % parameters): - raise RunTimeError(_('Running autoheader failed.')) diff --git a/tags/pisi-1.1_beta13/pisi/actionsapi/coreutils.py b/tags/pisi-1.1_beta13/pisi/actionsapi/coreutils.py deleted file mode 100644 index 83f8ede1..00000000 --- a/tags/pisi-1.1_beta13/pisi/actionsapi/coreutils.py +++ /dev/null @@ -1,81 +0,0 @@ -#!/usr/bin/python -#-*- coding: utf-8 -*- -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. - -# Standard Python Modules -import re -import sys -from itertools import izip -from itertools import imap -from itertools import count -from itertools import ifilter -from itertools import ifilterfalse - -# ActionsAPI -import pisi.actionsapi - -def cat(filename): - return file(filename).xreadlines() - -class grep: - '''keep only lines that match the regexp''' - def __init__(self, pat, flags = 0): - self.fun = re.compile(pat, flags).match - def __ror__(self, input): - return ifilter(self.fun, input) - -class tr: - '''apply arbitrary transform to each sequence element''' - def __init__(self, transform): - self.tr = transform - def __ror__(self, input): - return imap(self.tr, input) - -class printto: - '''print sequence elements one per line''' - def __init__(self, out = sys.stdout): - self.out = out - def __ror__(self,input): - for line in input: - print >> self.out, line - -printlines = printto(sys.stdout) - -class terminator: - def __init__(self,method): - self.process = method - def __ror__(self,input): - return self.process(input) - -aslist = terminator(list) -asdict = terminator(dict) -astuple = terminator(tuple) -join = terminator(''.join) -enum = terminator(enumerate) - -class sort: - def __ror__(self,input): - ll = list(input) - ll.sort() - return ll -sort = sort() - -class uniq: - def __ror__(self,input): - for i in input: - try: - if i == prev: - continue - except NameError: - pass - prev = i - yield i -uniq = uniq() diff --git a/tags/pisi-1.1_beta13/pisi/actionsapi/get.py b/tags/pisi-1.1_beta13/pisi/actionsapi/get.py deleted file mode 100644 index 0f34e320..00000000 --- a/tags/pisi-1.1_beta13/pisi/actionsapi/get.py +++ /dev/null @@ -1,197 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. - -# Standart Python Modules -import os -import sys - -import gettext -__trans = gettext.translation('pisi', fallback=True) -_ = __trans.ugettext - -# PISI Modules -import pisi.actionsapi -import pisi.context as ctx - -# ActionsAPI Modules -import pisi.actionsapi.variables - -class BinutilsError(pisi.actionsapi.Error): - def __init__(self, value=''): - pisi.actionsapi.Error.__init__(self, value) - self.value = value - ctx.ui.error(value) - -# Globals -env = pisi.actionsapi.variables.glb.env -dirs = pisi.actionsapi.variables.glb.dirs - -def curDIR(): - '''returns current work directory's path''' - return os.getcwd() - -def curKERNEL(): - '''returns currently running kernel's version''' - return os.uname()[2] - -def curPYTHON(): - ''' returns currently used python's version''' - (a, b, c, x, y) = sys.version_info - return 'python%s.%s' % (a, b) - -def curPERL(): - ''' returns currently used perl's version''' - return os.path.realpath("/usr/bin/perl").split("perl")[1] - -def ENV(environ): - '''returns any given environ variable''' - try: - return os.environ[environ]; - except KeyError: - return None - -# PİSİ Related Functions - -def pkgDIR(): - '''returns the path of binary packages''' - '''Default: /var/cache/pisi/packages''' - return env.pkg_dir - -def workDIR(): - return env.work_dir - -def installDIR(): - '''returns the path of binary packages''' - return env.install_dir - -# PSPEC Related Functions - -def srcNAME(): - return env.src_name - -def srcVERSION(): - return env.src_version - -def srcRELEASE(): - return env.src_release - -def srcTAG(): - return '%s-%s-%s' % (env.src_name, env.src_version, env.src_release) - -def srcDIR(): - return '%s-%s' % (env.src_name, env.src_version) - -# Build Related Functions - -def HOST(): - return env.host - -def CHOST(): - # FIXME: Currently it behave same as HOST, - # but will be used for cross-compiling when PİSİ ready... - return env.host - -def CFLAGS(): - return env.cflags - -def CXXFLAGS(): - return env.cxxflags - -def LDFLAGS(): - return env.ldflags - -def makeJOBS(): - return env.jobs - -# Directory Related Functions - -def docDIR(): - return dirs.doc - -def sbinDIR(): - return dirs.sbin - -def infoDIR(): - return dirs.info - -def manDIR(): - return dirs.man - -def dataDIR(): - return dirs.data - -def confDIR(): - return dirs.conf - -def localstateDIR(): - return dirs.localstate - -def defaultprefixDIR(): - return dirs.defaultprefix - -def kdeDIR(): - return dirs.kde - -def qtDIR(): - return dirs.qt - -def qtLIBDIR(): - return '%s/lib/' % qtDIR() - -# Binutils Variables - -def existBinary(bin): - # determine if path has binary - path = os.environ['PATH'].split(':') - for directory in path: - if os.path.exists(os.path.join(directory, bin)): - return True - return False - -def getBinutilsInfo(util): - cross_build_name = '%s-%s' % (HOST(), util) - if not existBinary(cross_build_name): - if not existBinary(util): - raise BinutilsError(_('Util %s cannot be found') % util) - else: - ctx.ui.debug(_('Warning: %s does not exist, using plain name %s') \ - % (cross_build_name, util)) - return util - else: - return cross_build_name - -def AR(): - return getBinutilsInfo('ar') - -def AS(): - return getBinutilsInfo('as') - -def CC(): - return getBinutilsInfo('gcc') - -def CXX(): - return getBinutilsInfo('g++') - -def LD(): - return getBinutilsInfo('ld') - -def NM(): - return getBinutilsInfo('nm') - -def RANLIB(): - return getBinutilsInfo('ranlib') - -def F77(): - return getBinutilsInfo('f77') - -def GCJ(): - return getBinutilsInfo('gcj') diff --git a/tags/pisi-1.1_beta13/pisi/actionsapi/kde.py b/tags/pisi-1.1_beta13/pisi/actionsapi/kde.py deleted file mode 100644 index 845e12f3..00000000 --- a/tags/pisi-1.1_beta13/pisi/actionsapi/kde.py +++ /dev/null @@ -1,82 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. - -# standard python modules -import os - -import gettext -__trans = gettext.translation('pisi', fallback=True) -_ = __trans.ugettext - -# Pisi Modules -import pisi.context as ctx - -# ActionsAPI Modules -import pisi.actionsapi -import pisi.actionsapi.get as get -from pisi.actionsapi.shelltools import system -from pisi.actionsapi.shelltools import can_access_file - -class ConfigureError(pisi.actionsapi.Error): - def __init__(self, value=''): - pisi.actionsapi.Error.__init__(self, value) - self.value = value - ctx.ui.error(value) - if can_access_file('config.log'): - ctx.ui.error(_('\n!!! Please attach the config.log to your bug report:\n%s/config.log') % os.getcwd()) - -class MakeError(pisi.actionsapi.Error): - def __init__(self, value=''): - pisi.actionsapi.Error.__init__(self, value) - self.value = value - ctx.ui.error(value) - -class InstallError(pisi.actionsapi.Error): - def __init__(self, value=''): - pisi.actionsapi.Error.__init__(self, value) - self.value = value - ctx.ui.error(value) - -def configure(parameters = ''): - ''' parameters = '--with-nls --with-libusb --with-something-usefull ''' - if can_access_file('configure'): - args = './configure \ - --prefix=%s \ - --host=%s \ - --with-x \ - --enable-mitshm \ - --with-xinerama \ - --with-qt-dir=%s \ - --enable-mt \ - --with-qt-libraries=%s \ - --disable-dependency-tracking \ - --disable-debug \ - %s' % (get.kdeDIR(), get.HOST(), get.qtDIR(), get.qtLIBDIR(), parameters) - - if system(args): - raise ConfigureError(_('Configure failed.')) - else: - raise ConfigureError(_('No configure script found.')) - -def make(parameters = ''): - '''make source with given parameters = "all" || "doc" etc.''' - if system('make %s %s' % (get.makeJOBS(), parameters)): - raise MakeError(_('Make failed.')) - -def install(parameters = 'install'): - if can_access_file('Makefile'): - args = 'make DESTDIR=%s destdir=%s %s' % (get.installDIR(), get.installDIR(), parameters) - - if system(args): - raise InstallError(_('Install failed.')) - else: - raise InstallError(_('No Makefile found.')) diff --git a/tags/pisi-1.1_beta13/pisi/actionsapi/libtools.py b/tags/pisi-1.1_beta13/pisi/actionsapi/libtools.py deleted file mode 100644 index f9aaf975..00000000 --- a/tags/pisi-1.1_beta13/pisi/actionsapi/libtools.py +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. - -# Standard Python Modules -import os - -import gettext -__trans = gettext.translation('pisi', fallback=True) -_ = __trans.ugettext - -# Pisi-Core Modules -import pisi.context as ctx -from pisi.util import join_path - -# ActionsAPI Modules -import pisi.actionsapi -from pisi.actionsapi.shelltools import * -import pisi.actionsapi.get as get - -class RunTimeError(pisi.actionsapi.Error): - def __init__(self, value=''): - pisi.actionsapi.Error.__init__(self, value) - self.value = value - ctx.ui.error(value) - -def preplib(sourceDirectory = '/usr/lib'): - sourceDirectory = join_path(get.installDIR(), sourceDirectory) - if can_access_directory(sourceDirectory): - if system('/sbin/ldconfig -n -N %s' % sourceDirectory): - raise RunTimeError(_('Running ldconfig failed.')) - -def gnuconfig_update(): - ''' copy newest config.* onto source\'s ''' - for root, dirs, files in os.walk(os.getcwd()): - for fileName in files: - if fileName in ['config.sub', 'config.guess']: - targetFile = os.path.join(root, fileName) - if os.path.islink(targetFile): - unlink(targetFile) - copy('/usr/share/gnuconfig/%s' % fileName, join_path(root, fileName)) - ctx.ui.info(_('GNU Config Update Finished.')) - -def libtoolize(parameters = ''): - if system('/usr/bin/libtoolize %s' % parameters): - raise RunTimeError(_('Running libtoolize failed.')) - -def gen_usr_ldscript(dynamicLib): - - makedirs('%s/usr/lib' % get.installDIR()) - - destinationFile = open('%s/usr/lib/%s' % (get.installDIR(), dynamicLib), 'w') - content = ''' -/* GNU ld script - Since Pardus has critical dynamic libraries - in /lib, and the static versions in /usr/lib, - we need to have a "fake" dynamic lib in /usr/lib, - otherwise we run into linking problems. -*/ -GROUP ( /lib/%s ) -''' % dynamicLib - - destinationFile.write(content) - destinationFile.close() - chmod('%s/usr/lib/%s' % (get.installDIR(), dynamicLib)) diff --git a/tags/pisi-1.1_beta13/pisi/actionsapi/perlmodules.py b/tags/pisi-1.1_beta13/pisi/actionsapi/perlmodules.py deleted file mode 100644 index b51e5876..00000000 --- a/tags/pisi-1.1_beta13/pisi/actionsapi/perlmodules.py +++ /dev/null @@ -1,86 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. - -# standard python modules -import os - -import gettext -__trans = gettext.translation('pisi', fallback=True) -_ = __trans.ugettext - -# Pisi Modules -import pisi.context as ctx - -# ActionsAPI Modules -import pisi.actionsapi -import pisi.actionsapi.get as get -from pisi.actionsapi.shelltools import system -from pisi.actionsapi.shelltools import can_access_file -from pisi.actionsapi.shelltools import export -from pisi.actionsapi.shelltools import unlink - -class ConfigureError(pisi.actionsapi.Error): - def __init__(self, value=''): - pisi.actionsapi.Error.__init__(self, value) - self.value = value - ctx.ui.error(value) - -class MakeError(pisi.actionsapi.Error): - def __init__(self, value=''): - pisi.actionsapi.Error.__init__(self, value) - self.value = value - ctx.ui.error(value) - -class InstallError(pisi.actionsapi.Error): - def __init__(self, value=''): - pisi.actionsapi.Error.__init__(self, value) - self.value = value - ctx.ui.error(value) - -def configure(parameters = ''): - '''configure source with given parameters.''' - export('PERL_MM_USE_DEFAULT', '1') - if can_access_file('Build.PL'): - if system('perl Build.PL installdirs=vendor destdir=%s' % get.installDIR()): - raise CompileError, _('Configure failed.') - else: - if system('perl Makefile.PL %s PREFIX=/usr INSTALLDIRS=vendor DESTDIR=%s' % (parameters, get.installDIR())): - raise CompileError, _('Configure failed.') - -def make(parameters = ''): - '''make source with given parameters.''' - if can_access_file('Makefile'): - if system('make %s' % parameters): - raise MakeError, _('Make failed.') - else: - if system('perl Build build'): - raise MakeError, _('perl build failed.') - -def install(parameters = 'install'): - '''install source with given parameters.''' - if can_access_file('Makefile'): - if system('make %s' % parameters): - raise InstallError, _('Make failed.') - else: - if system('perl Build install'): - raise MakeError, _('perl install failed.') - - fixLocalPod() - -def fixLocalPod(): - podFiles = [ "%s/usr/lib/perl5/vendor_perl/%s/i686-linux/perllocal.pod" % (get.installDIR(), get.curPERL()), - "%s/usr/lib/perl5/%s/i686-linux/perllocal.pod" % (get.installDIR(), get.curPERL()), - "%s/usr/lib/perl5/site_perl/%s/perllocal.pod" % (get.installDIR(), get.curPERL())] - - for podFile in podFiles: - if can_access_file(podFile): - unlink(podFile) diff --git a/tags/pisi-1.1_beta13/pisi/actionsapi/pisitools.py b/tags/pisi-1.1_beta13/pisi/actionsapi/pisitools.py deleted file mode 100644 index 7352d616..00000000 --- a/tags/pisi-1.1_beta13/pisi/actionsapi/pisitools.py +++ /dev/null @@ -1,235 +0,0 @@ -#!/usr/bin/python -#-*- coding: utf-8 -*- -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. - -'''supports globs in sourceFile arguments''' - - -# Standart Python Modules -import os -import glob -import sys -import fileinput -import re - -import gettext -__trans = gettext.translation('pisi', fallback=True) -_ = __trans.ugettext - -# Pisi Modules -import pisi.context as ctx -from pisi.util import join_path - -# ActionsAPI Modules -import pisi.actionsapi -import pisi.actionsapi.get as get -from pisi.actionsapi.pisitoolsfunctions import * -from pisi.actionsapi.shelltools import * - -from pisi.actionsapi import error - -def dobin(sourceFile, destinationDirectory = '/usr/bin'): - '''insert a executable file into /bin or /usr/bin''' - ''' example call: pisitools.dobin("bin/xloadimage", "/bin", "xload") ''' - executable_insinto(join_path(get.installDIR(), destinationDirectory), sourceFile) - -def dodir(destinationDirectory): - '''creates a directory tree''' - makedirs(join_path(get.installDIR(), destinationDirectory)) - -def dodoc(*sourceFiles): - '''inserts the files in the list of files into /usr/share/doc/PACKAGE''' - readable_insinto(join_path(get.installDIR(), join_path('/usr/share/doc', get.srcTAG())), *sourceFiles) - -def doexe(sourceFile, destinationDirectory): - '''insert a executable file into destination directory''' - - ''' example call: pisitools.doexe("kde-3.4.sh", "/etc/X11/Sessions")''' - executable_insinto(join_path(get.installDIR(), destinationDirectory), sourceFile) - -def dohtml(*sourceFiles): - '''inserts the files in the list of files into /usr/share/doc/PACKAGE/html''' - - ''' example call: pisitools.dohtml("doc/doxygen/html/*")''' - destionationDirectory = join_path(get.installDIR(), 'usr/share/doc' ,get.srcTAG(), 'html') - - if not can_access_directory(destionationDirectory): - makedirs(destionationDirectory) - - allowed_extensions = ['.png', '.gif', '.html', '.htm', '.jpg', '.css', '.js'] - disallowed_directories = ['CVS'] - - for sourceFile in sourceFiles: - for source in glob.glob(sourceFile): - if os.path.isfile(source) and os.path.splitext(source)[1] in allowed_extensions: - system('install -m0644 "%s" %s' % (source, destionationDirectory)) - if os.path.isdir(source) and os.path.basename(source) not in disallowed_directories: - for root, dirs, files in os.walk(source): - for source in files: - if os.path.splitext(source)[1] in allowed_extensions: - makedirs(destionationDirectory) - system('install -m0644 %s %s' % (join_path(root, source), destionationDirectory)) - -def doinfo(*sourceFiles): - '''inserts the into files in the list of files into /usr/share/info''' - readable_insinto(join_path(get.installDIR(), get.infoDIR()), *sourceFiles) - -def dolib(sourceFile, destinationDirectory = '/usr/lib'): - '''insert the library into /usr/lib''' - - '''example call: pisitools.dolib_a("libz.a")''' - '''example call: pisitools.dolib_a("libz.so")''' - sourceFile = join_path(os.getcwd(), sourceFile) - destinationDirectory = join_path(get.installDIR(), destinationDirectory) - - lib_insinto(sourceFile, destinationDirectory, 755) - -def dolib_a(sourceFile, destinationDirectory = '/usr/lib'): - '''insert the static library into /usr/lib with permission 0644''' - - '''example call: pisitools.dolib_a("staticlib/libvga.a")''' - sourceFile = join_path(os.getcwd(), sourceFile) - destinationDirectory = join_path(get.installDIR(), destinationDirectory) - - lib_insinto(sourceFile, destinationDirectory, 644) - -def dolib_so(sourceFile, destinationDirectory = '/usr/lib'): - '''insert the static library into /usr/lib with permission 0755''' - - '''example call: pisitools.dolib_so("pppd/plugins/minconn.so")''' - sourceFile = join_path(os.getcwd(), sourceFile) - destinationDirectory = join_path(get.installDIR(), destinationDirectory) - - lib_insinto(sourceFile, destinationDirectory, 755) - -def doman(*sourceFiles): - '''inserts the man pages in the list of files into /usr/share/man/''' - - '''example call: pisitools.doman("man.1", "pardus.*")''' - manDIR = join_path(get.installDIR(), get.manDIR()) - if not can_access_directory(manDIR): - makedirs(manDIR) - - for sourceFile in sourceFiles: - for source in glob.glob(sourceFile): - try: - pageName, pageDirectory = source[:source.rindex('.')], \ - source[source.rindex('.')+1:] - except ValueError: - error(_('ActionsAPI [doman]: Wrong man page file: %s') % (source)) - - makedirs(join_path(manDIR, '/man%s' % pageDirectory)) - system('install -m0644 %s %s' % (source, join_path(manDIR, '/man%s' % pageDirectory))) - -def domo(sourceFile, locale, destinationFile ): - '''inserts the mo files in the list of files into /usr/share/locale/LOCALE/LC_MESSAGES''' - - '''example call: pisitools.domo("po/tr.po", "tr", "pam_login.mo")''' - - system('msgfmt %s' % sourceFile) - makedirs('%s/usr/share/locale/%s/LC_MESSAGES/' % (get.installDIR(), locale)) - move('messages.mo', '%s/usr/share/locale/%s/LC_MESSAGES/%s' % (get.installDIR(), locale, destinationFile)) - -def domove(sourceFile, destination, destinationFile = ''): - '''moves sourceFile/Directory into destinationFile/Directory''' - - ''' example call: pisitools.domove("/usr/bin/bash", "/bin/bash")''' - ''' example call: pisitools.domove("/usr/bin/", "/usr/sbin")''' - makedirs(join_path(get.installDIR(), destination)) - - for filePath in glob.glob(join_path(get.installDIR(), sourceFile)): - if not destinationFile: - move(filePath, join_path(get.installDIR(), join_path(destination, os.path.basename(filePath)))) - else: - move(filePath, join_path(get.installDIR(), join_path(destination, destinationFile))) - -def rename(sourceFile, destinationFile): - ''' renames sourceFile as destinationFile''' - - ''' example call: pisitools.rename("/usr/bin/bash", "bash.old") ''' - ''' the result of the previous example would be "/usr/bin/bash.old" ''' - - baseDir = os.path.dirname(sourceFile) - - try: - os.rename(join_path(get.installDIR(), sourceFile), join_path(get.installDIR(), baseDir, destinationFile)) - except OSError: - error(_('ActionsAPI [rename]: No such file or directory: %s') % (sourceFile)) - -def dosed(sourceFiles, findPattern, replacePattern = ''): - '''replaces patterns in sourceFiles''' - - ''' example call: pisitools.dosed("/etc/passwd", "caglar", "cem")''' - ''' example call: pisitools.dosed("/etc/passwd", "caglar")''' - ''' example call: pisitools.dosed("/etc/pass*", "caglar")''' - ''' example call: pisitools.dosed("Makefile", "(?m)^(HAVE_PAM=.*)no", r"\1yes")''' - - for sourceFile in glob.glob(sourceFiles): - if can_access_file(sourceFile): - for line in fileinput.input(sourceFile, inplace = 1): - #FIXME: In-place filtering is disabled when standard input is read - line = re.sub(findPattern, replacePattern, line) - sys.stdout.write(line) - else: - raise FileError(_('File does not exist or permission denied: %s') % sourceFile) - -def dosbin(sourceFile, destinationDirectory = '/usr/sbin'): - '''insert a executable file into /sbin or /usr/sbin''' - - ''' example call: pisitools.dobin("bin/xloadimage", "/sbin") ''' - executable_insinto(join_path(get.installDIR(), destinationDirectory), sourceFile) - -def dosym(sourceFile, destinationFile): - '''creates soft link between sourceFile and destinationFile''' - - ''' example call: pisitools.dosym("/usr/bin/bash", "/bin/bash")''' - makedirs(join_path(get.installDIR(), os.path.dirname(destinationFile))) - - try: - os.symlink(sourceFile, join_path(get.installDIR() ,destinationFile)) - except OSError: - error(_('ActionsAPI [dosym]: File exists: %s') % (sourceFile)) - -def insinto(destinationDirectory, sourceFile, destinationFile = '', sym = True): - '''insert a sourceFile into destinationDirectory as a destinationFile with same uid/guid/permissions''' - makedirs(join_path(get.installDIR(), destinationDirectory)) - - if not destinationFile: - for filePath in glob.glob(sourceFile): - if can_access_file(filePath): - copy(filePath, join_path(get.installDIR(), join_path(destinationDirectory, os.path.basename(filePath))), sym) - else: - copy(sourceFile, join_path(get.installDIR(), join_path(destinationDirectory, destinationFile)), sym) - -def newdoc(sourceFile, destinationFile): - '''inserts a sourceFile into /usr/share/doc/PACKAGE/ directory as a destinationFile''' - destinationDirectory = '' #490 - destinationDirectory = os.path.dirname(destinationFile) - destinationFile = os.path.basename(destinationFile) - # Use copy instead of move or let build-install scream like file not found! - copy(sourceFile, destinationFile) - readable_insinto(join_path(get.installDIR(), 'usr/share/doc', get.srcTAG(), destinationDirectory), destinationFile) - -def newman(sourceFile, destinationFile): - '''inserts a sourceFile into /usr/share/man/manPREFIX/ directory as a destinationFile''' - # Use copy instead of move or let build-install scream like file not found! - copy(sourceFile, destinationFile) - doman(destinationFile) - -def remove(sourceFile): - '''removes sourceFile''' - for filePath in glob.glob(join_path(get.installDIR(), sourceFile)): - unlink(filePath) - -def removeDir(destinationDirectory): - '''removes destinationDirectory and its subtrees''' - for directory in glob.glob(join_path(get.installDIR(), destinationDirectory)): - unlinkDir(directory) diff --git a/tags/pisi-1.1_beta13/pisi/actionsapi/pisitoolsfunctions.py b/tags/pisi-1.1_beta13/pisi/actionsapi/pisitoolsfunctions.py deleted file mode 100644 index 2db4bd8f..00000000 --- a/tags/pisi-1.1_beta13/pisi/actionsapi/pisitoolsfunctions.py +++ /dev/null @@ -1,81 +0,0 @@ -#!/usr/bin/python -#-*- coding: utf-8 -*- -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. - -# Generic functions for common usage of pisitools # - -# Standart Python Modules -import os -import glob - -import gettext -__trans = gettext.translation('pisi', fallback=True) -_ = __trans.ugettext - -# Pisi Modules -import pisi.context as ctx - -# ActionsAPI Modules -import pisi.actionsapi -from pisi.actionsapi.shelltools import * - -class FileError(pisi.actionsapi.Error): - def __init__(self, value=''): - pisi.actionsapi.Error.__init__(self, value) - self.value = value - ctx.ui.error(value) - -class ArgumentError(pisi.actionsapi.Error): - def __init__(self, value=''): - pisi.actionsapi.Error.__init__(self, value) - self.value = value - ctx.ui.error(value) - -def executable_insinto(destinationDirectory, *sourceFiles): - '''insert a executable file into destinationDirectory''' - - if not sourceFiles or not destinationDirectory: - raise ArgumentError(_('Insufficient arguments.')) - - if not can_access_directory(destinationDirectory): - makedirs(destinationDirectory) - - for sourceFile in sourceFiles: - for source in glob.glob(sourceFile): - # FIXME: use an internal install routine for these - system('install -m0755 -o root -g root %s %s' % (source, destinationDirectory)) - -def readable_insinto(destinationDirectory, *sourceFiles): - '''inserts file list into destinationDirectory''' - - if not sourceFiles or not destinationDirectory: - raise ArgumentError(_('Insufficient arguments.')) - - if not can_access_directory(destinationDirectory): - makedirs(destinationDirectory) - - for sourceFile in sourceFiles: - for source in glob.glob(sourceFile): - system('install -m0644 "%s" %s' % (source, destinationDirectory)) - -def lib_insinto(sourceFile, destinationDirectory, permission = 0644): - '''inserts a library fileinto destinationDirectory with given permission''' - - if not sourceFile or not destinationDirectory: - raise ArgumentError(_('Insufficient arguments.')) - - if not can_access_directory(destinationDirectory): - makedirs(destinationDirectory) - - if os.path.islink(sourceFile): - os.symlink(os.path.realpath(sourceFile), os.path.join(destinationDirectory, sourceFile)) - else: - system('install -m%s %s %s' % (permission, sourceFile, destinationDirectory)) diff --git a/tags/pisi-1.1_beta13/pisi/actionsapi/pythonmodules.py b/tags/pisi-1.1_beta13/pisi/actionsapi/pythonmodules.py deleted file mode 100644 index 92ea0b59..00000000 --- a/tags/pisi-1.1_beta13/pisi/actionsapi/pythonmodules.py +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. - -# standard python modules -import os - -import gettext -__trans = gettext.translation('pisi', fallback=True) -_ = __trans.ugettext - -# Pisi Modules -import pisi.context as ctx - -# ActionsAPI Modules -import pisi.actionsapi -import pisi.actionsapi.get as get -from pisi.actionsapi.shelltools import system, can_access_file -from pisi.actionsapi.pisitools import dodoc - -class CompileError(pisi.actionsapi.Error): - def __init__(self, value=''): - pisi.actionsapi.Error.__init__(self, value) - self.value = value - ctx.ui.error(value) - -class InstallError(pisi.actionsapi.Error): - def __init__(self, value=''): - pisi.actionsapi.Error.__init__(self, value) - self.value = value - ctx.ui.error(value) - -class RunTimeError(pisi.actionsapi.Error): - def __init__(self, value=''): - pisi.actionsapi.Error.__init__(self, value) - self.value = value - ctx.ui.error(value) - -def compile(parameters = ''): - '''compile source with given parameters.''' - if system('python setup.py build %s' % (parameters)): - raise CompileError, _('Make failed.') - -def install(parameters = ''): - '''does python setup.py install''' - if system('python setup.py install --root=%s --no-compile %s' % (get.installDIR(), parameters)): - raise InstallError, _('Install failed.') - - DDOCS = 'CHANGELOG COPYRIGHT KNOWN_BUGS MAINTAINERS PKG-INFO \ - CONTRIBUTORS LICENSE COPYING* Change* MANIFEST* README*' - - for doc in DDOCS: - if can_access_file(doc): - pisitools.dodoc(doc) - -def run(parameters = ''): - '''executes parameters with python''' - if system('python %s' % (parameters)): - raise RunTimeError, _('Running %s failed.') % parameters diff --git a/tags/pisi-1.1_beta13/pisi/actionsapi/scons.py b/tags/pisi-1.1_beta13/pisi/actionsapi/scons.py deleted file mode 100644 index fbe44c97..00000000 --- a/tags/pisi-1.1_beta13/pisi/actionsapi/scons.py +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. - - -# Pisi Modules -import pisi.context as ctx - -import gettext -__trans = gettext.translation('pisi', fallback=True) -_ = __trans.ugettext - -# ActionsAPI Modules -import pisi.actionsapi -import pisi.actionsapi.get as get -from pisi.actionsapi.shelltools import system - -class MakeError(pisi.actionsapi.Error): - def __init__(self, value=''): - pisi.actionsapi.Error.__init__(self, value) - self.value = value - ctx.ui.error(value) - -class InstallError(pisi.actionsapi.Error): - def __init__(self, value=''): - pisi.actionsapi.Error.__init__(self, value) - self.value = value - ctx.ui.error(value) - -def make(parameters = ''): - if system('scons %s' % parameters): - raise MakeError(_('Make failed.')) - -def install(parameters = 'install', prefix = get.installDIR(), argument='prefix'): - if system('scons %s=%s %s' % (argument, prefix, parameters)): - raise InstallError(_('Install failed.')) diff --git a/tags/pisi-1.1_beta13/pisi/actionsapi/shelltools.py b/tags/pisi-1.1_beta13/pisi/actionsapi/shelltools.py deleted file mode 100644 index bdcdc8ba..00000000 --- a/tags/pisi-1.1_beta13/pisi/actionsapi/shelltools.py +++ /dev/null @@ -1,225 +0,0 @@ -#!/usr/bin/python -#-*- coding: utf-8 -*- -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. - -# Standart Python Modules -import os -import glob -import shutil -import string -import pwd -import grp - -import gettext -__trans = gettext.translation('pisi', fallback=True) -_ = __trans.ugettext - -# Pisi Modules -import pisi.context as ctx - -# ActionsAPI Modules -import pisi.actionsapi -import pisi.actionsapi.get - -from pisi.actionsapi import error -from pisi.util import run_logged -from pisi.util import join_path - -def can_access_file(filePath): - '''test the existence of file''' - return os.access(filePath, os.F_OK) - -def can_access_directory(destinationDirectory): - '''test readability, writability and executablility of directory''' - return os.access(destinationDirectory, os.R_OK | os.W_OK | os.X_OK) - -def makedirs(destinationDirectory): - '''recursive directory creation function''' - try: - if not os.access(destinationDirectory, os.F_OK): - os.makedirs(destinationDirectory) - except OSError: - error(_('Cannot create directory %s') % destinationDirectory) - -def echo(destionationFile, content): - try: - f = open(destionationFile, 'a') - f.write('%s\n' % content) - f.close() - except IOError: - error(_('ActionsAPI [echo]: Can\'t append to file %s.') % (destionationFile)) - -def chmod(filePath, mode = 0755): - '''change the mode of filePath to the mode''' - for fileName in glob.glob(filePath): - if can_access_file(fileName): - try: - os.chmod(fileName, mode) - except OSError: - ctx.ui.error(_('ActionsAPI [chmod]: Operation not permitted: %s (mode: %s)') \ - % (fileName, mode)) - else: - ctx.ui.error(_('ActionsAPI [chmod]: File %s doesn\'t exists.') % (fileName)) - -def chown(filePath, uid = "root", gid = "root"): - '''change the owner and group id of filePath to uid and gid''' - if can_access_file(filePath): - try: - os.chown(filePath, pwd.getpwnam(uid)[2], grp.getgrnam(gid)[2]) - except OSError: - ctx.ui.error(_('ActionsAPI [chown]: Operation not permitted: %s (uid: %s, gid: %s)') \ - % (filePath, uid, gid)) - else: - ctx.ui.error(_('ActionsAPI [chown]: File %s doesn\'t exists.') % filePath) - -def sym(source, destination): - '''creates symbolic link''' - try: - os.symlink(source, destination) - except OSError: - ctx.ui.error(_('ActionsAPI [sym]: Permission denied: %s to %s') % (source, destination)) - -def unlink(filePath): - '''remove the file path''' - if isFile(filePath) or isLink(filePath): - try: - os.unlink(filePath) - except OSError: - ctx.ui.error(_('ActionsAPI [unlink]: Permission denied: %s.') % (filePath)) - elif isDirectory(filePath): - pass - else: - ctx.ui.error(_('ActionsAPI [unlink]: File %s doesn\'t exists.') % (filePath)) - -def unlinkDir(sourceDirectory): - '''delete an entire directory tree''' - if isDirectory(sourceDirectory) or isLink(sourceDirectory): - try: - shutil.rmtree(sourceDirectory) - except OSError: - error(_('ActionsAPI [unlinkDir]: Operation not permitted: %s') % (sourceDirectory)) - elif isFile(sourceDirectory): - pass - else: - error(_('ActionsAPI [unlinkDir]: Directory %s doesn\'t exists.') % (sourceDirectory)) - -def move(source, destination): - '''recursively move a "source" file or directory to "destination"''' - for filePath in glob.glob(source): - if isFile(filePath) or isLink(filePath) or isDirectory(filePath): - try: - shutil.move(filePath, destination) - except OSError: - error(_('ActionsAPI [move]: Permission denied: %s to %s') % (filePath, destination)) - else: - error(_('ActionsAPI [move]: File %s doesn\'t exists.') % (filePath)) - -# FIXME: instead of passing a sym parameter, split copy and copytree into 4 different function -def copy(source, destination, sym = True): - '''recursively copy a "source" file or directory to "destination"''' - for filePath in glob.glob(source): - if isFile(filePath) and not isLink(filePath): - try: - shutil.copy(filePath, destination) - except IOError: - error(_('ActionsAPI [copy]: Permission denied: %s to %s') % (filePath, destination)) - elif isLink(filePath) and sym: - if isDirectory(destination): - os.symlink(os.readlink(filePath), join_path(destination, os.path.basename(filePath))) - else: - if isFile(destination): - os.remove(destination) - os.symlink(os.readlink(filePath), destination) - elif isLink(filePath) and not sym: - if isDirectory(filePath): - copytree(filePath, destination) - else: - shutil.copy(filePath, destination) - elif isDirectory(filePath): - copytree(filePath, destination, sym) - else: - error(_('ActionsAPI [copy]: File %s does not exist.') % filePath) - -def copytree(source, destination, sym = True): - '''recursively copy an entire directory tree rooted at source''' - if isDirectory(source): - if os.path.exists(destination): - if isDirectory(destination): - copytree(source, join_path(destination, os.path.basename(source.strip('/')))) - return - else: - copytree(source, join_path(destination, os.path.basename(source))) - return - try: - shutil.copytree(source, destination, sym) - except OSError, e: - error(_('ActionsAPI [copytree] %s to %s: %s') % (source, destination, e)) - else: - error(_('ActionsAPI [copytree]: Directory %s doesn\'t exists.') % (source)) - -def touch(filePath): - '''changes the access time of the 'filePath', or creates it if it is not exist''' - if glob.glob(filePath): - for f in glob.glob(filePath): - os.utime(f, None) - else: - try: - f = open(filePath, 'w') - f.close() - except IOError: - error(_('ActionsAPI [touch]: Permission denied: %s') % (filePath)) - -def cd(directoryName = ''): - '''change directory''' - current = os.getcwd() - if directoryName: - os.chdir(directoryName) - else: - os.chdir(os.path.dirname(current)) - -def ls(source): - '''listdir''' - if os.path.isdir(source): - return os.listdir(source) - else: - return glob.glob(source) - -def export(key, value): - '''export environ variable''' - os.environ[key] = value - -def isLink(filePath): - '''return True if filePath refers to a symbolic link''' - return os.path.islink(filePath) - -def isFile(filePath): - '''return True if filePath is an existing regular file''' - return os.path.isfile(filePath) - -def isDirectory(filePath): - '''Return True if filePath is an existing directory''' - return os.path.isdir(filePath) - -def realPath(filePath): - '''return the canonical path of the specified filename, eliminating any symbolic links encountered in the path''' - return os.path.realpath(filePath) - -def baseName(filePath): - '''return the base name of pathname filePath''' - return os.path.basename(filePath) - -def dirName(filePath): - '''return the directory name of pathname path''' - return os.path.dirname(filePath) - -def system(command): - command = string.join(string.split(command)) - return run_logged(command) diff --git a/tags/pisi-1.1_beta13/pisi/actionsapi/variables.py b/tags/pisi-1.1_beta13/pisi/actionsapi/variables.py deleted file mode 100644 index 6644212e..00000000 --- a/tags/pisi-1.1_beta13/pisi/actionsapi/variables.py +++ /dev/null @@ -1,102 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. - -# Standard Python Modules -import os -from copy import deepcopy - -# Pisi-Core Modules -import pisi.context as ctx - -# Set individual information, that are generally needed for ActionsAPI - -def exportFlags(): - '''General flags used in actions API.''' - - # first reset environ - os.environ = {} - os.environ = deepcopy(ctx.config.environ) - - # Build systems depend on these environment variables. That is why - # we export them instead of using as (instance) variables. - values = ctx.config.values - os.environ['HOST'] = values.build.host - os.environ['CFLAGS'] = values.build.cflags - os.environ['CXXFLAGS'] = values.build.cxxflags - os.environ['LDFLAGS'] = values.build.ldflags - os.environ['USER_LDFLAGS'] = values.build.ldflags - os.environ['JOBS'] = values.build.jobs - -class Env(object): - '''General environment variables used in actions API''' - def __init__(self): - - exportFlags() - - self.__vars = { - 'pkg_dir': 'PKG_DIR', - 'work_dir': 'WORK_DIR', - 'install_dir': 'INSTALL_DIR', - 'src_name': 'SRC_NAME', - 'src_version': 'SRC_VERSION', - 'src_release': 'SRC_RELEASE', - 'host': 'HOST', - 'cflags': 'CFLAGS', - 'cxxflags': 'CXXFLAGS', - 'ldflags': 'LDFLAGS', - 'jobs': 'JOBS' - } - - def __getattr__(self, attr): - - # Using environment variables is somewhat tricky. Each time - # you need them you need to check for their value. - if self.__vars.has_key(attr): - return os.getenv(self.__vars[attr]) - else: - return None - -class Dirs: - '''General directories used in actions API.''' - # TODO: Eventually we should consider getting these from a/the - # configuration file - doc = 'usr/share/doc' - sbin = 'usr/sbin' - man = 'usr/share/man' - info = 'usr/share/info' - data = 'usr/share' - conf = 'etc' - localstate = 'var/lib' - defaultprefix = 'usr' - - # These should be owned by object not the class. Or else Python - # will bug us with NoneType errors because of uninitialized - # context (ctx) because of the import in build.py. - def __init__(self): - self.values = ctx.config.values - self.kde = self.values.dirs.kde_dir - self.qt = self.values.dirs.qt_dir - - -# As we import this module from build.py, we can't init glb as a -# singleton here. Or else Python will bug us with NoneType errors -# because of uninitialized context (ctx) because of exportFlags(). -# -# We import this modue from build.py becase we need to reset/init glb -# for each build. # See bug #2575 -glb = None - -def initVariables(): - global glb - ctx.env = Env() - ctx.dirs = Dirs() - glb = ctx diff --git a/tags/pisi-1.1_beta13/pisi/api.py b/tags/pisi-1.1_beta13/pisi/api.py deleted file mode 100644 index 3f3c728a..00000000 --- a/tags/pisi-1.1_beta13/pisi/api.py +++ /dev/null @@ -1,490 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# -# Authors: Eray Ozkural -# Baris Metin - -"""Top level PISI interfaces. a facade to the entire PISI system""" - -import os -import sys -import logging -import logging.handlers -from os.path import exists -import bsddb3.db as db - -import gettext -__trans = gettext.translation('pisi', fallback=True) -_ = __trans.ugettext - -import pisi -import pisi.context as ctx -from pisi.uri import URI -import pisi.util as util -import pisi.dependency as dependency -import pisi.pgraph as pgraph -import pisi.operations as operations -import pisi.packagedb as packagedb -import pisi.repodb -import pisi.installdb -import pisi.sourcedb -import pisi.component as component -from pisi.index import Index -import pisi.cli -from pisi.operations import install, remove, upgrade, emerge -from pisi.build import build_until -from pisi.atomicoperations import resurrect_package, build -from pisi.metadata import MetaData -from pisi.files import Files -from pisi.file import File -import pisi.search -import pisi.lockeddbshelve as shelve -from pisi.version import Version - -class Error(pisi.Error): - pass - -def init(database = True, write = True, - options = None, ui = None, comar = True, - stdout = None, stderr = None, - comar_sockname = None): - """Initialize PiSi subsystem""" - - # UI comes first - - if ui is None: - from pisi.cli import CLI - if options: - ctx.ui = CLI(options.debug, options.verbose) - else: - ctx.ui = CLI() - else: - ctx.ui = ui - - if os.access('/var/log', os.W_OK): - handler = logging.handlers.RotatingFileHandler('/var/log/pisi.log') - #handler.setLevel(logging.DEBUG) - formatter = logging.Formatter('%(asctime)-12s: %(levelname)-8s %(message)s') - handler.setFormatter(formatter) - ctx.log = logging.getLogger('pisi') - ctx.log.addHandler(handler) - ctx.loghandler = handler - ctx.log.setLevel(logging.DEBUG) - else: - ctx.log = None - - # If given define stdout and stderr. Needed by buildfarm currently - # but others can benefit from this too. - if stdout: - ctx.stdout = stdout - if stderr: - ctx.stderr = stderr - - import pisi.config - ctx.config = pisi.config.Config(options) - - # TODO: this is definitely not dynamic beyond this point! - ctx.comar = comar and not ctx.config.get_option('ignore_comar') - # This is for YALI, used in comariface.py:make_com() - ctx.comar_sockname = comar_sockname - - # initialize repository databases - ctx.database = database - if database: - shelve.init_dbenv(write=write) - ctx.repodb = pisi.repodb.init() - ctx.installdb = pisi.installdb.init() - ctx.filesdb = pisi.files.FilesDB() - ctx.componentdb = pisi.component.ComponentDB() - ctx.packagedb = packagedb.init_db() - ctx.sourcedb = pisi.sourcedb.init() - pisi.search.init(['summary', 'description'], ['en', 'tr']) - else: - ctx.repodb = None - ctx.installdb = None - ctx.filesdb = None - ctx.componentdb = None - ctx.packagedb = None - ctx.sourcedb = None - ctx.ui.debug('PISI API initialized') - ctx.initialized = True - -def finalize(): - if ctx.initialized: - - if ctx.log: - ctx.loghandler.flush() - ctx.log.removeHandler(ctx.loghandler) - - pisi.repodb.finalize() - pisi.installdb.finalize() - if ctx.filesdb != None: - ctx.filesdb.close() - ctx.filesdb = None - if ctx.componentdb != None: - ctx.componentdb.close() - ctx.componentdb = None - if ctx.packagedb: - packagedb.finalize_db() - ctx.packagedb = None - if ctx.sourcedb: - pisi.sourcedb.finalize() - ctx.sourcedb = None - pisi.search.finalize() - if ctx.dbenv: - ctx.dbenv.close() - ctx.dbenv_lock.close() - if ctx.build_leftover and os.path.exists(ctx.build_leftover): - os.unlink(ctx.build_leftover) - - ctx.ui.debug('PISI API finalized') - ctx.ui.close() - ctx.initialized = False - -def list_available(repo = None): - '''returns a set of available package names''' - return set(ctx.packagedb.list_packages(repo = repo)) - -def list_upgradable(): - ignore_build = ctx.get_option('ignore_build_no') - - return filter(pisi.operations.is_upgradable, ctx.installdb.list_installed()) - -def package_graph(A, repo = pisi.itembyrepodb.installed, ignore_installed = False): - """Construct a package relations graph, containing - all dependencies of packages A, if ignore_installed - option is True, then only uninstalled deps will - be added.""" - - ctx.ui.debug('A = %s' % str(A)) - - # try to construct a pisi graph of packages to - # install / reinstall - - G_f = pgraph.PGraph(ctx.packagedb, repo) # construct G_f - - # find the "install closure" graph of G_f by package - # set A using packagedb - for x in A: - G_f.add_package(x) - B = A - #state = {} - while len(B) > 0: - Bp = set() - for x in B: - pkg = ctx.packagedb.get_package(x, repo) - #print pkg - for dep in pkg.runtimeDependencies(): - if ignore_installed: - if dependency.installed_satisfies_dep(dep): - continue - if not dep.package in G_f.vertices(): - Bp.add(str(dep.package)) - G_f.add_dep(x, dep) - B = Bp - return G_f - -def configure_pending(): - # start with pending packages - # configure them in reverse topological order of dependency - A = ctx.installdb.list_pending() - G_f = pgraph.PGraph(ctx.packagedb, pisi.itembyrepodb.installed) # construct G_f - for x in A.keys(): - G_f.add_package(x) - B = A - while len(B) > 0: - Bp = set() - for x in B.keys(): - pkg = ctx.packagedb.get_package(x, pisi.itembyrepodb.installed) - for dep in pkg.runtimeDependencies(): - if dep.package in G_f.vertices(): - G_f.add_dep(x, dep) - B = Bp - if ctx.get_option('debug'): - G_f.write_graphviz(sys.stdout) - order = G_f.topological_sort() - order.reverse() - try: - import pisi.comariface as comariface - for x in order: - if ctx.installdb.is_installed(x): - pkginfo = A[x] - pkgname = util.package_name(x, pkginfo.version, - pkginfo.release, - False, - False) - pkg_path = util.join_path(ctx.config.lib_dir(), - 'package', pkgname) - m = MetaData() - metadata_path = util.join_path(pkg_path, ctx.const.metadata_xml) - m.read(metadata_path) - # FIXME: we need a full package info here! - pkginfo.name = x - ctx.ui.notify(pisi.ui.configuring, package = pkginfo, files = None) - pisi.comariface.post_install( - pkginfo.name, - m.package.providesComar, - util.join_path(pkg_path, ctx.const.comar_dir), - util.join_path(pkg_path, ctx.const.metadata_xml), - util.join_path(pkg_path, ctx.const.files_xml), - ) - ctx.ui.notify(pisi.ui.configured, package = pkginfo, files = None) - ctx.installdb.clear_pending(x) - except ImportError: - raise Error(_("comar package is not fully installed")) - -def info(package, installed = False): - if package.endswith(ctx.const.package_suffix): - return info_file(package) - else: - return info_name(package, installed) - -def info_file(package_fn): - from package import Package - - if not os.path.exists(package_fn): - raise Error (_('File %s not found') % package_fn) - - package = Package(package_fn) - package.read() - return package.metadata, package.files - -def info_name(package_name, installed=False): - """fetch package information for a package""" - if installed: - package = ctx.packagedb.get_package(package_name, pisi.itembyrepodb.installed) - else: - package, repo = ctx.packagedb.get_package_repo(package_name, pisi.itembyrepodb.repos) - repostr = repo - - from pisi.metadata import MetaData - metadata = MetaData() - metadata.package = package - #FIXME: get it from sourcedb if available - metadata.source = None - #TODO: fetch the files from server if possible (wow, you maniac -- future exa) - if installed and ctx.installdb.is_installed(package.name): - try: - files = ctx.installdb.files(package.name) - except pisi.Error, e: - ctx.ui.warning(e) - files = None - else: - files = None - return metadata, files - -def search_package_names(query): - r = set() - packages = ctx.packagedb.list_packages() - for pkgname in packages: - if query in pkgname: - r.add(pkgname) - return r - -def search_package_terms(terms, lang = None, search_names = True, repo = pisi.itembyrepodb.all): - if not lang: - lang = pisi.pxml.autoxml.LocalText.get_lang() - r1 = pisi.search.query_terms('summary', lang, terms, repo = repo) - r2 = pisi.search.query_terms('description', lang, terms, repo = repo) - r = r1.union(r2) - if search_names: - for term in terms: - r |= search_package_names(term) - return r - -def search_package(query, lang = None, search_names = True, repo = pisi.itembyrepodb.all): - if not lang: - lang = pisi.pxml.autoxml.LocalText.get_lang() - r1 = pisi.search.query('summary', lang, query, repo = repo) - r2 = pisi.search.query('description', lang, query, repo = repo) - r = r1.union(r2) - if search_names: - r |= search_package_names(query) - return r - -def check(package): - md, files = info(package, True) - corrupt = [] - for file in files.list: - if file.hash and file.type != "config" \ - and not os.path.islink('/' + file.path): - ctx.ui.info(_("Checking %s ") % file.path, noln=True, verbose=True) - if file.hash != util.sha1_file('/' + file.path): - corrupt.append(file) - ctx.ui.info("Corrupt file: %s" % file) - else: - ctx.ui.info("OK", verbose=True) - return corrupt - -def index(dirs=None, output='pisi-index.xml', skip_sources=False, skip_signing=False, - non_recursive=False): - """accumulate PISI XML files in a directory""" - index = Index() - index.distribution = None - if not dirs: - dirs = ['.'] - for repo_dir in dirs: - repo_dir = str(repo_dir) - ctx.ui.info(_('* Building index of PISI files under %s') % repo_dir) - index.index(repo_dir, skip_sources, non_recursive) - - if skip_signing: - index.write(output, sha1sum=True, compress=File.bz2, sign=None) - else: - index.write(output, sha1sum=True, compress=File.bz2, sign=File.detached) - ctx.ui.info(_('* Index file written')) - -def add_repo(name, indexuri, at = None): - if ctx.repodb.has_repo(name): - raise Error(_('Repo %s already present.') % name) - else: - repo = pisi.repodb.Repo(URI(indexuri)) - ctx.repodb.add_repo(name, repo, at = at) - ctx.ui.info(_('Repo %s added to system.') % name) - -def remove_repo(name): - if ctx.repodb.has_repo(name): - ctx.repodb.remove_repo(name) - pisi.util.clean_dir(os.path.join(ctx.config.index_dir(), name)) - ctx.ui.info(_('Repo %s removed from system.') % name) - else: - ctx.ui.error(_('Repository %s does not exist. Cannot remove.') - % name) - -def list_repos(): - return ctx.repodb.list() - -def update_repo(repo, force=False): - ctx.ui.info(_('* Updating repository: %s') % repo) - index = Index() - if ctx.repodb.has_repo(repo): - repouri = ctx.repodb.get_repo(repo).indexuri.get_uri() - try: - index.read_uri_of_repo(repouri, repo) - except pisi.file.AlreadyHaveException, e: - ctx.ui.info(_('No updates available for repository %s.') % repo) - if force: - ctx.ui.info(_('Updating database at any rate as requested')) - index.read_uri_of_repo(repouri, repo, force = force) - else: - return - - try: - index.check_signature(repouri, repo) - except pisi.file.NoSignatureFound, e: - ctx.ui.warning(e) - - ctx.txn_proc(lambda txn : index.update_db(repo, txn=txn)) - ctx.ui.info(_('* Package database updated.')) - else: - raise Error(_('No repository named %s found.') % repo) - -def delete_cache(): - util.clean_dir(ctx.config.packages_dir()) - util.clean_dir(ctx.config.archives_dir()) - util.clean_dir(ctx.config.tmp_dir()) - -def rebuild_repo(repo): - ctx.ui.info(_('* Rebuilding \'%s\' named repo... ') % repo, noln=True) - - if ctx.repodb.has_repo(repo): - repouri = URI(ctx.repodb.get_repo(repo).indexuri.get_uri()) - indexname = repouri.filename() - index = Index() - indexpath = pisi.util.join_path(ctx.config.index_dir(), repo, indexname) - tmpdir = os.path.join(ctx.config.tmp_dir(), 'index') - pisi.util.clean_dir(tmpdir) - pisi.util.check_dir(tmpdir) - try: - index.read_uri(indexpath, tmpdir, force=True) # don't look for sha1sum there - except IOError, e: - ctx.ui.warning(_("Input/Output error while reading %s: %s") % (indexpath, unicode(e))) - return - ctx.txn_proc(lambda txn : index.update_db(repo, txn=txn)) - ctx.ui.info(_('OK.')) - else: - raise Error(_('No repository named %s found.') % repo) - -def rebuild_db(files=False): - - assert ctx.database == False - - # Bug 2596 - # finds and cleans duplicate package directories under '/var/lib/pisi/package' - # deletes the _older_ versioned package directories. - def clean_duplicates(): - i_version = {} # installed versions - replica = [] - for pkg in os.listdir(pisi.util.join_path(pisi.api.ctx.config.lib_dir(), 'package')): - (name, ver) = util.parse_package_name(pkg) - if i_version.has_key(name): - if Version(ver) > Version(i_version[name]): - # found a greater version, older one is a replica - replica.append(name + '-' + i_version[name]) - i_version[name] = ver - else: - # found an older version which is a replica - replica.append(name + '-' + ver) - else: - i_version[name] = ver - - for pkg in replica: - pisi.util.clean_dir(pisi.util.join_path(pisi.api.ctx.config.lib_dir(), 'package', pkg)) - - def destroy(files): - #TODO: either don't delete version files here, or remove force flag... - import bsddb3.db - for db in os.listdir(ctx.config.db_dir()): - if db.endswith('.bdb'):# or db.startswith('log'): # delete only db files - if db.startswith('files') or db.startswith('filesdbversion'): - clean = files - else: - clean = True - if clean: - fn = pisi.util.join_path(ctx.config.db_dir(), db) - #NB: there is a parameter bug with python-bsddb3, fixed in pardus - ctx.dbenv.dbremove(file=fn, flags=bsddb3.db.DB_AUTO_COMMIT) - - def reload_packages(files, txn): - for package_fn in os.listdir( pisi.util.join_path( ctx.config.lib_dir(), - 'package' ) ): - if not package_fn == "scripts": - ctx.ui.debug('Resurrecting %s' % package_fn) - pisi.api.resurrect_package(package_fn, files, txn) - - def reload_indices(txn): - index_dir = ctx.config.index_dir() - if os.path.exists(index_dir): # it may have been erased, or we may be upgrading from a previous version -- exa - for repo in os.listdir(index_dir): - indexuri = pisi.util.join_path(ctx.config.lib_dir(), 'index', repo, 'uri') - indexuri = open(indexuri, 'r').readline() - pisi.api.add_repo(repo, indexuri) - pisi.api.rebuild_repo(repo) - - # check db schema versions - try: - pisi.lockeddbshelve.check_dbversion('filesdbversion', pisi.__filesdbversion__, write=False) - except: - files = True # exception means the files db version was wrong - pisi.lockeddbshelve.init_dbenv(write=True, writeversion=True) - destroy(files) # bye bye - - # save parameters and shutdown pisi - options = ctx.config.options - ui = ctx.ui - comar = ctx.comar - finalize() - - # construct new database - init(database=True, options=options, ui=ui, comar=comar) - clean_duplicates() - reload_packages(files, None) - reload_indices(None) diff --git a/tags/pisi-1.1_beta13/pisi/archive.py b/tags/pisi-1.1_beta13/pisi/archive.py deleted file mode 100644 index 58496d73..00000000 --- a/tags/pisi-1.1_beta13/pisi/archive.py +++ /dev/null @@ -1,323 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# -# Archive module provides access to regular archive file types. -# maintainer baris and meren - -# standard library modules -import os -import stat -import shutil -import tarfile -import zipfile - -import gettext -__trans = gettext.translation('pisi', fallback=True) -_ = __trans.ugettext - -# PiSi modules -import pisi -import pisi.util as util -import pisi.context as ctx - -class ArchiveError(pisi.Error): - pass - -class LZMAError(pisi.Error): - def __init__(self, err): - pisi.Error.__init__(self, _("An error has occured while running LZMA:\n%s") % err) - - -class ArchiveBase(object): - """Base class for Archive classes.""" - def __init__(self, file_path, atype): - self.file_path = file_path - self.type = atype - - def unpack(self, target_dir, clean_dir = False): - self.target_dir = target_dir - # first we check if we need to clean-up our working env. - if os.path.exists(self.target_dir) and clean_dir: - util.clean_dir(self.target_dir) - - os.makedirs(self.target_dir) - - -class ArchiveBinary(ArchiveBase): - """ArchiveBinary handles binary archive files (usually distrubuted as - .bin files)""" - def __init__(self, file_path, arch_type = "binary"): - super(ArchiveBinary, self).__init__(file_path, arch_type) - - def unpack(self, target_dir, clean_dir = False): - super(ArchiveBinary, self).unpack(target_dir, clean_dir) - - # we can't unpack .bin files. we'll just move them to target - # directory and leave the dirty job to actions.py ;) - import shutil - target_file = os.path.join(target_dir, os.path.basename(self.file_path)) - shutil.copyfile(self.file_path, target_file) - - -class ArchiveTar(ArchiveBase): - """ArchiveTar handles tar archives depending on the compression - type. Provides access to tar, tar.gz and tar.bz2 files. - - This class provides the unpack magic for tar archives.""" - def __init__(self, file_path, arch_type = "tar"): - super(ArchiveTar, self).__init__(file_path, arch_type) - self.tar = None - - def unpack(self, target_dir, clean_dir = False): - """Unpack tar archive to a given target directory(target_dir).""" - super(ArchiveTar, self).unpack(target_dir, clean_dir) - self.unpack_dir(target_dir) - - def unpack_dir(self, target_dir): - rmode = "" - if self.type == 'tar': - rmode = 'r:' - elif self.type == 'targz': - rmode = 'r:gz' - elif self.type == 'tarbz2': - rmode = 'r:bz2' - elif self.type == 'tarlzma': - rmode = 'r:' - self.file_path = self.file_path.rstrip(ctx.const.lzma_suffix) - ret, out, err = util.run_batch("lzma d %s %s" % (self.file_path + ctx.const.lzma_suffix, - self.file_path)) - if ret != 0: - raise LZMAError(err) - else: - raise ArchiveError(_("Archive type not recognized")) - - self.tar = tarfile.open(self.file_path, rmode) - oldwd = os.getcwd() - os.chdir(target_dir) - - install_tar_path = util.join_path(ctx.config.tmp_dir(), ctx.const.install_tar) - for tarinfo in self.tar: - # Installing packages (especially shared libraries) is a - # bit tricky. You should also change the inode if you - # change the file, cause the file is opened allready and - # accessed. Removing and creating the file will also - # change the inode and will do the trick (in fact, old - # file will be deleted only when its closed). - # - # Also, tar.extract() doesn't write on symlinks... Not any - # more :). - if self.file_path == install_tar_path: - if os.path.isfile(tarinfo.name) or os.path.islink(tarinfo.name): - try: - os.unlink(tarinfo.name) - except OSError, e: - ctx.ui.warning(e) - - self.tar.extract(tarinfo) - - os.chdir(oldwd) - self.close() - - def add_to_archive(self, file_name, arc_name=None): - """Add file or directory path to the tar archive""" - if not self.tar: - if self.type == 'tar': - wmode = 'w:' - elif self.type == 'targz': - wmode = 'w:gz' - elif self.type == 'tarbz2': - wmode = 'w:bz2' - elif self.type == 'tarlzma': - wmode = 'w:' - self.file_path = self.file_path.rstrip(ctx.const.lzma_suffix) - else: - raise ArchiveError(_("Archive type not recognized")) - self.tar = tarfile.open(self.file_path, wmode) - - self.tar.add(file_name, arc_name) - - def close(self): - self.tar.close() - - if self.tar.mode == 'wb' and self.type == 'tarlzma': - batch = None - if ctx.config.values.build.compressionlevel: - batch = "lzmash -%s %s" % (ctx.config.values.build.compressionlevel, self.file_path) - else: - batch = "lzmash %s" % self.file_path - - ret, out, err = util.run_batch(batch) - if ret != 0: - raise LZMAError(err) - -class ArchiveZip(ArchiveBase): - """ArchiveZip handles zip archives. - - Being a zip archive PISI packages also use this class - extensively. This class provides unpacking and packing magic for - zip archives.""" - - symmagic = 2716663808 #long of hex val '0xA1ED0000L' - - def __init__(self, file_path, arch_type = "zip", mode = 'r'): - super(ArchiveZip, self).__init__(file_path, arch_type) - - self.zip_obj = zipfile.ZipFile(self.file_path, mode) - - def close(self): - """Close the zip archive.""" - self.zip_obj.close() - - def add_to_archive(self, file_name, arc_name=None): - """Add file or directory path to the zip file""" - # It's a pity that zipfile can't handle unicode strings. Grrr! - file_name = str(file_name) - if os.path.isdir(file_name) and not os.path.islink(file_name): - self.zip_obj.writestr(file_name + '/', '') - attr_obj = self.zip_obj.getinfo(file_name + '/') - attr_obj.external_attr = stat.S_IMODE(os.stat(file_name)[0]) << 16L - for f in os.listdir(file_name): - self.add_to_archive(os.path.join(file_name, f)) - else: - if os.path.islink(file_name): - dest = os.readlink(file_name) - attr = zipfile.ZipInfo() - attr.filename = file_name - attr.create_system = 3 - attr.external_attr = self.symmagic - self.zip_obj.writestr(attr, dest) - else: - self.zip_obj.write(file_name, arc_name, zipfile.ZIP_DEFLATED) - - if not arc_name: - zinfo = self.zip_obj.getinfo(file_name) - else: - zinfo = self.zip_obj.getinfo(arc_name) - zinfo.create_system = 3 - - def add_basename_to_archive(self, file_name): - """Add only the basepath to the zip file. For example; if the given - file_name parameter is /usr/local/bin/somedir, this function - will create only the base directory/file somedir in the - archive.""" - cwd = os.getcwd() - path_name = os.path.dirname(file_name) - file_name = os.path.basename(file_name) - if path_name: - os.chdir(path_name) - self.add_to_archive(file_name) - os.chdir(cwd) - - def has_file(self, file_path): - """ Returns true if file_path is member of the zip archive""" - return file_path in self.zip_obj.namelist() - - def unpack_file_cond(self, pred, target_dir, archive_root = ''): - """Unpack/Extract files according to predicate function - pred: filename -> bool - unpacks stuff into target_dir and only extracts files - from archive_root, treating it as the archive root""" - zip_obj = self.zip_obj - for info in zip_obj.infolist(): - if pred(info.filename): # check if condition holds - - # below code removes that, so we find it here - is_dir = info.filename.endswith('/') - - # calculate output file name - if archive_root == '': - outpath = info.filename - else: - # change archive_root - if util.subpath(archive_root, info.filename): - outpath = util.removepathprefix(archive_root, - info.filename) - else: - continue # don't extract if not under - - ofile = os.path.join(target_dir, outpath) - - if is_dir: # this is a directory - d = os.path.join(target_dir, outpath) - if not os.path.isdir(d): - os.makedirs(d) - perm = info.external_attr - perm &= 0xFFFF0000 - perm >>= 16 - perm |= 0x00000100 - os.chmod(d, perm) - continue - - # check that output dir is present - util.check_dir(os.path.dirname(ofile)) - - # remove output file we might be overwriting. - # (also check for islink? for broken symlinks...) - if os.path.isfile(ofile) or os.path.islink(ofile): - os.remove(ofile) - - if info.external_attr == self.symmagic: - if os.path.isdir(ofile): - shutil.rmtree(ofile) # a rare case, the file used to be a dir, now it is a symlink! - target = zip_obj.read(info.filename) - os.symlink(target, ofile) - else: - perm = info.external_attr - perm &= 0x08FF0000 - perm >>= 16 - perm |= 0x00000100 - buff = open (ofile, 'wb') - file_content = zip_obj.read(info.filename) - buff.write(file_content) - buff.close() - os.chmod(ofile, perm) - - def unpack_files(self, paths, target_dir): - self.unpack_file_cond(lambda f:f in paths, target_dir) - - def unpack_dir(self, path, target_dir): - self.unpack_file_cond(lambda f:util.subpath(path, f), target_dir) - - def unpack_dir_flat(self, path, target_dir): - self.unpack_file_cond(lambda f:util.subpath(path, f), target_dir, path) - - def unpack(self, target_dir, clean_dir=False): - super(ArchiveZip, self).unpack(target_dir, clean_dir) - - self.unpack_file_cond(lambda f: True, target_dir) - self.close() - return - - -class Archive: - """Archive is the main factory for ArchiveClasses, regarding the - Abstract Factory Pattern :).""" - - def __init__(self, file_path, arch_type): - """accepted archive types: - targz, tarbz2, zip, tar""" - - handlers = { - 'targz': ArchiveTar, - 'tarbz2': ArchiveTar, - 'tarlzma': ArchiveTar, - 'tar': ArchiveTar, - 'zip': ArchiveZip, - 'binary': ArchiveBinary - } - - self.archive = handlers.get(arch_type)(file_path, arch_type) - - def unpack(self, target_dir, clean_dir = False): - self.archive.unpack(target_dir, clean_dir) - - def unpack_files(self, files, target_dir): - self.archive.unpack_files(files, target_dir) diff --git a/tags/pisi-1.1_beta13/pisi/atomicoperations.py b/tags/pisi-1.1_beta13/pisi/atomicoperations.py deleted file mode 100644 index 4e0ab72c..00000000 --- a/tags/pisi-1.1_beta13/pisi/atomicoperations.py +++ /dev/null @@ -1,553 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# -# Author: Eray Ozkural - -"Atomic package operations such as install/remove/upgrade" - -import gettext -__trans = gettext.translation('pisi', fallback=True) -_ = __trans.ugettext - -import sys -import os -import bsddb3.db as db - -import pisi -import pisi.context as ctx -import pisi.packagedb as packagedb -import pisi.dependency as dependency -import pisi.util as util -from pisi.specfile import * -from pisi.metadata import MetaData -from pisi.files import Files -from pisi.uri import URI -import pisi.ui -from pisi.version import Version - -class Error(pisi.Error): - pass - -class NotfoundError(pisi.Error): - pass - -# single package operations - -class AtomicOperation(object): - - def __init__(self, ignore_dep = None): - #self.package = package - if ignore_dep==None: - self.ignore_dep = ctx.config.get_option('ignore_dependency') - else: - self.ignore_dep = ignore_dep - - def run(self, package): - "perform an atomic package operation" - pass - - -class Install(AtomicOperation): - "Install class, provides install routines for pisi packages" - - @staticmethod - def from_name(name, ignore_dep = None): - # download package and return an installer object - # find package in repository - repo = ctx.packagedb.which_repo(name) - if repo: - ctx.ui.info(_("Package %s found in repository %s") % (name, repo)) - repo = ctx.repodb.get_repo(repo) - pkg = ctx.packagedb.get_package(name) - - # FIXME: let pkg.packageURI be stored as URI type rather than string - pkg_uri = URI(pkg.packageURI) - if pkg_uri.is_absolute_path(): - pkg_path = str(pkg.packageURI) - else: - pkg_path = os.path.join(os.path.dirname(repo.indexuri.get_uri()), - str(pkg_uri.path())) - - ctx.ui.info(_("Package URI: %s") % pkg_path, verbose=True) - - return Install(pkg_path, ignore_dep) - else: - raise Error(_("Package %s not found in any active repository.") % name) - - def __init__(self, package_fname, ignore_dep = None, ignore_file_conflicts = None): - "initialize from a file name" - super(Install, self).__init__(ignore_dep) - if not ignore_file_conflicts: - ignore_file_conflicts = ctx.get_option('ignore_file_conflicts') - self.ignore_file_conflicts = ignore_file_conflicts - self.package_fname = package_fname - self.package = pisi.package.Package(package_fname) - self.package.read() - self.metadata = self.package.metadata - self.files = self.package.files - self.pkginfo = self.metadata.package - - def install(self, ask_reinstall = True): - "entry point" - ctx.ui.status(_('Installing %s, version %s, release %s, build %s') % - (self.pkginfo.name, self.pkginfo.version, - self.pkginfo.release, self.pkginfo.build)) - ctx.ui.notify(pisi.ui.installing, package = self.pkginfo, files = self.files) - - self.ask_reinstall = ask_reinstall - self.check_requirements() - self.check_relations() - self.check_reinstall() - self.extract_install() - self.store_pisi_files() - - self.postinstall() - - txn = ctx.dbenv.txn_begin() - try: - self.update_databases(txn) - txn.commit() - except db.DBError, e: - txn.abort() - raise e - - ctx.ui.status() - if self.upgrade: - event = pisi.ui.upgraded - else: - event = pisi.ui.installed - ctx.ui.notify(event, package = self.pkginfo, files = self.files) - - def check_requirements(self): - """check system requirements""" - #TODO: IS THERE ENOUGH SPACE? - # what to do if / is split into /usr, /var, etc. - # check comar - if self.metadata.package.providesComar and ctx.comar: - import pisi.comariface as comariface - com = comariface.make_com() - - def check_relations(self): - # check conflicts - for pkg in self.metadata.package.conflicts: - if ctx.installdb.is_installed(self.pkginfo): - raise Error(_("Package conflicts %s") % pkg) - - # check dependencies - if not ctx.config.get_option('ignore_dependency'): - if not self.pkginfo.installable(): - ctx.ui.error(_('Dependencies for %s not satisfied') % - self.pkginfo.name) - raise Error(_("Package not installable")) - - # check if package is in database - # If it is not, put it into 3rd party packagedb - if not ctx.packagedb.has_package(self.pkginfo.name): - ctx.packagedb.add_package(self.pkginfo, pisi.itembyrepodb.thirdparty) - - # check file conflicts - file_conflicts = [] - for file in self.files.list: - if ctx.filesdb.has_file(file.path): - pkg, existing_file = ctx.filesdb.get_file(file.path) - dst = pisi.util.join_path(ctx.config.dest_dir(), file.path) - if pkg != self.pkginfo.name and not os.path.isdir(dst): - file_conflicts.append( (pkg, existing_file) ) - if file_conflicts: - file_conflicts_str = "" - for (pkg, existing_file) in file_conflicts: - file_conflicts_str += _("%s from %s package") % (existing_file.path, pkg) - msg = _('File conflicts:\n%s') % file_conflicts_str - if self.ignore_file_conflicts: - ctx.ui.warning(msg) - else: - raise Error(msg) - - def check_reinstall(self): - "check reinstall, confirm action, and schedule reinstall" - - pkg = self.pkginfo - - self.reinstall = False - self.upgrade = False - if ctx.installdb.is_installed(pkg.name): # is this a reinstallation? - - #FIXME: consider REPOSITORY instead of DISTRIBUTION -- exa - #ipackage = ctx.packagedb.get_package(pkg.name, pisi.itembyrepodb.installed) - ipkg = ctx.installdb.get_info(pkg.name) - repomismatch = ipkg.distribution != pkg.distribution - - (iversion, irelease, ibuild) = ctx.installdb.get_version(pkg.name) - - # determine if same version - self.same_ver = False - ignore_build = ctx.config.options and ctx.config.options.ignore_build_no - if repomismatch or (not ibuild) or (not pkg.build) or ignore_build: - # we don't look at builds to compare two package versions - if Version(pkg.release) == Version(irelease): - self.same_ver = True - else: - if pkg.build == ibuild: - self.same_ver = True - - if self.same_ver: - if self.ask_reinstall: - if not ctx.ui.confirm(_('Re-install same version package?')): - raise Error(_('Package re-install declined')) - else: - upgrade = False - # is this an upgrade? - # determine and report the kind of upgrade: version, release, build - if Version(pkg.version) > Version(iversion): - ctx.ui.info(_('Upgrading to new upstream version')) - upgrade = True - elif Version(pkg.release) > Version(irelease): - ctx.ui.info(_('Upgrading to new distribution release')) - upgrade = True - elif ((not ignore_build) and ibuild and pkg.build - and pkg.build > ibuild): - ctx.ui.info(_('Upgrading to new distribution build')) - upgrade = True - self.upgrade = upgrade - - # is this a downgrade? confirm this action. - if self.ask_reinstall and (not upgrade): - if Version(pkg.version) < Version(iversion): - #x = _('Downgrade to old upstream version?') - x = None - elif Version(pkg.release) < Version(irelease): - x = _('Downgrade to old distribution release?') - else: - x = _('Downgrade to old distribution build?') - if x and not ctx.ui.confirm(x): - raise Error(_('Package downgrade declined')) - - # schedule for reinstall - self.old_files = ctx.installdb.files(pkg.name) - self.old_path = ctx.installdb.pkg_dir(pkg.name, iversion, irelease) - self.reinstall = True - self.remove_old = Remove(pkg.name) - self.remove_old.run_preremove() - - def postinstall(self): - self.config_later = False - if ctx.comar: - import pisi.comariface - ctx.ui.notify(pisi.ui.configuring, package = self.pkginfo, files = self.files) - pisi.comariface.post_install( - self.pkginfo.name, - self.metadata.package.providesComar, - self.package.comar_dir(), - os.path.join(self.package.pkg_dir(), ctx.const.metadata_xml), - os.path.join(self.package.pkg_dir(), ctx.const.files_xml), - ) - ctx.ui.notify(pisi.ui.configured, package = self.pkginfo, files = self.files) - else: - self.config_later = True - - def extract_install(self): - "unzip package in place" - - ctx.ui.notify(pisi.ui.extracting, package = self.pkginfo, files = self.files) - - config_changed = [] - if self.reinstall: - new = set(map(lambda x: str(x.path), self.files.list)) - old = set(map(lambda x: str(x.path), self.old_files.list)) - - # handle special cases for upgrades - overlap = old & new - self.files.list.sort(key=lambda x:x.path) - self.old_files.list.sort(key=lambda x:x.path) - def get_upgrades(list): - return filter(lambda x : str(x.path) in overlap, list) - (upgrade_new, upgrade_old) = map(get_upgrades, [self.files.list, self.old_files.list]) - for newf, oldf in zip(upgrade_new, upgrade_old): - assert newf.path == oldf.path - if newf.type == 'config' and oldf.type == 'config': # config upgrade - fpath = pisi.util.join_path(ctx.config.dest_dir(), oldf.path) - try: - if pisi.util.sha1_file(fpath) != oldf.hash: - # old config file changed, don't overwrite - config_changed.append(fpath) - if os.path.exists(fpath + '.old'): - os.unlink(fpath + '.old') - os.rename(fpath, fpath + '.old') - # otherwise, old config file not changed, overwrite - except pisi.util.FileError, e: - pass - else: - for file in self.files.list: - if file.type == 'config': - fpath = pisi.util.join_path(ctx.config.dest_dir(), file.path) - if os.path.exists(fpath): # there is an old config file lying around - try: - if pisi.util.sha1_file(fpath) != file.hash: - config_changed.append(fpath) - if os.path.exists(fpath + '.old'): - os.unlink(fpath + '.old') - os.rename(fpath, fpath + '.old') - except pisi.util.FileError, e: - pass - - self.package.extract_install(ctx.config.dest_dir()) - - for path in config_changed: - if os.path.exists(path + '.newconfig'): - os.unlink(path + '.newconfig') - os.rename(path, path + '.newconfig') - os.rename(path + '.old', path) - - if self.reinstall: - # remove left over files - new = set(map(lambda x: str(x.path), self.files.list)) - old = set(map(lambda x: str(x.path), self.old_files.list)) - leftover = old - new - old_fileinfo = {} - for fileinfo in self.old_files.list: - old_fileinfo[str(fileinfo.path)] = fileinfo - for path in leftover: - Remove.remove_file( old_fileinfo[path] ) - - - def store_pisi_files(self): - """put files.xml, metadata.xml, actions.py and COMAR scripts - somewhere in the file system. We'll need these in future...""" - - if self.reinstall: - util.clean_dir(self.old_path) - - ctx.ui.info(_('Storing %s, ') % ctx.const.files_xml, verbose=True) - self.package.extract_file(ctx.const.files_xml, self.package.pkg_dir()) - - ctx.ui.info(_('Storing %s.') % ctx.const.metadata_xml, verbose=True) - self.package.extract_file(ctx.const.metadata_xml, self.package.pkg_dir()) - - for pcomar in self.metadata.package.providesComar: - fpath = os.path.join(ctx.const.comar_dir, pcomar.script) - # comar prefix is added to the pkg_dir while extracting comar - # script file. so we'll use pkg_dir as destination. - ctx.ui.info(_('Storing %s') % fpath, verbose=True) - self.package.extract_file(fpath, self.package.pkg_dir()) - - def update_databases(self, txn): - "update databases" - if self.reinstall: - self.remove_old.remove_db(txn) - - # installdb - ctx.installdb.install(self.metadata.package.name, - self.metadata.package.version, - self.metadata.package.release, - self.metadata.package.build, - self.metadata.package.distribution, - config_later = self.config_later, - txn = txn) - - # filesdb - ctx.filesdb.add_files(self.metadata.package.name, self.files, txn=txn) - - # installed packages - ctx.packagedb.add_package(self.pkginfo, pisi.itembyrepodb.installed, txn=txn) - - -def install_single(pkg, upgrade = False): - """install a single package from URI or ID""" - url = URI(pkg) - # Check if we are dealing with a remote file or a real path of - # package filename. Otherwise we'll try installing a package from - # the package repository. - if url.is_remote_file() or os.path.exists(url.uri): - install_single_file(pkg, upgrade) - else: - install_single_name(pkg, upgrade) - -# FIXME: Here and elsewhere pkg_location must be a URI -def install_single_file(pkg_location, upgrade = False): - """install a package file""" - Install(pkg_location).install(not upgrade) - -def install_single_name(name, upgrade = False): - """install a single package from ID""" - install = Install.from_name(name) - install.install(not upgrade) - -class Remove(AtomicOperation): - - def __init__(self, package_name, ignore_dep = None): - super(Remove, self).__init__(ignore_dep) - self.package_name = package_name - self.package = ctx.packagedb.get_package(self.package_name, pisi.itembyrepodb.installed) - try: - self.files = ctx.installdb.files(self.package_name) - except pisi.Error, e: - # for some reason file was deleted, we still allow removes! - ctx.ui.error(unicode(e)) - ctx.ui.warning(_('File list could not be read for package %s, continuing removal.') % package_name) - self.files = Files() - - def run(self): - """Remove a single package""" - - ctx.ui.status(_('Removing package %s') % self.package_name) - ctx.ui.notify(pisi.ui.removing, package = self.package, files = self.files) - if not ctx.installdb.is_installed(self.package_name): - raise Exception(_('Trying to remove nonexistent package ') - + self.package_name) - - self.check_dependencies() - - self.run_preremove() - for fileinfo in self.files.list: - self.remove_file(fileinfo) - - txn = ctx.dbenv.txn_begin() - try: - self.remove_db(txn) - txn.commit() - except db.DBError, e: - txn.abort() - raise e - - self.remove_pisi_files() - ctx.ui.status() - ctx.ui.notify(pisi.ui.removed, package = self.package, files = self.files) - - def check_dependencies(self): - #FIXME: why is this not implemented? -- exa - #we only have to check the dependencies to ensure the - #system will be consistent after this removal - pass - # is there any package who depends on this package? - - @staticmethod - def remove_file(fileinfo): - fpath = pisi.util.join_path(ctx.config.dest_dir(), fileinfo.path) - - # we should check if the file belongs to another - # package (this can legitimately occur while upgrading - # two packages such that a file has moved from one package to - # another as in #2911) - if ctx.filesdb.has_file(fpath): - pkg, existing_file = ctx.filesdb.get_file(fpath) - if pkg != self.package_name: - ctx.ui.warning(_('Not removing conflicted file : %s') % fpath) - return - - if fileinfo.permanent: - # do not remove precious files :) - pass - elif fileinfo.type == ctx.const.conf: - # config files are precious, leave them as they are - # unless they are the same as provided by package. - try: - if pisi.util.sha1_file(fpath) == fileinfo.hash: - os.unlink(fpath) - except pisi.util.FileError, e: - pass - else: - if os.path.isfile(fpath) or os.path.islink(fpath): - os.unlink(fpath) - elif os.path.isdir(fpath) and not os.listdir(fpath): - os.rmdir(fpath) - else: - ctx.ui.warning(_('Not removing non-file, non-link %s') % fpath) - return - - # remove emptied directories - dpath = os.path.dirname(fpath) - while dpath != '/' and not os.listdir(dpath): - os.rmdir(dpath) - dpath = os.path.dirname(dpath) - - def run_preremove(self): - if ctx.comar: - import pisi.comariface - pisi.comariface.pre_remove( - self.package_name, - os.path.join(self.package.pkg_dir(), ctx.const.metadata_xml), - os.path.join(self.package.pkg_dir(), ctx.const.files_xml), - ) - - def remove_pisi_files(self): - util.clean_dir(self.package.pkg_dir()) - - def remove_db(self, txn): - ctx.installdb.remove(self.package_name, txn) - ctx.filesdb.remove_files(self.files, txn) - pisi.packagedb.remove_tracking_package(self.package_name, txn) - - -def remove_single(package_name): - Remove(package_name).run() - -def build(package): - # wrapper for build op - import pisi.build - return pisi.build.build(package) - -def virtual_install(metadata, files, txn): - """Recreate the package info for rebuilddb command""" - # installdb - ctx.installdb.install(metadata.package.name, - metadata.package.version, - metadata.package.release, - metadata.package.build, - metadata.package.distribution, - rebuild=True, - txn=txn) - - # filesdb - if files: - ctx.filesdb.add_files(metadata.package.name, files, txn=txn) - - # installed packages - ctx.packagedb.add_package(metadata.package, pisi.itembyrepodb.installed, txn=txn) - -def resurrect_package(package_fn, write_files, txn = None): - """Resurrect the package from xml files""" - - from os.path import exists - - metadata_xml = util.join_path(ctx.config.lib_dir(), 'package', - package_fn, ctx.const.metadata_xml) - if not exists(metadata_xml): - raise Error, _("Metadata XML '%s' cannot be found") % metadata_xml - - metadata = MetaData() - metadata.read(metadata_xml) - - errs = metadata.errors() - if errs: - util.Checks.print_errors(errs) - raise Error, _("MetaData format wrong (%s)") % package_fn - - ctx.ui.info(_('* Adding \'%s\' to db... ') % (metadata.package.name), noln=True) - - if write_files: - files_xml = util.join_path(ctx.config.lib_dir(), 'package', - package_fn, ctx.const.files_xml) - if not exists(files_xml): - raise Error, _("Files XML '%s' cannot be found") % files_xml - - files = Files() - files.read(files_xml) - if files.errors(): - raise Error, _("Invalid %s") % ctx.const.files_xml - else: - files = None - - #import pisi.atomicoperations - def f(t): - pisi.atomicoperations.virtual_install(metadata, files, t) - ctx.txn_proc(f, txn) - - ctx.ui.info(_('OK.')) diff --git a/tags/pisi-1.1_beta13/pisi/build.py b/tags/pisi-1.1_beta13/pisi/build.py deleted file mode 100644 index b50fb639..00000000 --- a/tags/pisi-1.1_beta13/pisi/build.py +++ /dev/null @@ -1,929 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# -# Authors: Baris Metin -# A. Murat Eren -# Eray Ozkural - -"""package building code""" - -# python standard library -import os -import sys -import glob -from copy import deepcopy -from os.path import basename, dirname - -import gettext -__trans = gettext.translation('pisi', fallback=True) -_ = __trans.ugettext - -import pisi -from pisi.specfile import SpecFile -import pisi.util as util -from pisi.util import join_path as join, parenturi -from pisi.file import File -import pisi.context as ctx -import pisi.dependency as dependency -import pisi.operations as operations -from pisi.sourcearchive import SourceArchive -from pisi.files import Files, FileInfo -from pisi.fetcher import fetch_url -from pisi.uri import URI -from pisi.metadata import MetaData -from pisi.package import Package -import pisi.component as component -import pisi.archive as archive -import pisi.actionsapi.variables - - -class Error(pisi.Error): - pass - - -# Helper Functions -def get_file_type(path, pinfo_list, install_dir): - """Return the file type of a path according to the given PathInfo - list""" - - Match = lambda x: [match for match in glob.glob(install_dir + x) if join(install_dir, path).find(match) > -1] - - def Sort(x): - x.sort(reverse=True) - return x - - best_matched_path = Sort([pinfo.path for pinfo in pinfo_list if Match(pinfo.path)])[0] - info = [pinfo for pinfo in pinfo_list if best_matched_path == pinfo.path][0] - return info.fileType, info.permanent - -def check_path_collision(package, pkgList): - """This function will check for collision of paths in a package with - the paths of packages in pkgList. The return value will be the - list containing the paths that collide.""" - collisions = [] - for pinfo in package.files: - for pkg in pkgList: - if pkg is package: - continue - for path in pkg.files: - # if pinfo.path is a subpath of path.path like - # the example below. path.path is marked as a - # collide. Exp: - # pinfo.path: /usr/share - # path.path: /usr/share/doc - if (path.path.endswith(ctx.const.ar_file_suffix) and ctx.get_option('create_static')) or \ - (path.path.endswith(ctx.const.debug_file_suffix) and ctx.config.values.build.generatedebug): - # don't throw collision error for these files. - # we'll handle this in gen_files_xml.. - continue - if util.subpath(pinfo.path, path.path): - collisions.append(path.path) - ctx.ui.debug(_('Path %s belongs in multiple packages') % - path.path) - return collisions - - -class Builder: - """Provides the package build and creation routines""" - #FIXME: this class and every other class must use URLs as paths! - - @staticmethod - def from_name(name): - # download package and return an installer object - # find package in repository - sf, reponame = ctx.sourcedb.get_spec_repo(name) - src = sf.source - if src: - - src_uri = URI(src.sourceURI) - if src_uri.is_absolute_path(): - src_path = str(src_uri) - else: - repo = ctx.repodb.get_repo(reponame) - #FIXME: don't use dirname to work on URLs - src_path = os.path.join(os.path.dirname(repo.indexuri.get_uri()), - str(src_uri.path())) - - ctx.ui.debug(_("Source URI: %s") % src_path) - - return Builder(src_path) - else: - raise Error(_("Source %s not found in any active repository.") % name) - - def __init__(self, specuri): - - # process args - if not isinstance(specuri, URI): - specuri = URI(specuri) - - # read spec file, we'll need it :) - self.set_spec_file(specuri) - - if specuri.is_remote_file(): - #make local here and fuck up - self.specdir = self.fetch_files() - else: - self.specdir = dirname(self.specuri.get_uri()) - - self.sourceArchive = SourceArchive(self.spec, self.pkg_work_dir()) - - self.set_environment_vars() - - self.actionLocals = None - self.actionGlobals = None - self.srcDir = None - - def set_spec_file(self, specuri): - if not specuri.is_remote_file(): - specuri = URI(os.path.realpath(specuri.get_uri())) # FIXME: doesn't work for file:// - self.specuri = specuri - spec = SpecFile() - spec.read(specuri, ctx.config.tmp_dir()) - self.spec = spec - - # directory accessor functions - - # pkg_x_dir: per package directory for storing info type x - - def pkg_dir(self): - "package build directory" - packageDir = self.spec.source.name + '-' + \ - self.spec.source.version + '-' + self.spec.source.release - return util.join_path(ctx.config.dest_dir(), ctx.config.values.dirs.tmp_dir, - packageDir) - - def pkg_work_dir(self): - return self.pkg_dir() + ctx.const.work_dir_suffix - - def pkg_debug_dir(self): - return self.pkg_dir() + ctx.const.debug_dir_suffix - - def pkg_install_dir(self): - return self.pkg_dir() + ctx.const.install_dir_suffix - - def set_state(self, state): - stateFile = util.join_path(self.pkg_work_dir(), "pisiBuildState") - open(stateFile, "w").write(state) - - def get_state(self): - stateFile = util.join_path(self.pkg_work_dir(), "pisiBuildState") - if not os.path.exists(stateFile): # no state - return None - return open(stateFile, "r").read() - - def build(self): - """Build the package in one shot.""" - - ctx.ui.status(_("Building PISI source package: %s") % self.spec.source.name) - - self.compile_action_script() - - # check if all patch files exists, if there are missing no need to unpack! - self.patch_exists() - - self.check_build_dependencies() - self.fetch_component() - self.fetch_source_archive() - self.unpack_source_archive() - - # apply the patches and prepare a source directory for build. - self.apply_patches() - - self.run_setup_action() - self.run_build_action() - self.run_install_action() - - # after all, we are ready to build/prepare the packages - return self.build_packages() - - def set_environment_vars(self): - """Sets the environment variables for actions API to use""" - - # Each time a builder is created we must reset - # environment. See bug #2575 - pisi.actionsapi.variables.initVariables() - - env = { - "PKG_DIR": self.pkg_dir(), - "WORK_DIR": self.pkg_work_dir(), - "INSTALL_DIR": self.pkg_install_dir(), - "SRC_NAME": self.spec.source.name, - "SRC_VERSION": self.spec.source.version, - "SRC_RELEASE": self.spec.source.release - } - os.environ.update(env) - - # First check icecream, if not found use ccache, no need to use both - # together (according to kde-wiki it cause performance loss) - if ctx.config.values.build.buildhelper == "icecream": - if os.path.exists("/opt/icecream/bin/gcc"): - # Add icecream directory for support distributed compiling :) - os.environ["PATH"] = "/opt/icecream/bin/:%s" % os.environ["PATH"] - ctx.ui.info(_("IceCream detected. Make sure your daemon is up and running...")) - elif ctx.config.values.build.buildhelper == "ccache": - if os.path.exists("/usr/lib/ccache/bin/gcc"): - # Add ccache directory for support Compiler Cache :) - os.environ["PATH"] = "/usr/lib/ccache/bin/:%s" % os.environ["PATH"] - ctx.ui.info(_("CCache detected...")) - - def fetch_files(self): - self.specdiruri = dirname(self.specuri.get_uri()) - pkgname = basename(self.specdiruri) - self.destdir = join(ctx.config.tmp_dir(), pkgname) - #self.location = dirname(self.url.uri) - - self.fetch_actionsfile() - self.fetch_patches() - self.fetch_comarfiles() - self.fetch_additionalFiles() - - return self.destdir - - def fetch_actionsfile(self): - actionsuri = join(self.specdiruri, ctx.const.actions_file) - self.download(actionsuri, self.destdir) - - def fetch_patches(self): - spec = self.spec - for patch in spec.source.patches: - file_name = basename(patch.filename) - dir_name = dirname(patch.filename) - patchuri = join(self.specdiruri, - ctx.const.files_dir, dir_name, file_name) - self.download(patchuri, join(self.destdir, ctx.const.files_dir, dir_name)) - - def fetch_comarfiles(self): - spec = self.spec - for package in spec.packages: - for pcomar in package.providesComar: - comaruri = join(self.specdiruri, - ctx.const.comar_dir, pcomar.script) - self.download(comaruri, join(self.destdir, ctx.const.comar_dir)) - - def fetch_additionalFiles(self): - spec = self.spec - for pkg in spec.packages: - for afile in pkg.additionalFiles: - file_name = basename(afile.filename) - dir_name = dirname(afile.filename) - afileuri = join(self.specdiruri, - ctx.const.files_dir, dir_name, file_name) - self.download(afileuri, join(self.destdir, ctx.const.files_dir, dir_name)) - - def download(self, uri, transferdir): - # fix auth info and download - uri = File.make_uri(uri) - File.download(uri, transferdir) - - def fetch_component(self): - if not self.spec.source.partOf: - ctx.ui.warning(_('PartOf tag not defined, looking for component')) - diruri = parenturi(self.specuri.get_uri()) - parentdir = parenturi(diruri) - url = util.join_path(parentdir, 'component.xml') - progress = ctx.ui.Progress - if URI(url).is_remote_file(): - fetch_url(url, self.pkg_work_dir(), progress) - path = util.join_path(self.pkg_work_dir(), 'component.xml') - else: - if not os.path.exists(url): - raise Exception(_('Cannot find component.xml in upper directory')) - path = url - comp = component.Component() - comp.read(path) - ctx.ui.info(_('Source is part of %s component') % comp.name) - self.spec.source.partOf = comp.name - self.spec.override_tags() - - def fetch_source_archive(self): - ctx.ui.info(_("Fetching source from: %s") % self.spec.source.archive.uri) - self.sourceArchive.fetch() - ctx.ui.info(_("Source archive is stored: %s/%s") - %(ctx.config.archives_dir(), self.spec.source.archive.name)) - - def unpack_source_archive(self): - ctx.ui.info(_("Unpacking archive..."), noln = True) - self.sourceArchive.unpack() - ctx.ui.info(_(" unpacked (%s)") % self.pkg_work_dir()) - self.set_state("unpack") - - def run_setup_action(self): - # Run configure, build and install phase - ctx.ui.action(_("Setting up source...")) - self.run_action_function(ctx.const.setup_func) - self.set_state("setupaction") - - def run_build_action(self): - ctx.ui.action(_("Building source...")) - self.run_action_function(ctx.const.build_func) - self.set_state("buildaction") - - def run_install_action(self): - ctx.ui.action(_("Installing...")) - - # Before install make sure install_dir is clean - if os.path.exists(self.pkg_install_dir()): - util.clean_dir(self.pkg_install_dir()) - - # install function is mandatory! - self.run_action_function(ctx.const.install_func, True) - self.set_state("installaction") - - def get_abandoned_files(self): - # return the files those are not collected from the install dir - - install_dir = self.pkg_dir() + ctx.const.install_dir_suffix - abandoned_files = [] - all_paths_in_packages = [] - - - for package in self.spec.packages: - for path in package.files: - map(lambda p: all_paths_in_packages.append(p), [p for p in glob.glob(install_dir + path.path)]) - - for root, dirs, files in os.walk(install_dir): - for file_ in files: - already_in_package = False - fpath = util.join_path(root, file_) - for path in all_paths_in_packages: - if not fpath.find(path): - already_in_package = True - if not already_in_package: - abandoned_files.append(fpath) - - return abandoned_files - - - def compile_action_script(self): - """Compiles actions.py and sets the actionLocals and actionGlobals""" - scriptfile = util.join_path(self.specdir, ctx.const.actions_file) - try: - localSymbols = globalSymbols = {} - buf = open(scriptfile).read() - exec compile(buf, "error", "exec") in localSymbols, globalSymbols - except IOError, e: - raise Error(_("Unable to read Action Script (%s): %s") %(scriptfile,e)) - except SyntaxError, e: - raise Error(_("SyntaxError in Action Script (%s): %s") %(scriptfile,e)) - - self.actionLocals = localSymbols - self.actionGlobals = globalSymbols - self.srcDir = self.pkg_src_dir() - - def pkg_src_dir(self): - """Returns the real path of WorkDir for an unpacked archive.""" - try: - workdir = self.actionGlobals['WorkDir'] - except KeyError: - workdir = self.spec.source.name + "-" + self.spec.source.version - - return util.join_path(self.pkg_work_dir(), workdir) - - def run_action_function(self, func, mandatory=False): - """Calls the corresponding function in actions.py. - - If mandatory parameter is True, and function is not present in - actionLocals pisi.build.Error will be raised.""" - # we'll need our working directory after actionscript - # finished its work in the archive source directory. - curDir = os.getcwd() - os.chdir(self.srcDir) - - - if func in self.actionLocals: - self.actionLocals[func]() - else: - if mandatory: - Error, _("unable to call function from actions: %s") %func - - os.chdir(curDir) - - def check_build_dependencies(self): - """check and try to install build dependencies, otherwise fail.""" - - build_deps = self.spec.source.buildDependencies - - if not ctx.get_option('bypass_safety'): - if ctx.componentdb.has_component('system.devel'): - build_deps_names = set([x.package for x in build_deps]) - devel_deps_names = set(ctx.componentdb.get_component('system.devel').packages) - extra_names = devel_deps_names - build_deps_names - extra_names = filter(lambda x: not ctx.installdb.is_installed(x), extra_names) - if extra_names: - ctx.ui.warning(_('Safety switch: following extra packages in system.devel will be installed: ') + - util.strlist(extra_names)) - extra_deps = [dependency.Dependency(package = x) for x in extra_names] - build_deps.extend(extra_deps) - else: - ctx.ui.warning(_('Safety switch: system.devel is already installed')) - else: - ctx.ui.warning(_('Safety switch: the component system.devel cannot be found')) - - # find out the build dependencies that are not satisfied... - dep_unsatis = [] - for dep in build_deps: - if not dependency.installed_satisfies_dep(dep): - dep_unsatis.append(dep) - - if dep_unsatis: - ctx.ui.info(_("Unsatisfied Build Dependencies:") + ' ' - + util.strlist([str(x) for x in dep_unsatis]) ) - - def fail(): - raise Error(_('Cannot build package due to unsatisfied build dependencies')) - - if ctx.config.get_option('no_install'): - fail() - - if not ctx.config.get_option('ignore_dependency'): - for dep in dep_unsatis: - if not dependency.repo_satisfies_dep(dep): - raise Error(_('Build dependency %s cannot be satisfied') % str(dep)) - if ctx.ui.confirm( - _('Do you want to install the unsatisfied build dependencies')): - ctx.ui.info(_('Installing build dependencies.')) - operations.install([dep.package for dep in dep_unsatis]) - else: - fail() - else: - ctx.ui.warning(_('Ignoring build dependencies.')) - - def patch_exists(self): - """check existence of patch files declared in PSPEC""" - - files_dir = os.path.abspath(util.join_path(self.specdir, - ctx.const.files_dir)) - for patch in self.spec.source.patches: - patchFile = util.join_path(files_dir, patch.filename) - if not os.access(patchFile, os.F_OK): - raise Error(_("Patch file is missing: %s\n") % patch.filename) - - def apply_patches(self): - files_dir = os.path.abspath(util.join_path(self.specdir, - ctx.const.files_dir)) - - for patch in self.spec.source.patches: - patchFile = util.join_path(files_dir, patch.filename) - if patch.compressionType: - patchFile = util.uncompress(patchFile, - compressType=patch.compressionType, - targetDir=ctx.config.tmp_dir()) - - ctx.ui.action(_("* Applying patch: %s") % patch.filename) - util.do_patch(self.srcDir, patchFile, level=patch.level, target=patch.target) - - def generate_static_package_object(self): - ar_files = [] - for root, dirs, files in os.walk(self.pkg_install_dir()): - for f in files: - if f.endswith(ctx.const.ar_file_suffix) and util.is_ar_file(util.join_path(root, f)): - ar_files.append(util.join_path(root, f)) - - if not len(ar_files): - return None - - static_package_obj = pisi.specfile.Package() - static_package_obj.name = self.spec.source.name + ctx.const.static_name_suffix - # FIXME: find a better way to deal with the summary and description constants. - static_package_obj.summary['en'] = u'Ar files for %s' % (self.spec.source.name) - static_package_obj.description['en'] = u'Ar files for %s' % (self.spec.source.name) - static_package_obj.partOf = self.spec.source.partOf - for f in ar_files: - static_package_obj.files.append(pisi.specfile.Path(path = f[len(self.pkg_install_dir()):], fileType = "library")) - - # append all generated packages to dependencies - for p in self.spec.packages: - static_package_obj.packageDependencies.append( - pisi.dependency.Dependency(package = p.name)) - - return static_package_obj - - def generate_debug_package_object(self): - debug_files = [] - for root, dirs, files in os.walk(self.pkg_debug_dir()): - for f in files: - if f.endswith(ctx.const.debug_file_suffix): - debug_files.append(util.join_path(root, f)) - - if not len(debug_files): - return None - - debug_package_obj = pisi.specfile.Package() - debug_package_obj.debug_package = True - debug_package_obj.name = self.spec.source.name + ctx.const.debug_name_suffix - # FIXME: find a better way to deal with the summary and description constants. - debug_package_obj.summary['en'] = u'Debug files for %s' % (self.spec.source.name) - debug_package_obj.description['en'] = u'Debug files for %s' % (self.spec.source.name) - debug_package_obj.partOf = self.spec.source.partOf + '-debug' - for f in debug_files: - debug_package_obj.files.append(pisi.specfile.Path(path = f[len(self.pkg_debug_dir()):], fileType = "debug")) - - # append all generated packages to dependencies - for p in self.spec.packages: - debug_package_obj.packageDependencies.append( - pisi.dependency.Dependency(package = p.name)) - - return debug_package_obj - - def strip_install_dir(self): - """strip install directory""" - ctx.ui.action(_("Stripping files..")) - install_dir = self.pkg_install_dir() - try: - nostrip = self.actionGlobals['NoStrip'] - util.strip_directory(install_dir, nostrip) - except KeyError: - util.strip_directory(install_dir) - - def gen_metadata_xml(self, package, build_no=None): - """Generate the metadata.xml file for build source. - - metadata.xml is composed of the information from specfile plus - some additional information.""" - metadata = MetaData() - metadata.from_spec(self.spec.source, package) - - metadata.package.distribution = ctx.config.values.general.distribution - metadata.package.distributionRelease = ctx.config.values.general.distribution_release - metadata.package.architecture = "Any" - metadata.package.packageFormat = ctx.get_option('package_format') - - size = 0 - if package.debug_package: - d = self.pkg_debug_dir() - else: - d = self.pkg_install_dir() - - for path in package.files: - for p in glob.glob(util.join_path(d, path.path)): - size += util.dir_size(p) - - metadata.package.installedSize = size - - metadata.package.build = build_no - - metadata_xml_path = util.join_path(self.pkg_dir(), ctx.const.metadata_xml) - metadata.write(metadata_xml_path) - self.metadata = metadata - - - def gen_files_xml(self, package): - """Generates files.xml using the path definitions in specfile and - the files produced by the build system.""" - files = Files() - - if package.debug_package: - install_dir = self.pkg_debug_dir() - else: - install_dir = self.pkg_install_dir() - - # FIXME: We need to expand globs before trying to calculate hashes - # Not on the fly like now. - - # we'll exclude collisions in get_file_hashes. Having a - # collisions list is not wrong, we must just handle it :). - collisions = check_path_collision(package, self.spec.packages) - # FIXME: material collisions after expanding globs could be - # reported as errors - - d = {} - def add_path(path): - # add the files under material path - for fpath, fhash in util.get_file_hashes(path, collisions, install_dir): - if ctx.get_option('create_static') \ - and fpath.endswith(ctx.const.ar_file_suffix) \ - and not package.name.endswith(ctx.const.static_name_suffix) \ - and util.is_ar_file(fpath): - # if this is an ar file, and this package is not a static package, - # don't include this file into the package. - continue - frpath = util.removepathprefix(install_dir, fpath) # relative path - ftype, permanent = get_file_type(frpath, package.files, install_dir) - fsize = util.dir_size(fpath) - d[frpath] = FileInfo(path=frpath, type=ftype, permanent=permanent, - size=fsize, hash=fhash) - - for pinfo in package.files: - wildcard_path = util.join_path(install_dir, pinfo.path) - for path in glob.glob(wildcard_path): - add_path(path) - - for (p, fileinfo) in d.iteritems(): - files.append(fileinfo) - - files_xml_path = util.join_path(self.pkg_dir(), ctx.const.files_xml) - files.write(files_xml_path) - self.files = files - - def calc_build_no(self, package_name): - """Calculate build number""" - # find previous build in packages dir - found = [] - def locate_old_package(old_package_fn): - if util.is_package_name(os.path.basename(old_package_fn), package_name): - try: - old_pkg = Package(old_package_fn, 'r') - old_pkg.read(util.join_path(ctx.config.tmp_dir(), 'oldpkg')) - ctx.ui.info(_('(found old version %s)') % old_package_fn) - if str(old_pkg.metadata.package.name) != package_name: - ctx.ui.warning(_('Skipping %s with wrong pkg name ') % - old_package_fn) - return - old_build = old_pkg.metadata.package.build - found.append( (old_package_fn, old_build) ) - except: - ctx.ui.warning('Package file %s may be corrupt. Skipping.' % old_package_fn) - - for root, dirs, files in os.walk(ctx.config.packages_dir()): - for file in files: - locate_old_package(join(root,file)) - - outdir=ctx.get_option('output_dir') - if not outdir: - outdir = '.' - for file in [join(outdir,entry) for entry in os.listdir(outdir)]: - if os.path.isfile(file): - locate_old_package(file) - - if not found: - return (1, None) - ctx.ui.warning(_('(no previous build found, setting build no to 1.)')) - else: - a = filter(lambda (x,y): y != None, found) - ctx.ui.debug(str(a)) - if a: - # sort in order of increasing build number - a.sort(lambda x,y : cmp(x[1],y[1])) - old_package_fn = a[-1][0] # get the last one - old_build = a[-1][1] - - # compare old files.xml with the new one.. - old_pkg = Package(old_package_fn, 'r') - old_pkg.read(util.join_path(ctx.config.tmp_dir(), 'oldpkg')) - - # FIXME: TAKE INTO ACCOUNT MINOR CHANGES IN METADATA - changed = False - fnew = self.files.list - fold = old_pkg.files.list - fold.sort(lambda x,y : cmp(x.path,y.path)) - fnew.sort(lambda x,y : cmp(x.path,y.path)) - - if len(fnew) != len(fold): - changed = True - else: - for i in range(len(fold)): - fo = fold.pop(0) - fn = fnew.pop(0) - if fo.path != fn.path: - changed = True - break - else: - if fo.hash != fn.hash: - changed = True - break - else: # no old build had a build number - old_build = None - - ctx.ui.debug('old build number: %s' % old_build) - - # set build number - if old_build is None: - ctx.ui.warning(_('(old package lacks a build no, setting build no to 1.)')) - return (1, None) - elif changed: - ctx.ui.info(_('There are changes, incrementing build no to %d') % (old_build + 1)) - return (old_build + 1, old_build) - else: - ctx.ui.info(_('There is no change from previous build %d') % old_build) - return (old_build, old_build) - - def build_packages(self): - """Build each package defined in PSPEC file. After this process there - will be .pisi files hanging around, AS INTENDED ;)""" - - self.fetch_component() # bug 856 - - # Strip install directory before building .pisi packages. - self.strip_install_dir() - - if ctx.get_option('create_static'): - obj = self.generate_static_package_object() - if obj: - self.spec.packages.append(obj) - - if ctx.config.values.build.generatedebug: - obj = self.generate_debug_package_object() - if obj: - self.spec.packages.append(obj) - - new_packages = [] - old_package_names = [] - - for package in self.spec.packages: - old_package_name = None - # store additional files - c = os.getcwd() - os.chdir(self.specdir) - install_dir = self.pkg_dir() + ctx.const.install_dir_suffix - for afile in package.additionalFiles: - src = os.path.join(ctx.const.files_dir, afile.filename) - dest = os.path.join(install_dir + os.path.dirname(afile.target), os.path.basename(afile.target)) - util.copy_file(src, dest) - if afile.permission: - # mode is octal! - os.chmod(dest, int(afile.permission, 8)) - os.chdir(c) - - ctx.ui.action(_("** Building package %s") % package.name); - - ctx.ui.info(_("Generating %s,") % ctx.const.files_xml) - self.gen_files_xml(package) - - - # build number - if ctx.config.options.ignore_build_no or not ctx.config.values.build.buildno: - build_no = old_build_no = None - ctx.ui.warning(_('Build number is not available. For repo builds you must enable buildno in pisi.conf.')) - else: - build_no, old_build_no = self.calc_build_no(package.name) - - ctx.ui.info(_("Generating %s,") % ctx.const.metadata_xml) - self.gen_metadata_xml(package, build_no) - - # Calculate new and oldpackage names for buildfarm - name = util.package_name(package.name, - self.spec.source.version, - self.spec.source.release, - self.metadata.package.build) - - if old_build_no: - old_package_name = util.package_name(package.name, - self.spec.source.version, - self.spec.source.release, - old_build_no) - old_package_names.append(old_package_name) - - outdir = ctx.get_option('output_dir') - if outdir: - name = pisi.util.join_path(outdir, name) - new_packages.append(name) - - ctx.ui.info(_("Creating PISI package %s.") % name) - - pkg = Package(name, 'w') - - # add comar files to package - os.chdir(self.specdir) - for pcomar in package.providesComar: - fname = util.join_path(ctx.const.comar_dir, - pcomar.script) - pkg.add_to_package(fname) - - # add xmls and files - os.chdir(self.pkg_dir()) - - pkg.add_to_package(ctx.const.metadata_xml) - pkg.add_to_package(ctx.const.files_xml) - - # Now it is time to add files to the packages using newly - # created files.xml - files = Files() - files.read(ctx.const.files_xml) - - if ctx.get_option('package_format') == "1.0": - for finfo in files.list: - orgname = arcname = join("install", finfo.path) - if package.debug_package: - orgname = join("debug", finfo.path) - pkg.add_to_package(orgname, arcname) - pkg.close() - else: # default package format is 1.1, so make it fallback. - ctx.build_leftover = join(self.pkg_dir(), ctx.const.install_tar_lzma) - tar = archive.ArchiveTar(ctx.const.install_tar_lzma, "tarlzma") - for finfo in files.list: - orgname = arcname = join("install", finfo.path) - if package.debug_package: - orgname = join("debug", finfo.path) - tar.add_to_archive(orgname, arcname.lstrip("install")) - tar.close() - pkg.add_to_package(ctx.const.install_tar_lzma) - pkg.close() - os.unlink(ctx.const.install_tar_lzma) - ctx.build_leftover = None - - os.chdir(c) - self.set_state("buildpackages") - ctx.ui.info(_("Done.")) - - #show the files those are not collected from the install dir - if ctx.get_option('show_abandoned_files') or ctx.get_option('debug'): - abandoned_files = self.get_abandoned_files() - if abandoned_files: - ctx.ui.warning(_('Abandoned files under the install dir (%s):') % (install_dir)) - for f in abandoned_files: - ctx.ui.info(' - %s' % (f)) - else: - ctx.ui.warning(_('All of the files under the install dir (%s) has been collected by package(s)') - % (install_dir)) - - if ctx.config.values.general.autoclean is True: - ctx.ui.info(_("Cleaning Build Directory...")) - util.clean_dir(self.pkg_dir()) - else: - ctx.ui.info(_("Keeping Build Directory")) - - - # reset environment variables after build. this one is for - # buildfarm actually. buildfarm re-inits pisi for each build - # and left environment variables go directly into initial dict - # making actionsapi.variables.exportFlags() useless... - os.environ = {} - os.environ = deepcopy(ctx.config.environ) - - return new_packages, old_package_names - - -# build functions... - -def build(pspec): - if pspec.endswith('.xml'): - pb = Builder(pspec) - else: - pb = Builder.from_name(pspec) - return pb.build() - -order = {"none": 0, - "unpack": 1, - "setupaction": 2, - "buildaction": 3, - "installaction": 4, - "buildpackages": 5} - -def __buildState_unpack(pb): - # unpack is the first state to run. - pb.fetch_source_archive() - pb.unpack_source_archive() - pb.apply_patches() - -def __buildState_setupaction(pb, last): - - if order[last] < order["unpack"]: - __buildState_unpack(pb) - pb.run_setup_action() - -def __buildState_buildaction(pb, last): - - if order[last] < order["setupaction"]: - __buildState_setupaction(pb, last) - pb.run_build_action() - -def __buildState_installaction(pb, last): - - if order[last] < order["buildaction"]: - __buildState_buildaction(pb, last) - pb.run_install_action() - -def __buildState_buildpackages(pb, last): - - if order[last] < order["installaction"]: - __buildState_installaction(pb, last) - pb.build_packages() - -def build_until(pspec, state): - if pspec.endswith('.xml'): - pb = Builder(pspec) - else: - pb = Builder.from_name(pspec) - - pb.compile_action_script() - - last = pb.get_state() - ctx.ui.info("Last state was %s"%last) - - if not last: last = "none" - - if state == "unpack": - __buildState_unpack(pb) - return - - if state == "setup": - __buildState_setupaction(pb, last) - return - - if state == "build": - __buildState_buildaction(pb, last) - return - - if state == "install": - __buildState_installaction(pb, last) - return - - __buildState_buildpackages(pb, last) diff --git a/tags/pisi-1.1_beta13/pisi/cli/README b/tags/pisi-1.1_beta13/pisi/cli/README deleted file mode 100644 index 5ad52a09..00000000 --- a/tags/pisi-1.1_beta13/pisi/cli/README +++ /dev/null @@ -1,23 +0,0 @@ -Writing commands: ------------------ - -TODO: this is a *bit* out of date now. - -Subclass from Command. - -Be careful not to import PiSi modules before Command is run, e.g. -do it in run() method. This is necessary to prevent an obscure -initialization error. - -We used to import pisi.operations in pisi.cli - -This prevented pisi.operations from having the current global -pisi.ui.ui because it's loaded before the UI is set! So, despite -what you might understand from the python FAQ 1.2.3 -http://www.python.org/doc/faq/programming.html#how-do-i-share-global-variables-across-modules -you have to be careful about the initialization order when using -singleton modules. - -Another way to solve this is to ensure that the global module is -always imported again in every function it is called (see -ui.CLI.confirm() ) but this is more expensive. diff --git a/tags/pisi-1.1_beta13/pisi/cli/__init__.py b/tags/pisi-1.1_beta13/pisi/cli/__init__.py deleted file mode 100644 index 3ec6856d..00000000 --- a/tags/pisi-1.1_beta13/pisi/cli/__init__.py +++ /dev/null @@ -1,158 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# - -import sys -import logging -import locale - -import gettext -__trans = gettext.translation('pisi', fallback=True) -_ = __trans.ugettext - -import pisi -import pisi.context as ctx -from pisi.ui import UI -import pisi.ui as ui -import pisi.util as util -from pisi.cli.colors import colorize - - -class Error(pisi.Error): - pass - - -class Exception(pisi.Exception): - pass - - -def printu(obj, err = False): - if not isinstance(obj, unicode): - obj = unicode(obj) - if err: - out = sys.stderr - else: - out = sys.stdout - out.write(obj.encode('utf-8')) - out.flush() - -class CLI(UI): - "Command Line Interface" - - def __init__(self, show_debug = False, show_verbose = False): - super(CLI, self).__init__(show_debug, show_verbose) - - def close(self): - util.xterm_title_reset() - - def output(self, msg, err = False, verbose = False): - if (verbose and self.show_verbose) or (not verbose): - if type(msg)==type(unicode()): - msg = msg.encode('utf-8') - if err: - out = sys.stderr - else: - out = sys.stdout - out.write(msg) - out.flush() - - def info(self, msg, verbose = False, noln = False): - # TODO: need to look at more kinds of info messages - # let's cheat from KDE :) - if not noln: - msg += '\n' - self.output(unicode(msg), verbose=verbose) - - def warning(self, msg, verbose = False): - msg = unicode(msg) - if ctx.log: - ctx.log.warning(msg) - if ctx.get_option('no_color'): - self.output(_('Warning: ') + msg + '\n', err=True, verbose=verbose) - else: - self.output(colorize(msg + '\n', 'purple'), err=True, verbose=verbose) - - def error(self, msg): - msg = unicode(msg) - if ctx.log: - ctx.log.error(msg) - if ctx.get_option('no_color'): - self.output(_('Error: ') + msg + '\n', err=True) - else: - self.output(colorize(msg + '\n', 'red'), err=True) - - def action(self, msg, verbose = False): - #TODO: this seems quite redundant? - msg = unicode(msg) - if ctx.log: - ctx.log.info(msg) - self.output(colorize(msg + '\n', 'green')) - - def choose(self, msg, opts): - print msg - for i in range(0,len(opts)): - print i + 1, opts(i) - while True: - s = raw_input(msg + colorize('1-%d' % len(opts), 'red')) - try: - opt = int(s) - if 1 <= opt and opt <= len(opts): - return opts(opt-1) - except (Exception,e): - pass - - def confirm(self, msg): - msg = unicode(msg) - if ctx.config.options and ctx.config.options.yes_all: - return True - while True: - import re - yesexpr = re.compile(locale.nl_langinfo(locale.YESEXPR)) - - prompt = msg + colorize(_(' (yes/no)'), 'red') - s = raw_input(prompt.encode('utf-8')) - if yesexpr.search(s): - return True - - return False - - def display_progress(self, **ka): - totalsize = '%.1f %s' % pisi.util.human_readable_size(ka['total_size']) - out = '\r%-30.30s (%s)%3d%% %9.2f %s [%s]' % \ - (ka['filename'], totalsize, ka['percent'], - ka['rate'], ka['symbol'], ka['eta']) - self.output(out) - if ka['percent'] == 100: - self.output(colorize(_(' [complete]\n'), 'gray')) - - def status(self, msg = None): - if msg: - msg = unicode(msg) - self.output(colorize(msg + '\n', 'purple')) - util.xterm_title(msg) - - def notify(self, event, **keywords): - if event == ui.installed: - msg = _('Installed %s') % keywords['package'].name - elif event == ui.removed: - msg = _('Removed %s') % keywords['package'].name - elif event == ui.upgraded: - msg = _('Upgraded %s') % keywords['package'].name - elif event == ui.configured: - msg = _('Configured %s') % keywords['package'].name - elif event == ui.extracting: - msg = _('Extracting the files of %s') % keywords['package'].name - else: - msg = None - if msg: - self.output(colorize(msg + '\n', 'cyan')) - if ctx.log: - ctx.log.info(msg) diff --git a/tags/pisi-1.1_beta13/pisi/cli/colors.py b/tags/pisi-1.1_beta13/pisi/cli/colors.py deleted file mode 100644 index 12fd4911..00000000 --- a/tags/pisi-1.1_beta13/pisi/cli/colors.py +++ /dev/null @@ -1,64 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# - -# Colors module provides some color codes for console output. - -import pisi.context as ctx - -colors = {'black' : "\033[30m", - 'red' : "\033[31m", - 'green' : "\033[32m", - 'yellow' : "\033[33m", - 'blue' : "\033[34m", - 'purple' : "\033[35m", - 'cyan' : "\033[36m", - 'white' : "\033[37m", - 'brightblack' : "\033[01;30m", - 'brightred' : "\033[01;31m", - 'brightgreen' : "\033[01;32m", - 'brightyellow' : "\033[01;33m", - 'brightblue' : "\033[01;34m", - 'brightmagenta' : "\033[01;35m", - 'brightcyan' : "\033[01;36m", - 'brightwhite' : "\033[01;37m", - 'underlineblack' : "\033[04;30m", - 'underlinered' : "\033[04;31m", - 'underlinegreen' : "\033[04;32m", - 'underlineyellow' : "\033[04;33m", - 'underlineblue' : "\033[04;34m", - 'underlinemagenta' : "\033[04;35m", - 'underlinecyan' : "\033[04;36m", - 'underlinewhite' : "\033[04;37m", - 'blinkingblack' : "\033[05;30m", - 'blinkingred' : "\033[05;31m", - 'blinkinggreen' : "\033[05;32m", - 'blinkingyellow' : "\033[05;33m", - 'blinkingblue' : "\033[05;34m", - 'blinkingmagenta' : "\033[05;35m", - 'blinkingcyan' : "\033[05;36m", - 'blinkingwhite' : "\033[05;37m", - 'backgroundblack' : "\033[07;30m", - 'backgroundred' : "\033[07;31m", - 'backgroundgreen' : "\033[07;32m", - 'backgroundyellow' : "\033[07;33m", - 'backgroundblue' : "\033[07;34m", - 'backgroundmagenta' : "\033[07;35m", - 'backgroundcyan' : "\033[07;36m", - 'backgroundwhite' : "\033[07;37m", - 'default' : "\033[0m" } - -def colorize(msg, color): - """Colorize the given message for console output""" - if colors.has_key(color) and not ctx.get_option('no_color'): - return colors[color] + msg + colors['default'] - else: - return msg diff --git a/tags/pisi-1.1_beta13/pisi/cli/commands.py b/tags/pisi-1.1_beta13/pisi/cli/commands.py deleted file mode 100644 index c005d7be..00000000 --- a/tags/pisi-1.1_beta13/pisi/cli/commands.py +++ /dev/null @@ -1,1362 +0,0 @@ -# -*- coding:utf-8 -*- -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# - -import sys -from optparse import OptionParser - -import gettext -__trans = gettext.translation('pisi', fallback=True) -_ = __trans.ugettext - -import pisi -import pisi.cli -import pisi.context as ctx -from pisi.uri import URI -import pisi.util as util -import pisi.api as api -import pisi.packagedb as packagedb -from colors import colorize - -class Error(pisi.Error): - pass - - -class Command(object): - """generic help string for any command""" - - # class variables - - cmd = [] - cmd_dict = {} - - @staticmethod - def commands_string(): - s = '' - list = [x.name[0] for x in Command.cmd] - list.sort() - for name in list: - commandcls = Command.cmd_dict[name] - trans = gettext.translation('pisi', fallback=True) - summary = trans.ugettext(commandcls.__doc__).split('\n')[0] - name = commandcls.name[0] - if commandcls.name[1]: - name += ' (%s)' % commandcls.name[1] - s += '%21s - %s\n' % (name, summary) - return s - - @staticmethod - def get_command(cmd, fail=False, args=None): - - if Command.cmd_dict.has_key(cmd): - return Command.cmd_dict[cmd](args) - - if fail: - raise Error(_("Unrecognized command: %s") % cmd) - else: - return None - - # instance variabes - - def __init__(self, args = None): - # now for the real parser - import pisi - self.comar = False - self.parser = OptionParser(usage=getattr(self, "__doc__"), - version="%prog " + pisi.__version__) - self.options() - self.commonopts() - (self.options, self.args) = self.parser.parse_args(args) - if self.args: - self.args.pop(0) # exclude command arg - - self.process_opts() - - def commonopts(self): - '''common options''' - p = self.parser - p.add_option("-D", "--destdir", action="store", default = None, - help = _("change the system root for pisi commands")) - p.add_option("-y", "--yes-all", action="store_true", - default=False, help = _("assume yes in all yes/no queries")) - p.add_option("-u", "--username", action="store") - p.add_option("-p", "--password", action="store") - p.add_option("-v", "--verbose", action="store_true", - dest="verbose", default=False, - help=_("detailed output")) - p.add_option("-d", "--debug", action="store_true", - default=False, help=_("show debugging information")) - p.add_option("-N", "--no-color", action="store_true", default=False, - help = _("print like a man")) - return p - - def options(self): - """This is a fall back function. If the implementer module provides an - options function it will be called""" - pass - - def process_opts(self): - self.check_auth_info() - - # make destdir absolute - if self.options.destdir: - dir = str(self.options.destdir) - import os.path - if not os.path.exists(dir): - pisi.cli.printu(_('Destination directory %s does not exist. Creating directory.\n') % dir) - os.makedirs(dir) - self.options.destdir = os.path.realpath(dir) - - def check_auth_info(self): - username = self.options.username - password = self.options.password - - # TODO: We'll get the username, password pair from a configuration - # file from users home directory. Currently we need user to - # give it from the user interface. - # if not username and not password: - # if someauthconfig.username and someauthconfig.password: - # self.authInfo = (someauthconfig.username, - # someauthconfig.password) - # return - if username and password: - self.options.authinfo = (username, password) - return - - if username and not password: - from getpass import getpass - password = getpass(_("Password: ")) - self.options.authinfo = (username, password) - else: - self.options.authinfo = None - - def init(self, database = True, write = True): - """initialize PiSi components""" - - # NB: command imports here or in the command class run fxns - import pisi.api - pisi.api.init(database = database, write = write, options = self.options, - comar = self.comar) - - def finalize(self): - """do cleanup work for PiSi components""" - pisi.api.finalize() - - def get_name(self): - return self.__class__.name - - def format_name(self): - (name, shortname) = self.get_name() - if shortname: - return "%s (%s)" % (name, shortname) - else: - return name - - def help(self): - """print help for the command""" - print self.format_name() + ': ' - trans = gettext.translation('pisi', fallback=True) - print trans.ugettext(self.__doc__) + '\n' - print self.parser.format_option_help() - - def die(self): - """exit program""" - #FIXME: not called from anywhere? - ctx.ui.error(_('Command terminated abnormally.')) - sys.exit(-1) - - -class autocommand(type): - def __init__(cls, name, bases, dict): - super(autocommand, cls).__init__(name, bases, dict) - Command.cmd.append(cls) - name = getattr(cls, 'name', None) - if name is None: - raise pisi.cli.Error(_('Command lacks name')) - longname, shortname = name - def add_cmd(cmd): - if Command.cmd_dict.has_key(cmd): - raise pisi.cli.Error(_('Duplicate command %s') % cmd) - else: - Command.cmd_dict[cmd] = cls - add_cmd(longname) - if shortname: - add_cmd(shortname) - - -class Help(Command): - """Prints help for given commands - -Usage: help [ ... ] - -If run without parameters, it prints the general help.""" - - __metaclass__ = autocommand - - def __init__(self, args = None): - #TODO? Discard Help's own usage doc in favor of general usage doc - #self.__doc__ = usage_text - #self.__doc__ += commands_string() - super(Help, self).__init__(args) - - name = ("help", "?") - - def run(self): - - if not self.args: - self.parser.set_usage(usage_text) - pisi.cli.printu(self.parser.format_help()) - return - - self.init(database = False, write = False) - - for arg in self.args: - obj = Command.get_command(arg, True) - obj.help() - ctx.ui.info('') - - self.finalize() - - -class Clean(Command): - """Clean stale locks - -Usage: clean - -PISI uses filesystem locks for managing database access. -This command deletes unused locks from the database directory.""" - - __metaclass__ = autocommand - - def __init__(self, args=None): - super(Clean, self).__init__(args) - - name = ("clean", None) - - def run(self): - self.init() - pisi.util.clean_locks() - self.finalize() - - -class DeleteCache(Command): - """Delete cache files - -Usage: delete-cache - -Sources, packages and temporary files are stored -under /var directory. Since these accumulate they can -consume a lot of disk space.""" - - __metaclass__ = autocommand - - def __init__(self, args=None): - super(DeleteCache, self).__init__(args) - - name = ("delete-cache", "dc") - - def run(self): - self.init(database=False, write=True) - pisi.api.delete_cache() - - -class Graph(Command): - """Graph package relations - -Usage: graph [ ...] - -Write a graph of package relations, tracking dependency and -conflicts relations starting from given packages. By default -shows the package relations among repository packages, and writes -the package in graphviz format to 'pgraph.dot'. -""" - - __metaclass__ = autocommand - - def __init__(self, args=None): - super(Graph, self).__init__(args) - - def options(self): - self.parser.add_option("-r", "--repository", action="store", - default=None, - help=_("specify a particular repository")) - self.parser.add_option("-i", "--installed", action="store_true", - default=False, - help=_("graph of installed packages")) - self.parser.add_option("", "--ignore-installed", action="store_true", - default=False, - help=_("do not show installed packages")) - self.parser.add_option("-o", "--output", action="store", - default='pgraph.dot', - help=_("dot output file")) - - name = ("graph", None) - - def run(self): - self.init(write=False) - if not ctx.get_option('installed'): - if ctx.get_option('repository'): - repo = ctx.get_option('repository') - ctx.ui.info(_('Plotting packages in repository %s') % repo) - else: - repo = pisi.itembyrepodb.repos - if self.args: - a = self.args - else: - ctx.ui.info(_('Plotting a graph of relations among all repository packages')) - a = ctx.packagedb.list_packages(repo) - else: - if self.args: - a = self.args - else: - # if A is empty, then graph all packages - ctx.ui.info(_('Plotting a graph of relations among all installed packages')) - a = ctx.installdb.list_installed() - repo = pisi.itembyrepodb.installed - g = pisi.api.package_graph(a, repo = repo, - ignore_installed = ctx.get_option('ignore_installed')) - g.write_graphviz(file(ctx.get_option('output'), 'w')) - self.finalize() - -# option mixins - -def buildno_opts(self): - self.parser.add_option("", "--ignore-build-no", action="store_true", - default=False, - help=_("do not take build no into account.")) - -def abandoned_files_opt(self): - self.parser.add_option("", "--show-abandoned-files", action="store_true", - default=False, - help=_("show abandoned files under the install directory after build.")) - -def ignoredep_opt(self): - p = self.parser - p.add_option("-E", "--ignore-dependency", action="store_true", - default=False, - help=_("do not take dependency information into account")) - - -class Build(Command): - """Build PISI packages - -Usage: build [ | ] ... - -You can give a URI of the pspec.xml file. PISI will -fetch all necessary files and build the package for you. - -Alternatively, you can give the name of a source package -to be downloaded from a repository containing sources. - -If you would like to run the build process partially, -provide the --until option where is one of -unpack, setup, build, install, package. -""" - __metaclass__ = autocommand - - def __init__(self, args): - super(Build, self).__init__(args) - - name = ("build", "bi") - - steps = ('unpack', 'setup', 'build', 'install', 'package') - - package_formats = ('1.0', '1.1') - - def options(self): - buildno_opts(self) - abandoned_files_opt(self) - ignoredep_opt(self) - self.parser.add_option("-O", "--output-dir", action="store", default=None, - help=_("output directory for produced packages")) - #self.parser.add_option("-s", "--step", action="store", default=None, - # help=_("perform only specified step")) - self.parser.add_option("-U", "--until", action="store", default=None, - help=_("perform until and including specified step")) - self.parser.add_option("-A", "--ignore-action-errors", - action="store_true", default=False, - help=_("bypass errors from ActionsAPI")) - self.parser.add_option("-S", "--bypass-safety", action="store_true", - default=False, help=_("bypass safety switch")) - self.parser.add_option("", "--ignore-file-conflicts", action="store_true", - default=False, help=_("Ignore file conflicts")) - self.parser.add_option("-B", "--ignore-comar", action="store_true", - default=False, help=_("bypass comar configuration agent")) - self.parser.add_option("", "--create-static", action="store_true", - default=False, help=_("create a static package with ar files")) - self.parser.add_option("", "--no-install", action="store_true", - default=False, help=_("don't install build dependencies, fail if a build dependency is present")) - self.parser.add_option("-F", "--package-format", action="store", default='1.1', - help=_("pisi package format")) - - def run(self): - if not self.args: - self.help() - return - - # We cant use ctx.get_option as we didn't init PiSi - # currently... - if self.options.until: - if not self.options.until in Build.steps: - raise Error(_('Step must be one of %s ') % pisi.util.strlist(Build.steps)) - - if self.options.no_install: - self.init(database=True, write=False) - else: - self.init() - - if ctx.get_option('package_format') not in Build.package_formats: - raise Error(_('package_format must be one of %s ') % pisi.util.strlist(Build.package_formats)) - - if ctx.get_option('output_dir'): - ctx.ui.info(_('Output directory: %s') % ctx.config.options.output_dir) - else: - ctx.ui.info(_('Outputting packages in the working directory.')) - ctx.config.options.output_dir = '.' - - for x in self.args: - if ctx.get_option('until'): - pisi.api.build_until(x, ctx.get_option('until')) - else: - pisi.api.build(x) - self.finalize() - - -class Emerge(Build): - """Build and install PISI source packages from repository - -Usage: emerge ... - -You should give the name of a source package to be -downloaded from a repository containing sources. - -You can also give the name of a component. -""" - __metaclass__ = autocommand - - def __init__(self, args): - super(Emerge, self).__init__(args) - self.comar = True - - name = ("emerge", "em") - - def options(self): - Build.options(self) - - def run(self): - if not self.args: - self.help() - return - - self.init(database = True) - if ctx.get_option('output_dir'): - ctx.ui.info(_('Output directory: %s') % ctx.config.options.output_dir) - else: - ctx.ui.info(_('Outputting binary packages in the package cache.')) - ctx.config.options.output_dir = ctx.config.packages_dir() - - pisi.api.emerge(self.args) - self.finalize() - - -class PackageOp(Command): - """Abstract package operation command""" - - def __init__(self, args): - super(PackageOp, self).__init__(args) - self.comar = True - - def options(self): - p = self.parser - p.add_option("-B", "--ignore-comar", action="store_true", - default=False, help=_("bypass comar configuration agent")) - p.add_option("-S", "--bypass-safety", action="store_true", - default=False, help=_("bypass safety switch")) - p.add_option("-n", "--dry-run", action="store_true", default=False, - help = _("do not perform any action, just show what would be done")) - ignoredep_opt(self) - - def init(self): - super(PackageOp, self).init(True) - - def finalize(self): - #self.finalize_db() - pass - - -class Install(PackageOp): - """Install PISI packages - -Usage: install ... - -You may use filenames, URI's or package names for packages. If you have -specified a package name, it should exist in a specified repository. - -You can also specify components instead of package names, which will be -expanded to package names. -""" - __metaclass__ = autocommand - - def __init__(self, args): - super(Install, self).__init__(args) - - name = "install", "it" - - def options(self): - super(Install, self).options() - p = self.parser - p.add_option("", "--reinstall", action="store_true", - default=False, help=_("Reinstall already installed packages")) - p.add_option("", "--ignore-file-conflicts", action="store_true", - default=False, help=_("Ignore file conflicts")) - buildno_opts(self) - - def run(self): - if not self.args: - self.help() - return - - self.init() - pisi.api.install(self.args, ctx.get_option('reinstall')) - self.finalize() - - -class Upgrade(PackageOp): - """Upgrade PISI packages - -Usage: Upgrade [ ... ] - -: package name - -Upgrades the entire system if no package names are given - -You may use only package names to specify packages because -the package upgrade operation is defined only with respect -to repositories. If you have specified a package name, it -should exist in the package repositories. If you just want to -reinstall a package from a pisi file, use the install command. - -You can also specify components instead of package names, which will be -expanded to package names. -""" - - __metaclass__ = autocommand - - def __init__(self, args): - super(Upgrade, self).__init__(args) - - name = ("upgrade", "up") - - def options(self): - super(Upgrade, self).options() - buildno_opts(self) - p = self.parser - p.add_option("", "--security", action="store_true", - default=False, help=_("select only security upgrades")) - p.add_option("-r", "--bypass-update-repo", action="store_true", - default=False, help=_("Do not update repositories")) - p.add_option("", "--ignore-file-conflicts", action="store_true", - default=False, help=_("Ignore file conflicts")) - p.add_option("-e", "--eager", action="store_true", - default=False, help=_("eager upgrades")) - - def run(self): - self.init() - - if not ctx.get_option('bypass_update_repo'): - ctx.ui.info(_('Updating repositories')) - repos = ctx.repodb.list() - for repo in repos: - pisi.api.update_repo(repo) - else: - ctx.ui.info(_('Will not update repositories')) - - if not self.args: - packages = ctx.installdb.list_installed() - else: - packages = self.args - - pisi.api.upgrade(packages) - self.finalize() - - -class Remove(PackageOp): - """Remove PISI packages - -Usage: remove ... - -Remove package(s) from your system. Just give the package names to remove. - -You can also specify components instead of package names, which will be -expanded to package names. -""" - __metaclass__ = autocommand - - def __init__(self, args): - super(Remove, self).__init__(args) - - name = ("remove", "rm") - - def run(self): - if not self.args: - self.help() - return - - self.init() - pisi.api.remove(self.args) - self.finalize() - - -class ConfigurePending(PackageOp): - """Configure pending packages - -If COMAR configuration of some packages were not -done at installation time, they are added to a list -of packages waiting to be configured. This command -configures those packages. -""" - - __metaclass__ = autocommand - - def __init__(self, args): - super(ConfigurePending, self).__init__(args) - - name = ("configure-pending", "cp") - - def run(self): - - self.init() - pisi.api.configure_pending() - self.finalize() - - -class Info(Command): - """Display package information - -Usage: info ... - - is either a package name or a .pisi file, -""" - __metaclass__ = autocommand - - def __init__(self, args): - super(Info, self).__init__(args) - - name = ("info", None) - - def options(self): - self.parser.add_option("-f", "--files", action="store_true", - default=False, - help=_("show a list of package files.")) - self.parser.add_option("-F", "--files-path", action="store_true", - default=False, - help=_("show only paths.")) - self.parser.add_option("-s", "--short", action="store_true", - default=False, help=_("do not show details")) - self.parser.add_option("", "--xml", action="store_true", - default=False, help=_("output in xml format")) - - def run(self): - - self.init(database = True, write = False) - - if len(self.args) == 0: - self.help() - return - - index = pisi.index.Index() - index.distribution = None - - for arg in self.args: - if ctx.componentdb.has_component(arg): - component = ctx.componentdb.get_union_comp(arg) - if self.options.xml: - index.add_component(component) - else: - if not self.options.short: - ctx.ui.info(unicode(component)) - else: - ctx.ui.info("%s - %s" % (component.name, component.summary)) - else: # then assume it was a package - if self.options.xml: - index.packages.append(pisi.api.info(arg)[0].package) - else: - self.info_package(arg) - if self.options.xml: - errs = [] - index.newDocument() - index.encode(index.rootNode(), errs) - index.writexmlfile(sys.stdout) - sys.stdout.write('\n') - self.finalize() - - - def info_package(self, arg): - if arg.endswith(ctx.const.package_suffix): - metadata, files = pisi.api.info_file(arg) - ctx.ui.info(_('Package file: %s') % arg) - self.print_pkginfo(metadata, files) - else: - if ctx.installdb.is_installed(arg): - metadata, files = pisi.api.info_name(arg, True) - if self.options.short: - ctx.ui.info(_('[inst] '), noln=True) - else: - ctx.ui.info(_('Installed package:')) - self.print_pkginfo(metadata, files,pisi.itembyrepodb.installed) - - if ctx.packagedb.has_package(arg): - metadata, files = pisi.api.info_name(arg, False) - if self.options.short: - ctx.ui.info(_('[repo] '), noln=True) - else: - ctx.ui.info(_('Package found in repository:')) - self.print_pkginfo(metadata, files, pisi.itembyrepodb.repos) - - def print_pkginfo(self, metadata, files, repo = None): - import os.path - - if ctx.get_option('short'): - pkg = metadata.package - ctx.ui.info('%15s - %s' % (pkg.name, unicode(pkg.summary))) - else: - ctx.ui.info(unicode(metadata.package)) - if repo: - revdeps = [x[0] for x in - ctx.packagedb.get_rev_deps(metadata.package.name, repo)] - print _('Reverse Dependencies:'), util.strlist(revdeps) - if self.options.files or self.options.files_path: - if files: - print _('\nFiles:') - files.list.sort(key = lambda x:x.path) - for fileinfo in files.list: - if self.options.files: - print fileinfo - else: - print fileinfo.path - else: - ctx.ui.warning(_('File information not available')) - if not self.options.short: - print - - -class Check(Command): - """Verify installation - -Usage: check [ ... ] - -: package name - -A cryptographic checksum is stored for each installed -file. Check command uses the checksums to verify a package. -Just give the names of packages. - -If no packages are given, checks all installed packages. -""" - __metaclass__ = autocommand - - def __init__(self, args): - super(Check, self).__init__(args) - - name = ("check", None) - - def run(self): - self.init(database = True, write = False) - if self.args: - pkgs = self.args - else: - ctx.ui.info(_('Checking all installed packages')) - pkgs = ctx.installdb.list_installed() - for pkg in pkgs: - if ctx.installdb.is_installed(pkg): - corrupt = pisi.api.check(pkg) - if corrupt: - ctx.ui.info(_('Package %s is corrupt.') % pkg) - else: - ctx.ui.info(_('Package %s not installed') % pkg) - self.finalize() - - -class Index(Command): - """Index PISI files in a given directory - -Usage: index ... - -This command searches for all PISI files in a directory, collects PISI -tags from them and accumulates the information in an output XML file, -named by default 'pisi-index.xml'. In particular, it indexes both -source and binary packages. - -If you give multiple directories, the command still works, but puts -everything in a single index file. -""" - __metaclass__ = autocommand - - def __init__(self, args): - super(Index, self).__init__(args) - - name = ("index", "ix") - - def options(self): - self.parser.add_option("-a", "--absolute-uris", action="store_true", - default=False, - help=_("store absolute links for indexed files.")) - self.parser.add_option("-o", "--output", action="store", - default='pisi-index.xml', - help=_("index output file")) - self.parser.add_option("-S", "--skip-sources", action="store_true", - default=False, - help=_("do not index pisi spec files.")) - self.parser.add_option("-G", "--skip-signing", action="store_true", - default=False, - help=_("do not sign index.")) - self.parser.add_option("-R", "--non-recursive", action="store_true", - default=False, - help=_("do not recurse into directories.")) - - def run(self): - - self.init(database = True, write = False) - from pisi.api import index - if len(self.args)>0: - index(self.args, ctx.get_option('output'), - skip_sources = ctx.get_option('skip_sources'), - skip_signing = ctx.get_option('skip_signing'), - non_recursive = ctx.get_option('non_recursive')) - elif len(self.args)==0: - ctx.ui.info(_('Indexing current directory.')) - index(['.'], ctx.get_option('output'), - skip_sources = ctx.get_option('skip_sources'), - skip_signing = ctx.get_option('skip_signing'), - non_recursive = ctx.get_option('non_recursive')) - self.finalize() - - -class ListInstalled(Command): - """Print the list of all installed packages - -Usage: list-installed -""" - - __metaclass__ = autocommand - - def __init__(self, args): - super(ListInstalled, self).__init__(args) - - name = ("list-installed", "li") - - def options(self): - self.parser.add_option("-l", "--long", action="store_true", - default=False, help=_("show in long format")) - self.parser.add_option("-i", "--install-info", action="store_true", - default=False, help=_("show detailed install info")) - - def run(self): - self.init(database = True, write = False) - list = ctx.installdb.list_installed() - list.sort() - if self.options.install_info: - ctx.ui.info(_('Package Name |St| Version| Rel.| Build| Distro| Date')) - print '========================================================================' - for pkg in list: - package = ctx.packagedb.get_package(pkg, pisi.itembyrepodb.installed) - inst_info = ctx.installdb.get_info(pkg) - if self.options.long: - ctx.ui.info(unicode(package)) - ctx.ui.info(unicode(inst_info)) - elif self.options.install_info: - ctx.ui.info('%-15s |%s' % (package.name, inst_info.one_liner())) - else: - ctx.ui.info('%15s - %s' % (package.name, unicode(package.summary))) - self.finalize() - - -class RebuildDb(Command): - """Rebuild Databases - -Usage: rebuilddb [ ... ] - -Rebuilds the PISI databases - -If package specs are given, they should be the names of package -dirs under /var/lib/pisi -""" - __metaclass__ = autocommand - - def __init__(self, args): - super(RebuildDb, self).__init__(args) - - name = ("rebuild-db", "rdb") - - def options(self): - self.parser.add_option("-f", "--files", action="store_true", - default=False, help=_("rebuild files database")) - - def run(self): - if self.args: - self.init(database=True) - for package_fn in self.args: - pisi.api.resurrect_package(package_fn, ctx.get_option('files`')) - else: - self.init(database=False) - if ctx.ui.confirm(_('Rebuild PISI databases?')): - pisi.api.rebuild_db(ctx.get_option('files')) - - self.finalize() - - -class UpdateRepo(Command): - """Update repository databases - -Usage: update-repo [ ... ] - -: repository name - -Synchronizes the PISI databases with the current repository. -If no repository is given, all repositories are updated. -""" - __metaclass__ = autocommand - - def __init__(self,args): - super(UpdateRepo, self).__init__(args) - - name = ("update-repo", "ur") - - def options(self): - self.parser.add_option("-f", "--force", action="store_true", - default=False, - help=_("update database in any case")) - - def run(self): - self.init(database = True) - - if self.args: - repos = self.args - else: - repos = ctx.repodb.list() - - for repo in repos: - pisi.api.update_repo(repo, ctx.get_option('force')) - self.finalize() - - -class AddRepo(Command): - """Add a repository - -Usage: add-repo - -: name of repository to add -: URI of index file - -If no repo is given, add-repo pardus-devel repo is added by default - -NB: We support only local files (e.g., /a/b/c) and http:// URIs at the moment -""" - __metaclass__ = autocommand - - def __init__(self, args): - super(AddRepo, self).__init__(args) - - name = ("add-repo", "ar") - - def options(self): - self.parser.add_option("", "--at", action="store", - type="int", default=None, - help=_("add repository at given position (0 is first)")) - - def run(self): - - if len(self.args)==2 or len(self.args)==0: - self.init() - if len(self.args)==2: - name = self.args[0] - indexuri = self.args[1] - else: - name = 'pardus-1-test' - indexuri = 'http://paketler.pardus.org.tr/pardus-1-test/pisi-index.xml.bz2' - pisi.api.add_repo(name, indexuri, ctx.get_option('at')) - if ctx.ui.confirm(_('Update PISI database for repository %s?') % name): - pisi.api.update_repo(name) - self.finalize() - else: - self.help() - return - - -class RemoveRepo(Command): - """Remove repositories - -Usage: remove-repo ... - -Remove all repository information from the system. -""" - __metaclass__ = autocommand - - def __init__(self,args): - super(RemoveRepo, self).__init__(args) - - name = ("remove-repo", "rr") - - def run(self): - - if len(self.args)>=1: - self.init() - for repo in self.args: - pisi.api.remove_repo(repo) - self.finalize() - else: - self.help() - return - - -class ListRepo(Command): - """List repositories - -Usage: list-repo - -Lists currently tracked repositories. -""" - __metaclass__ = autocommand - - def __init__(self, args): - super(ListRepo, self).__init__(args) - - name = ("list-repo", "lr") - - def run(self): - - self.init(database = True, write = False) - for repo in ctx.repodb.list(): - ctx.ui.info(repo) - print ' ', ctx.repodb.get_repo(repo).indexuri.get_uri() - self.finalize() - - -class ListAvailable(Command): - """List available packages in the repositories - -Usage: list-available [ ... repon ] - -Gives a brief list of PISI packages published in the specified -repositories. If no repository is specified, we list packages in -all repositories. -""" - __metaclass__ = autocommand - - def __init__(self, args): - super(ListAvailable, self).__init__(args) - - name = ("list-available", "la") - - def options(self): - self.parser.add_option("-l", "--long", action="store_true", - default=False, help=_("show in long format")) - self.parser.add_option("-U", "--uninstalled", action="store_true", - default=False, help=_("show uninstalled packages only")) - - def run(self): - - self.init(database = True, write = False) - - if not (ctx.get_option('no_color') or ctx.config.get_option('uninstalled')): - ctx.ui.info(colorize(_('Installed packages are shown in this color'), 'green')) - - if self.args: - for arg in self.args: - self.print_packages(arg) - else: - # print for all repos - for repo in ctx.repodb.list(): - ctx.ui.info(_("Repository : %s\n") % repo) - self.print_packages(repo) - self.finalize() - - def print_packages(self, repo): - from pisi import packagedb - - list = ctx.packagedb.list_packages(repo) - installed_list = ctx.installdb.list_installed() - list.sort() - for p in list: - package = ctx.packagedb.get_package(p) - if self.options.long: - ctx.ui.info(unicode(package)) - else: - lenp = len(p) - if p in installed_list: - if ctx.config.get_option('uninstalled'): - continue - p = colorize(p, 'green') - p = p + ' ' * max(0, 15 - lenp) - ctx.ui.info('%s - %s ' % (p, unicode(package.summary))) - - -class ListComponents(Command): - """List available components - -Usage: list-components - -Gives a brief list of PISI components published in the -repositories. -""" - __metaclass__ = autocommand - - def __init__(self, args): - super(ListComponents, self).__init__(args) - - name = ("list-components", "lc") - - def options(self): - self.parser.add_option("-l", "--long", action="store_true", - default=False, help=_("show in long format")) - - def run(self): - - self.init(database = True, write = False) - - list = ctx.componentdb.list_components() - list.sort() - for p in list: - component = ctx.componentdb.get_component(p) - if self.options.long: - ctx.ui.info(unicode(component)) - else: - lenp = len(p) - #if p in installed_list: - # p = colorize(p, 'cyan') - p = p + ' ' * max(0, 15 - lenp) - ctx.ui.info('%s - %s ' % (component.name, unicode(component.summary))) - self.finalize() - - -class ListSources(Command): - """List available sources - -Usage: list-sources - -Gives a brief list of sources published in the repositories. -""" - __metaclass__ = autocommand - - def __init__(self, args): - super(ListSources, self).__init__(args) - - name = ("list-sources", "ls") - - def options(self): - self.parser.add_option("-l", "--long", action="store_true", - default=False, help=_("show in long format")) - - def run(self): - - self.init(database = True, write = False) - - list = ctx.sourcedb.list() - list.sort() - for p in list: - sf, repo = ctx.sourcedb.get_spec_repo(p) - if self.options.long: - ctx.ui.info('[Repository: ' + repo + ']') - ctx.ui.info(unicode(sf.source)) - else: - lenp = len(p) - #if p in installed_list: - # p = colorize(p, 'cyan') - p = p + ' ' * max(0, 15 - lenp) - ctx.ui.info('%s - %s' % (sf.source.name, unicode(sf.source.summary))) - self.finalize() - -class ListUpgrades(Command): - """List packages to be upgraded - -Usage: list-upgrades - -Lists the packages that will be upgraded. -""" - __metaclass__ = autocommand - - def __init__(self, args): - super(ListUpgrades, self).__init__(args) - - name = ("list-upgrades", "lu") - - def options(self): - self.parser.add_option("-l", "--long", action="store_true", - default=False, help=_("show in long format")) - self.parser.add_option("-i", "--install-info", action="store_true", - default=False, help=_("show detailed install info")) - buildno_opts(self) - - def run(self): - self.init(database = True, write = False) - list = pisi.api.list_upgradable() - if not list: - ctx.ui.info(_('No packages to upgrade.')) - list.sort() - if self.options.install_info: - ctx.ui.info(_('Package Name |St| Version| Rel.| Build| Distro| Date')) - print '========================================================================' - for pkg in list: - package = ctx.packagedb.get_package(pkg, pisi.itembyrepodb.installed) - inst_info = ctx.installdb.get_info(pkg) - if self.options.long: - ctx.ui.info(package) - print inst_info - elif self.options.install_info: - ctx.ui.info('%-15s | %s ' % (package.name, inst_info.one_liner())) - else: - ctx.ui.info('%15s - %s ' % (package.name, package.summary)) - self.finalize() - - -class ListPending(Command): - """List pending packages - -Lists packages waiting to be configured. -""" - - __metaclass__ = autocommand - - def __init__(self, args): - super(ListPending, self).__init__(args) - - name = ("list-pending", "lp") - - def run(self): - self.init(database = True, write = False) - - list = ctx.installdb.list_pending() - for p in list.keys(): - print p - self.finalize() - - -class Search(Info): - """Search packages - -Usage: search ... - -Finds a package containing specified search terms -in summary, description, and package name fields. -""" - __metaclass__ = autocommand - - def __init__(self, args): - super(Search, self).__init__(args) - - name = ("search", "sr") - - def options(self): - super(Search, self).options() - self.parser.add_option("-l", "--language", action="store", - help=_("set search language")) - self.parser.remove_option("--short") - self.parser.add_option("-L", "--long", action="store_true", - default=False, help=_("show details")) - - def get_lang(self): - lang = ctx.get_option('language') - if not lang: - lang = pisi.pxml.autoxml.LocalText.get_lang() - if not lang in ['en', 'tr']: - lang = 'en' - return lang - - def run(self): - - self.init(database = True, write = False) - - if not self.args: - self.help() - return - - r = pisi.api.search_package_terms(self.args, self.get_lang()) - ctx.ui.info(_('%s packages found') % len(r)) - - ctx.config.options.short = not ctx.config.options.long - for pkg in r: - self.info_package(pkg) - - self.finalize() - -class SearchFile(Command): - """Search for a file - -Usage: search-file ... - -Finds the installed package which contains the specified file. -""" - __metaclass__ = autocommand - - def __init__(self, args): - super(SearchFile, self).__init__(args) - - name = ("search-file", "sf") - - def options(self): - self.parser.add_option("-l", "--long", action="store_true", - default=False, help=_("show in long format")) - self.parser.add_option("-f", "--fuzzy", action="store_true", - default=False, help=_("fuzzy search")) - - # what does exact mean? -- exa - @staticmethod - def search_exact(path): - files = [] - path = path.lstrip('/') #FIXME: this shouldn't be necessary :/ - - if not ctx.config.options.fuzzy: - if ctx.filesdb.has_file(path): - files.append(ctx.filesdb.get_file(path)) - else: - #FIXME: this linear search thing is not working well -- exa - files = ctx.filesdb.match_files(path) - - if files: - for (pkg_name, file_info) in files: - ctx.ui.info(_("Package %s has file %s") % (pkg_name, file_info.path)) - if ctx.config.options.long: - ctx.ui.info(_('Type: %s, Hash: %s') % (file_info.type, - file_info.hash)) - else: - ctx.ui.error(_("Path '%s' does not belong to an installed package") % path) - - def run(self): - - self.init(database = True, write = False) - - if not self.args: - self.help() - return - - # search among existing files - for path in self.args: - ctx.ui.info(_('Searching for %s') % path) - import os.path - if os.path.exists(path): - path = os.path.realpath(path) - self.search_exact(path) - - self.finalize() - -# texts - -usage_text1 = _("""%prog [options] [arguments] - -where is one of: - -""") - -usage_text2 = _(""" -Use \"%prog help \" for help on a specific command. -""") - -usage_text = (usage_text1 + Command.commands_string() + usage_text2) diff --git a/tags/pisi-1.1_beta13/pisi/cli/pisicli.py b/tags/pisi-1.1_beta13/pisi/cli/pisicli.py deleted file mode 100644 index 4a86076f..00000000 --- a/tags/pisi-1.1_beta13/pisi/cli/pisicli.py +++ /dev/null @@ -1,111 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# - -import sys -from optparse import OptionParser - -import gettext -__trans = gettext.translation('pisi', fallback=True) -_ = __trans.ugettext - -import pisi -import pisi.cli -from pisi.cli import printu -from pisi.uri import URI -from pisi.cli.commands import * - -class ParserError(pisi.Exception): - pass - -class Error(pisi.Error): - pass - -class PreParser(OptionParser): - """consumes any options, and finds arguments from command line""" - - def __init__(self, version): - OptionParser.__init__(self, usage=usage_text, version=version) - - def error(self, msg): - raise ParserError, msg - - def parse_args(self, args=None): - self.opts = [] - self.rargs = self._get_args(args) - self._process_args() - return (self.opts, self.args) - - def _process_args(self): - args = [] - rargs = self.rargs - if not self.allow_interspersed_args: - first_arg = False - while rargs: - arg = rargs[0] - def option(): - if not self.allow_interspersed_args and first_arg: - self.error(_('Options must precede non-option arguments')) - arg = rargs[0] - if arg.startswith('--'): - self.opts.append(arg[2:]) - else: - self.opts.append(arg[1:]) - del rargs[0] - return - # We handle bare "--" explicitly, and bare "-" is handled by the - # standard arg handler since the short arg case ensures that the - # len of the opt string is greater than 1. - if arg == "--": - del rargs[0] - break - elif arg[0:2] == "--": - # process a single long option (possibly with value(s)) - option() - elif arg[:1] == "-" and len(arg) > 1: - # process a cluster of short options (possibly with - # value(s) for the last one only) - option() - else: # then it must be an argument - args.append(arg) - del rargs[0] - self.args = args - - -class PisiCLI(object): - - def __init__(self, orig_args=None): - # first construct a parser for common options - # this is really dummy - self.parser = PreParser(version="%prog " + pisi.__version__) - try: - opts, args = self.parser.parse_args(args=orig_args) - if len(args)==0: # more explicit than using IndexError - if 'version' in opts: - self.parser.print_version() - sys.exit(0) - elif 'help' in opts or 'h' in opts: - self.die() - raise Error(_('No command given')) - cmd_name = args[0] - except ParserError: - raise Error(_('Command line parsing error')) - - self.command = Command.get_command(cmd_name, args=orig_args) - if not self.command: - raise Error(_("Unrecognized command: %s") % cmd_name) - - def die(self): - printu('\n' + self.parser.format_help()) - sys.exit(1) - - def run_command(self): - self.command.run() diff --git a/tags/pisi-1.1_beta13/pisi/comariface.py b/tags/pisi-1.1_beta13/pisi/comariface.py deleted file mode 100644 index 00fb8e17..00000000 --- a/tags/pisi-1.1_beta13/pisi/comariface.py +++ /dev/null @@ -1,125 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright (C) 2005-2006, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# - -import os - -import gettext -__trans = gettext.translation('pisi', fallback=True) -_ = __trans.ugettext - -import comar -import pisi -import pisi.context as ctx - - -class Error(pisi.Error): - pass - - -def make_com(): - try: - if ctx.comar_sockname: - com = comar.Link(sockname=ctx.comar_sockname) - else: - com = comar.Link() - return com - except ImportError: - raise Error(_("comar package is not fully installed")) - except comar.Error: - raise Error(_("cannot connect to comar")) - -def wait_comar(): - import socket, time - sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) - timeout = 5 - while timeout > 0: - try: - if ctx.comar_sockname: - sock.connect(ctx.comar_sockname) - else: - sock.connect("/var/run/comar.socket") - return True - except: - timeout -= 0.2 - time.sleep(0.2) - return False - -def wait_for_result(com, package_name=None): - multiple = False - while 1: - try: - reply = com.read_cmd() - except: - # Comar postInstall does a "service comar restart" which cuts - # our precious communication link, so we waitsss - if package_name == "comar": - if not wait_comar(): - raise Error, _("Could not restart comar") - return - else: - raise Error, _("connection with comar unexpectedly closed") - - cmd = reply[0] - if cmd == com.RESULT and not multiple: - return - elif cmd == com.NONE and not multiple: - # no post/pre function, that is ok - return - elif cmd == com.RESULT_START: - multiple = True - elif cmd == com.RESULT_END: - return - elif cmd == com.FAIL: - e = _("Configuration error: %s") % reply[2] - raise Error, e - elif cmd == com.ERROR: - e = _("Script error: %s") % reply[2] - raise Error, e - elif cmd == com.DENIED: - raise Error, _("comar denied our access") - -def post_install(package_name, provided_scripts, scriptpath, metapath, filepath): - ctx.ui.info(_("Configuring package")) - self_post = False - com = make_com() - - for script in provided_scripts: - ctx.ui.debug(_("Registering %s comar script") % script.om) - if script.om == "System.Package": - self_post = True - com.register(script.om, package_name, os.path.join(scriptpath, script.script)) - wait_for_result(com) - - ctx.ui.debug(_("Calling post install handlers")) - com.call("System.PackageHandler.setupPackage", [ "metapath", metapath, "filepath", filepath ]) - wait_for_result(com) - - if self_post: - ctx.ui.debug(_("Running package's post install script")) - com.call_package("System.Package.postInstall", package_name) - wait_for_result(com, package_name) - -def pre_remove(package_name, metapath, filepath): - ctx.ui.info(_("Configuring package for removal")) - com = make_com() - - ctx.ui.debug(_("Running package's pre remove script")) - com.call_package("System.Package.preRemove", package_name) - wait_for_result(com) - - ctx.ui.debug(_("Calling pre remove handlers")) - com.call("System.PackageHandler.cleanupPackage", [ "metapath", metapath, "filepath", filepath ]) - wait_for_result(com) - - ctx.ui.debug(_("Unregistering comar scripts")) - com.remove(package_name) - wait_for_result(com) diff --git a/tags/pisi-1.1_beta13/pisi/component.py b/tags/pisi-1.1_beta13/pisi/component.py deleted file mode 100644 index ce929690..00000000 --- a/tags/pisi-1.1_beta13/pisi/component.py +++ /dev/null @@ -1,211 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# -# Author: Eray Ozkural - -import gettext -__trans = gettext.translation('pisi', fallback=True) -_ = __trans.ugettext - -import pisi -import pisi.context as ctx -import pisi.pxml.xmlfile as xmlfile -import pisi.pxml.autoxml as autoxml -import pisi.lockeddbshelve as shelve -from pisi.itembyrepodb import ItemByRepoDB -import pisi.itembyrepodb as itembyrepodb - -class Error(pisi.Error): - pass - -__metaclass__ = autoxml.autoxml - - -class Distribution(xmlfile.XmlFile): - - __metaclass__ = autoxml.autoxml - - tag = "PISI" - - t_SourceName = [autoxml.Text, autoxml.mandatory] # name of distribution (source) - t_Description = [autoxml.LocalText, autoxml.mandatory] - t_Version = [autoxml.Text, autoxml.optional] - t_Type = [autoxml.Text, autoxml.mandatory] - t_Dependencies = [ [autoxml.Text], autoxml.optional, "Dependencies/Distribution"] - - t_BinaryName = [autoxml.Text, autoxml.optional] # name of repository (binary distro) - t_Architecture = [autoxml.Text, autoxml.optional] # architecture identifier - - -class Component(xmlfile.XmlFile): - "representation for component declarations" - - __metaclass__ = autoxml.autoxml - - tag = "PISI" - - t_Name = [autoxml.String, autoxml.mandatory] # fully qualified name - - # component name in other languages, for instance in Turkish - # LocalName for system.base could be sistem.taban or "Taban Sistem", - # this could be useful for GUIs - - t_LocalName = [autoxml.LocalText, autoxml.mandatory] - - # Information about the component - t_Summary = [autoxml.LocalText, autoxml.mandatory] - t_Description = [autoxml.LocalText, autoxml.mandatory] - #t_Icon = [autoxml.Binary, autoxml.mandatory] - - # Dependencies to other components - t_Dependencies = [ [autoxml.String], autoxml.optional, "Dependencies/Component"] - - # the parts of this component. - # to be filled by the component database, thus it is optional. - t_Packages = [ [autoxml.String], autoxml.optional, "Parts/Package"] - - t_Sources = [ [autoxml.String], autoxml.optional, "Parts/Source"] - - # TODO: this is probably not necessary since we use fully qualified - # module names (like in Java) - #t_PartOf = [autoxml.Text, autoxml.mandatory] - -#FIXME: recursive declarations do not work! -#class ComponentTree(xmlfile.XmlFile): -# "index representation for the component structure" -# -# __metaclass__ = autoxml.autoxml -# -# tag = "Component" -# -# t_Name = [autoxml.Text, autoxml.mandatory] # fully qualified name -# #t_Icon = [autoxml.Binary, autoxml.mandatory] -# t_Dependencies = [ [autoxml.Text], autoxml.optional, "Component"] -# #t_Parts = [ [pisi.component.ComponentTree], autoxml.optional, "Component"] - -class ComponentDB(object): - """a database of components""" - - #FIXME: we might need a database per repo in the future - def __init__(self): - self.d = ItemByRepoDB('component') - - def close(self): - self.d.close() - - def destroy(self): - self.d.destroy() - - def has_component(self, name, repo = pisi.itembyrepodb.repos, txn = None): - #name = shelve.LockedDBShelf.encodekey(name) - name = str(name) - return self.d.has_key(name, repo, txn) - - def get_component(self, name, repo=None, txn = None): - try: - return self.d.get_item(name, repo, txn=txn) - except pisi.itembyrepodb.NotfoundError, e: - raise Error(_('Component %s not found') % name) - - def get_component_repo(self, name, repo=None, txn = None): - #name = shelve.LockedDBShelf.encodekey(name) - try: - return self.d.get_item_repo(name, repo, txn=txn) - except pisi.itembyrepodb.NotfoundError, e: - raise Error(_('Component %s not found') % name) - - def get_union_comp(self, name, txn = None, repo = pisi.itembyrepodb.repos ): - """get a union of all repository components packages, not just the first repo in order. - get only basic repo info from the first repo""" - def proc(txn): - s = self.d.d.get(name, txn=txn) - pkgs = set() - srcs = set() - for repostr in self.d.order(repo = repo): - if s.has_key(repostr): - pkgs |= set(s[repostr].packages) - srcs |= set(s[repostr].sources) - comp = self.get_component(name) - comp.packages = list(pkgs) - comp.sources = list(srcs) - return comp - return self.d.txn_proc(proc, txn) - - def list_components(self, repo=None): - return self.d.list(repo) - - def update_component(self, component, repo, txn = None): - def proc(txn): - if self.has_component(component.name, repo, txn): - # preserve the list of packages - component.packages = self.d.get_item(component.name, repo, txn).packages - self.d.add_item(component.name, component, repo, txn) - self.d.txn_proc(proc, txn) - - def add_package(self, component_name, package, repo, txn = None): - def proc(txn): - assert component_name - if self.has_component(component_name, repo, txn): - component = self.get_component(component_name, repo, txn) - else: - component = Component( name = component_name ) - if not package in component.packages: - component.packages.append(package) - self.d.add_item(component_name, component, repo, txn) # update - self.d.txn_proc(proc, txn) - - def remove_package(self, component_name, package, repo = None, txn = None): - def proc(txn, repo): - if not self.has_component(component_name, repo, txn): - raise Error(_('Information for component %s not available') % component_name) - if not repo: - repo = self.d.which_repo(component_name, txn=txn) # get default repo then - component = self.get_component(component_name, repo, txn) - if package in component.packages: - component.packages.remove(package) - self.d.add_item(component_name, component, repo, txn) # update - - ctx.txn_proc(lambda x: proc(txn, repo), txn) - - def add_spec(self, component_name, spec, repo, txn = None): - def proc(txn): - assert component_name - if self.has_component(component_name, repo, txn): - component = self.get_component(component_name, repo, txn) - else: - component = Component( name = component_name ) - if not spec in component.sources: - component.sources.append(spec) - self.d.add_item(component_name, component, repo, txn) # update - self.d.txn_proc(proc, txn) - - def remove_spec(self, component_name, spec, repo = None, txn = None): - def proc(txn, repo): - if not self.has_component(component_name, repo, txn): - raise Error(_('Information for component %s not available') % component_name) - if not repo: - repo = self.d.which_repo(component_name, txn=txn) # get default repo then - component = self.get_component(component_name, repo, txn) - if spec in component.sources: - component.sources.remove(spec) - self.d.add_item(component_name, component, repo, txn) # update - - ctx.txn_proc(lambda x: proc(txn, repo), txn) - - def clear(self, txn = None): - self.d.clear(txn) - - def remove_component(self, name, repo = None, txn = None): - name = str(name) - self.d.remove_item(name, repo, txn) - - def remove_repo(self, repo, txn = None): - self.d.remove_repo(repo, txn=txn) diff --git a/tags/pisi-1.1_beta13/pisi/config.py b/tags/pisi-1.1_beta13/pisi/config.py deleted file mode 100644 index 131b1f7d..00000000 --- a/tags/pisi-1.1_beta13/pisi/config.py +++ /dev/null @@ -1,121 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# -# Authors: Baris Metin -# Eray Ozkural - -""" -PISI Configuration module is used for gathering and providing -regular PISI configurations. -""" - -import os -from copy import deepcopy - -import gettext -__trans = gettext.translation('pisi', fallback=True) -_ = __trans.ugettext - -import pisi -import pisi.context as ctx -from pisi.configfile import ConfigurationFile -import pisi.util -from pisi.util import join_path as join - -class Error(pisi.Error): - pass - -class Options(object): - def __getattr__(self, name): - if not self.__dict__.has_key(name): - return None - else: - return self.__dict__[name] - -class Config(object): - """Config Singleton""" - - def __init__(self, options = Options()): - self.options = options - self.values = ConfigurationFile("/etc/pisi/pisi.conf") - - destdir = self.get_option('destdir') - if destdir: - if destdir.strip().startswith('/'): - self.destdir = destdir - else: - self.destdir = join(os.getcwd(), destdir) - else: - self.destdir = self.values.general.destinationdirectory - - if not os.path.exists(self.destdir): - ctx.ui.warning( _('Destination directory %s does not exist. Creating it.') % self.destdir) - os.makedirs(self.destdir) - - # get the initial environment variables. this is needed for - # build process. - self.environ = deepcopy(os.environ) - - - def get_option(self, opt): - if self.options: - if hasattr(self.options, opt): - return getattr(self.options, opt) - return None - - # directory accessor functions - # here is how it goes - # x_dir: system wide directory for storing info type x - # pkg_x_dir: per package directory for storing info type x - - def dest_dir(self): - return self.destdir - - def subdir(self, path): - dir = join(self.dest_dir(), path) - pisi.util.check_dir(dir) - return dir - - def lib_dir(self): - return self.subdir(self.values.dirs.lib_dir) - - def db_dir(self): - return self.subdir(self.values.dirs.db_dir) - - def archives_dir(self): - return self.subdir(self.values.dirs.archives_dir) - - def packages_dir(self): - return self.subdir(self.values.dirs.packages_dir) - - def index_dir(self): - return self.subdir(self.values.dirs.index_dir) - - def tmp_dir(self): - sysdir = self.subdir(self.values.dirs.tmp_dir) - if os.environ.has_key('USER'): - userdir = '/tmp/pisi-' + os.environ['USER'] - else: - userdir = '/tmp/pisi-root' - # check write access - if os.access(sysdir, os.W_OK): - return sysdir - else: - return userdir - - # bu dizini neden kullanıyoruz? Yalnızca index.py içerisinde - # kullanılıyor ama /var/tmp/pisi/install gibi bir dizine niye - # ihtiyacımız var? (baris) - def install_dir(self): - return self.tmp_dir() + ctx.const.install_dir_suffix - -#TODO: remove this -config = Config() diff --git a/tags/pisi-1.1_beta13/pisi/configfile.py b/tags/pisi-1.1_beta13/pisi/configfile.py deleted file mode 100644 index bce2a77d..00000000 --- a/tags/pisi-1.1_beta13/pisi/configfile.py +++ /dev/null @@ -1,162 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# - -# PISI Configuration File module, obviously, is used to read from the -# configuration file. Module also defines default values for -# configuration parameters. -# -# Configuration file is located in /etc/pisi/pisi.conf by default, -# having an INI like format like below. -# -#[general] -#destinationdirectory = / -#autoclean = False -#xdelta = False -# -#[build] -#host = i686-pc-linux-gnu -#generateDebug = False -#jobs = "-j1" -#CFLAGS= -mtune=i686 -O2 -pipe -fomit-frame-pointer -#CXXFLAGS= -mtune=i686 -O2 -pipe -fomit-frame-pointer -#LDFLAGS= -#buildno=True # necessary for generating build nos -#buildhelper = None / ccache / icecream -#compressionlevel = 7 -# -#[directories] -#lib_dir = /var/lib/pisi -#db_dir = /var/db/pisi -#archives_dir = /var/cache/pisi/archives -#packages_dir = /var/cache/pisi/packages -#index_dir = /var/cache/pisi/index -#tmp_dir = /var/tmp/pisi -#icon_theme_dir = /usr/share/icons/Tulliana-1.0 -#kde_dir = /usr/kde/3.5 -#qt_dir = /usr/qt/3 - -import os -from ConfigParser import ConfigParser, NoSectionError - -import gettext -__trans = gettext.translation('pisi', fallback=True) -_ = __trans.ugettext - -import pisi - -class Error(pisi.Error): - pass - -class GeneralDefaults: - """Default values for [general] section""" - destinationdirectory = "/" - autoclean = False - xdelta = False - distribution = "Pardus" - distribution_release = "1.1" - http_proxy = os.getenv("HTTP_PROXY") or None - https_proxy = os.getenv("HTTPS_PROXY") or None - ftp_proxy = os.getenv("FTP_PROXY") or None - -class BuildDefaults: - """Default values for [build] section""" - host = "i686-pc-linux-gnu" - jobs = "-j1" - generateDebug = False - cflags = "-mtune=i686 -O2 -pipe -fomit-frame-pointer" - cxxflags = "-mtune=i686 -O2 -pipe -fomit-frame-pointer" - ldflags = "" - buildno = False - buildhelper = None - compressionlevel = 7 - -class DirectoriesDefaults: - "Default values for [directories] section" - lib_dir = "/var/lib/pisi" - db_dir = "/var/db/pisi" - archives_dir = "/var/cache/pisi/archives" - packages_dir = "/var/cache/pisi/packages" - index_dir = "/var/lib/pisi/index" - tmp_dir = "/var/tmp/pisi" - icon_theme_dir = "/usr/share/icons/Tulliana-1.0" - kde_dir = "/usr/kde/3.5" - qt_dir = "/usr/qt/3" - -class ConfigurationSection(object): - """ConfigurationSection class defines a section in the configuration - file, using defaults (above) as a fallback.""" - def __init__(self, section, items=[]): - self.items = items - - if section == "general": - self.defaults = GeneralDefaults - elif section == "build": - self.defaults = BuildDefaults - elif section == "directories": - self.defaults = DirectoriesDefaults - else: - e = _("No section by name '%s'") % section - raise Error, e - - self.section = section - - def __getattr__(self, attr): - - # first search for attribute in the items provided in the - # configuration file. - if self.items: - for item in self.items: - if item[0] == attr: - # all values are returned as string types by ConfigParser. - # evaluate "True" or "False" strings to boolean. - if item[1] in ["True", "False"]: - return eval(item[1]) - else: - return item[1] - - # then fall back to defaults - if hasattr(self.defaults, attr): - return getattr(self.defaults, attr) - - return "" - - # We'll need to access configuration keys by their names as a - # string. Like; ["default"]... - def __getitem__(self, key): - return self.__getattr__(key) - - -class ConfigurationFile(object): - """Parse and get configuration values from the configuration file""" - def __init__(self, filePath): - parser = ConfigParser() - self.filePath = filePath - - parser.read(self.filePath) - - try: - generalitems = parser.items("general") - except NoSectionError: - generalitems = [] - self.general = ConfigurationSection("general", generalitems) - - try: - builditems = parser.items("build") - except NoSectionError: - builditems = [] - self.build = ConfigurationSection("build", builditems) - - try: - dirsitems = parser.items("directories") - except NoSectionError: - dirsitems = [] - self.dirs = ConfigurationSection("directories", dirsitems) diff --git a/tags/pisi-1.1_beta13/pisi/constants.py b/tags/pisi-1.1_beta13/pisi/constants.py deleted file mode 100644 index 1e29d64f..00000000 --- a/tags/pisi-1.1_beta13/pisi/constants.py +++ /dev/null @@ -1,107 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# - -"""PISI constants. -If you have a "magic" constant value this is where it should be -defined.""" - -# Author: Baris Metin - -# global variables here - -import pisi.constants - -const = pisi.constants.Constants() - -config = None - -log = None - -use_mdom = False - -def get_option(opt): - return config and config.get_option(opt) - -# default UI is CLI -ui = None # not now - -# stdout, stderr for PiSi API -stdout = None -stderr = None - -dbenv = None -installdb = None -packagedb = None -repodb = None -invidx = None - -comar = None -comar_sockname = None - -initialized = False - -# Bug #2879 -# FIXME: Maybe we can create a simple rollback mechanism. There are other -# places which need this, too. -# this is needed in build process to clean after if something goes wrong. -build_leftover = None - -#def register(_impl): -# """ Register a UI implementation""" -# ui = _impl - -import bsddb3.db as db - -# copy of DBShelve.txn_proc, the only difference is it doesn't need a shelf object -#FIXME: remove this redundancy, and move all this stuff to database.py -def txn_proc(proc, txn = None): - # can be used to txn protect a method automatically - if not txn: - if dbenv: - autotxn = dbenv.txn_begin() - try: - retval = proc(autotxn) - except db.DBError, e: - autotxn.abort() - raise e - except Exception, e: - autotxn.abort() - raise e - autotxn.commit() - else: - retval = proc(None) - return retval - else: - return proc(txn) diff --git a/tags/pisi-1.1_beta13/pisi/dbshelve.py b/tags/pisi-1.1_beta13/pisi/dbshelve.py deleted file mode 100644 index b9534cde..00000000 --- a/tags/pisi-1.1_beta13/pisi/dbshelve.py +++ /dev/null @@ -1,322 +0,0 @@ -#!/bin/env python -#------------------------------------------------------------------------ -# Copyright (c) 1997-2001 by Total Control Software -# All Rights Reserved -#------------------------------------------------------------------------ -# -# Module Name: dbShelve.py -# -# Description: A reimplementation of the standard shelve.py that -# forces the use of cPickle, and DB. -# -# Creation Date: 11/3/97 3:39:04PM -# -# License: This is free software. You may use this software for any -# purpose including modification/redistribution, so long as -# this header remains intact and that you do not claim any -# rights of ownership or authorship of this software. This -# software has been tested, but no warranty is expressed or -# implied. -# -# 13-Dec-2000: Updated to be used with the new bsddb3 package. -# Added DBShelfCursor class. -# -# 13-Dec-2005: Minor hacking by exa to make it work better with PISI -#------------------------------------------------------------------------ - -"""Manage shelves of pickled objects using bsddb database files for the -storage. - -Add transaction processing by default to dictionary ops also -Also other minor improvements -- exa - -Now added support for overriding the marshalling method -""" - -#------------------------------------------------------------------------ - -import cPickle -import bsddb3.db as db -import bsddb3.dbobj as dbobj -import string -import sys -import traceback -import pisi - -class CodingError(pisi.Error): - pass - -class DBShelf: - """A shelf to hold pickled objects, built upon a bsddb DB object. It - automatically pickles/unpickles data objects going to/from the DB. - """ - def __init__(self, dbenv = None): - self.dbenv = dbenv - # how lame is bsddb3? - if self.dbenv: - self.db = dbobj.DB(dbenv) - else: - self.db = db.DB(None) - - # it is better to explicitly close a shelf - #def __del__(self): - # self.close() - - allowed_chars = string.letters + string.digits + '-' - def check_key(key): - return pisi.util.all(lambda x: x in allowed_chars, key) - - def has_key(self, key, txn = None): - if txn: - return self.db.has_key(key, txn) - else: - return self.db.has_key(key) - - def txn_proc(self, proc, txn): - # can be used to txn protect a method automatically - if not txn: - if self.dbenv: - autotxn = self.dbenv.txn_begin() - try: - retval = proc(autotxn) - except db.DBError, e: - autotxn.abort() - raise e - except Exception, e: - autotxn.abort() - #e.args += tuple(traceback.format_tb(sys.exc_traceback)) - raise e - autotxn.commit() - else: # execute without transactions - retval = proc(None) - return retval - else: - return proc(txn) - - def decode(self, data): - try: - return cPickle.loads(data) - except cPickle.UnpicklingError: - raise CodingError() - - def encode(self, obj): - return cPickle.dumps(obj, 1) - - def clear(self, txn = None): - def proc(txn): - for x in self.keys(txn): - self.db.delete(x, txn) - self.txn_proc(proc, txn) - - def delete(self, x, txn): - def proc(txn): - self.db.delete(x, txn) - self.txn_proc(proc, txn) - - # another lame pythonic implementation method: - #def __getattr__(self, name): - # """Many methods we can just pass through to the DB object. - # (See below) - # """ - # print 'aptal bsddb3', name - # return getattr(self.db, name) - - #----------------------------------- - # Dictionary access methods - - def __len__(self): - return len(self.db) - - def __getitem__(self, key): - def proc(txn): - data = self.db.get(key) - return self.decode(data) - return self.txn_proc(proc, None) - - def __setitem__(self, key, value): - # hyperdandik transactions - def proc(txn): - data = self.encode(value) - self.db.put(key,data,txn) - return self.txn_proc(proc, None) - - def __delitem__(self, key): - txn = self.dbenv.txn_begin() - try: - self.db.delete(key, txn) - except db.DBError, e: - txn.abort() - raise e - txn.commit() - - def keys(self, txn=None): - if txn != None: - return self.db.keys(txn) - else: - return self.db.keys() - - def items(self, txn=None): - if txn != None: - items = self.db.items(txn) - else: - items = self.db.items() - newitems = [] - - for k, v in items: - newitems.append( (k, self.decode(v) ) ) - return newitems - - def values(self, txn=None): - if txn != None: - values = self.db.values(txn) - else: - values = self.db.values() - - return map(lambda x : self.decode(x), values) - - #----------------------------------- - # Other methods - - def __append(self, value, txn=None): - data = self.encode(value) - return self.db.append(data, txn) - - def append(self, value, txn=None): - if self.get_type() != db.DB_RECNO: - self.append = self.__append - return self.append(value, txn=txn) - raise db.DBError, "append() only supported when dbshelve opened with filetype=dbshelve.db.DB_RECNO" - - - def associate(self, secondaryDB, callback, flags=0): - def _shelf_callback(priKey, priData, realCallback=callback): - data = self.decode(priData) - return realCallback(priKey, data) - return self.db.associate(secondaryDB, _shelf_callback, flags) - - - #def get(self, key, default=None, txn=None, flags=0): - def get(self, *args, **kw): - # We do it with *args and **kw so if the default value wasn't - # given nothing is passed to the extension module. That way - # an exception can be raised if set_get_returns_none is turned - # off. - data = apply(self.db.get, args, kw) - try: - return self.decode(data) - except (TypeError, CodingError): - return data # we may be getting the default value, or None, - # so it doesn't need unpickled. - - def get_both(self, key, value, txn=None, flags=0): - data = self.encode(value) - data = self.db.get(key, data, txn, flags) - return self.decode(data) - - def cursor(self, txn=None, flags=0): - c = DBShelfCursor(self.db.cursor(txn, flags)) - c.binary = self.binary - return c - - def put(self, key, value, txn=None, flags=0): - data = self.encode(value) - return self.db.put(key, data, txn, flags) - - def join(self, cursorList, flags=0): - raise NotImplementedError - - #---------------------------------------------- - # Methods allowed to pass-through to self.db - # - # close, delete, fd, get_byteswapped, get_type, has_key, - # key_range, open, remove, rename, stat, sync, - # upgrade, verify, and all set_* methods. - - -#--------------------------------------------------------------------------- - -class DBShelfCursor: - """ - """ - def __init__(self, cursor): - self.dbc = cursor - - def __del__(self): - self.close() - - def __getattr__(self, name): - """Some methods we can just pass through to the cursor object. (See below)""" - return getattr(self.dbc, name) - - #---------------------------------------------- - - def dup(self, flags=0): - return DBShelfCursor(self.dbc.dup(flags)) - - def put(self, key, value, flags=0): - data = self.encode(value) - return self.dbc.put(key, data, flags) - - - def get(self, *args): - count = len(args) # a method overloading hack - method = getattr(self, 'get_%d' % count) - apply(method, args) - - def get_1(self, flags): - rec = self.dbc.get(flags) - return self._extract(rec) - - def get_2(self, key, flags): - rec = self.dbc.get(key, flags) - return self._extract(rec) - - def get_3(self, key, value, flags): - data = self.encode(value) - rec = self.dbc.get(key, flags) - return self._extract(rec) - - - def current(self, flags=0): return self.get_1(flags|db.DB_CURRENT) - def first(self, flags=0): return self.get_1(flags|db.DB_FIRST) - def last(self, flags=0): return self.get_1(flags|db.DB_LAST) - def next(self, flags=0): return self.get_1(flags|db.DB_NEXT) - def prev(self, flags=0): return self.get_1(flags|db.DB_PREV) - def consume(self, flags=0): return self.get_1(flags|db.DB_CONSUME) - def next_dup(self, flags=0): return self.get_1(flags|db.DB_NEXT_DUP) - def next_nodup(self, flags=0): return self.get_1(flags|db.DB_NEXT_NODUP) - def prev_nodup(self, flags=0): return self.get_1(flags|db.DB_PREV_NODUP) - - def get_both(self, key, value, flags=0): - data = self.encode(value) - rec = self.dbc.get_both(key, flags) - return self._extract(rec) - - def set(self, key, flags=0): - rec = self.dbc.set(key, flags) - return self._extract(rec) - - def set_range(self, key, flags=0): - rec = self.dbc.set_range(key, flags) - return self._extract(rec) - - def set_recno(self, recno, flags=0): - rec = self.dbc.set_recno(recno, flags) - return self._extract(rec) - - set_both = get_both - - def _extract(self, rec): - if rec is None: - return None - else: - key, data = rec - return key, self.decode(data) - - #---------------------------------------------- - # Methods allowed to pass-through to self.dbc - # - # close, count, delete, get_recno, join_item - - -#--------------------------------------------------------------------------- diff --git a/tags/pisi-1.1_beta13/pisi/dependency.py b/tags/pisi-1.1_beta13/pisi/dependency.py deleted file mode 100644 index ff98fc85..00000000 --- a/tags/pisi-1.1_beta13/pisi/dependency.py +++ /dev/null @@ -1,123 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# -# Author: Eray Ozkural - -"""dependency analyzer""" - -import gettext -__trans = gettext.translation('pisi', fallback=True) -_ = __trans.ugettext - -import pisi.context as ctx -#import pisi.packagedb as packagedb -from pisi.version import Version -import pisi.pxml.autoxml as autoxml -from pisi.util import Checks -import pisi.itembyrepodb - -class Dependency: - - __metaclass__ = autoxml.autoxml - - s_Package = [autoxml.String, autoxml.mandatory] - a_version = [autoxml.String, autoxml.optional] - a_versionFrom = [autoxml.String, autoxml.optional] - a_versionTo = [autoxml.String, autoxml.optional] - a_release = [autoxml.String, autoxml.optional] - a_releaseFrom = [autoxml.String, autoxml.optional] - a_releaseTo = [autoxml.String, autoxml.optional] - - def __str__(self): - s = self.package - if self.versionFrom: - s += _(" version >= ") + self.versionFrom - if self.versionTo: - s += _(" version <= ") + self.versionTo - if self.releaseFrom: - s += _(" release >= ") + self.releaseFrom - if self.releaseTo: - s += _(" release <= ") + self.releaseTo - return s - - def satisfies(self, pkg_name, version, release): - """determine if a package ver. satisfies given dependency spec""" - ret = True - v = Version(version) - if self.version: - ret &= v == Version(self.version) - if self.versionFrom: - ret &= v >= Version(self.versionFrom) - if self.versionTo: - ret &= v <= Version(self.versionTo) - r = Version(release) - if self.release: - ret &= r == Version(self.release) - if self.releaseFrom: - ret &= r >= Version(self.releaseFrom) - if self.releaseTo: - ret &= r <= Version(self.releaseTo) - return ret - -def dict_satisfies_dep(dict, depinfo): - """determine if a package in a dictionary satisfies given dependency spec""" - pkg_name = depinfo.package - if not dict.has_key(pkg_name): - return False - else: - pkg = dict[pkg_name] - (version, release) = (pkg.version, pkg.release) - return depinfo.satisfies(pkg_name, version, release) - -def installed_satisfies_dep(depinfo): - """determine if a package in *repository* satisfies given -dependency spec""" - pkg_name = depinfo.package - if not ctx.installdb.is_installed(pkg_name): - return False - else: - pkg = ctx.packagedb.get_package(pkg_name, pisi.itembyrepodb.installed) - (version, release) = (pkg.version, pkg.release) - return depinfo.satisfies(pkg_name, version, release) - -def repo_satisfies_dep(depinfo): - """determine if a package in *repository* satisfies given -dependency spec""" - pkg_name = depinfo.package - if not ctx.packagedb.has_package(pkg_name): - return False - else: - pkg = ctx.packagedb.get_package(pkg_name) - (version, release) = (pkg.version, pkg.release) - return depinfo.satisfies(pkg_name, version, release) - -def satisfies_dependencies(pkg, deps, sat = installed_satisfies_dep): - for dep in deps: - if not sat(dep): - ctx.ui.error(_('Package %s does not satisfy dependency %s') % - (pkg,dep)) - return False - return True - -def satisfies_runtime_deps(pkg): - deps = ctx.packagedb.get_package(pkg).runtimeDependencies() - return satisfies_dependencies(pkg, deps) - -def installable(pkg): - """calculate if pkg name is installable currently - which means it has to satisfy both install and runtime dependencies""" - if not ctx.packagedb.has_package(pkg): - ctx.ui.info(_("Package %s is not present in the package database") % pkg); - return False - elif satisfies_runtime_deps(pkg): - return True - else: - return False diff --git a/tags/pisi-1.1_beta13/pisi/fetcher.py b/tags/pisi-1.1_beta13/pisi/fetcher.py deleted file mode 100644 index 85114b6c..00000000 --- a/tags/pisi-1.1_beta13/pisi/fetcher.py +++ /dev/null @@ -1,372 +0,0 @@ -# -*- coding: utf-8 -*- - -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# - -"""Yet another Pisi module for fetching files from various sources. Of -course, this is not limited to just fetching source files. We fetch -all kinds of things: source tarballs, index files, packages, and God -knows what.""" - -# python standard library modules -import urllib2 -import urllib -import ftplib -import os -import socket -import sys -from mimetypes import guess_type -from mimetools import Message -from base64 import encodestring -from shutil import move -from time import time -from time import gmtime - -import gettext -__trans = gettext.translation('pisi', fallback=True) -_ = __trans.ugettext - -# pisi modules -import pisi -import pisi.util as util -import pisi.context as ctx -from pisi.uri import URI - -class FetchError(pisi.Error): - pass - -class RangeError(pisi.Error): - pass - -# helper functions -def fetch_url(url, destdir, progress=None, resume=True): - fetch = Fetcher(url, destdir) - if not resume: - fetch.resume = False - fetch.progress = progress - fetch.fetch() - if progress: - pass - - -class Fetcher: - """Fetcher can fetch a file from various sources using various - protocols.""" - def __init__(self, url, destdir, resume = True): - if not isinstance(url, URI): - url = URI(url) - - if ctx.config.get_option("authinfo"): - url.set_auth_info(ctx.config.get_option("authinfo")) - - self.resume = resume - self.scheme = url.scheme() - self.url = url - self.destdir = destdir - util.check_dir(self.destdir) - self.eta = '??:??:??' - self.percent = 0 - self.rate = 0.0 - self.progress = None - self.exist_size = 0 - - def fetch (self): - """Return value: Fetched file's full path..""" - - if not self.url.filename(): - self.err(_('Filename error')) - - if not os.access(self.destdir, os.W_OK): - self.err(_('Access denied to write to destination directory: "%s"') % (self.destdir)) - - archive_file = os.path.join(self.destdir, self.url.filename()) - - if os.path.exists(archive_file) and not os.access(archive_file, os.W_OK): - self.err(_('Access denied to destination file: "%s"') % (archive_file)) - - partial_file = archive_file + '.part' - - if self.url.is_local_file(): - self.fetchLocalFile(partial_file) - else: - self.fetchRemoteFile(partial_file) - - if os.stat(partial_file).st_size == 0: - os.remove(partial_file) - self.err(_('A problem occured. Please check the archive address and/or permissions again.')) - - move(partial_file, archive_file) - - return archive_file - - def _do_grab(self, fileURI, dest, total_size): - ctx.ui.notify(pisi.ui.downloading, url = fileURI) - bs, tt, = 1024, int(time()) - s_time = time() - Tdiff = lambda: time() - s_time - downloaded_size = exist_size = self.exist_size - symbol = 'B/s' - st = time() - chunk = fileURI.read(bs) - downloaded_size += len(chunk) - - if self.progress: - p = self.progress(total_size, exist_size) - self.percent = p.update(downloaded_size) - self.complete = False - - while chunk: - dest.write(chunk) - chunk = fileURI.read(bs) - downloaded_size += len(chunk) - ct = time() - if int(tt) != int(ct): - self.rate = (downloaded_size - exist_size) / (ct - st) - - if self.percent: - self.eta = '%02d:%02d:%02d' %\ - tuple([i for i in gmtime((Tdiff() * (100 - self.percent)) / self.percent)[3:6]]) - - self.rate, symbol = util.human_readable_rate(self.rate) - - tt = time() - - if self.progress: - if p.update(downloaded_size): - self.percent = p.percent - if not self.complete: - ctx.ui.display_progress(filename = self.url.filename(), - percent = self.percent, - total_size = total_size, - downloaded_size = downloaded_size, - rate = self.rate, - eta = self.eta, - symbol = symbol) - if self.percent == 100: #FIXME: will be superseded by a - self.complete = True # working progress interface - - dest.close() - - def fetchLocalFile (self, archive_file): - url = self.url - - if not os.access(url.path(), os.F_OK): - self.err(_('No such file or no permission to read')) - - dest = open(archive_file, 'w') - total_size = os.path.getsize(url.path()) - fileObj = open(url.path()) - self._do_grab(fileObj, dest, total_size) - - def fetchRemoteFile (self, archive_file): - from httplib import HTTPException - - if os.path.exists(archive_file) and self.resume: - if self.scheme == 'http' or self.scheme == 'https' or self.scheme == 'ftp': - self.exist_size = os.path.getsize(archive_file) - dest = open(archive_file, 'ab') - else: - dest = open(archive_file, 'wb') - - uri = self.url.get_uri() - - flag = 1 - try: - try: - try: - fileObj = urllib2.urlopen(self.formatRequest(urllib2.Request(uri))) - except RangeError: - ctx.ui.info(_('Requested range not satisfiable, starting again.')) - dest = open(archive_file, 'wb') - self.exist_size = 0 - fileObj = urllib2.urlopen(self.formatRequest(urllib2.Request(uri))) - headers = fileObj.info() - flag = 0 - except ValueError, e: - self.err(_('Cannot fetch %s; value error: %s') % (uri, e)) - except urllib2.HTTPError, e: - self.err(_('Cannot fetch %s; %s') % (uri, e)) - except urllib2.URLError, e: - self.err(_('Cannot fetch %s; %s') % (uri, e[-1][-1])) - except OSError, e: - self.err(_('Cannot fetch %s; %s') % (uri, e)) - except HTTPException, e: - self.err(_('Cannot fetch %s; (%s): %s') % (uri, e.__class__.__name__, e)) - finally: - if flag: - if os.stat(archive_file).st_size == 0: - os.remove(archive_file) - - try: - total_size = int(headers['Content-Length']) + self.exist_size - except: - total_size = 0 - - self._do_grab(fileObj, dest, total_size) - - def formatRequest(self, request): - if self.url.auth_info(): - enc = encodestring('%s:%s' % self.url.auth_info()) - request.add_header('Authorization', 'Basic %s' % enc) - - range_handlers = { - 'http' : HTTPRangeHandler, - 'https': HTTPRangeHandler, - 'ftp' : FTPRangeHandler - } - - if self.exist_size and range_handlers.has_key(self.scheme): - opener = urllib2.build_opener(range_handlers.get(self.scheme)()) - urllib2.install_opener(opener) - request.add_header('Range', 'bytes=%d-' % self.exist_size) - - proxy_handler = None - - if ctx.config.values.general.http_proxy and self.url.scheme() == "http": - http_proxy = ctx.config.values.general.http_proxy - proxy_handler = urllib2.ProxyHandler({URI(http_proxy).scheme(): http_proxy}) - - elif ctx.config.values.general.https_proxy and self.url.scheme() == "https": - https_proxy = ctx.config.values.general.https_proxy - proxy_handler = urllib2.ProxyHandler({URI(https_proxy): https_proxy}) - - elif ctx.config.values.general.ftp_proxy and self.url.scheme() == "ftp": - ftp_proxy = ctx.config.values.general.ftp_proxy - proxy_handler = urllib2.ProxyHandler({URI(http_proxy): ftp_proxy}) - - if proxy_handler: - ctx.ui.info(_("Proxy configuration has been found for '%s' protocol") % self.url.scheme()) - opener = urllib2.build_opener(proxy_handler) - urllib2.install_opener(opener) - - return request - - def err (self, error): - raise FetchError(error) - -class HTTPRangeHandler(urllib2.BaseHandler): - """ - to override the urllib2 error: 'Error 206: Partial Content' - this reponse from the HTTP server is already what we expected to get. - Don't give up, resume downloading.. - """ - - def http_error_206(self, request, fp, errcode, msg, headers): - return urllib.addinfourl(fp, headers, request.get_full_url()) - - def http_error_416(self, request, fp, errcode, msg, headers): - # HTTP 1.1's 'Range Not Satisfiable' error.. - raise RangeError - - -class FTPRangeHandler(urllib2.FTPHandler): - """ - FTP Range support.. - """ - def ftp_open(self, req): - host = req.get_host() - host, port = urllib.splitport(host) - if port is None: - port = ftplib.FTP_PORT - - try: - host = socket.gethostbyname(host) - except socket.error, msg: - raise FetchError(msg) - - path, attrs = urllib.splitattr(req.get_selector()) - dirs = path.split('/') - dirs = map(urllib.unquote, dirs) - dirs, file = dirs[:-1], dirs[-1] - if dirs and not dirs[0]: - dirs = dirs[1:] - try: - fw = self.connect_ftp('', '', host, port, dirs) - type = file and 'I' or 'D' - for attr in attrs: - attr, value = urllib.splitattr(attr) - if attr.lower() == 'type' and \ - value in ('a', 'A', 'i', 'I', 'd', 'D'): - type = value.upper() - - rawr = req.headers.get('Range', None) - if rawr: - rest = int(rawr.split("=")[1].rstrip("-")) - else: - rest = 0 - - fp, retrlen = fw.retrfile(file, type, rest) - - fb, lb = rest, retrlen - if retrlen is None or retrlen == 0: - raise RangeError - retrlen = lb - fb - if retrlen < 0: - # beginning of range is larger than file - raise RangeError - - headers = '' - mtype = guess_type(req.get_full_url())[0] - if mtype: - headers += 'Content-Type: %s\n' % mtype - if retrlen is not None and retrlen >= 0: - headers += 'Content-Length: %d\n' % retrlen - - try: - from cStringIO import StringIO - except ImportError, msg: - from StringIO import StringIO - - return urllib.addinfourl(fp, Message(StringIO(headers)), req.get_full_url()) - except ftplib.all_errors, msg: - raise IOError, (_('ftp error'), msg), sys.exc_info()[2] - - def connect_ftp(self, user, passwd, host, port, dirs): - fw = ftpwrapper('', '', host, port, dirs) - return fw - -class ftpwrapper(urllib.ftpwrapper): - def retrfile(self, file, type, rest=None): - self.endtransfer() - if type in ('d', 'D'): cmd = 'TYPE A'; isdir = 1 - else: cmd = 'TYPE ' + type; isdir = 0 - try: - self.ftp.voidcmd(cmd) - except ftplib.all_errors: - self.init() - self.ftp.voidcmd(cmd) - conn = None - if file and not isdir: - try: - self.ftp.nlst(file) - except ftplib.error_perm, reason: - raise IOError, (_('ftp error'), reason), sys.exc_info()[2] - # Restore the transfer mode! - self.ftp.voidcmd(cmd) - try: - cmd = 'RETR ' + file - conn = self.ftp.ntransfercmd(cmd, rest) - except ftplib.error_perm, reason: - if str(reason)[:3] == '501': - # workaround for REST not suported error - fp, retrlen = self.retrfile(file, type) - fp = RangeableFileObject(fp, (rest,'')) - return (fp, retrlen) - elif str(reason)[:3] != '550': - raise IOError, (_('ftp error'), reason), sys.exc_info()[2] - if not conn: - self.ftp.voidcmd('TYPE A') - if file: cmd = 'LIST ' + file - else: cmd = 'LIST' - conn = self.ftp.ntransfercmd(cmd) - self.busy = 1 - return (urllib.addclosehook(conn[0].makefile('rb'), - self.endtransfer), conn[1]) - diff --git a/tags/pisi-1.1_beta13/pisi/file.py b/tags/pisi-1.1_beta13/pisi/file.py deleted file mode 100644 index fdd1cc1f..00000000 --- a/tags/pisi-1.1_beta13/pisi/file.py +++ /dev/null @@ -1,266 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# -# Author: Eray Ozkural - -""" -generic file abstraction that allows us to use URIs for everything -we support only the simple read case ATM -we are just encapsulating a common pattern in our program, nothing big. -like all pisi classes, it has been programmed in a non-restrictive way -""" - -import os -import types -import bz2 -import shutil - -import gettext -__trans = gettext.translation('pisi', fallback=True) -_ = __trans.ugettext - -import pisi -from pisi.uri import URI -from pisi.util import join_path as join -from pisi.fetcher import fetch_url -import pisi.context as ctx - -class AlreadyHaveException(pisi.Exception): - def __init__(self, url, localfile): - pisi.Exception.__init__(self, "URL %s already downloaded as %s" % (url, localfile)) - self.url = url - self.localfile = localfile - -class NoSignatureFound(pisi.Exception): - def __init__(self, url): - pisi.Exception.__init__(self, "No signature found for %s" % url) - self.url = url - -class Error(pisi.Error): - pass - -class InvalidSignature(pisi.Error): - def __init__(self, url): - pisi.Exception.__init__(self, " invalid for %s" % url) - self.url = url - -class File: - - (read, write) = range(2) # modes - (bz2, gzip, auto) = range(3) # compress enums - (detached, whatelse) = range(2) - - @staticmethod - def make_uri(uri): - "handle URI arg" - if type(uri) == types.StringType or type(uri) == types.UnicodeType: - uri = URI(uri) - elif not isinstance(uri, URI): - raise Error(_("uri must have type either URI or string")) - return uri - - @staticmethod - def choose_method(filename, compress): - # this is really simple (^_^) -- exa - if compress == File.auto: - if filename.endswith('.bz2'): - return File.bz2 - elif filename.endswith('.gz'): - return File.gzip - else: - return None - else: - return compress - - @staticmethod - def decompress(localfile, compress): - compress = File.choose_method(localfile, compress) - if compress == File.bz2: - open(localfile[:-4], "w").write(bz2.BZ2File(localfile).read()) - localfile = localfile[:-4] - elif compress == File.gzip: - raise Error(_("zip compression not supported yet")) - return localfile - - @staticmethod - def download(uri, transfer_dir = "/tmp", sha1sum = False, - compress = None, sign = None, copylocal = False): - - assert isinstance(uri, URI) - - if sha1sum: - sha1filename = File.download(URI(uri.get_uri() + '.sha1sum'), transfer_dir) - sha1f = file(sha1filename) - newsha1 = sha1f.readlines()[0] - - if uri.is_remote_file() or copylocal: - localfile = join(transfer_dir, uri.filename()) - - # TODO: code to use old .sha1sum file, is this a necessary optimization? - #oldsha1fn = localfile + '.sha1sum' - #if os.exists(oldsha1fn): - #oldsha1 = file(oldsha1fn).readlines()[0] - if sha1sum and os.path.exists(localfile): - oldsha1 = pisi.util.sha1_file(localfile) - if (newsha1 == oldsha1): - # early terminate, we already got it ;) - raise AlreadyHaveException(uri, localfile) - - if uri.is_remote_file(): - ctx.ui.info(_("Fetching %s") % uri.get_uri(), verbose=True) - fetch_url(uri, transfer_dir, ctx.ui.Progress) - else: - # copy to transfer dir, - localfile = join(transfer_dir, uri.filename()) - ctx.ui.info(_("Copying %s to transfer dir") % uri.get_uri(), verbose=True) - shutil.copy(uri.get_uri(), transfer_dir) - else: - localfile = uri.get_uri() #TODO: use a special function here? - if not os.path.exists(localfile): - raise IOError(_("File '%s' not found.") % localfile) - if not os.access(localfile, os.W_OK): - oldfn = localfile - localfile = join(transfer_dir, os.path.basename(localfile)) - shutil.copy(oldfn, localfile) - - if sha1sum: - if (pisi.util.sha1_file(localfile) != newsha1): - raise Error(_("File integrity of %s compromised.") % uri) - - localfile = File.decompress(localfile, compress) - - return localfile - - - def __init__(self, uri, mode, transfer_dir = "/tmp", - sha1sum = False, compress = None, sign = None): - "it is pointless to open a file without a URI and a mode" - - self.transfer_dir = transfer_dir - self.sha1sum = sha1sum - self.compress = compress - self.sign = sign - - - uri = File.make_uri(uri) - if mode==File.read or mode==File.write: - self.mode = mode - else: - raise Error(_("File mode must be either File.read or File.write")) - if uri.is_remote_file(): - if self.mode == File.read: - localfile = File.download(uri, transfer_dir, sha1sum, compress, sign) - else: - raise Error(_("Remote write not implemented")) - else: - localfile = uri.get_uri() - if self.mode == File.read: - localfile = File.decompress(localfile, self.compress) - - if self.mode == File.read: - access = 'r' - else: - access = 'w' - self.__file__ = file(localfile, access) - self.localfile = localfile - - def local_file(self): - "returns the underlying file object" - return self.__file__ - - def close(self, delete_transfer = False): - "this method must be called at the end of operation" - self.__file__.close() - if self.mode == File.write: - compressed_file = None - if self.compress == File.bz2: - compressed_file = self.localfile + ".bz2" - bz2.BZ2File(compressed_file, "w").write(open(self.localfile, "r").read()) - - elif self.compress == File.gzip: - raise Error(_("gzip compression not supported yet")) - - if self.sha1sum: - sha1 = pisi.util.sha1_file(self.localfile) - cs = file(self.localfile + '.sha1sum', 'w') - cs.write(sha1) - cs.close() - if compressed_file: - sha1 = pisi.util.sha1_file(compressed_file) - cs = file(compressed_file + '.sha1sum', 'w') - cs.write(sha1) - cs.close() - - if self.sign==File.detached: - if pisi.util.run_batch('gpg --detach-sig ' + self.localfile)[0]: - raise Error(_("ERROR: gpg --detach-sig %s failed") % self.localfile) - if compressed_file: - if pisi.util.run_batch('gpg --detach-sig ' + compressed_file)[0]: - raise Error(_("ERROR: gpg --detach-sig %s failed") % compressed_file) - - @staticmethod - def check_signature(uri, transfer_dir, sign=detached): - if sign==File.detached: - try: - sigfilename = File.download(URI(uri + '.sig'), transfer_dir) - except: - raise NoSignatureFound(uri) - if os.system('gpg --verify ' + sigfilename) != 0: - raise InvalidSignature(uri) - # everything is all right here - - def flush(self): - self.__file__.flush() - - def fileno(self): - return self.__file__.fileno() - - def isatty(self): - return self.__file__.isatty() - - def next(self): - return self.__file__.next() - - def read(self, size = None): - if size: - return self.__file__.read(size) - else: - return self.__file__.read() - - def readline(self, size = None): - if size: - return self.__file__.readline(size) - else: - return self.__file__.readline() - - def readlines(self, size = None): - if size: - return self.__file__.readlines(size) - else: - return self.__file__.readlines() - - def xreadlines(self): - return self.__file__.xreadlines() - - def seek(self, offset, whence=0): - self.__file__.seek(offset, whence) - - def tell(self): - return self.__file__.tell() - - def truncate(self): - self.__file__.truncate() - - def write(self, str): - self.__file__.write(str) - - def writelines(self, sequence): - self.__file__.writelines(sequence) diff --git a/tags/pisi-1.1_beta13/pisi/files.py b/tags/pisi-1.1_beta13/pisi/files.py deleted file mode 100644 index d1076d95..00000000 --- a/tags/pisi-1.1_beta13/pisi/files.py +++ /dev/null @@ -1,102 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# -# Authors: Eray Ozkural - -'''Files module provides access to files.xml. files.xml is generated -during the build process of a package and used in installation.''' - - -import pisi.pxml.autoxml as autoxml -from pisi.util import Checks -import pisi.lockeddbshelve as shelve - - -class FileInfo: - """File holds the information for a File node/tag in files.xml""" - - __metaclass__ = autoxml.autoxml - - t_Path = [ autoxml.String, autoxml.mandatory ] - t_Type = [ autoxml.String, autoxml.mandatory ] - t_Size = [ autoxml.Long, autoxml.optional ] - t_Hash = [ autoxml.String, autoxml.optional, "SHA1Sum" ] - t_Permanent = [ autoxml.String, autoxml.optional ] - - def __str__(self): - s = "%s, type: %s, size: %s, sha1sum: %s" % (self.path, self.type, - self.size, self.hash) - return s - - -class Files(autoxml.XmlFile): - - __metaclass__ = autoxml.autoxml - - tag = "Files" - - t_List = [ [FileInfo], autoxml.optional, "File"] - - def append(self, fileinfo): - self.list.append(fileinfo) - - -class FilesDB(shelve.LockedDBShelf): - - def __init__(self): - shelve.LockedDBShelf.__init__(self, 'files') - - def add_files(self, pkg_name, files, txn = None): - def proc(txn): - for x in files.list: - path = x.path - del x.path # don't store redundant attribute in db - self.put(path, (pkg_name, x), txn) - x.path = path # store it back in - self.txn_proc(proc, txn) - - def remove_files(self, files, txn = None): - def proc(txn): - for x in files.list: - if self.has_key(x.path): - self.delete(x.path, txn) - self.txn_proc(proc, txn) - - def has_file(self, path, txn = None): - return self.has_key(str(path), txn) - - def get_file(self, path, txn = None): - path = str(path) - def proc(txn): - if not self.has_key(path, txn): - return None - else: - (name, fileinfo) = self.get(path, txn) - fileinfo.path = path - return (name, fileinfo) - return self.txn_proc(proc, txn) - - def match_files(self, glob): - # NB: avoid using, this reads the entire db - import fnmatch - glob = str(glob) - infos = [] - for key in self.keys(): - if fnmatch.fnmatch(key, glob): - - # FIXME: Why should we assign path attribute manually - # in fileinfo? This is also done in get_file(), seems - # like a dirty workaround... - baris - name = self[key][0] - fileinfo = self[key][1] - fileinfo.path = key - infos.append((name, fileinfo)) - return infos diff --git a/tags/pisi-1.1_beta13/pisi/graph.py b/tags/pisi-1.1_beta13/pisi/graph.py deleted file mode 100644 index ffc15396..00000000 --- a/tags/pisi-1.1_beta13/pisi/graph.py +++ /dev/null @@ -1,175 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. - -# the most simple minded digraph class ever - - -import sys -import string - -import pisi - -import gettext -__trans = gettext.translation('pisi', fallback=True) -_ = __trans.ugettext - -# not an error! - -class CycleException(pisi.Exception): - def __init__(self, cycle): - self.cycle = cycle - - def __str__(self): - return _('Encountered cycle %s') % self.cycle - -class Digraph(object): - - def __init__(self): - self.__v = set() - self.__adj = {} - self.__vdata = {} - self.__edata = {} - - def vertices(self): - "return set of vertex descriptors" - return self.__v - - def edges(self): - "return a list of edge descriptors" - list = [] - for u in self.__v: - for v in self.__u: - list.append( (u,v) ) - return list - - def from_list(self, el): - "convert a list of edges (u,v) to graph" - for (u,v) in el: - self.add_edge(u,v) - - def add_vertex(self, u, data = None): - "add vertex u, optionally with data" - assert not u in self.__v - self.__v.add(u) - self.__adj[u] = set() - if data: - self.__vdata[u] = data - self.__edata[u] = {} - - def add_edge(self, u, v, edata = None, udata = None, vdata = None): - "add edge u -> v" - if not u in self.__v: - self.add_vertex(u, udata) - if not v in self.__v: - self.add_vertex(v, vdata) - self.__adj[u].add(v) - if edata != None: - self.__edata[u][v] = edata - - def add_biedge(self, u, v, edata = None): - self.add_edge(u, v, edata) - self.add_edge(v, u, edata) - - def set_vertex_data(self, u, data): - self.__vdata[u] = data - - def vertex_data(self, u): - return self.__vdata[u] - - def edge_data(self, u, v): - return self.__edata[u][v] - - def has_vertex(self, u): - return u in self.__v - - def has_edge(self, u,v): - if u in self.__v: - return v in self.__adj[u] - else: - return False - - def adj(self, u): - return self.__adj[u] - - def dfs(self, finish_hook = None): - self.color = {} - self.p = {} - self.d = {} - self.f = {} - for u in self.__v: - self.color[u] = 'w' # mark white (unexplored) - self.p[u] = None - self.time = 0 - for u in self.__v: - if self.color[u] == 'w': - self.dfs_visit(u, finish_hook) - - def dfs_visit(self, u, finish_hook): - self.color[u] = 'g' # mark green (discovered) - self.d[u] = self.time = self.time + 1 - for v in self.adj(u): - if self.color[v] == 'w': # explore unexplored vertices - self.p[v] = u - self.dfs_visit(v, finish_hook) - elif self.color[v] == 'g': # cycle detected - cycle = [u] - while self.p[u]: - u = self.p[u] - cycle.append(u) - cycle.reverse() - raise CycleException(cycle) - self.color[u] = 'b' # mark black (completed) - if finish_hook: - finish_hook(u) - self.f[u] = self.time = self.time + 1 - - def cycle_free(self): - try: - self.dfs() - return True - except CycleException: - return False - - def topological_sort(self): - list = [] - self.dfs(lambda u: list.append(u)) - list.reverse() - return list - - def id_str(self, u): - def repl(char): - if char in string.punctuation: - return '_' - else: - return char - return pisi.util.concat(map(repl, str(u))) - - def write_graphviz(self, f): - f.write('digraph G {\n') - for u in self.vertices(): - f.write(self.id_str(u)) - self.write_graphviz_vlabel(f, u) - f.write(';\n') - f.write('\n') - for u in self.vertices(): - for v in self.adj(u): - f.write( self.id_str(u) + ' -> ' + self.id_str(v)) - self.write_graphviz_elabel(f, u, v) - f.write(';\n') - f.write('\n') - f.write('}\n') - - def write_graphviz_vlabel(self, f, u): - pass - - def write_graphviz_elabel(self, f, u, v): - pass - diff --git a/tags/pisi-1.1_beta13/pisi/index.py b/tags/pisi-1.1_beta13/pisi/index.py deleted file mode 100644 index ac3a4118..00000000 --- a/tags/pisi-1.1_beta13/pisi/index.py +++ /dev/null @@ -1,173 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# -# Author: Eray Ozkural - - -"""PISI source/package index""" - -import os - -import gettext -__trans = gettext.translation('pisi', fallback=True) -_ = __trans.ugettext - -import pisi -import pisi.context as ctx -import pisi.specfile as specfile -import pisi.metadata as metadata -import pisi.packagedb as packagedb -import pisi.sourcedb as sourcedb -import pisi.util as util -from pisi.package import Package -from pisi.pxml.xmlfile import XmlFile -from pisi.file import File -import pisi.pxml.autoxml as autoxml -from pisi.uri import URI -import pisi.component as component -import pisi.specfile as specfile - - -class Error(pisi.Error): - pass - - -class Index(XmlFile): - __metaclass__ = autoxml.autoxml - - tag = "PISI" - - t_Distribution = [ component.Distribution, autoxml.optional ] - t_Specs = [ [specfile.SpecFile], autoxml.optional, "SpecFile"] - t_Packages = [ [metadata.Package], autoxml.optional, "Package"] - #t_Metadatas = [ [metadata.MetaData], autoxml.optional, "MetaData"] - t_Components = [ [component.Component], autoxml.optional, "Component"] - - def name(): - return self.distribution.name + self.distribution.repositoryname - - def read_uri(self, uri, tmpdir, force = False): - self.read(uri, tmpDir=tmpdir, sha1sum=not force, - compress=File.auto, sign=File.detached, copylocal = True) - - # read index for a given repo, force means download even if remote not updated - def read_uri_of_repo(self, uri, repo = None, force = False): - """Read PSPEC file""" - if repo: - tmpdir = os.path.join(ctx.config.index_dir(), repo) - else: - tmpdir = os.path.join(ctx.config.tmp_dir(), 'index') - pisi.util.clean_dir(tmpdir) - pisi.util.check_dir(tmpdir) - - # write uri - urlfile = file(pisi.util.join_path(tmpdir, 'uri'), 'w') - urlfile.write(uri) # uri - urlfile.close() - - self.read_uri(uri, tmpdir, force) - - if not repo: - repo = self.distribution.name() - # and what do we do with it? move it to index dir properly - newtmpdir = os.path.join(ctx.config.index_dir(), repo) - pisi.util.clean_dir(newtmpdir) # replace newtmpdir - shutil.move(tmpdir, newtmpdir) - - def check_signature(self, filename, repo): - tmpdir = os.path.join(ctx.config.index_dir(), repo) - File.check_signature(filename, tmpdir) - - def index(self, repo_uri, skip_sources=False, non_recursive=False): - self.repo_dir = repo_uri - for root, dirs, files in os.walk(repo_uri): - for fn in files: - if fn.endswith(ctx.const.package_suffix): - ctx.ui.info(_('Adding %s to package index') % fn) - self.add_package(os.path.join(root, fn), repo_uri) - if fn == 'component.xml': - ctx.ui.info(_('Adding %s to component index') % fn) - self.add_component(os.path.join(root, fn)) - if fn == 'pspec.xml' and not skip_sources: - self.add_spec(os.path.join(root, fn), repo_uri) - if fn == 'distribution.xml': - self.add_distro(os.path.join(root, fn)) - if non_recursive: - del dirs[0:] - - def update_db(self, repo, txn = None): - ctx.componentdb.remove_repo(repo, txn=txn) - for comp in self.components: - ctx.componentdb.update_component(comp, repo, txn) - ctx.packagedb.remove_repo(repo, txn=txn) - for pkg in self.packages: - ctx.packagedb.add_package(pkg, repo, txn=txn) - ctx.sourcedb.remove_repo(repo, txn=txn) - for sf in self.specs: - ctx.sourcedb.add_spec(sf, repo, txn=txn) - - def add_package(self, path, repo_uri): - package = Package(path, 'r') - # extract control files - util.clean_dir(ctx.config.install_dir()) - package.extract_PISI_files(ctx.config.install_dir()) - - md = metadata.MetaData() - md.read(os.path.join(ctx.config.install_dir(), ctx.const.metadata_xml)) - md.package.packageSize = os.path.getsize(path) - if ctx.config.options and ctx.config.options.absolute_uris: - # FIXME: the name "absolute_uris" does not seem to fit below :/ - md.package.packageURI = os.path.realpath(path) - else: # create relative path by default - # TODO: in the future well do all of this with purl/pfile/&helpers - # really? heheh -- future exa - md.package.packageURI = util.removepathprefix(repo_uri, path) - # check package semantics - errs = md.errors() - if md.errors(): - ctx.ui.error(_('Package %s: metadata corrupt, skipping...') % md.package.name) - ctx.ui.error(unicode(Error(*errs))) - else: - self.packages.append(md.package) - - def add_component(self, path): - comp = component.Component() - #try: - comp.read(path) - self.components.append(comp) - #except: - # raise Error(_('Component in %s is corrupt') % path) - #ctx.ui.error(str(Error(*errs))) - - def add_distro(self, path): - distro = component.Distribution() - #try: - distro.read(path) - self.distribution = distro - #except: - # raise Error(_('Distribution in %s is corrupt') % path) - #ctx.ui.error(str(Error(*errs))) - - def add_spec(self, path, repo_uri): - import pisi.build - ctx.ui.info(_('Adding %s to source index') % path) - #TODO: may use try/except to handle this - builder = pisi.build.Builder(path) - #ctx.ui.error(_('SpecFile in %s is corrupt, skipping...') % path) - #ctx.ui.error(str(Error(*errs))) - builder.fetch_component() - sf = builder.spec - if ctx.config.options and ctx.config.options.absolute_uris: - sf.source.sourceURI = os.path.realpath(path) - else: # create relative path by default - sf.source.sourceURI = util.removepathprefix(repo_uri, path) - # check component - self.specs.append(sf) diff --git a/tags/pisi-1.1_beta13/pisi/installdb.py b/tags/pisi-1.1_beta13/pisi/installdb.py deleted file mode 100644 index b130251b..00000000 --- a/tags/pisi-1.1_beta13/pisi/installdb.py +++ /dev/null @@ -1,216 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# -# -# installation database -# -# Author: Eray Ozkural - -# System -import os -import fcntl - -import gettext -__trans = gettext.translation('pisi', fallback=True) -_ = __trans.ugettext - -# PiSi -import pisi -import pisi.context as ctx -import pisi.lockeddbshelve as shelve -from pisi.files import Files -import pisi.util as util -from pisi.util import join_path as join - - -class InstallDBError(pisi.Error): - pass - - -class InstallInfo: - # some data is replicated from packagedb - # we store as an object, hey, we can waste O(1) space. - # this is also easier to modify in the future, without - # requiring database upgrades! wow! - def __init__(self, state, version, release, build, distribution, time): - self.state = state - self.version = version - self.release = release - self.build = build - self.distribution = distribution - self.time = time - - def one_liner(self): - import time - time_str = time.strftime("%d %b %Y %H:%M", self.time) - s = '%2s|%10s|%6s|%6s|%8s|%12s' % (self.state, self.version, self.release, - self.build, self.distribution, - time_str) - return s - - state_map = { 'i': _('installed'), 'ip':_('installed-pending'), - 'r':_('removed'), 'p': _('purged') } - - def __str__(self): - s = _("State: %s\nVersion: %s, Release: %s, Build: %s\n") % \ - (InstallInfo.state_map[self.state], self.version, - self.release, self.build) - import time - time_str = time.strftime("%d %b %Y %H:%M", self.time) - s += _('Distribution: %s, Install Time: %s\n') % (self.distribution, - time_str) - return s - - -class InstallDB: - - def __init__(self): - self.d = shelve.LockedDBShelf('install') - self.dp = shelve.LockedDBShelf('configpending') - self.files_dir = join(ctx.config.db_dir(), 'files') - - def close(self): - self.d.close() - self.dp.close() - - def files_name(self, pkg, version, release): - pkg_dir = self.pkg_dir(pkg, version, release) - return join(pkg_dir, ctx.const.files_xml) - - def files(self, pkg): - pkg = str(pkg) - pkginfo = self.d[pkg] - files = Files() - files.read(self.files_name(pkg,pkginfo.version,pkginfo.release)) - return files - - def pkg_dir(self, pkg, version, release): - return join(ctx.config.lib_dir(), 'package', - pkg + '-' + version + '-' + release) - - def is_recorded(self, pkg, txn = None): - pkg = str(pkg) - def proc(txn): - return self.d.has_key(pkg) - return self.d.txn_proc(proc, txn) - - def is_installed(self, pkg, txn = None): - pkg = str(pkg) - def proc(txn): - if self.is_recorded(pkg, txn): - info = self.d.get(pkg, txn) - return info.state=='i' or info.state=='ip' - else: - return False - return self.d.txn_proc(proc, txn) - - def list_installed(self, txn = None): - def proc(txn): - list = [] - for (pkg, info) in self.d.items(txn): - if info.state=='i' or info.state=='ip': - list.append(pkg) - return list - return self.d.txn_proc(proc, txn) - - def list_pending(self): - # warning: reads the entire db - dict = {} - for (pkg, x) in self.dp.items(): - pkginfo = self.d[pkg] - dict[pkg] = pkginfo - return dict - - def get_info(self, pkg): - pkg = str(pkg) - return self.d[pkg] - - def get_version(self, pkg): - pkg = str(pkg) - info = self.d[pkg] - return (info.version, info.release, info.build) - - def is_removed(self, pkg): - pkg = str(pkg) - if self.is_recorded(pkg): - info = self.d[pkg] - return info.state=='r' - else: - return False - - def install(self, pkg, version, release, build, distro = "", - config_later = False, rebuild=False, txn = None): - """install package with specific version, release, build""" - pkg = str(pkg) - def proc(txn): - if self.is_installed(pkg, txn): - raise InstallDBError(_("Already installed")) - if config_later: - state = 'ip' - self.dp.put(pkg, True, txn) - else: - state = 'i' - - # FIXME: it might be more appropriate to pass date - # as an argument, or installation data afterwards - # to do this -- exa - if not rebuild: - import time - ctime = time.localtime() - else: - files_xml = self.files_name(pkg, version, release) - ctime = util.creation_time(files_xml) - - self.d.put(pkg, InstallInfo(state, version, release, build, distro, ctime), txn) - - self.d.txn_proc(proc,txn) - - def clear_pending(self, pkg, txn = None): - pkg = str(pkg) - def proc(txn): - info = self.d.get(pkg, txn) - if self.is_installed(pkg, txn): - assert info.state == 'ip' - info.state = 'i' - self.d.put(pkg, info, txn) - self.dp.delete(pkg, txn) - self.d.txn_proc(proc,txn) - - def remove(self, pkg, txn = None): - pkg = str(pkg) - def proc(txn): - info = self.d.get(pkg, txn) - info.state = 'r' - self.d.put(pkg, info, txn) - self.d.txn_proc(proc, txn) - - def purge(self, pkg, txn = None): - pkg = str(pkg) - def proc(txn): - if self.d.has_key(pkg, txn): - self.d.delete(pkg, txn) - self.d.txn_proc(proc, txn) - -db = None - -def init(): - global db - if db: - return db - - db = InstallDB() - return db - -def finalize(): - global db - if db: - db.close() - db = None diff --git a/tags/pisi-1.1_beta13/pisi/itembyrepodb.py b/tags/pisi-1.1_beta13/pisi/itembyrepodb.py deleted file mode 100644 index 57264ab1..00000000 --- a/tags/pisi-1.1_beta13/pisi/itembyrepodb.py +++ /dev/null @@ -1,221 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# -# Author: Eray Ozkural - -import os -import fcntl -import types - -import gettext -__trans = gettext.translation('pisi', fallback=True) -_ = __trans.ugettext - -import pisi -import pisi.util as util -import pisi.context as ctx -import pisi.lockeddbshelve as shelve - -installed, thirdparty, repos, all = range(1, 5) - -"""installed and thirdparty are special databases to keep track -of already installed stuff and third party stuff not in any real repository. -repos means search in repositories only, and all means search in -repositories and special databases (called tracking databases) -""" - -class Error(pisi.Error): - pass - -class NotfoundError(pisi.Error): - pass - -class ItemByRepoDB(object): - - def __init__(self, name): - self.d = shelve.LockedDBShelf(name) - #self.dbyrepo = shelve.LockedDBShelf(name + '-byrepo') - - def close(self): - self.d.close() - - def clear(self, txn = None): - self.d.clear(txn=txn) - - def txn_proc(self, proc, txn): - return self.d.txn_proc(proc, txn) - - def items(self): - return self.d.items() - - @staticmethod - def not_just_tracking(data): - keys = data.keys() - if len(keys)==1: - if 'trdparty' in keys or 'inst' in keys: - return False - elif len(keys)==2: - if 'trdparty' in keys and 'inst' in keys: - return False - return True - #below is a slower way - #for x in data.keys(): - # if x.startsWith('repo-'): - # return True - #return False - - def list_if(self, pred): - return [ k for k,data in self.d.items() if pred(k, data)] - - def list(self, repo = None): - if repo == None: - repo = repos - if repo not in [repos, all]: - return [ k for k,data in self.d.items() if data.has_key(self.repo_str(repo))] - else: - if repo == all: - return [ pkg for pkg in self.d.keys() ] - else: - return self.list_if( lambda k,data: ItemByRepoDB.not_just_tracking(data) ) - - # TODO: carry this to repodb, really :/ - def order(self, repo = None): - if repo == None: - repo = repos - assert repo in [all, repos] - import pisi.repodb - order = [ 'repo-' + x for x in ctx.repodb.list() ] - if repo == all: - order += ['trdparty', 'inst'] - return order - -# def list_repo(self, repo): -# return self.dbyrepo[repo] - - def repo_str(self, repo): - if repo==thirdparty: - repo='trdparty' - elif repo==installed: - repo='inst' - else: - assert type(repo) == type("") - repo='repo-'+repo - return repo - - def str_repo(self, str): - if str.startswith('repo-'): - return str[5:] - elif str=='trdparty': - return thirdparty - elif str=='inst': - return installed - else: - raise Error(_('Invalid repository string')) - - def has_key(self, name, repo = None, txn = None): - name = str(name) - if repo == None: - repo = repos - haskey = self.d.has_key(name, txn) - if repo == all: - return haskey - elif repo == repos: - data = self.d.get(name, txn) - return haskey and ItemByRepoDB.not_just_tracking(data) - else: - repostr = self.repo_str(repo) - return haskey and self.d.get(name, txn).has_key(repostr) - - def get_item_repo(self, name, repo = None, txn = None): - name = str(name) - if repo == None: - repo = repos - def proc(txn): - if not self.d.has_key(name, txn=txn): - raise NotfoundError(_('Key %s not found') % name) - s = self.d.get(name, txn=txn) - if repo in [repos, all]: - for repostr in self.order(repo): - if s.has_key(repostr): - return (s[repostr], self.str_repo(repostr)) - else: - repostr = self.repo_str(repo) - if s.has_key(repostr): - return (s[repostr], repo) - raise NotfoundError(_('Key %s in repo %s not found') % (name, repo)) - #return None - - return self.d.txn_proc(proc, txn) - - def get_item(self, name, repo = None, txn = None): - if repo == None: - repo = repos - x = self.get_item_repo(name, repo, txn) - if x: - item, repo = x - # discard repo, not always needed - return item - else: - return None - - def which_repo(self, name, txn = None): - x = self.get_item_repo(name, txn=txn) - if x: - item, repo = x - return repo - else: - return None - - def add_item(self, name, obj, repo, txn = None): - assert not repo in [all, repos] - repostr = self.repo_str(repo) - def proc(txn): - if not self.d.has_key(name): - s = dict() - else: - s = self.d.get(name, txn) - s[ repostr ] = obj - self.d.put(name, s, txn) - self.d.txn_proc(proc, txn) - - def remove_item_repo(self, name, repo, txn = None): - assert not repo in [all, repos] - name = str(name) - def p(txn): - s = self.d.get(name, txn) - repostr = self.repo_str(repo) - if s.has_key(repostr): - del s[repostr] - if (len(s)==0): - self.d.delete(name, txn) - else: - self.d.put(name, s, txn) - self.d.txn_proc(p, txn) - - def remove_item_only(self, name, txn = None): - def p(txn): - repo = self.which_repo(name, txn=txn) - self.remove_item_repo(name, repo, txn=txn) - self.d.txn_proc(p, txn) - - def remove_item(self, name, repo=None, txn=None): - if repo == None: - repo = repos - if not repo in [all, repos]: - self.remove_item_repo(name, repo,txn=txn) - else: - self.remove_item_only(name,txn=txn) - - def remove_repo(self, repo, txn = None): - def proc(txn): - for key in self.d.keys(): - self.remove_item_repo(key, repo, txn=txn) - self.d.txn_proc(proc, txn) diff --git a/tags/pisi-1.1_beta13/pisi/lockeddbshelve.py b/tags/pisi-1.1_beta13/pisi/lockeddbshelve.py deleted file mode 100644 index e41e924b..00000000 --- a/tags/pisi-1.1_beta13/pisi/lockeddbshelve.py +++ /dev/null @@ -1,186 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# -# Authors: Eray Ozkural - -import os -import fcntl -import types -import cPickle - -import bsddb3.db as db -import bsddb3.dbobj as dbobj -#import bsddb3.dbshelve as shelve -import pisi.dbshelve as shelve - -import gettext -__trans = gettext.translation('pisi', fallback=True) -_ = __trans.ugettext - -import pisi -import pisi.context as ctx -from pisi.util import join_path - -from pisi.version import Version - -class Error(pisi.Error): - pass - -# check database version -# if write is given it knows it has write access -# if force is given it updates the specified db version -def check_dbversion(versionfile, ver, write=False, update=False): - verfn = join_path(pisi.context.config.db_dir(), versionfile) - firsttime = False - if os.path.exists(verfn): - verfile = file(verfn, 'r') - ls = verfile.readlines() - currver = Version(ls[0]) - dbver = Version(ver) - if currver < dbver: - if not update: - raise Error(_('Database version for %s insufficient. Please run rebuild-db command.') % versionfile) - else: - pass # continue to update, then - elif currver > dbver: - raise Error(_('Database version for %s greater than PiSi version. You need a newer PiSi.') % versionfile) - elif not update: - return True # db version is OK - else: - firsttime = True - if write and (update or firsttime): - if os.access(pisi.context.config.db_dir(), os.W_OK): - ctx.ui.warning(_('Writing current database version for %s') % versionfile) - verfile = file(verfn, 'w') - verfile.write(ver) - verfile.close() - else: - raise Error(_('Cannot attain write access to database environment')) - else: - raise Error(_('Database version %s not present.') % versionfile) - -def lock_dbenv(): - ctx.dbenv_lock = file(join_path(pisi.context.config.db_dir(), 'dbenv.lock'), 'w') - try: - fcntl.flock(ctx.dbenv_lock, fcntl.LOCK_EX | fcntl.LOCK_NB) - except IOError: - raise Error(_("Another instance of PISI is running. Only one instance is allowed to modify the PISI database at a time.")) - -# write: write access to database environment -# writeversion: would you like to be able -def init_dbenv(write=False, writeversion=False): - if os.access(pisi.context.config.db_dir(), os.R_OK): - # try to read version - check_dbversion('dbversion', pisi.__dbversion__, write=write, update=writeversion) - check_dbversion('filesdbversion', pisi.__filesdbversion__, write=write, update=writeversion) - else: - raise Error(_('Cannot attain read access to database environment')) - if write: - if os.access(pisi.context.config.db_dir(), os.W_OK): - lock_dbenv() - ctx.dbenv = dbobj.DBEnv() - flags = (db.DB_INIT_MPOOL | # cache - db.DB_INIT_TXN | # transaction subsystem - db.DB_INIT_LOG | # logging subsystem - db.DB_RECOVER | # run normal recovery - db.DB_CREATE) # allow db to create files - ctx.dbenv.set_cachesize(0, 4*1024*1024) - ctx.dbenv.open(pisi.context.config.db_dir(), flags) - ctx.dbenv.set_flags(db.DB_LOG_AUTOREMOVE, 1) # clear inactive logs automatically - else: - raise Error(_("Cannot write to PISI database.")) - else: - ctx.dbenv = None # read-only access to database - -#def open(filename, flags='r', mode = 0644, filetype = db.DB_BTREE): -# db = LockedDBShelf(None, mode, filetype, None, True) -# db.open(filename, filename, filetype, flags, mode) -# return db - -class LockedDBShelf(shelve.DBShelf): - """A simple wrapper to implement locking for bsddb's dbshelf""" - - def __init__(self, dbname, mode=0644, - filetype=db.DB_BTREE, dbenv = None): - if dbenv == None: - dbenv = ctx.dbenv - shelve.DBShelf.__init__(self, dbenv) - filename = join_path(pisi.context.config.db_dir(), dbname + '.bdb') - if dbenv and os.access(os.path.dirname(filename), os.W_OK): - flags = 'w' - elif os.access(filename, os.R_OK): - flags = 'r' - else: - raise Error(_('Cannot attain read or write access to database %s') % dbname) - self.open(filename, dbname, filetype, flags, mode) - - def destroy(self): - os.unlink(self.filename) - #self.close() - #self.db.remove(self.filename) - - def __del__(self): - # superclass does something funky, we don't need that - pass - - def open(self, filename, dbname, filetype, flags=db.DB_CREATE, mode=0644): - self.filename = filename - self.closed = False - if type(flags) == type(''): - sflag = flags - if sflag == 'r': - flags = db.DB_RDONLY - elif sflag == 'rw': - flags = 0 - elif sflag == 'w': - flags = db.DB_CREATE - elif sflag == 'c': - flags = db.DB_CREATE - elif sflag == 'n': - flags = db.DB_TRUNCATE | db.DB_CREATE - else: - raise Error, _("Flags should be one of 'r', 'w', 'c' or 'n' or use the bsddb.db.DB_* flags") - self.flags = flags - if self.flags & db.DB_RDONLY == 0: - flags |= db.DB_AUTO_COMMIT # use txn subsystem in write mode - self.lock() - filename = os.path.realpath(filename) # we give absolute path due to dbenv - #print 'opening', filename, filetype, flags, mode - return self.db.open(filename, None, filetype, flags, mode) - - def lock(self): - self.lockfile = file(self.filename + '.lock', 'w') - try: - fcntl.flock(self.lockfile, fcntl.LOCK_EX | fcntl.LOCK_NB) - except IOError: - raise Error(_("Another instance of PISI is running. Only one instance is allowed to modify the PISI database at a time.")) - - def close(self): - if self.closed: - return - self.db.close() - if self.flags & db.DB_RDONLY == 0: - self.unlock() - self.closed = True - - def unlock(self): - self.lockfile.close() - os.unlink(self.filename + '.lock') - - @staticmethod - def encodekey(key): - '''utility method for dbs that must store unicodes in keys''' - if type(key)==types.UnicodeType: - return key.encode('utf-8') - elif type(key)==types.StringType: - return key - else: - raise Error('Key must be either string or unicode') diff --git a/tags/pisi-1.1_beta13/pisi/metadata.py b/tags/pisi-1.1_beta13/pisi/metadata.py deleted file mode 100644 index 7e034f33..00000000 --- a/tags/pisi-1.1_beta13/pisi/metadata.py +++ /dev/null @@ -1,107 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# -# Authors: Eray Ozkural -# Baris Metin - -"Package Operations: install/remove/upgrade" - -import os -import sys - -import gettext -__trans = gettext.translation('pisi', fallback=True) -_ = __trans.ugettext - -import pisi -import pisi.context as ctx -from pisi.uri import URI -import pisi.util as util -import pisi.dependency as dependency -import pisi.pgraph as pgraph -import pisi.packagedb as packagedb -import pisi.repodb -import pisi.installdb -from pisi.index import Index -import pisi.cli -import pisi.atomicoperations as atomicoperations -import pisi.ui as ui -from pisi.version import Version - -class Error(pisi.Error): - pass - -class PisiUpgradeException(pisi.Exception): - """application must reload all pisi modules it imported after receiving - this exception""" - def __init__(self): - pisi.Exception.__init__(self, _("Upgrading PISI requires database rebuild and restart")) - -def upgrade_pisi(): - ctx.ui.warning(_("PISI package has been upgraded. Rebuilding PISI database.")) - pisi.api.finalize() - os.system('pisi rebuild-db -y') - #reload(pisi) - #pisi.api.init() - #pisi.api.rebuild_db() - raise PisiUpgradeException() - -# high level operations - -def install(packages, reinstall = False): - """install a list of packages (either files/urls, or names)""" - - # FIXME: this function name "install" makes impossible to import - # and use install module directly. - from pisi.atomicoperations import Error as InstallError - - # determine if this is a list of files/urls or names - if packages[0].endswith(ctx.const.package_suffix): # they all have to! - return install_pkg_files(packages) - else: - return install_pkg_names(packages, reinstall) - -def install_pkg_files(package_URIs): - """install a number of pisi package files""" - from package import Package - - ctx.ui.debug('A = %s' % str(package_URIs)) - - for x in package_URIs: - if not x.endswith(ctx.const.package_suffix): - raise Error(_('Mixing file names and package names not supported yet.')) - - if ctx.config.get_option('ignore_dependency'): - # simple code path then - for x in package_URIs: - atomicoperations.install_single_file(x) - return # short circuit - - # read the package information into memory first - # regardless of which distribution they come from - d_t = {} - dfn = {} - for x in package_URIs: - package = Package(x) - package.read() - name = str(package.metadata.package.name) - d_t[name] = package.metadata.package - dfn[name] = x - - def satisfiesDep(dep): - # is dependency satisfied among available packages - # or packages to be installed? - return dependency.installed_satisfies_dep(dep) \ - or dependency.dict_satisfies_dep(d_t, dep) - - # for this case, we have to determine the dependencies - # that aren't already satisfied and try to install them - # from the repository - dep_unsatis = [] - for name in d_t.keys(): - pkg = d_t[name] - deps = pkg.runtimeDependencies() - for dep in deps: - if not satisfiesDep(dep): - dep_unsatis.append(dep) - - # now determine if these unsatisfied dependencies could - # be satisfied by installing packages from the repo - - # if so, then invoke install_pkg_names - extra_packages = [x.package for x in dep_unsatis] - if extra_packages: - ctx.ui.info(_("""The following packages will be installed -in the respective order to satisfy extra dependencies: -""") + util.strlist(extra_packages)) - if not ctx.ui.confirm(_('Do you want to continue?')): - raise Error(_('External dependencies not satisfied')) - install_pkg_names(extra_packages) - - class PackageDB: - def get_package(self, key, repo = None): - return d_t[str(key)] - - packagedb = PackageDB() - - A = d_t.keys() - - if len(A)==0: - ctx.ui.info(_('No packages to install.')) - return - - # try to construct a pisi graph of packages to - # install / reinstall - - G_f = pgraph.PGraph(packagedb) # construct G_f - - # find the "install closure" graph of G_f by package - # set A using packagedb - for x in A: - G_f.add_package(x) - B = A - while len(B) > 0: - Bp = set() - for x in B: - pkg = packagedb.get_package(x) - for dep in pkg.runtimeDependencies(): - if dependency.dict_satisfies_dep(d_t, dep): - if not dep.package in G_f.vertices(): - Bp.add(str(dep.package)) - G_f.add_dep(x, dep) - B = Bp - if ctx.config.get_option('debug'): - G_f.write_graphviz(sys.stdout) - order = G_f.topological_sort() - if not ctx.get_option('ignore_file_conflicts'): - check_conflicts(order, packagedb) - order.reverse() - ctx.ui.info(_('Installation order: ') + util.strlist(order) ) - - if ctx.get_option('dry_run'): - return - - ctx.ui.notify(ui.packagestogo, order = order) - - for x in order: - atomicoperations.install_single_file(dfn[x]) - -def check_conflict(pkg): - conflicts = [] - - for c in pkg.conflicts: - if ctx.installdb.is_installed(c): - conflicts.append(c) - - return conflicts - -def calculate_conflicts(order, packagedb): - B_0 = set(order) - C = D = set() - pkg_conflicts = {} - - for x in order: - pkg = packagedb.get_package(x) - B_p = set(check_conflict(pkg)) - if B_p: - pkg_conflicts[x] = B_p - C = C.union(B_p) - - B_i = B_0.intersection(set(pkg.conflicts)) - # check if there are any conflicts within the packages that are - # going to be installed - if B_i: - D = D.union(B_i) - D.add(pkg.name) - - return (C, D, pkg_conflicts) - -def check_conflicts(order, packagedb): - """check if upgrading to the latest versions will cause havoc - done in a simple minded way without regard for dependencies of - conflicts, etc.""" - - (C, D, pkg_conflicts) = calculate_conflicts(order, packagedb) - - if D: - raise Error(_("Selected packages [%s] are in conflict with each other.") % - util.strlist(list(D))) - - if pkg_conflicts: - conflicts = "" - for pkg in pkg_conflicts.keys(): - conflicts += _("[%s conflicts with: %s]") % (pkg, util.strlist(pkg_conflicts[pkg])) - - ctx.ui.info(_("The following packages have conflicts: %s") % - conflicts) - - if not ctx.ui.confirm(_('Remove the following conflicting packages?')): - raise Error(_("Conflicts remain")) - - if remove(list(C), True) == False: - raise Error(_("Conflicts remain")) - -def expand_components(A): - Ap = set() - for x in A: - if ctx.componentdb.has_component(x): - Ap = Ap.union(ctx.componentdb.get_union_comp(x).packages) - else: - Ap.add(x) - return Ap - -def is_upgradable(name, ignore_build = False): - if not ctx.installdb.is_installed(name): - return False - (version, release, build) = ctx.installdb.get_version(name) - try: - pkg = ctx.packagedb.get_package(name) - except: - return False - if ignore_build or (not build) or (not pkg.build): - return Version(release) < Version(pkg.release) - else: - return build < pkg.build - -def upgrade_base(A = set()): - ignore_build = ctx.get_option('ignore_build_no') - if not ctx.get_option('bypass_safety'): - if ctx.componentdb.has_component('system.base'): - systembase = set(ctx.componentdb.get_union_comp('system.base').packages) - extra_installs = filter(lambda x: not ctx.installdb.is_installed(x), systembase - A) - if extra_installs: - ctx.ui.warning(_('Safety switch: Following packages in system.base will be installed: ') + - util.strlist(extra_installs)) - G_f, install_order = plan_install_pkg_names(extra_installs) - extra_upgrades = filter(lambda x: is_upgradable(x, ignore_build), systembase - set(install_order)) - upgrade_order = [] - if extra_upgrades: - ctx.ui.warning(_('Safety switch: Following packages in system.base will be upgraded: ') + - util.strlist(extra_upgrades)) - G_f, upgrade_order = plan_upgrade(extra_upgrades, ignore_build) - # return packages that must be added to any installation - return set(install_order + upgrade_order) - else: - ctx.ui.warning(_('Safety switch: the component system.base cannot be found')) - return set() - -def install_pkg_names(A, reinstall = False): - """This is the real thing. It installs packages from - the repository, trying to perform a minimum number of - installs""" - - A = [str(x) for x in A] #FIXME: why do we still get unicode input here? :/ -- exa - # A was a list, remove duplicates and expand components - A_0 = A = expand_components(set(A)) - ctx.ui.debug('A = %s' % str(A)) - - # filter packages that are already installed - if not reinstall: - Ap = set(filter(lambda x: not ctx.installdb.is_installed(x), A)) - d = A - Ap - if len(d) > 0: - ctx.ui.warning(_('Not re-installing the following packages: ') + - util.strlist(d)) - A = Ap - - if len(A)==0: - ctx.ui.info(_('No packages to install.')) - return - - A |= upgrade_base(A) - - if not ctx.config.get_option('ignore_dependency'): - G_f, order = plan_install_pkg_names(A) - else: - G_f = None - order = A - - ctx.ui.info(_("""Following packages will be installed -in the respective order to satisfy dependencies: -""") + util.strlist(order)) - - total_size = sum([ctx.packagedb.get_package(p).packageSize for p in order]) - total_size, symbol = util.human_readable_size(total_size) - ctx.ui.info(_('Total size of packages: %.2f %s') % (total_size, symbol)) - - if ctx.get_option('dry_run'): - return - - if len(order) > len(A_0): - if not ctx.ui.confirm(_('There are extra packages due to dependencies. Do you want to continue?')): - return False - - ctx.ui.notify(ui.packagestogo, order = order) - - pisi_installed = ctx.installdb.is_installed('pisi') - - for x in order: - atomicoperations.install_single_name(x, True) # allow reinstalls here - - if 'pisi' in order and pisi_installed: - upgrade_pisi() - -def plan_install_pkg_names(A): - # try to construct a pisi graph of packages to - # install / reinstall - - G_f = pgraph.PGraph(ctx.packagedb) # construct G_f - - # find the "install closure" graph of G_f by package - # set A using packagedb - for x in A: - G_f.add_package(x) - B = A - - while len(B) > 0: - Bp = set() - for x in B: - pkg = ctx.packagedb.get_package(x) - for dep in pkg.runtimeDependencies(): - ctx.ui.debug('checking %s' % str(dep)) - # we don't deal with already *satisfied* dependencies - if not dependency.installed_satisfies_dep(dep): - if not dep.package in G_f.vertices(): - Bp.add(str(dep.package)) - G_f.add_dep(x, dep) - B = Bp - if ctx.config.get_option('debug'): - G_f.write_graphviz(sys.stdout) - order = G_f.topological_sort() - order.reverse() - if not ctx.get_option('ignore_file_conflicts'): - check_conflicts(order, ctx.packagedb) - return G_f, order - -def upgrade(A): - upgrade_pkg_names(A) - -def upgrade_pkg_names(A = []): - """Re-installs packages from the repository, trying to perform - a minimum or maximum number of upgrades according to options.""" - - ignore_build = ctx.get_option('ignore_build_no') - security = ctx.get_option('security') - - if not A: - # if A is empty, then upgrade all packages - A = ctx.installdb.list_installed() - - A_0 = A = expand_components(set(A)) - - Ap = [] - for x in A: - if x.endswith(ctx.const.package_suffix): - ctx.ui.debug(_("Warning: package *name* ends with '.pisi'")) - - if not ctx.installdb.is_installed(x): - ctx.ui.info(_('Package %s is not installed.') % x, True) - continue - (version, release, build) = ctx.installdb.get_version(x) - if ctx.packagedb.has_package(x): - pkg = ctx.packagedb.get_package(x) - else: - ctx.ui.info(_('Package %s is not available in repositories.') % x, True) - continue - - if security: # below is a readable functional code, don't overflow lines! - updates = [x for x in pkg.history if Version(x.release) > Version(release)] - if not pisi.util.any(lambda x:x.type == 'security', updates): - continue - - if ignore_build or (not build) or (not pkg.build): - if Version(release) < Version(pkg.release): - Ap.append(x) - else: - ctx.ui.info(_('Package %s is already at the latest release %s.') - % (pkg.name, pkg.release), True) - else: - if build < pkg.build: - Ap.append(x) - else: - ctx.ui.info(_('Package %s is already at the latest build %s.') - % (pkg.name, pkg.build), True) - - - A = set(Ap) - - if len(A)==0: - ctx.ui.info(_('No packages to upgrade.')) - return True - - A |= upgrade_base(A) - - ctx.ui.debug('A = %s' % str(A)) - - if not ctx.config.get_option('ignore_dependency'): - G_f, order = plan_upgrade(A, ignore_build) - else: - G_f = None - order = A - - ctx.ui.info(_('The following packages will be upgraded: ') + - util.strlist(order)) - - total_size = sum([ctx.packagedb.get_package(p).packageSize for p in order]) - total_size, symbol = util.human_readable_size(total_size) - ctx.ui.info(_('Total size of packages: %.2f %s') % (total_size, symbol)) - - if ctx.get_option('dry_run'): - return - - if len(order) > len(A_0): - if not ctx.ui.confirm(_('There are extra packages due to dependencies. Do you want to continue?')): - return False - - ctx.ui.notify(ui.packagestogo, order = order) - - paths = [] - for x in order: - install_op = atomicoperations.Install.from_name(x) - paths.append(install_op.package_fname) - - for path in paths: - install_op = atomicoperations.Install(path, ignore_file_conflicts = True) - install_op.install(True) - - if 'pisi' in order: - upgrade_pisi() - -def plan_upgrade(A, ignore_build = False): - # try to construct a pisi graph of packages to - # install / reinstall - - packagedb = ctx.packagedb - - G_f = pgraph.PGraph(packagedb) # construct G_f - - # find the "install closure" graph of G_f by package - # set A using packagedb - for x in A: - G_f.add_package(x) - B = A - - # TODO: conflicts - - while len(B) > 0: - Bp = set() - for x in B: - pkg = packagedb.get_package(x) - for dep in pkg.runtimeDependencies(): - # add packages that can be upgraded - if dependency.repo_satisfies_dep(dep): - if ctx.installdb.is_installed(dep.package): - if ctx.get_option('eager'): - if not is_upgradable(dep.package): - continue - else: - if dependency.installed_satisfies_dep(dep): - continue - if not dep.package in G_f.vertices(): - Bp.add(str(dep.package)) - G_f.add_dep(x, dep) - else: - ctx.ui.error(_('Dependency %s of %s cannot be satisfied') % (dep, x)) - raise Error(_("Upgrade is not possible.")) - B = Bp - # now, search reverse dependencies to see if anything - # should be upgraded - B = A - while len(B) > 0: - Bp = set() - for x in B: - pkg = packagedb.get_package(x) - rev_deps = packagedb.get_rev_deps(x) - for (rev_dep, depinfo) in rev_deps: - if ctx.get_option('eager'): - # add all upgradable reverse deps - if is_upgradable(rev_dep): - if not rev_dep in G_f.vertices(): - Bp.add(rev_dep) - G_f.add_plain_dep(rev_dep, x) - else: - # add only installed but unsatisfied reverse dependencies - if ctx.installdb.is_installed(rev_dep) and \ - (not dependency.installed_satisfies_dep(depinfo)): - if not dependency.repo_satisfies_dep(depinfo): - raise Error(_('Reverse dependency %s of %s cannot be satisfied') % (rev_dep, x)) - if not rev_dep in G_f.vertices(): - Bp.add(rev_dep) - G_f.add_plain_dep(rev_dep, x) - B = Bp - - if ctx.config.get_option('debug'): - G_f.write_graphviz(sys.stdout) - order = G_f.topological_sort() - order.reverse() - if not ctx.get_option('ignore_file_conflicts'): - check_conflicts(order, ctx.packagedb) - return G_f, order - -def remove(A, ignore_dep = None): - """remove set A of packages from system (A is a list of package names)""" - - A = [str(x) for x in A] - - # filter packages that are not installed - A_0 = A = expand_components(set(A)) - - if not ctx.get_option('bypass_safety'): - if ctx.componentdb.has_component('system.base'): - systembase = set(ctx.componentdb.get_union_comp('system.base').packages) - refused = A.intersection(systembase) - if refused: - ctx.ui.warning(_('Safety switch: cannot remove the following packages in system.base: ') + - util.strlist(refused)) - A = A - systembase - else: - ctx.ui.warning(_('Safety switch: the component system.base cannot be found')) - - Ap = [] - for x in A: - if ctx.installdb.is_installed(x): - Ap.append(x) - else: - ctx.ui.info(_('Package %s does not exist. Cannot remove.') % x) - A = set(Ap) - - if len(A)==0: - ctx.ui.info(_('No packages to remove.')) - return False - - if not ctx.config.get_option('ignore_dependency') and not ignore_dep: - G_f, order = plan_remove(A) - else: - G_f = None - order = A - - ctx.ui.info(_("""The following minimal list of packages will be removed -in the respective order to satisfy dependencies: -""") + util.strlist(order)) - if len(order) > len(A_0): - if not ctx.ui.confirm(_('Do you want to continue?')): - ctx.ui.warning(_('Package removal declined')) - return False - - if ctx.get_option('dry_run'): - return - - ctx.ui.notify(ui.packagestogo, order = order) - - for x in order: - if ctx.installdb.is_installed(x): - atomicoperations.remove_single(x) - else: - ctx.ui.info(_('Package %s is not installed. Cannot remove.') % x) - -def plan_remove(A): - # try to construct a pisi graph of packages to - # install / reinstall - - G_f = pgraph.PGraph(ctx.packagedb, pisi.itembyrepodb.installed) # construct G_f - - # find the (install closure) graph of G_f by package - # set A using packagedb - for x in A: - G_f.add_package(x) - B = A - while len(B) > 0: - Bp = set() - for x in B: - pkg = ctx.packagedb.get_package(x, pisi.itembyrepodb.installed) - rev_deps = ctx.packagedb.get_rev_deps(x, pisi.itembyrepodb.installed) - for (rev_dep, depinfo) in rev_deps: - # we don't deal with uninstalled rev deps - # and unsatisfied dependencies (this is important, too) - if ctx.packagedb.has_package(rev_dep, pisi.itembyrepodb.installed) and \ - dependency.installed_satisfies_dep(depinfo): - if not rev_dep in G_f.vertices(): - Bp.add(rev_dep) - G_f.add_plain_dep(rev_dep, x) - B = Bp - if ctx.config.get_option('debug'): - G_f.write_graphviz(sys.stdout) - order = G_f.topological_sort() - return G_f, order - -def expand_src_components(A): - Ap = set() - for x in A: - if ctx.componentdb.has_component(x): - Ap = Ap.union(ctx.componentdb.get_union_comp(x).sources) - else: - Ap.add(x) - return Ap - -##def build_names(A, rebuild = true): -## -## # A was a list, remove duplicates and expand components -## A_0 = A = expand_src_components(set(A)) -## ctx.ui.debug('A = %s' % str(A)) -## -## # filter packages that are already installed -## if not rebuild: -## Ap = set(filter(lambda x: not ctx.installdb.is_installed(x), A)) -## d = A - Ap -## if len(d) > 0: -## ctx.ui.warning(_('Not re-building the following packages: ') + -## util.strlist(d)) -## A = Ap -## -## if len(A)==0: -## ctx.ui.info(_('No packages to build.')) -## return -## -## if not ctx.config.get_option('ignore_dependency'): -## G_f, order_inst = plan_build_pkg_names(A) -## else: -## G_f = None -## order_inst = [] -## -## ctx.ui.info(_("""The following minimal list of packages will be installed -##in the respective order to satisfy dependencies: -##""") + util.strlist(order)) -## -## if ctx.get_option('dry_run'): -## return -## -## if len(order) > len(A_0): -## if not ctx.ui.confirm(_('There are extra packages due to dependencies. Do you want to continue?')): -## return False -## -## ctx.ui.notify(ui.packagestogo, order = order) -## -## for x in order: -## atomicoperations.install_single_name(x) -## -##def plan_build_names(A): -## # try to construct a pisi graph of packages to -## # install / reinstall -## -## G_f = pgraph.PGraph(packagedb) # construct G_f -## -## # find the "install closure" graph of G_f by package -## # set A using packagedb -## for x in A: -## G_f.add_package(x) -## B = A -## -## while len(B) > 0: -## Bp = set() -## for x in B: -## pkg = packagedb.get_package(x) -## for dep in pkg.runtimeDependencies(): -## ctx.ui.debug('checking %s' % str(dep)) -## # we don't deal with already *satisfied* dependencies -## if not dependency.installed_satisfies_dep(dep): -## if not dep.package in G_f.vertices(): -## Bp.add(str(dep.package)) -## G_f.add_dep(x, dep) -## B = Bp -## if ctx.config.get_option('debug'): -## G_f.write_graphviz(sys.stdout) -## order = G_f.topological_sort() -## order.reverse() -## check_conflicts(order) -## return G_f, order - -def emerge(A, rebuild_all = False): - - # A was a list, remove duplicates and expand components - A = [str(x) for x in A] - A_0 = A = expand_src_components(set(A)) - ctx.ui.debug('A = %s' % str(A)) - - if len(A)==0: - ctx.ui.info(_('No packages to emerge.')) - return - - #A |= upgrade_base(A) - - # FIXME: Errr... order_build changes type conditionally and this - # is not good. - baris - if not ctx.config.get_option('ignore_dependency'): - G_f, order_inst, order_build = plan_emerge(A, rebuild_all) - else: - G_f = None - order_inst = [] - order_build = A - - if order_inst: - ctx.ui.info(_("""The following minimal list of packages will be installed -from repository in the respective order to satisfy dependencies: -""") + util.strlist(order_inst)) - ctx.ui.info(_("""The following minimal list of packages will be built and -installed in the respective order to satisfy dependencies: -""") + util.strlist(order_build)) - - if ctx.get_option('dry_run'): - return - - if len(order_inst) + len(order_build) > len(A_0): - if not ctx.ui.confirm(_('There are extra packages due to dependencies. Do you want to continue?')): - return False - - ctx.ui.notify(ui.packagestogo, order = order_inst) - - pisi_installed = ctx.installdb.is_installed('pisi') - - for x in order_inst: - atomicoperations.install_single_name(x) - - #ctx.ui.notify(ui.packagestogo, order = order_build) - - for x in order_build: - package_names = atomicoperations.build(x)[0] - install_pkg_files(package_names) # handle inter-package deps here - - # FIXME: take a look at the fixme above :(, we have to be sure - # that order_build is a known type... - U = set(order_build) - U.update(order_inst) - if 'pisi' in order_build or (('pisi' in U) and pisi_installed): - upgrade_pisi() - -def plan_emerge(A, rebuild_all): - - # try to construct a pisi graph of packages to - # install / reinstall - - G_f = pisi.graph.Digraph() - - def get_spec(name): - if ctx.sourcedb.has_spec(name): - return ctx.sourcedb.get_spec(name) - else: - raise Error(_('Cannot find source package: %s') % name) - def get_src(name): - return get_spec(name).source - def add_src(src): - if not str(src.name) in G_f.vertices(): - G_f.add_vertex(str(src.name), (src.version, src.release)) - def pkgtosrc(pkg): - return ctx.sourcedb.pkgtosrc(pkg) - - # setup first - #specfiles = [ ctx.sourcedb.get_source(x)[1] for x in A ] - #pkgtosrc = {} - B = A - - install_list = set() - - while len(B) > 0: - Bp = set() - for x in B: - sf = get_spec(x) - src = sf.source - add_src(src) - - # add dependencies - - def process_dep(dep): - if not dependency.installed_satisfies_dep(dep): - if dependency.repo_satisfies_dep(dep): - install_list.add(dep.package) - return - srcdep = pkgtosrc(dep.package) - if not srcdep in G_f.vertices(): - Bp.add(srcdep) - add_src(get_src(srcdep)) - if not src.name == srcdep: # firefox - firefox-devel thing - G_f.add_edge(src.name, srcdep) - - for builddep in src.buildDependencies: - process_dep(builddep) - - for pkg in sf.packages: - for rtdep in pkg.packageDependencies: - process_dep(rtdep) - B = Bp - - if ctx.config.get_option('debug'): - G_f.write_graphviz(sys.stdout) - order_build = G_f.topological_sort() - order_build.reverse() - - G_f2, order_inst = plan_install_pkg_names(install_list) - - return G_f, order_inst, order_build diff --git a/tags/pisi-1.1_beta13/pisi/package.py b/tags/pisi-1.1_beta13/pisi/package.py deleted file mode 100644 index 48e2f482..00000000 --- a/tags/pisi-1.1_beta13/pisi/package.py +++ /dev/null @@ -1,167 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# - -# package abstraction -# provides methods to add/remove files, extract control files - -# maintainer: baris and meren - -from os.path import join, exists, basename, dirname - -import gettext -__trans = gettext.translation('pisi', fallback=True) -_ = __trans.ugettext - -import pisi -import pisi.context as ctx -import pisi.archive as archive -from pisi.uri import URI -from pisi.metadata import MetaData -from pisi.files import Files -import pisi.util as util - -class Error(pisi.Error): - pass - - -class Package: - """PISI Package Class provides access to a pisi package (.pisi - file).""" - def __init__(self, packagefn, mode='r'): - self.filepath = packagefn - url = URI(packagefn) - - if url.is_remote_file(): - from fetcher import fetch_url, FetchError - dest = ctx.config.packages_dir() - self.filepath = join(dest, url.filename()) - - # get current package name without version info (like tasma) - current_pkg = util.pure_package_name(url.filename()) - - # if package is installed (which means we are upgrading it), - # calculate needed info - if ctx.installdb.is_installed(current_pkg) and ctx.config.values.general.xdelta: - installed = True - - # calculate currently installed package's name and pisi file's location - (version, release, build) = ctx.installdb.get_version(current_pkg) - current = util.package_name(current_pkg, version, release, build, prependSuffix=False) - current_fn = join(dest, current) + ctx.const.package_suffix - - # calculate xdelta file location (format: oldpackage_newpackage.xdelta) - # ex: tasma-1.0.2-4-1_tasma-1.0.3-5-2.xdelta - delta = basename(url.filename()).rstrip(ctx.const.package_suffix) - delta = "%s_%s" % (current, delta) + ctx.const.xdelta_suffix - - # create xdelta_url for fetching - xdelta_url = URI(join(dirname(str(url)), delta)) - xdelta_fn = join(dest, xdelta_url.filename()) - else: - installed = False - - if installed and exists(current_fn) and ctx.config.values.general.xdelta: - # if package is installed and old pisi file exists, fetch xdelta - if not exists(xdelta_fn): - ctx.ui.info(_("Trying to fetch xdelta: %s") % xdelta_url) - try: - fetch_url(xdelta_url, dest, ctx.ui.Progress) - except FetchError,e: - ctx.ui.warning(_('XDelta %s: not exists') % xdelta_url) - else: - # generate new one using old pisi file and xdelta - util.generate_pisi_file(xdelta_fn, current_fn, self.filepath) - else: - util.generate_pisi_file(xdelta_fn, current_fn, self.filepath) - - # FIXME: exists is not enough, also sha1sum check needed - # when implemented in pisi-index.xml - if not exists(self.filepath): - fetch_url(url, dest, ctx.ui.Progress) - else: - ctx.ui.info(_('%s [cached]') % url.filename()) - - self.impl = archive.ArchiveZip(self.filepath, 'zip', mode) - - def add_to_package(self, fn, an=None): - """Add a file or directory to package""" - self.impl.add_to_archive(fn, an) - - def close(self): - """Close the package archive""" - self.impl.close() - - def extract(self, outdir): - """Extract entire package contents to directory""" - self.extract_dir('', outdir) # means package root - - def extract_files(self, paths, outdir): - """Extract paths to outdir""" - self.impl.unpack_files(paths, outdir) - - def extract_file(self, path, outdir): - """Extract file with path to outdir""" - self.extract_files([path], outdir) - - def extract_dir(self, dir, outdir): - """Extract directory recursively, this function - copies the directory archiveroot/dir to outdir""" - self.impl.unpack_dir(dir, outdir) - - def extract_install(self, outdir): - if self.impl.has_file(ctx.const.install_tar_lzma): - self.extract_file(ctx.const.install_tar_lzma, ctx.config.tmp_dir()) - tar = archive.ArchiveTar(join(ctx.config.tmp_dir(), ctx.const.install_tar_lzma), 'tarlzma') - tar.unpack_dir(outdir) - else: - self.extract_dir_flat('install', outdir) - - def extract_dir_flat(self, dir, outdir): - """Extract directory recursively, this function - unpacks the *contents* of directory archiveroot/dir inside outdir - this is the function used by the installer""" - self.impl.unpack_dir_flat(dir, outdir) - - def extract_PISI_files(self, outdir): - """Extract PISI control files: metadata.xml, files.xml, - action scripts, etc.""" - self.extract_files([ctx.const.metadata_xml, ctx.const.files_xml], outdir) - self.extract_dir('config', outdir) - - def read(self, outdir = None): - if not outdir: - outdir = ctx.config.tmp_dir() - - # extract control files - self.extract_PISI_files(outdir) - - self.metadata = MetaData() - self.metadata.read( join(outdir, ctx.const.metadata_xml) ) - errs = self.metadata.errors() - if errs: - util.Checks.print_errors(errs) - raise Error, _("MetaData format wrong") - - self.files = Files() - self.files.read( join(outdir, ctx.const.files_xml) ) - if self.files.errors(): - raise Error, _("Invalid %s") % ctx.const.files_xml - - def pkg_dir(self): - packageDir = self.metadata.package.name + '-' \ - + self.metadata.package.version + '-' \ - + self.metadata.package.release - - return join( ctx.config.lib_dir(), 'package', packageDir) - - def comar_dir(self): - return join(self.pkg_dir(), ctx.const.comar_dir) diff --git a/tags/pisi-1.1_beta13/pisi/packagedb.py b/tags/pisi-1.1_beta13/pisi/packagedb.py deleted file mode 100644 index 93a5466c..00000000 --- a/tags/pisi-1.1_beta13/pisi/packagedb.py +++ /dev/null @@ -1,167 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# -# Authors: Eray Ozkural -# Baris Metin - -"""package database -interface for update/query to local package repository - -we basically store everything in PackageInfo class -yes, we are cheap -""" - -import os -import fcntl -import types - -import gettext -__trans = gettext.translation('pisi', fallback=True) -_ = __trans.ugettext - -import pisi -import pisi.util as util -import pisi.context as ctx -import pisi.lockeddbshelve as shelve -from pisi.itembyrepodb import ItemByRepoDB -import pisi.itembyrepodb as itembyrepodb - -class Error(pisi.Error): - pass - -class NotfoundError(pisi.Error): - def __init__(self, pkg): - pisi.Error.__init__("Package %s not found" % pkg) - self.pkg = pkg - -class PackageDB(object): - """PackageDB class provides an interface to the package database - using shelf objects""" - - def __init__(self): - self.d = ItemByRepoDB('package') - self.dr = ItemByRepoDB('revdep') - - def close(self): - self.d.close() - self.dr.close() - - def destroy(self): - self.d.destroy() - self.dr.destroy() - - def has_package(self, name, repo=None, txn = None): - return self.d.has_key(name, repo, txn=txn) - - def get_package(self, name, repo=None, txn = None): - try: - return self.d.get_item(name, repo, txn=txn) - except pisi.itembyrepodb.NotfoundError, e: - raise Error(_('Package %s not found') % name) - - def get_package_repo(self, name, repo=None, txn = None): - return self.d.get_item_repo(name, repo, txn=txn) - - def which_repo(self, name, txn = None): - return self.d.which_repo(name, txn=txn) - - def get_rev_deps(self, name, repo = None, txn = None): - if self.dr.has_key(name, repo, txn=txn): - return self.dr.get_item(name, repo, txn=txn) - else: - return [] - - def get_deps(self, name, repo = None, txn = None): - if self.d.has_key(name, repo, txn=txn): - pinfo = self.d.get_item(name, repo, txn=txn) - return pinfo.packageDependencies - else: - return [] - - def list_packages(self, repo=None): - return self.d.list(repo) - - def add_package(self, package_info, repo, txn = None): - name = str(package_info.name) - - def proc(txn): - self.d.add_item(name, package_info, repo, txn) - for dep in package_info.runtimeDependencies(): - dep_name = str(dep.package) - if self.dr.has_key(dep_name, repo, txn): - revdep = self.dr.get_item(dep_name, repo, txn) - revdep = filter(lambda (n,d):n!=name, revdep) - revdep.append( (name, dep) ) - self.dr.add_item(dep_name, revdep, repo, txn) - else: - self.dr.add_item(dep_name, [ (name, dep) ], repo, txn) - # add component - ctx.componentdb.add_package(package_info.partOf, package_info.name, repo, txn) - # index summary and description - for (lang, doc) in package_info.summary.iteritems(): - if lang in ['en', 'tr']: - pisi.search.add_doc('summary', lang, package_info.name, doc, repo=repo, txn=txn) - for (lang, doc) in package_info.description.iteritems(): - if lang in ['en', 'tr']: - pisi.search.add_doc('description', lang, package_info.name, doc, repo=repo, txn=txn) - - ctx.txn_proc(proc, txn) - - def clear(self, txn = None): - self.d.clear() - self.dr.clear() - - def remove_package(self, name, repo = None, txn = None): - name = str(name) - def proc(txn): - package_info = self.d.get_item(name, repo, txn=txn) - self.d.remove_item(name, repo, txn=txn) - for dep in package_info.runtimeDependencies(): - dep_name = str(dep.package) - if self.dr.has_key(dep_name, repo, txn): - revdep = self.dr.get_item(dep_name, repo, txn) - revdep = filter(lambda (n,d):n!=name, revdep) - self.dr.add_item(dep_name, revdep, repo, txn) - if self.dr.has_key(name, repo, txn=txn): - self.dr.remove_item(name, repo, txn=txn) - ctx.componentdb.remove_package(package_info.partOf, package_info.name, repo, txn) - for (lang, doc) in package_info.summary.iteritems(): - if lang in ['en', 'tr']: - pisi.search.remove_doc('summary', lang, package_info.name, doc, repo=repo, txn=txn) - for (lang, doc) in package_info.description.iteritems(): - if lang in ['en', 'tr']: - pisi.search.remove_doc('description', lang, package_info.name, doc, repo=repo, txn=txn) - self.d.txn_proc(proc, txn) - - def remove_repo(self, repo, txn = None): - def proc(txn): - self.d.remove_repo(repo, txn=txn) - self.dr.remove_repo(repo, txn=txn) - self.d.txn_proc(proc, txn) - -pkgdb = None - -def remove_tracking_package(name, txn = None): - # remove the guy from the tracking databases - if pkgdb.has_package(name, itembyrepodb.installed, txn=txn): - pkgdb.remove_package(name, itembyrepodb.installed, txn=txn) - if pkgdb.has_package(name, itembyrepodb.thirdparty, txn=txn): - pkgdb.remove_package(name, itembyrepodb.thirdparty, txn=txn) - -def init_db(): - global pkgdb - pkgdb = PackageDB() - return pkgdb - -def finalize_db(): - global pkgdb - if pkgdb: - pkgdb.close() diff --git a/tags/pisi-1.1_beta13/pisi/pgraph.py b/tags/pisi-1.1_beta13/pisi/pgraph.py deleted file mode 100644 index d36b43e9..00000000 --- a/tags/pisi-1.1_beta13/pisi/pgraph.py +++ /dev/null @@ -1,84 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# - -"""PISI package relation graph that represents the state of packagedb""" - -import string - -from graph import * - -# Cache the results from packagedb queries in a graph - -class PGraph(Digraph): - - def __init__(self, packagedb, repo = pisi.itembyrepodb.repos): - super(PGraph, self).__init__() - self.packagedb = packagedb - self.repo = repo - - def add_package(self, pkg): - pkg1 = self.packagedb.get_package(pkg, self.repo) - self.add_vertex(str(pkg), (pkg1.version, pkg1.release)) - - def add_plain_dep(self, pkg1name, pkg2name): - pkg1data = None - if not pkg1name in self.vertices(): - pkg1 = self.packagedb.get_package(pkg1name, self.repo) - pkg1data = (pkg1.version, pkg1.release) - pkg2data = None - if not pkg2name in self.vertices(): - pkg2 = self.packagedb.get_package(pkg2name, self.repo) - pkg2data = (pkg2.version, pkg2.release) - self.add_edge(str(pkg1name), str(pkg2name), ('d', None), - pkg1data, pkg2data ) - - def add_dep(self, pkg, depinfo): - pkg1data = None - if not pkg in self.vertices(): - pkg1 = self.packagedb.get_package(pkg, self.repo) - pkg1data = (pkg1.version, pkg1.release) - pkg2data = None - if not depinfo.package in self.vertices(): - pkg2 = self.packagedb.get_package(depinfo.package, self.repo) - pkg2data = (pkg2.version, pkg2.release) - self.add_edge(str(pkg), str(depinfo.package), ('d', depinfo), - pkg1data, pkg2data ) - - def add_rev_dep(self, depinfo, pkg): - pkg1data = None - if not pkg in self.vertices(): - pkg1 = self.packagedb.get_package(depinfo.package, self.repo) - pkg1data = (pkg1.version, pkg1.release) - pkg2data = None - if not depinfo.package in self.vertices(): - pkg2 = self.packagedb.get_package(pkg, self.repo) - pkg2data = (pkg2.version, pkg2.release) - self.add_edge(str(depinfo.package), str(pkg), ('d', depinfo), - pkg1data, pkg2data ) - - def add_conflict(self, pkg, conflinfo): - pkg1data = None - if not pkg in self.vertices(): - pkg1 = self.packagedb.get_package(pkg, self.repo) - pkg1data = (pkg1.version, pkg1.release) - pkg2data = None - if not pkg in self.vertices(): - pkg2 = self.packagedb.get_package(conflinfo.package, self.repo) - pkg2data = (pkg2.version, pkg2.release) - - self.add_biedge(str(pkg), str(conflinfo.package), ('c', conflinfo) - , pkg1data, pkg2data ) - - def write_graphviz_vlabel(self, f, u): - (v, r) = self.vertex_data(u) - f.write('[ label = \"' + str(u) + '(' + str(v) + ',' + str(r) + ')\" ]') - diff --git a/tags/pisi-1.1_beta13/pisi/pxml/__init__.py b/tags/pisi-1.1_beta13/pisi/pxml/__init__.py deleted file mode 100644 index 67d1fd25..00000000 --- a/tags/pisi-1.1_beta13/pisi/pxml/__init__.py +++ /dev/null @@ -1,23 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# - -import sys -import locale - -import gettext -__trans = gettext.translation('pisi', fallback=True) -_ = __trans.ugettext - -import pisi - -class Error(pisi.Error): - pass diff --git a/tags/pisi-1.1_beta13/pisi/pxml/autoxml.py b/tags/pisi-1.1_beta13/pisi/pxml/autoxml.py deleted file mode 100644 index e6c522f9..00000000 --- a/tags/pisi-1.1_beta13/pisi/pxml/autoxml.py +++ /dev/null @@ -1,839 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# -# -# Authors: Eray Ozkural -# Gurer Ozen -# Bahadir Kandemir -# Baris Metin - - -""" - autoxml is a metaclass for automatic XML translation, using - a miniature type system. (w00t!) This is based on an excellent - high-level XML processing prototype that Gurer prepared. - - Method names are mixedCase for compatibility with minidom, - an old library. -""" - -# System -import locale -import codecs -import types -import formatter -import sys -from StringIO import StringIO - -import gettext -__trans = gettext.translation('pisi', fallback=True) -_ = __trans.ugettext - -# PiSi -import pisi -from pisi.pxml.xmlext import * -from pisi.pxml.xmlfile import XmlFile -import pisi.context as ctx -import pisi.util as util -import pisi.oo as oo - -class Error(pisi.Error): - pass - -# requirement specs - -mandatory, optional = range(2) # poor man's enum - -# basic types - -String = types.StringType -Text = types.UnicodeType -Integer = types.IntType -Long = types.LongType -Float = types.FloatType - -#class datatype(type): -# def __init__(cls, name, bases, dict): -# """entry point for metaclass code""" -# # standard initialization -# super(autoxml, cls).__init__(name, bases, dict) - -class LocalText(dict): - """Handles XML tags with localized text""" - - def __init__(self, tag = "", req = optional): - self.tag = tag - self.req = req - dict.__init__(self) - - def decode(self, node, errs, where = ""): - # flags, tag name, instance attribute - assert self.tag != '' - nodes = getAllNodes(node, self.tag) - if not nodes: - if self.req == mandatory: - errs.append(where + ': ' + _("At least one '%s' tag should have local text") % - self.tag ) - else: - for node in nodes: - lang = getNodeAttribute(node, 'xml:lang') - c = getNodeText(node) - if not c: - errs.append(where + ': ' + _("'%s' language of tag '%s' is empty") % - (lang, self.tag)) - # FIXME: check for dups and 'en' - if not lang: - lang = 'en' - self[lang] = c - - def encode(self, node, errs): - assert self.tag != '' - for key in self.iterkeys(): - newnode = addNode(node, self.tag) - setNodeAttribute(newnode, 'xml:lang', key) - addText(newnode, '', self[key]) - - #FIXME: maybe more appropriate for pisi.util - @staticmethod - def get_lang(): - try: - (lang, encoding) = locale.getlocale() - if not lang: - (lang, encoding) = locale.getdefaultlocale() - if lang==None: # stupid python means it is C locale - return 'en' - else: - return lang[0:2] - except: - raise Error(_('LocalText: unable to get either current or default locale')) - - def errors(self, where = unicode()): - errs = [] - langs = [ LocalText.get_lang(), 'en', 'tr', ] - if not util.any(lambda x : self.has_key(x), langs): - errs.append( where + ': ' + _("Tag should have at least the current locale, or failing that an English or Turkish version")) - #FIXME: check if all entries are unicode - return errs - - def format(self, f, errs): - L = LocalText.get_lang() - if self.has_key(L): - f.add_flowing_data(self[L]) - elif self.has_key('en'): - # fallback to English, blah - f.add_flowing_data(self['en']) - elif self.has_key('tr'): - # fallback to Turkish - f.add_flowing_data(self['tr']) - else: - errs.append(_("Tag should have at least the current locale, or failing that an English or Turkish version")) - - #FIXME: factor out these common routines - def print_text(self, file = sys.stdout): - w = Writer(file) # plain text - f = formatter.AbstractFormatter(w) - errs = [] - self.format(f, errs) - if errs: - for x in errs: - ctx.ui.warning(x) - - def __str__(self): - L = LocalText.get_lang() - if self.has_key(L): - return unicode(self[L]) - elif self.has_key('en'): - # fallback to English, blah - return unicode(self['en']) - elif self.has_key('tr'): - # fallback to Turkish - return unicode(self['tr']) - else: - return unicode() - -class Writer(formatter.DumbWriter): - """adds unicode support""" - - def __init__(self, file=None, maxcol=78): - formatter.DumbWriter.__init__(self, file, maxcol) - - def send_literal_data(self, data): - self.file.write(data.encode("utf-8")) - i = data.rfind('\n') - if i >= 0: - self.col = 0 - data = data[i+1:] - data = data.expandtabs() - self.col = self.col + len(data) - self.atbreak = 0 - - -class autoxml(oo.autosuper, oo.autoprop): - """High-level automatic XML transformation interface for xmlfile. - The idea is to declare a class for each XML tag. Inside the - class the tags and attributes nested in the tag are further - elaborated. A simple example follows: - - class Employee: - __metaclass__ = autoxml - t_Name = [xmlfile.Text, xmlfile.mandatory] - a_Type = [xmlfile.Integer, xmlfile.optional] - - This class defines a tag and an attribute nested in Employee - class. Name is a string and type is an integer, called basic - types. - While the tag is mandatory, the attribute may be left out. - - Other basic types supported are: xmlfile.Float, xmlfile.Double - and (not implemented yet): xmlfile.Binary - - By default, the class name is taken as the corresponding tag, - which may be overridden by defining a tag attribute. Thus, - the same tag may also be written as: - - class EmployeeXML: - ... - tag = 'Employee' - ... - - In addition to basic types, we allow for two kinds of complex - types: class types and list types. - - A declared class can be nested in another class as follows - - class Position: - __metaclass__ = autoxml - t_Name = [xmlfile.Text, xmlfile.mandatory] - t_Description = [xmlfile.Text, xmlfile.optional] - - which we can add to our Employee class. - - class Employee: - __metaclass__ = autoxml - t_Name = [xmlfile.Text, xmlfile.mandatory] - a_Type = [xmlfile.Integer, xmlfile.optional] - t_Position = [Position, xmlfile.mandatory] - - Note some unfortunate redundancy here with Position; this is - justified by the implementation (kidding). Still, you might - want to assign a different name than the class name that - goes in there, which may be fully qualified. - - There is more! Suppose we want to define a company, with - of course many employees. - - class Company: - __metaclass__ = autoxml - t_Employees = [ [Employee], xmlfile.mandatory, 'Employees/Employee'] - - Logically, inside the Company/Employees tag, we will have several - Employee tags, which are inserted to the Employees instance variable of - Company in order of appearance. We can define lists of any other valid - type. Here we used a list of an autoxml class defined above. - - The mandatory flag here asserts that at least one such record - is to be found. - - You see, it works like magic, when it works of course. All of it - done without a single brain exploding. - - """ - - - def __init__(cls, name, bases, dict): - """entry point for metaclass code""" - #print 'generating class', name - - # standard initialization - super(autoxml, cls).__init__(name, bases, dict) - - xmlfile_support = XmlFile in bases - - cls.autoxml_bases = filter(lambda base: isinstance(base, autoxml), bases) - - #TODO: initialize class attribute __xml_tags - #setattr(cls, 'xml_variables', []) - - # default class tag is class name - if not dict.has_key('tag'): - cls.tag = name - - # generate helper routines, for each XML component - names = [] - inits = [] - decoders = [] - encoders = [] - errorss = [] - formatters = [] - - # read declaration order from source - # code contributed by bahadir kandemir - from inspect import getsourcelines - from itertools import ifilter - import re - - fn = re.compile('\s*([tas]_[a-zA-Z]+).*').findall - - lines = filter(fn, getsourcelines(cls)[0]) - decl_order = map(lambda x:x.split()[0], lines) - - # there should be at most one str member, and it should be - # the first to process - - order = filter(lambda x: not x.startswith('s_'), decl_order) - - # find string member - str_members = filter(lambda x:x.startswith('s_'), decl_order) - if len(str_members)>1: - raise Error('Only one str member can be defined') - elif len(str_members)==1: - order.insert(0, str_members[0]) - - for var in order: - if var.startswith('t_') or var.startswith('a_') or var.startswith('s_'): - name = var[2:] - if var.startswith('a_'): - x = autoxml.gen_attr_member(cls, name) - elif var.startswith('t_'): - x = autoxml.gen_tag_member(cls, name) - elif var.startswith('s_'): - x = autoxml.gen_str_member(cls, name) - (name, init, decoder, encoder, errors, format_x) = x - names.append(name) - inits.append(init) - decoders.append(decoder) - encoders.append(encoder) - errorss.append(errors) - formatters.append(format_x) - - # generate top-level helper functions - cls.initializers = inits - def initialize(self, uri = None, keepDoc = False, tmpDir = '/tmp', - **args): - if xmlfile_support: - if args.has_key('tag'): - XmlFile.__init__(self, tag = args['tag']) - else: - XmlFile.__init__(self, tag = cls.tag) - for base in cls.autoxml_bases: - base.__init__(self) - #super(cls, self).__init__(tag = tag) cooperative shit disabled for now - for init in inits:#self.__class__.initializers: - init(self) - for x in args.iterkeys(): - setattr(self, x, args[x]) - # init hook - if hasattr(self, 'init'): - self.init(tag) - if xmlfile_support and uri: - self.read(uri, keepDoc, tmpDir) - - cls.__init__ = initialize - - cls.decoders = decoders - def decode(self, node, errs, where = unicode(cls.tag)): - for base in cls.autoxml_bases: - base.decode(self, node, errs, where) - for decode_member in decoders:#self.__class__.decoders: - decode_member(self, node, errs, where) - if hasattr(self, 'decode_hook'): - self.decode_hook(node, errs, where) - cls.decode = decode - - cls.encoders = encoders - def encode(self, node, errs): - for base in cls.autoxml_bases: - base.encode(self, node, errs) - for encode_member in encoders:#self.__class__.encoders: - encode_member(self, node, errs) - if hasattr(self, 'encode_hook'): - self.encode_hook(node, errs) - cls.encode = encode - - cls.errorss = errorss - def errors(self, where = unicode(name)): - errs = [] - for base in cls.autoxml_bases: - errs.extend(base.errors(self, where)) - for errors in errorss:#self.__class__.errorss: - errs.extend(errors(self, where)) - if hasattr(self, 'errors_hook'): - errs.extend(self.errors_hook(where)) - return errs - cls.errors = errors - def check(self): - errs = self.errors() - if errs: - errs.append(_("autoxml.check: '%s' errors") % len(errs)) - raise Error(*errs) - cls.check = check - - cls.formatters = formatters - def format(self, f, errs): - for base in cls.autoxml_bases: - base.format(self, f, errs) - for formatter in formatters:#self.__class__.formatters: - formatter(self, f, errs) - cls.format = format - def print_text(self, file = sys.stdout): - w = Writer(file) # plain text - f = formatter.AbstractFormatter(w) - errs = [] - self.format(f, errs) - if errs: - for x in errs: - ctx.ui.warning(x) - cls.print_text = print_text - if not dict.has_key('__str__'): - def str(self): - strfile = StringIO() - self.print_text(strfile) - str = strfile.getvalue() - strfile.close() - return str - cls.__str__ = str - - if not dict.has_key('__eq__'): - def equal(self, other): - # handle None - if other ==None: - return False # well, must be False at this point :) - for name in names: - try: - if getattr(self, name) != getattr(other, name): - return False - except: - return False - return True - def notequal(self, other): - return not self.__eq__(other) - cls.__eq__ = equal - cls.__ne__ = notequal - - if xmlfile_support: - def read(self, uri, keepDoc = False, tmpDir = '/tmp', - sha1sum = False, compress = None, sign = None, copylocal = False): - "read XML file and decode it into a python object" - self.readxml(uri, tmpDir, sha1sum=sha1sum, - compress=compress, sign=sign, copylocal=copylocal) - errs = [] - self.decode(self.rootNode(), errs) - if errs: - errs.append(_("autoxml.read: File '%s' has errors") % uri) - raise Error(*errs) - if hasattr(self, 'read_hook'): - self.read_hook(errs) - - if not keepDoc: - self.unlink() # get rid of the tree - - errs = self.errors() - if errs: - errs.append(_("autoxml.read: File '%s' has errors") % uri) - raise Error(*errs) - - def write(self, uri, keepDoc = False, tmpDir = '/tmp', - sha1sum = False, compress = None, sign = None): - "encode the contents of the python object into an XML file" - errs = self.errors() - if errs: - errs.append(_("autoxml.write: object validation has failed")) - raise Error(*errs) - errs = [] - self.newDocument() - self.encode(self.rootNode(), errs) - if hasattr(self, 'write_hook'): - self.write_hook(errs) - if errs: - errs.append(_("autoxml.write: File encoding '%s' has errors") % uri) - raise Error(*errs) - self.writexml(uri, tmpDir, sha1sum=sha1sum, compress=compress, sign=sign) - if not keepDoc: - self.unlink() # get rid of the tree - - cls.read = read - cls.write = write - - - def gen_attr_member(cls, attr): - """generate readers and writers for an attribute member""" - #print 'attr:', attr - spec = getattr(cls, 'a_' + attr) - tag_type = spec[0] - assert type(tag_type) == type(type) - def readtext(node, attr): - return getNodeAttribute(node, attr) - def writetext(node, attr, text): - #print 'write attr', attr, text - setNodeAttribute(node, attr, text) - anonfuns = cls.gen_anon_basic(attr, spec, readtext, writetext) - return cls.gen_named_comp(attr, spec, anonfuns) - - def gen_tag_member(cls, tag): - """generate helper funs for tag member of class""" - #print 'tag:', tag - spec = getattr(cls, 't_' + tag) - anonfuns = cls.gen_tag(tag, spec) - return cls.gen_named_comp(tag, spec, anonfuns) - - def gen_tag(cls, tag, spec): - """generate readers and writers for the tag""" - tag_type = spec[0] - if type(tag_type) is types.TypeType and \ - autoxml.basic_cons_map.has_key(tag_type): - def readtext(node, tagpath): - #print 'read tag', node, tagpath - return getNodeText(node, tagpath) - def writetext(node, tagpath, text): - #print 'write tag', node, tagpath, text - addText(node, tagpath, text) - return cls.gen_anon_basic(tag, spec, readtext, writetext) - elif type(tag_type) is types.ListType: - return cls.gen_list_tag(tag, spec) - elif tag_type is LocalText: - return cls.gen_insetclass_tag(tag, spec) - elif type(tag_type) is autoxml or type(tag_type) is types.TypeType: - return cls.gen_class_tag(tag, spec) - else: - raise Error(_('gen_tag: unrecognized tag type %s in spec') % - str(tag_type)) - - def gen_str_member(cls, token): - """generate readers and writers for a string member""" - spec = getattr(cls, 's_' + token) - tag_type = spec[0] - assert type(tag_type) == type(type) - def readtext(node, blah): - #node.normalize() # piksemel doesn't have this - return getNodeText(node) - def writetext(node, blah, text): - addText(node, "", text) - anonfuns = cls.gen_anon_basic(token, spec, readtext, writetext) - return cls.gen_named_comp(token, spec, anonfuns) - - def gen_named_comp(cls, token, spec, anonfuns): - """generate a named component tag/attr. a decoration of - anonymous functions that do not bind to variable names""" - name = cls.mixed_case(token) - token_type = spec[0] - req = spec[1] - (init_a, decode_a, encode_a, errors_a, format_a) = anonfuns - - def init(self): - """initialize component""" - setattr(self, name, init_a()) - - def decode(self, node, errs, where): - """decode component from DOM node""" - setattr(self, name, decode_a(node, errs, where + '.' + unicode(name))) - - def encode(self, node, errs): - """encode self inside, possibly new, DOM node using xml""" - if hasattr(self, name): - value = getattr(self, name) - else: - value = None - encode_a(node, value, errs) - - def errors(self, where): - """return errors in the object""" - errs = [] - if hasattr(self, name) and getattr(self, name) != None: - value = getattr(self,name) - errs.extend(errors_a(value, where + '.' + name)) - else: - if req == mandatory: - errs.append(where + ': ' + _('Mandatory variable %s not available') % name) - return errs - - def format(self, f, errs): - if hasattr(self, name): - value = getattr(self,name) - f.add_literal_data(token + ': ') - format_a(value, f, errs) - f.add_line_break() - else: - if req == mandatory: - errs.append(_('Mandatory variable %s not available') % name) - - return (name, init, decode, encode, errors, format) - - def mixed_case(cls, identifier): - """helper function to turn token name into mixed case""" - if identifier is "": - return "" - else: - if identifier[0]=='I': - lowly = 'i' # because of pythonic idiots we can't choose locale in lower - else: - lowly = identifier[0].lower() - return lowly + identifier[1:] - - def tagpath_head_last(cls, tagpath): - "returns split of the tag path into last tag and the rest" - try: - lastsep = tagpath.rindex('/') - except ValueError, e: - return ('', tagpath) - return (tagpath[:lastsep], tagpath[lastsep+1:]) - - def parse_spec(cls, token, spec): - """decompose member specification""" - name = cls.mixed_case(token) - token_type = spec[0] - req = spec[1] - - if len(spec)>=3: - path = spec[2] # an alternative path specified - elif type(token_type) is type([]): - if type(token_type[0]) is autoxml: - # if list of class, by default nested like in most PSPEC - path = token + '/' + token_type[0].tag - else: - # if list of ordinary type, just take the name for - path = token - elif type(token_type) is autoxml: - # if a class, by default its tag - path = token_type.tag - else: - path = token # otherwise it's the same name as - # the token - return name, token_type, req, path - - def gen_anon_basic(cls, token, spec, readtext, writetext): - """Generate a tag or attribute with one of the basic - types like integer. This has got to be pretty generic - so that we can invoke it from the complex types such as Class - and List. The readtext and writetext arguments achieve - the DOM text access for this datatype.""" - - name, token_type, req, tagpath = cls.parse_spec(token, spec) - - def initialize(): - """default value for all basic types is None""" - return None - - def decode(node, errs, where): - """decode from DOM node, the value, watching the spec""" - text = readtext(node, token) - #print 'read text ', text - if text: - try: - value = autoxml.basic_cons_map[token_type](text) - except: - value = None - errs.append(where + ': ' + _('Type mismatch: read text cannot be decoded')) - return value - else: - if req == mandatory: - errs.append(where + ': ' + _('Mandatory token %s not available') % token) - return None - - def encode(node, value, errs): - """encode given value inside DOM node""" - if value: - writetext(node, token, unicode(value)) - else: - if req == mandatory: - errs.append(_('Mandatory token %s not available') % token) - - def errors(value, where): - errs = [] - if value and not isinstance(value, token_type): - errs.append(where + ': ' + _('Type mismatch. Expected %s, got %s') % - (token_type, type(value)) ) - return errs - - def format(value, f, errs): - """format value for pretty printing""" - f.add_literal_data(unicode(value)) - - return initialize, decode, encode, errors, format - - def gen_class_tag(cls, tag, spec): - """generate a class datatype""" - name, tag_type, req, path = cls.parse_spec(tag, spec) - - def make_object(): - obj = tag_type.__new__(tag_type) - obj.__init__(tag=tag, req=req) - return obj - - def init(): - return make_object() - - def decode(node, errs, where): - node = getNode(node, tag) - if node: - try: - obj = make_object() - obj.decode(node, errs, where) - return obj - except Error: - errs.append(where + ': '+ _('Type mismatch: DOM cannot be decoded')) - else: - if req == mandatory: - errs.append(where + ': ' + _('Mandatory argument not available')) - return None - - def encode(node, obj, errs): - if node and obj: - try: - #FIXME: this doesn't look pretty - classnode = newNode(node, tag) - obj.encode(classnode, errs) - addNode(node, '', classnode) - except Error: - if req == mandatory: - # note: we can receive an error if obj has no content - errs.append(_('Object cannot be encoded')) - else: - if req == mandatory: - errs.append(_('Mandatory argument not available')) - - def errors(obj, where): - return obj.errors(where) - - def format(obj, f, errs): - try: - obj.format(f, errs) - except Error: - if req == mandatory: - errs.append(_('Mandatory argument not available')) - return (init, decode, encode, errors, format) - - def gen_list_tag(cls, tag, spec): - """generate a list datatype. stores comps in tag/comp_tag""" - name, tag_type, req, path = cls.parse_spec(tag, spec) - - pathcomps = path.split('/') - comp_tag = pathcomps.pop() - list_tagpath = util.makepath(pathcomps, sep='/', relative=True) - - if len(tag_type) != 1: - raise Error(_('List type must contain only one element')) - - x = cls.gen_tag(comp_tag, [tag_type[0], mandatory]) - (init_item, decode_item, encode_item, errors_item, format_item) = x - - def init(): - return [] - - def decode(node, errs, where): - l = [] - nodes = getAllNodes(node, path) - #print node, tag + '/' + comp_tag, nodes - if len(nodes)==0 and req==mandatory: - errs.append(where + ': ' + _('Mandatory list empty')) - ix = 1 - for node in nodes: - dummy = newNode(node, "Dummy") - addNode(dummy, '', node) - l.append(decode_item(dummy, errs, where + unicode("[%s]" % ix))) - #l.append(decode_item(node, errs, where + unicode("[%s]" % ix))) - ix += 1 - return l - - def encode(node, l, errs): - if l and len(l) > 0: - for item in l: - if list_tagpath: - listnode = addNode(node, list_tagpath, branch = False) - else: - listnode = node - encode_item(listnode, item, errs) - #encode_item(node, item, errs) - else: - if req is mandatory: - errs.append(_('Mandatory list empty')) - - def errors(l, where): - errs = [] - ix = 1 - for node in l: - errs.extend(errors_item(node, where + '[%s]' % ix)) - ix += 1 - return errs - - def format(l, f, errs): - # TODO: indent here - ix = 1 - length = len(l) - for node in l: - f.add_flowing_data(str(ix) + ': ') - format_item(node, f, errs) - if ix != length: - f.add_flowing_data(', ') - ix += 1 - - return (init, decode, encode, errors, format) - - def gen_insetclass_tag(cls, tag, spec): - """generate a class datatype that is highly integrated - don't worry if that means nothing to you. this is a silly - hack to implement local text quickly. it's not the most - elegant thing in the world. it's basically a copy of - class tag""" - name, tag_type, req, path = cls.parse_spec(tag, spec) - - def make_object(): - obj = tag_type.__new__(tag_type) - obj.__init__(tag=tag, req=req) - return obj - - def init(): - return make_object() - - def decode(node, errs, where): - if node: - try: - obj = make_object() - obj.decode(node, errs, where) - return obj - except Error: - errs.append(where + ': ' + _('Type mismatch: DOM cannot be decoded')) - else: - if req == mandatory: - errs.append(where + ': ' + _('Mandatory argument not available')) - return None - - def encode(node, obj, errs): - if node and obj: - try: - #FIXME: this doesn't look pretty - obj.encode(node, errs) - except Error: - if req == mandatory: - # note: we can receive an error if obj has no content - errs.append(_('Object cannot be encoded')) - else: - if req == mandatory: - errs.append(_('Mandatory argument not available')) - - def errors(obj, where): - return obj.errors(where) - - def format(obj, f, errs): - try: - obj.format(f, errs) - except Error: - if req == mandatory: - errs.append(_('Mandatory argument not available')) - - return (init, decode, encode, errors, format) - - basic_cons_map = { - types.StringType : str, - types.UnicodeType : unicode, - types.IntType : int, - types.FloatType : float, - types.LongType : long - } diff --git a/tags/pisi-1.1_beta13/pisi/pxml/xmlext.py b/tags/pisi-1.1_beta13/pisi/pxml/xmlext.py deleted file mode 100644 index 02fe77ac..00000000 --- a/tags/pisi-1.1_beta13/pisi/pxml/xmlext.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# -# Authors: Eray Ozkural - -try: - from xmlextpiks import * -except: - try: - #if pisi.context.use_mdom: - # gibidi - from xmlextcdom import * - except: - #raise Error('cannot find 4suite implementation') - print 'xmlext: piksemel or cDomlette implementation cannot be loaded, falling back to minidom' - from xmlextmdom import * diff --git a/tags/pisi-1.1_beta13/pisi/pxml/xmlextcdom.py b/tags/pisi-1.1_beta13/pisi/pxml/xmlextcdom.py deleted file mode 100644 index 6ca19564..00000000 --- a/tags/pisi-1.1_beta13/pisi/pxml/xmlextcdom.py +++ /dev/null @@ -1,218 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# -# Authors: Eray Ozkural -# Baris Metin -# Faik Uygur - -""" - xmlext is a helper module for accessing XML files using - xml.dom.minidom . It is a convenient wrapper for some - DOM functions, and provides path based get/add functions - as in KDE API. - - function names are mixedCase for compatibility with minidom, - an 'old library' - - this implementation uses cDomlette from 4suite.org - adapted from the minidom implementation by Faik Uygur and fixed by Eray -""" - -import gettext -__trans = gettext.translation('pisi', fallback=True) -_ = __trans.ugettext - -import Ft -from Ft.Xml.Domlette import implementation -from Ft.Xml.Domlette import NoExtDtdReader -import Ft.Lib -import pisi - -from xml.dom import XHTML_NAMESPACE, XML_NAMESPACE -XHTML_NS = unicode(XHTML_NAMESPACE) -XML_NS = unicode(XML_NAMESPACE) - -class XmlError(pisi.Error): - "named this way because the class if mostly used with an import *" - pass - -# Document wrappers - -def newDocument(tag): - # create a document and return document root - doc = implementation.createDocument(None, tag, None) - return doc.documentElement - -def parse(filename): - # parse file and return document root - try: - doc = NoExtDtdReader.parseUri(Ft.Lib.Uri.OsPathToUri(filename)) - return doc.documentElement - except Ft.FtException, e: - raise Error(_("File '%s' has invalid XML: %s") % (filename, str(e))) - -def newNode(node, tag): - return node.ownerDocument.createElementNS(None, tag) - -def newTextNode(node, text): - return node.ownerDocument.createTextNode(text) - -# Node related wrappers - -def getNodeAttribute(node, attrname): - """get named attribute from DOM node""" - if attrname.startswith('xml:'): - if node.hasAttributeNS(XML_NS, attrname[4:]): - return node.getAttributeNS(XML_NS, attrname[4:]) - else: - return None - else: - if not node.hasAttributeNS(None, attrname): - return None - else: - return node.getAttributeNS(None, attrname) - -def setNodeAttribute(node, attrname, value): - """get named attribute from DOM node""" - if attrname.startswith('xml:'): - node.setAttributeNS(XML_NS, attrname, value) - else: - node.setAttributeNS(None, attrname, value) - -def getChildElts(node): - """get only child elements""" - return filter(lambda x:x.nodeType == x.ELEMENT_NODE, node.childNodes) - -def getTagByName(parent, childName): - return [x for x in parent.childNodes - if x.nodeType == x.ELEMENT_NODE and x.tagName == childName] - -def getNodeText(node, tagpath = ""): - """get the first child and expect it to be text!""" - if tagpath!="": - node = getNode(node, tagpath) - try: - child = node.childNodes[0] - except IndexError: - return None - except AttributeError: # no node by that name - return None - if child.nodeType == child.TEXT_NODE: - # in any case, strip whitespaces... - return child.data.strip() - else: - raise XmlError(_("getNodeText: Expected text node, got something else!")) - -def getChildText(node_s, tagpath): - """get the text of a child at the end of a tag path""" - node = getNode(node_s, tagpath) - if not node: - return None - return getNodeText(node) - -def getNode(node, tagpath): - """returns the *first* matching node for given tag path.""" - - assert type(tagpath)==str - tags = tagpath.split('/') - assert len(tags)>0 - - # iterative code to search for the path - for tag in tags: - currentNode = None - for child in node.childNodes: - if child.nodeType == node.ELEMENT_NODE and child.tagName == tag: - currentNode = child - break - if not currentNode: - return None - else: - node = currentNode - return currentNode - -def getAllNodes(node, tagPath): - """retrieve all nodes that match a given tag path.""" - - tags = tagPath.split('/') - - if len(tags) == 0: - return [] - - nodeList = [node] # basis case - - for tag in tags: - results = map(lambda x: getTagByName(x, tag), nodeList) - nodeList = [] - for x in results: - nodeList.extend(x) - pass # emacs indentation error, keep it here - - if len(nodeList) == 0: - return [] - - return nodeList - -def createTagPath(node, tags): - """create new child at the end of a tag chain starting from node - no matter what""" - if len(tags)==0: - return node - dom = node.ownerDocument - for tag in tags: - node = node.appendChild(dom.createElementNS(None, tag)) - return node - -def addTagPath(node, tags, newnode=None): - """add newnode at the end of a tag chain, smart one""" - node = createTagPath(node, tags) - if newnode: # node to add specified - node.appendChild(newnode) - return node - -def addNode(node, tagpath, newnode = None, branch=True): - """add a new node at the end of the tree and returns it - if newnode is given adds that node, too.""" - - assert type(tagpath)==str - tags = [] - if tagpath != "": - tags = tagpath.split('/') # tag chain - else: - addTagPath(node, [], newnode) - return node #FIXME: is this correct!?!? - - assert len(tags)>0 # we want a chain - - # iterative code to search for the path - - if branch: - rem = 1 - else: - rem = 0 - - while len(tags) > rem: - tag = tags.pop(0) - nodeList = getTagByName(node, tag) - if len(nodeList) == 0: # couldn't find - tags.insert(0, tag) # put it back in - return addTagPath(node, tags, newnode) - else: - node = nodeList[len(nodeList)-1] # discard other matches - else: - # had only one tag.. - return addTagPath(node, tags, newnode) - - return node - -def addText(node, tagPath, text, branch = True): - newnode = newTextNode(node, text) - return addNode(node, tagPath, newnode, branch = branch) diff --git a/tags/pisi-1.1_beta13/pisi/pxml/xmlextmdom.py b/tags/pisi-1.1_beta13/pisi/pxml/xmlextmdom.py deleted file mode 100644 index f650a2f5..00000000 --- a/tags/pisi-1.1_beta13/pisi/pxml/xmlextmdom.py +++ /dev/null @@ -1,197 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# -# Authors: Eray Ozkural -# Baris Metin - -""" - xmlext is a helper module for accessing XML files using - xml.dom.minidom . It is a convenient wrapper for some - DOM functions, and provides path based get/add functions - as in KDE API. - - function names are mixedCase for compatibility with minidom, - an 'old library' - - note: this is a particularly inefficient implementation of xmlext. -""" - -import gettext -__trans = gettext.translation('pisi', fallback=True) -_ = __trans.ugettext - -import xml.dom.minidom as mdom -from xml.parsers.expat import ExpatError - -import pisi - -class XmlError(pisi.Error): - "named this way because the class if mostly used with an import *" - pass - -# Document wrappers - -def newDocument(tag): - impl = mdom.getDOMImplementation() - dom = impl.createDocument(None, tag, None) - return dom.documentElement - -def parse(filename): - try: - dom = mdom.parse(filename) - return dom.documentElement - except ExpatError, inst: - raise Error(_("File '%s' has invalid XML: %s\n") % (fileName, - str(inst))) - -def newNode(node, tag): - return node.ownerDocument.createElement(tag) - -def newTextNode(node, text): - return node.ownerDocument.createTextNode(text) - -# Node related wrappers - -def getNodeAttribute(node, attrname): - """get named attribute from DOM node""" - if not node.hasAttribute(attrname): - return None - return node.getAttribute(attrname) - -def getChildElts(node): - """get only child elements""" - return filter(lambda x:x.nodeType == x.ELEMENT_NODE, node.childNodes) - -def getTagByName(parent, childName): - return [x for x in parent.childNodes - if x.nodeType == x.ELEMENT_NODE and x.tagName == childName] - -def getNodeText(node, tagpath = ""): - """get the first child and expect it to be text!""" - if tagpath!="": - node = getNode(node, tagpath) - try: - child = node.childNodes[0] - except IndexError: - return None - except AttributeError: # no node by that name - return None - if child.nodeType == child.TEXT_NODE: - # in any case, strip whitespaces... - return child.data.strip() - else: - raise XmlError(_("getNodeText: Expected text node, got something else!")) - -def getChildText(node_s, tagpath): - """get the text of a child at the end of a tag path""" - node = getNode(node_s, tagpath) - if not node: - return None - return getNodeText(node) - -def getNode(node, tagpath): - """returns the *first* matching node for given tag path.""" - - assert type(tagpath)==str - tags = tagpath.split('/') - assert len(tags)>0 - - # iterative code to search for the path - for tag in tags: - currentNode = None - for child in node.childNodes: - if child.nodeType == node.ELEMENT_NODE and child.tagName == tag: - currentNode = child - break - if not currentNode: - return None - else: - node = currentNode - return currentNode - -def getAllNodes(node, tagPath): - """retrieve all nodes that match a given tag path.""" - - tags = tagPath.split('/') - - if len(tags) == 0: - return [] - - nodeList = [node] # basis case - - for tag in tags: - results = map(lambda x: getTagByName(x, tag), nodeList) - nodeList = [] - for x in results: - nodeList.extend(x) - pass # emacs indentation error, keep it here - - if len(nodeList) == 0: - return [] - - return nodeList - -def createTagPath(node, tags): - """create new child at the end of a tag chain starting from node - no matter what""" - if len(tags)==0: - return node - dom = node.ownerDocument - for tag in tags: - node = node.appendChild(dom.createElement(tag)) - return node - -def addTagPath(node, tags, newnode=None): - """add newnode at the end of a tag chain, smart one""" - node = createTagPath(node, tags) - if newnode: # node to add specified - node.appendChild(newnode) - return node - -def addNode(node, tagpath, newnode = None, branch=True): - """add a new node at the end of the tree and returns it - if newnode is given adds that node, too.""" - - assert type(tagpath)==str - tags = [] - if tagpath != "": - tags = tagpath.split('/') # tag chain - else: - addTagPath(node, [], newnode) - return node #FIXME: is this correct!?!? - - assert len(tags)>0 # we want a chain - - # iterative code to search for the path - - if branch: - rem = 1 - else: - rem = 0 - - while len(tags) > rem: - tag = tags.pop(0) - nodeList = getTagByName(node, tag) - if len(nodeList) == 0: # couldn't find - tags.insert(0, tag) # put it back in - return addTagPath(node, tags, newnode) - else: - node = nodeList[len(nodeList)-1] # discard other matches - else: - # had only one tag.. - return addTagPath(node, tags, newnode) - - return node - -def addText(node, tagPath, text, branch = True): - newnode = newTextNode(node, text) - return addNode(node, tagPath, newnode, branch = branch) diff --git a/tags/pisi-1.1_beta13/pisi/pxml/xmlextpiks.py b/tags/pisi-1.1_beta13/pisi/pxml/xmlextpiks.py deleted file mode 100644 index 1801fae4..00000000 --- a/tags/pisi-1.1_beta13/pisi/pxml/xmlextpiks.py +++ /dev/null @@ -1,171 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# -# Authors: Eray Ozkural -# Gurer Ozen -# -# piksemel written by Gurer Ozen - -""" - xmlext is a helper module for accessing XML files using - xml.dom.minidom . It is a convenient wrapper for some - DOM functions, and provides path based get/add functions - as in KDE API. - - function names are mixedCase for compatibility with minidom, - an 'old library' - - this implementation uses piksemel -""" - -import gettext -__trans = gettext.translation('pisi', fallback=True) -_ = __trans.ugettext - -import pisi -import piksemel as iks - -parse = iks.parse -newDocument = iks.newDocument - -def getAllNodes(node, tagPath): - """retrieve all nodes that match a given tag path.""" - tags = tagPath.split('/') - if len(tags) == 0: - return [] - nodeList = [node] # basis case - for tag in tags: - results = map(lambda x: getTagByName(x, tag), nodeList) - nodeList = [] - for x in results: - nodeList.extend(x) - pass # emacs indentation error, keep it here - if len(nodeList) == 0: - return [] - return nodeList - -def getNodeAttribute(node, attrname): - """get named attribute from DOM node""" - return node.getAttribute(attrname) - -def setNodeAttribute(node, attrname, value): - """get named attribute from DOM node""" - return node.setAttribute(attrname, value) - -def getChildElts(parent): - """get only child elements""" - return [x for x in parent.tags()] - -def getTagByName(parent, childName): - return [x for x in parent.tags(childName)] - -def getNodeText(node, tagpath = ""): - """get the first child and expect it to be text!""" - if tagpath!="": - node = getNode(node, tagpath) - if not node: - return None - child = node.firstChild() - if not child: - return None - if child.type() == iks.DATA: - # in any case, strip whitespaces... - return child.data().strip() - else: - raise XmlError(_("getNodeText: Expected text node, got something else!")) - -def getChildText(node_s, tagpath): - """get the text of a child at the end of a tag path""" - node = getNode(node_s, tagpath) - if not node: - return None - return getNodeText(node) - -def getNode(node, tagpath): - """returns the *first* matching node for given tag path.""" - - if tagpath == "": - return node - - assert type(tagpath)==str - tags = tagpath.split('/') - assert len(tags)>0 - - # iterative code to search for the path - for tag in tags: - currentNode = None - for child in node.tags(): - if child.name() == tag: - currentNode = child - break - if not currentNode: - return None - else: - node = currentNode - return currentNode - -def createTagPath(node, tags): - """create new child at the end of a tag chain starting from node - no matter what""" - if len(tags)==0: - return node - for tag in tags: - node = node.insertTag(tag) - return node - -def addTagPath(node, tags, newnode=None): - """add newnode at the end of a tag chain, smart one""" - node = createTagPath(node, tags) - if newnode: # node to add specified - node.insertNode(newnode) - return node - -def addNode(node, tagpath, newnode = None, branch=True): - """add a new node at the end of the tree and returns it - if newnode is given adds that node, too.""" - - assert type(tagpath)==str - tags = [] - if tagpath != "": - tags = tagpath.split('/') # tag chain - else: - addTagPath(node, [], newnode) - return node #FIXME: is this correct!?!? - - assert len(tags)>0 # we want a chain - - # iterative code to search for the path - - if branch: - rem = 1 - else: - rem = 0 - - while len(tags) > rem: - tag = tags.pop(0) - nodeList = getTagByName(node, tag) - if len(nodeList) == 0: # couldn't find - tags.insert(0, tag) # put it back in - return addTagPath(node, tags, newnode) - else: - node = nodeList[len(nodeList)-1] # discard other matches - else: - # had only one tag.. - return addTagPath(node, tags, newnode) - - return node - -def addText(node, tagpath, text): - node = addNode(node, tagpath) - node.insertData(text) - -def newNode(node, tag): - return iks.newDocument(tag) diff --git a/tags/pisi-1.1_beta13/pisi/pxml/xmlfile.py b/tags/pisi-1.1_beta13/pisi/pxml/xmlfile.py deleted file mode 100644 index 50673684..00000000 --- a/tags/pisi-1.1_beta13/pisi/pxml/xmlfile.py +++ /dev/null @@ -1,27 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# -# Authors: Eray Ozkural - -import pisi.context - -try: - from xmlfilepiks import * -except: - try: - #if pisi.context.use_mdom: - # zibidi - #else: - from xmlfilecdom import * - except: - #raise Error('cannot find 4suite implementation') - print 'xmlext: cDomlette/piksemel implementation cannot be loaded, falling back to minidom' - from xmlfilemdom import * diff --git a/tags/pisi-1.1_beta13/pisi/pxml/xmlfilecdom.py b/tags/pisi-1.1_beta13/pisi/pxml/xmlfilecdom.py deleted file mode 100644 index 6f20a8cf..00000000 --- a/tags/pisi-1.1_beta13/pisi/pxml/xmlfilecdom.py +++ /dev/null @@ -1,171 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# -# Authors: Eray Ozkural -# Baris Metin - -""" - XmlFile class further abstracts a dom object using the - high-level dom functions provided in xmlext module (and sorely lacking - in xml.dom :( ) - - function names are mixedCase for compatibility with minidom, - an 'old library' - - this implementation uses cDomlette from 4suite.org - adapted from the minidom implementation by Faik Uygur and fixed by Eray -""" - -import gettext -__trans = gettext.translation('pisi', fallback=True) -_ = __trans.ugettext - -import codecs -import exceptions - -import Ft -from Ft.Xml.Domlette import implementation -from Ft.Xml.Domlette import NoExtDtdReader -from Ft.Xml.Domlette import Print, PrettyPrint -from xml.dom import XHTML_NAMESPACE, XML_NAMESPACE - -XHTML_NS = unicode(XHTML_NAMESPACE) -XML_NS = unicode(XML_NAMESPACE) - -import pisi -from pisi.pxml.xmlextcdom import * -from pisi.file import File -from pisi.util import join_path as join - -class Error(pisi.Error): - pass - -class XmlFile(object): - """A class to help reading and writing an XML file""" - - def __init__(self, tag): - self.rootTag = tag - - def newDocument(self): - """clear DOM""" - self.doc = implementation.createDocument(None, self.rootTag, None) - - def unlink(self): - """deallocate DOM structure""" - del self.doc - - def rootNode(self): - """returns root document element""" - return self.doc.documentElement - - def readxml(self, uri, tmpDir='/tmp', sha1sum=False, compress=None, sign=None): - uri = File.make_uri(uri) - localpath = File.download(uri, tmpDir,sha1sum=sha1sum,compress=compress,sign=sign) - try: - self.doc = NoExtDtdReader.parseUri(Ft.Lib.Uri.OsPathToUri(localpath)) - return self.doc.documentElement - except Ft.FtException, e: - raise Error(_("File '%s' has invalid XML: %s") % (localpath, str(e)) ) - except exceptions.ValueError, e: - raise Error(_("File '%s' not found") % localpath ) - - def writexml(self, uri, tmpDir = '/tmp', sha1sum=False, compress=None, sign=None): - f = File(uri, File.write, sha1sum=sha1sum, compress=compress, sign=sign) - PrettyPrint(self.rootNode(), stream = f) - f.close() - - def verifyRootTag(self): - actual_roottag = self.rootNode().tagName - if actual_roottag != self.rootTag: - raise Error(_("Root tagname %s not identical to %s as expected") % - (actual_roottag, self.rootTag) ) - - # construction helpers - - def newNode(self, tag): - return self.doc.createElementNS(None, tag) - - def newTextNode(self, text): - return self.doc.createTextNode(text) - - def newAttribute(self, attr): - return self.doc.createAttribute(attr) - - # read helpers - - def getNode(self, tagPath = ""): - """returns the *first* matching node for given tag path.""" - self.verifyRootTag() - return getNode(self.doc.documentElement, tagPath) - - def getNodeText(self, tagPath): - """returns the text of *first* matching node for given tag path.""" - node = self.getNode(tagPath) - if not node: - return None - return getNodeText(node) - - def getAllNodes(self, tagPath): - """returns all nodes matching a given tag path.""" - self.verifyRootTag() - return getAllNodes(self.doc.documentElement, tagPath) - - def getChildren(self, tagpath): - """ returns the children of the given path""" - node = self.getNode(tagpath) - return node.childNodes - - # get only elements of a given type - #FIXME: this doesn't work - def getChildrenWithType(self, tagpath, type): - """ returns the children of the given path, only with given type """ - node = self.getNode(tagpath) - return filter(lambda x:x.nodeType == type, node.childNodes) - - # get only child elements - def getChildElts(self, tagpath): - """ returns the children of the given path, only with given type """ - node = self.getNode(tagpath) - try: - return filter(lambda x:x.nodeType == x.ELEMENT_NODE, - node.childNodes) - except AttributeError: - return None - - # write helpers - - def addNode(self, tagPath, newnode = None): - "this adds the newnode under given tag path" - self.verifyRootTag() - return addNode(self.doc.documentElement, tagPath, newnode) - - def addNodeUnder(self, node, tagPath, newnode = None): - "this adds the new stuff under node and then following tag path" - self.verifyRootTag() - return addNode(node, tagPath, newnode) - - def addChild(self, newnode): - "add a new child node right under root element document" - self.doc.documentElement.appendChild(newnode) - - def addText(self, node, text): - "add text to node" - node.appendChild(self.newTextNode(text)) - - def addTextNode(self, tagPath, text): - "add a text node with given tag path" - node = self.addNode(tagPath, self.newTextNode(text)) - return node - - def addTextNodeUnder(self, node, tagPath, text): - "add a text node under given node with tag path (phew)" - return self.addNodeUnder(node, tagPath, self.newTextNode(text)) diff --git a/tags/pisi-1.1_beta13/pisi/pxml/xmlfilemdom.py b/tags/pisi-1.1_beta13/pisi/pxml/xmlfilemdom.py deleted file mode 100644 index c9be3d42..00000000 --- a/tags/pisi-1.1_beta13/pisi/pxml/xmlfilemdom.py +++ /dev/null @@ -1,162 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# -# Authors: Eray Ozkural -# Baris Metin - -""" - XmlFile class further abstracts a dom object using the - high-level dom functions provided in xmlext module (and sorely lacking - in xml.dom :( ) - - function names are mixedCase for compatibility with minidom, - an 'old library' - - note: this is a particularly inefficient implementation of xmlfile -""" - -import gettext -__trans = gettext.translation('pisi', fallback=True) -_ = __trans.ugettext - -import xml.dom.minidom as mdom -from xml.parsers.expat import ExpatError -import codecs - -import pisi -from pisi.file import File - -class Error(pisi.Error): - "named this way because the class if mostly used with an import *" - pass - -class XmlFile(object): - """A class to help reading and writing an XML file""" - - def __init__(self, tag): - self.rootTag = tag - - def newDocument(self): - """clear DOM""" - impl = mdom.getDOMImplementation() - self.doc = impl.createDocument(None, self.rootTag, None) - - def unlink(self): - """deallocate DOM structure""" - self.doc.unlink() - del self.doc - - def rootNode(self): - """returns root document element""" - return self.doc.documentElement - - def readxml(self, uri, tmpDir = '/tmp'): - uri = File.make_uri(uri) - localpath = File.download(uri, tmpDir) - - try: - self.doc = mdom.parse(localpath) - except ExpatError, inst: - raise Error(_("File '%s' has invalid XML: %s\n") % (fileName, - str(inst))) - - def writexml(self, fileName): - f = codecs.open(fileName,'w', "utf-8") - f.write(self.doc.toprettyxml()) - f.close() - - def verifyRootTag(self): - actual_roottag = self.rootNode().tagName - if actual_roottag != self.rootTag: - raise Error(_("Root tagname %s not identical to %s as expected") % - (actual_roottag, self.rootTag) ) - - # construction helpers - - def newNode(self, tag): - return self.doc.createElement(tag) - - def newTextNode(self, text): - return self.doc.createTextNode(text) - - def newAttribute(self, attr): - return self.doc.createAttribute(attr) - - # read helpers - - def getNode(self, tagPath = ""): - """returns the *first* matching node for given tag path.""" - self.verifyRootTag() - return getNode(self.doc.documentElement, tagPath) - - def getNodeText(self, tagPath): - """returns the text of *first* matching node for given tag path.""" - node = self.getNode(tagPath) - if not node: - return None - return getNodeText(node) - - def getAllNodes(self, tagPath): - """returns all nodes matching a given tag path.""" - self.verifyRootTag() - return getAllNodes(self.doc.documentElement, tagPath) - - def getChildren(self, tagpath): - """ returns the children of the given path""" - node = self.getNode(tagpath) - return node.childNodes - - # get only elements of a given type - #FIXME: this doesn't work - def getChildrenWithType(self, tagpath, type): - """ returns the children of the given path, only with given type """ - node = self.getNode(tagpath) - return filter(lambda x:x.nodeType == type, node.childNodes) - - # get only child elements - def getChildElts(self, tagpath): - """ returns the children of the given path, only with given type """ - node = self.getNode(tagpath) - try: - return filter(lambda x:x.nodeType == x.ELEMENT_NODE, - node.childNodes) - except AttributeError: - return None - - # write helpers - - def addNode(self, tagPath, newnode = None): - "this adds the newnode under given tag path" - self.verifyRootTag() - return addNode(self.doc.documentElement, tagPath, newnode) - - def addNodeUnder(self, node, tagPath, newnode = None): - "this adds the new stuff under node and then following tag path" - self.verifyRootTag() - return addNode(node, tagPath, newnode) - - def addChild(self, newnode): - "add a new child node right under root element document" - self.doc.documentElement.appendChild(newnode) - - def addText(self, node, text): - "add text to node" - node.appendChild(self.newTextNode(text)) - - def addTextNode(self, tagPath, text): - "add a text node with given tag path" - node = self.addNode(tagPath, self.newTextNode(text)) - return node - - def addTextNodeUnder(self, node, tagPath, text): - "add a text node under given node with tag path (phew)" - return self.addNodeUnder(node, tagPath, self.newTextNode(text)) diff --git a/tags/pisi-1.1_beta13/pisi/pxml/xmlfilepiks.py b/tags/pisi-1.1_beta13/pisi/pxml/xmlfilepiks.py deleted file mode 100644 index 15355940..00000000 --- a/tags/pisi-1.1_beta13/pisi/pxml/xmlfilepiks.py +++ /dev/null @@ -1,87 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# - -""" - XmlFile class further abstracts a dom object using the - high-level dom functions provided in xmlext module (and sorely lacking - in xml.dom :( ) - - function names are mixedCase for compatibility with minidom, - an 'old library' - - this implementation uses piksemel -""" - -import gettext -__trans = gettext.translation('pisi', fallback=True) -_ = __trans.ugettext - -import codecs -import exceptions - -import piksemel as iks - -import pisi -from pisi.file import File -from pisi.util import join_path as join - -class Error(pisi.Error): - pass - -class XmlFile(object): - """A class to help reading and writing an XML file""" - - def __init__(self, tag): - self.rootTag = tag - - def newDocument(self): - """clear DOM""" - self.doc = iks.newDocument(self.rootTag) - - def unlink(self): - """deallocate DOM structure""" - del self.doc - - def rootNode(self): - """returns root document element""" - return self.doc - - def readxmlfile(self, file): - raise Exception("not implemented") - try: - self.doc = iks.parse(file) - return self.doc - except Exception, e: - raise Error(_("File '%s' has invalid XML") % (localpath) ) - - - def readxml(self, uri, tmpDir='/tmp', sha1sum=False, - compress=None, sign=None, copylocal = False): - uri = File.make_uri(uri) - #try: - localpath = File.download(uri, tmpDir, sha1sum=sha1sum, - compress=compress,sign=sign, copylocal=copylocal) - #except IOError, e: - # raise Error(_("Cannot read URI %s: %s") % (uri, unicode(e)) ) - try: - self.doc = iks.parse(localpath) - return self.doc - except Exception, e: - raise Error(_("File '%s' has invalid XML") % (localpath) ) - - def writexml(self, uri, tmpDir = '/tmp', sha1sum=False, compress=None, sign=None): - f = File(uri, File.write, sha1sum=sha1sum, compress=compress, sign=sign) - f.write(self.doc.toPrettyString()) - f.close() - - def writexmlfile(self, f): - f.write(self.doc.toPrettyString()) diff --git a/tags/pisi-1.1_beta13/pisi/repodb.py b/tags/pisi-1.1_beta13/pisi/repodb.py deleted file mode 100644 index 440ab2c3..00000000 --- a/tags/pisi-1.1_beta13/pisi/repodb.py +++ /dev/null @@ -1,128 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# - -# Author: Eray Ozkural - -import os, fcntl - -import gettext -__trans = gettext.translation('pisi', fallback=True) -_ = __trans.ugettext - -import pisi -import pisi.lockeddbshelve as shelve -import pisi.context as ctx -import pisi.packagedb as packagedb -import pisi.util as util -from pisi.uri import URI - -class Error(pisi.Error): - pass - -class Repo: - def __init__(self, indexuri): - self.indexuri = indexuri - -#class HttpRepo - -#class FtpRepo - -#class RemovableRepo - - -class RepoDB(object): - """RepoDB maps repo ids to repository information""" - - def __init__(self, txn = None): - self.d = shelve.LockedDBShelf("repo") - def proc(txn): - if not self.d.has_key("order", txn): - self.d.put("order", [], txn) - self.d.txn_proc(proc, txn) - - def close(self): - self.d.close() - - def repo_name(self, ix): - l = self.list() - return l[ix] - - def swap(self, x, y): - def proc(txn): - l = self.d.get("order", txn) - t = l[x] - l[x] = l[y] - l[y] = t - self.d.put("order", l, txn) - self.d.txn_proc(proc, txn) - - def has_repo(self, name): - name = str(name) - return self.d.has_key("repo-" + name) - - def get_repo(self, name): - name = str(name) - return self.d["repo-" + name] - - def add_repo(self, name, repo_info, txn = None, at = None): - """add repository with name and repo_info at a given optional position""" - name = str(name) - assert (isinstance(repo_info,Repo)) - def proc(txn): - if self.d.has_key("repo-" + name, txn): - raise Error(_('Repository %s already exists') % name) - self.d.put("repo-" + name, repo_info, txn) - order = self.d.get("order", txn) - if at == None: - order.append(name) - else: - if at<0 or at>len(order): - raise Error(_("Cannot add repository at position %s") % at) - order.insert(at, name) - self.d.put("order", order, txn) - self.d.txn_proc(proc, txn) - - def list(self): - return self.d["order"] - - def clear(self): - self.d.clear() - - def remove_repo(self, name, txn = None): - name = str(name) - def proc(txn): - self.d.delete("repo-" + name, txn) - list = self.d.get("order", txn) - list.remove(name) - self.d.put("order", list, txn) - ctx.packagedb.remove_repo(name, txn=txn) - ctx.sourcedb.remove_repo(name, txn=txn) - ctx.componentdb.remove_repo(name, txn=txn) - self.d.txn_proc(proc, txn) - -db = None - -def init(): - global db - - if db: - return db - - db = RepoDB() - return db - -def finalize(): - global db - - if db: - db.close() - db = None diff --git a/tags/pisi-1.1_beta13/pisi/search/__init__.py b/tags/pisi-1.1_beta13/pisi/search/__init__.py deleted file mode 100644 index bff53010..00000000 --- a/tags/pisi-1.1_beta13/pisi/search/__init__.py +++ /dev/null @@ -1,64 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# -# -# Author: Eray Ozkural - -import pisi -import pisi.context as ctx - -class Error(pisi.Error): - pass - -class Exception(pisi.Exception): - pass - -# API - -from invertedindex import InvertedIndex -import preprocess as p - -def init(ids, langs): - "initialize databases" - - assert type(ids)==type([]) - assert type(langs)==type([]) - - ctx.invidx = {} - for id in ids: - ctx.invidx[id] = {} - for lang in langs: - ctx.invidx[id][lang] = InvertedIndex(id, lang) - -def finalize(): - import pisi.context as ctx - - if ctx.invidx: - for id in ctx.invidx.iterkeys(): - for lang in ctx.invidx[id].iterkeys(): - ctx.invidx[id][lang].close() - ctx.invidx = {} - -def add_doc(id, lang, docid, str, repo = None, txn = None): - terms = p.preprocess(lang, str) - ctx.invidx[id][lang].add_doc(docid, terms, repo=repo, txn=txn) - -def remove_doc(id, lang, docid, str, repo = None, txn = None): - terms = p.preprocess(lang, str) - ctx.invidx[id][lang].remove_doc(docid, terms, repo = repo, txn = txn) - -def query_terms(id, lang, terms, repo = None, txn = None): - terms = map(lambda x: p.lower(lang, x), terms) - return ctx.invidx[id][lang].query(terms, repo = repo, txn = txn) - -def query(id, lang, str, repo = None, txn = None): - terms = p.preprocess(lang, str) - return query_terms(id, lang, terms, repo = repo, txn = txn) diff --git a/tags/pisi-1.1_beta13/pisi/search/invertedindex.py b/tags/pisi-1.1_beta13/pisi/search/invertedindex.py deleted file mode 100644 index d054a2c8..00000000 --- a/tags/pisi-1.1_beta13/pisi/search/invertedindex.py +++ /dev/null @@ -1,84 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# -# Author: Eray Ozkural - -import types - -import pisi.lockeddbshelve as shelve -from pisi.itembyrepodb import ItemByRepoDB -import pisi.itembyrepodb as itembyrepodb - -class InvertedIndex(object): - """a database of term -> set of documents""" - - def __init__(self, id, lang): - self.d = ItemByRepoDB('ii-%s-%s' % (id, lang)) - - def close(self): - self.d.close() - - def has_term(self, term, repo = None, txn = None): - return self.d.has_key(shelve.LockedDBShelf.encodekey(term), repo=repo,txn=txn) - - def get_term(self, term, repo = None, txn = None): - """get set of doc ids given term""" - term = shelve.LockedDBShelf.encodekey(term) - def proc(txn): - if not self.has_term(term, repo=repo, txn=txn): - return set() - return self.d.get_item(term, repo=repo, txn=txn) - return self.d.txn_proc(proc, txn) - - def get_union_term(self, name, txn = None, repo = itembyrepodb.repos ): - """get a union of all repository terms, not just the first repo in order. - get only basic repo info from the first repo""" - name = shelve.LockedDBShelf.encodekey(name) - def proc(txn): - terms= set() - if self.d.d.has_key(name): - s = self.d.d.get(name, txn=txn) - for repostr in self.d.order(repo = repo): - if s.has_key(repostr): - terms |= s[repostr] - return terms - return self.d.txn_proc(proc, txn) - - def query(self, terms, repo = None, txn = None): - def proc(txn): - docs = [ self.get_union_term(x, repo=repo, txn=txn) for x in terms ] - if docs: - return reduce(lambda x,y: x.intersection(y), docs) - else: - return set() - return self.d.txn_proc(proc, txn) - - def list_terms(self, repo = None, txn= None): - return self.d.list(f, repo=repo, txn=txn) - - def add_doc(self, doc, terms, repo = None, txn = None): - def f(txn): - for term_i in terms: - term_i = shelve.LockedDBShelf.encodekey(term_i) - term_i_docs = self.get_term(term_i, repo=repo, txn=txn) - term_i_docs.add(doc) - self.d.add_item(term_i, term_i_docs, repo=repo, txn=txn) # update - return self.d.txn_proc(f, txn) - - def remove_doc(self, doc, terms,repo=None, txn=None): - def f(txn): - for term_i in terms: - term_i = shelve.LockedDBShelf.encodekey(term_i) - term_i_docs = self.get_term(term_i,repo=repo, txn=txn) - if doc in term_i_docs: - term_i_docs.remove(doc) - self.d.add_item(term_i, term_i_docs, repo=repo, txn=txn) # update - return self.d.txn_proc(f, txn) diff --git a/tags/pisi-1.1_beta13/pisi/search/preprocess.py b/tags/pisi-1.1_beta13/pisi/search/preprocess.py deleted file mode 100644 index df55e999..00000000 --- a/tags/pisi-1.1_beta13/pisi/search/preprocess.py +++ /dev/null @@ -1,40 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# - -import tokenize - -def lowly_python(str): - def lowly_char(c): - if c=='I': - lowly = 'i' # because of some fools we can't choose locale in lower - else: - lowly = c.lower() - return c - - r = "" - for c in str: - r += lowly_char(c) - return r - -def lower(lang, str): - if lang=='tr': - return lowly_python(str) - else: - return str.lower() - -def preprocess(lang, str): - terms = tokenize.tokenize(lang, str) - - # normalize - terms = map(lambda x: lower(lang, x), terms) - - return terms diff --git a/tags/pisi-1.1_beta13/pisi/search/tokenize.py b/tags/pisi-1.1_beta13/pisi/search/tokenize.py deleted file mode 100644 index 2d69e344..00000000 --- a/tags/pisi-1.1_beta13/pisi/search/tokenize.py +++ /dev/null @@ -1,34 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# -# Author: Eray Ozkural -# -# rev 1: very simple tokenization, for testing - -import string - -def tokenize(lang, str): - if type(str) != type(unicode()): - str = unicode(str) - tokens = [] - token = unicode() - for x in str: - if x in string.whitespace or x in string.punctuation: - if len(token) > 0: - tokens.append(token) - token = unicode() - else: - token += x - - if token: - tokens.append(token) - - return tokens diff --git a/tags/pisi-1.1_beta13/pisi/sourcearchive.py b/tags/pisi-1.1_beta13/pisi/sourcearchive.py deleted file mode 100644 index 76724177..00000000 --- a/tags/pisi-1.1_beta13/pisi/sourcearchive.py +++ /dev/null @@ -1,71 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# -# Authors: Baris Metin -# Eray Ozkural - -# python standard library - -from os.path import join -from os import access, R_OK - -import gettext -__trans = gettext.translation('pisi', fallback=True) -_ = __trans.ugettext - -# pisi modules -import pisi -import pisi.util as util -import pisi.context as ctx -from pisi.archive import Archive -from pisi.uri import URI -from pisi.fetcher import fetch_url - -class Error(pisi.Error): - pass - -class SourceArchive: - """source archive. this is a class responsible for fetching - and unpacking a source archive""" - def __init__(self, spec, pkg_work_dir): - self.url = URI(spec.source.archive.uri) - self.pkg_work_dir = pkg_work_dir - self.archiveFile = join(ctx.config.archives_dir(), self.url.filename()) - self.archive = spec.source.archive - - def fetch(self, interactive=True): - if not self.is_cached(interactive): - if interactive: - progress = ctx.ui.Progress - else: - progress = None - fetch_url(self.url, ctx.config.archives_dir(), progress) - - def is_cached(self, interactive=True): - if not access(self.archiveFile, R_OK): - return False - - # check hash - if util.check_file_hash(self.archiveFile, self.archive.sha1sum): - if interactive: - ctx.ui.info(_('%s [cached]') % self.archive.name) - return True - - return False - - def unpack(self, clean_dir=True): - - # check archive file's integrity - if not util.check_file_hash(self.archiveFile, self.archive.sha1sum): - raise Error, _("unpack: check_file_hash failed") - - archive = Archive(self.archiveFile, self.archive.type) - archive.unpack(self.pkg_work_dir, clean_dir) diff --git a/tags/pisi-1.1_beta13/pisi/sourcedb.py b/tags/pisi-1.1_beta13/pisi/sourcedb.py deleted file mode 100644 index 4abb44dc..00000000 --- a/tags/pisi-1.1_beta13/pisi/sourcedb.py +++ /dev/null @@ -1,113 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# -# Author: Eray Ozkural - -""" -package source database -interface for update/query to local package repository -we basically store everything in sourceinfo class -yes, we are cheap -to handle multiple repositories, for sources, we -store a set of repositories in which the source appears. -the actual guy to take is determined from the repo order. -""" - -import os -import fcntl - -import gettext -__trans = gettext.translation('pisi', fallback=True) -_ = __trans.ugettext - -import pisi.util as util -import pisi.context as ctx -import pisi.lockeddbshelve as shelve -import pisi.repodb -from pisi.itembyrepodb import ItemByRepoDB - -class NotfoundError(pisi.Error): - pass - -class SourceDB(object): - - def __init__(self): - self.d = ItemByRepoDB('source') - self.dpkgtosrc = ItemByRepoDB('pkgtosrc') - - def close(self): - self.d.close() - self.dpkgtosrc.close() - - def list(self): - return self.d.list() - - def has_spec(self, name, repo=None, txn=None): - return self.d.has_key(name, repo, txn) - - def get_spec(self, name, repo=None, txn = None): - try: - return self.d.get_item(name, repo, txn) - except pisi.itembyrepodb.NotfoundError, e: - raise NotfoundError(_("Source package %s not found") % name) - - def get_spec_repo(self, name, repo=None, txn = None): - try: - return self.d.get_item_repo(name, repo, txn) - except pisi.itembyrepodb.NotfoundError, e: - raise NotfoundError(_("Source package %s not found") % name) - - def pkgtosrc(self, name, txn = None): - return self.dpkgtosrc.get_item(name, txn=txn) - - def add_spec(self, spec, repo, txn = None): - assert not spec.errors() - name = str(spec.source.name) - def proc(txn): - self.d.add_item(name, spec, repo, txn) - for pkg in spec.packages: - self.dpkgtosrc.add_item(pkg.name, name, repo, txn) - ctx.componentdb.add_spec(spec.source.partOf, spec.source.name, repo, txn) - self.d.txn_proc(proc, txn) - - def remove_spec(self, name, repo, txn = None): - name = str(name) - def proc(txn): - assert self.has_spec(name, txn=txn) - spec = self.d.get_item(name, repo, txn) - self.d.remove_item(name, txn=txn) - for pkg in spec.packages: - self.dpkgtosrc.remove_item_repo(pkg.name, repo, txn) - ctx.componentdb.remove_spec(spec.source.partOf, spec.source.name, repo, txn) - - self.d.txn_proc(proc, txn) - - def remove_repo(self, repo, txn = None): - def proc(txn): - self.d.remove_repo(repo, txn=txn) - self.dpkgtosrc.remove_repo(repo, txn=txn) - self.d.txn_proc(proc, txn) - -sourcedb = None - -def init(): - global sourcedb - if sourcedb: - return sourcedb - - sourcedb = SourceDB() - return sourcedb - -def finalize(): - global sourcedb - if sourcedb: - sourcedb.close() - sourcedb = None diff --git a/tags/pisi-1.1_beta13/pisi/specfile.py b/tags/pisi-1.1_beta13/pisi/specfile.py deleted file mode 100644 index 6ff9acd8..00000000 --- a/tags/pisi-1.1_beta13/pisi/specfile.py +++ /dev/null @@ -1,284 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# -# Authors: Eray Ozkural -# Baris Metin - -""" - Specfile module is our handler for PSPEC files. PSPEC (PISI SPEC) - files are specification files for PISI source packages. This module - provides read and write routines for PSPEC files. -""" - -import gettext -__trans = gettext.translation('pisi', fallback=True) -_ = __trans.ugettext - -# standard python modules -from os.path import basename - -# pisi modules -from pisi.pxml.xmlfile import XmlFile -import pisi.pxml.autoxml as autoxml -import pisi.context as ctx -from pisi.dependency import Dependency -import pisi.dependency -import pisi.component as component -from pisi.util import Checks -import pisi.util as util - - -class Error(pisi.Error): - pass - -__metaclass__ = autoxml.autoxml - -class Packager: - - t_Name = [autoxml.Text, autoxml.mandatory] - t_Email = [autoxml.String, autoxml.mandatory] - - def __str__(self): - s = "%s <%s>" % (self.name, self.email) - return s - - -class AdditionalFile: - - s_Filename = [autoxml.String, autoxml.mandatory] - a_target = [autoxml.String, autoxml.mandatory] - a_permission = [autoxml.String, autoxml.optional] - - def __str__(self): - s = "%s -> %s " % (self.filename, self.target) - if self.permission: - s += '(%s)' % self.permission - return s - - -class Patch: - - s_Filename = [autoxml.String, autoxml.mandatory] - a_compressionType = [autoxml.String, autoxml.optional] - a_level = [autoxml.Integer, autoxml.optional] - a_target = [autoxml.String, autoxml.optional] - - #FIXME: what's the cleanest way to give a default value for reading level? - #def decode_hook(self, node, errs, where): - # if self.level == None: - # self.level = 0 - - def __str__(self): - s = self.filename - if self.compressionType: - s += ' (' + self.compressionType + ')' - if self.level: - s += ' level:' + self.level - if self.target: - s += ' target:' + self.target - return s - - -class Update: - - a_release = [autoxml.String, autoxml.mandatory] - t_Date = [autoxml.String, autoxml.mandatory] - t_Version = [autoxml.String, autoxml.mandatory] - t_Type = [autoxml.String, autoxml.optional] - t_Name = [autoxml.Text, autoxml.optional] - t_Email = [autoxml.String, autoxml.optional] - t_Comment = [autoxml.String, autoxml.optional] - - def __str__(self): - s = self.date - s += ", ver=" + self.version - s += ", rel=" + self.release - if self.type: - s += ", type=" + self.type - return s - - -class Path: - - s_Path = [autoxml.String, autoxml.mandatory] - a_fileType = [autoxml.String, autoxml.optional] - a_permanent = [autoxml.String, autoxml.optional] - - def __str__(self): - s = self.path - s += ", type=" + self.fileType - return s - - -class ComarProvide: - - s_om = [autoxml.String, autoxml.mandatory] - a_script = [autoxml.String, autoxml.mandatory] - - def __str__(self): - # FIXME: descriptive enough? - s = self.script - s += ' (' + self.om + ')' - return s - - -class Archive: - - s_uri = [ autoxml.String, autoxml.mandatory ] - a_type =[ autoxml.String, autoxml.mandatory ] - a_sha1sum =[ autoxml.String, autoxml.mandatory ] - - def decode_hook(self, node, errs, where): - self.name = basename(self.uri) - - def __str__(self): - s = _('URI: %s, type: %s, sha1sum: %s') % (self.uri, self.type, self.sha1sum) - return s - - -class Source: - - t_Name = [autoxml.String, autoxml.mandatory] - t_Homepage = [autoxml.String, autoxml.optional] - t_Packager = [Packager, autoxml.mandatory] - t_Summary = [autoxml.LocalText, autoxml.mandatory] - t_Description = [autoxml.LocalText, autoxml.mandatory] - t_IsA = [ [autoxml.String], autoxml.optional] - t_PartOf = [autoxml.String, autoxml.optional] - t_Icon = [ autoxml.String, autoxml.optional] - t_License = [ [autoxml.String], autoxml.mandatory] - t_Archive = [Archive, autoxml.mandatory ] - t_Patches = [ [Patch], autoxml.optional] - t_BuildDependencies = [ [Dependency], autoxml.optional] - t_Version = [ autoxml.String, autoxml.optional] - t_Release = [ autoxml.String, autoxml.optional] - t_SourceURI = [ autoxml.String, autoxml.optional ] # used in index - - -class Package: - - t_Name = [ autoxml.String, autoxml.mandatory ] - t_Summary = [ autoxml.LocalText, autoxml.optional ] - t_Description = [ autoxml.LocalText, autoxml.optional ] - t_IsA = [ [autoxml.String], autoxml.optional] - t_PartOf = [autoxml.String, autoxml.optional] - t_License = [ [autoxml.String], autoxml.optional] - t_Icon = [ autoxml.String, autoxml.optional] - t_PackageDependencies = [ [Dependency], autoxml.optional, "RuntimeDependencies/Dependency"] - t_ComponentDependencies = [ [autoxml.String], autoxml.optional, "RuntimeDependencies/Component"] - t_Files = [ [Path], autoxml.optional] - t_Conflicts = [ [autoxml.String], autoxml.optional, "Conflicts/Package"] - t_ProvidesComar = [ [ComarProvide], autoxml.optional, "Provides/COMAR"] - #t_RequiresComar = [ [autoxml.String], autoxml.mandatory, "Requires/COMAR"] - t_AdditionalFiles = [ [AdditionalFile], autoxml.optional] - t_History = [ [Update], autoxml.optional] - - # FIXME: needed in build process, to distinguish dynamically generated debug packages. - # find a better way to do this. - debug_package = False - - def runtimeDependencies(self): - deps = self.packageDependencies - deps += [ ctx.componentdb.get_component[x].packages for x in self.componentDependencies ] - return deps - - def pkg_dir(self): - packageDir = self.name + '-' \ - + self.version + '-' \ - + self.release - - return util.join_path( ctx.config.lib_dir(), 'package', packageDir) - - def installable(self): - """calculate if pkg is installable currently""" - deps = self.runtimeDependencies() - return pisi.dependency.satisfies_dependencies(self.name, deps) - - def __str__(self): - if self.build: - build = self.build - else: - build = '--' - s = _('Name: %s, version: %s, release: %s, build %s\n') % ( - self.name, self.version, self.release, build) - s += _('Summary: %s\n') % unicode(self.summary) - s += _('Description: %s\n') % unicode(self.description) - s += _('Component: %s\n') % unicode(self.partOf) - s += _('Provides: ') - for x in self.providesComar: - s += x.om + ' ' - s += '\n' - s += _('Dependencies: ') - for x in self.componentDependencies: - s += x.package + ' ' - for x in self.packageDependencies: - s += x.package + ' ' - return s + '\n' - - -class SpecFile(XmlFile): - __metaclass__ = autoxml.autoxml #needed when we specify a superclass - - tag = "PISI" - - t_Source = [ Source, autoxml.mandatory] - t_Packages = [ [Package], autoxml.mandatory, "Package"] - t_History = [ [Update], autoxml.mandatory] - t_Components = [ [component.Component], autoxml.optional, "Component"] - - def read_hook(self, errs): - """Read PSPEC file""" - self.merge_tags() - self.override_tags() - - def merge_tags(self): - """Merge tags from Source in Packages. Some tags in Packages merged - with the tags from Source. There is a more detailed - description in documents.""" - - # FIXME: copy only needed information - # no need to keep full history with comments in metadata.xml - self.source.history = self.history - - # To avoid tag duplication in PSPEC we need to get - # the last version and release information - # from the most recent History/Update. - if not self.source.version: - self.source.version = self.history[0].version - if not self.source.release: - self.source.release = self.history[0].release - - tmp = [] - for pkg in self.packages: - pkg.isA.extend(self.source.isA) - pkg.history = self.history - tmp.append(pkg) - self.packages = tmp - - def override_tags(self): - """Override tags from Source in Packages. Some tags in Packages - overrides the tags from Source. There is a more detailed - description in documents.""" - - tmp = [] - for pkg in self.packages: - if not pkg.summary: - pkg.summary = self.source.summary - if not pkg.description: - pkg.description = self.source.description - if not pkg.partOf: - pkg.partOf = self.source.partOf - if not pkg.license: - pkg.license = self.source.license - if not pkg.icon: - pkg.icon = self.source.icon - tmp.append(pkg) - self.packages = tmp diff --git a/tags/pisi-1.1_beta13/pisi/ui.py b/tags/pisi-1.1_beta13/pisi/ui.py deleted file mode 100644 index 30b3644f..00000000 --- a/tags/pisi-1.1_beta13/pisi/ui.py +++ /dev/null @@ -1,103 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# -# generic user interface -# -# Authors: Eray Ozkural -# A. Murat Eren - -import sys - -import pisi -import pisi.context as ctx - -(installed, upgraded, removed, installing, removing, - configuring, configured, extracting, downloading, packagestogo) = range(10) - -class UI(object): - "Abstract class for UI operations, derive from this." - - class Progress: - def __init__(self, totalsize, existsize = 0): - self.totalsize = totalsize - try: - self.percent = (existsize * 100) / totalsize - except: - self.percent = 0 - - def update(self, size): - if not self.totalsize: - return 100 - try: - self.percent = (size * 100) / self.totalsize - except: - self.percent = 0 - return self.percent - - def __init__(self, debuggy = False, verbose = False): - self.show_debug = debuggy - self.show_verbose = verbose - - def close(self): - "cleanup stuff here" - pass - - def set_verbose(self, flag): - self.show_verbose = flag - - def set_debug(self, flag): - self.show_debug = flag - - def info(self, msg, verbose = False, noln = False): - "give an informative message" - pass - - def ack(self, msg): - "inform the user of an important event and wait for acknowledgement" - pass - - def debug(self, msg): - "show debugging info" - if self.show_debug: - self.info('DEBUG: ' + msg) - - def warning(self,msg): - "warn the user" - pass - - def error(self,msg): - "inform a (possibly fatal) error" - pass - - #FIXME: merge this with info, this just means "important message" - def action(self,msg): - "uh?" - pass - - def choose(self, msg, list): - "ask the user to choose from a list of alternatives" - pass - - def confirm(self, msg): - "ask a yes/no question" - pass - - def display_progress(self, pd): - "display progress" - pass - - def status(self, msg = None): - "set status, if not given clear it" - pass - - def notify(self, event, **keywords): - "notify UI of a significant event" - pass diff --git a/tags/pisi-1.1_beta13/pisi/uri.py b/tags/pisi-1.1_beta13/pisi/uri.py deleted file mode 100644 index 86f8784a..00000000 --- a/tags/pisi-1.1_beta13/pisi/uri.py +++ /dev/null @@ -1,109 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# -# Simplifies working with URLs, purl module provides common URL -# parsing and processing - -from urlparse import urlparse -from os.path import basename - -import gettext -__trans = gettext.translation('pisi', fallback=True) -_ = __trans.ugettext - -import pisi.util as util - -class URI(object): - """URI class provides a URL parser and simplifies working with - URLs.""" - - def __init__(self, uri=None): - if uri: - self.set_uri(str(uri)) - else: - self.__scheme = None - self.__location = None - self.__path = None - self.__filename = None - self.__params = None - self.__query = None - self.__fragment = None - self.__uri = None - - self.__authinfo = None - - def get_uri(self): - if self.__uri: - return self.__uri - return None - - def set_uri(self, uri): - # (scheme, location, path, params, query, fragment) - uri = str(uri) - u = urlparse(uri, "file") - self.__scheme = u[0] - self.__location = u[1] - self.__path = u[2] - self.__filename = basename(self.__path) - self.__params = u[3] - self.__query = u[4] - self.__fragment = u[5] - - self.__uri = uri - - def is_local_file(self): - if self.scheme() == "file": - return True - else: - return False - - def is_remote_file(self): - return not self.is_local_file() - - def is_absolute_path(self): - return util.absolute_path(self.__path) - - def is_relative_path(self): - return not self.is_absolute_path() - - def set_auth_info(self, authTuple): - if not isinstance(authTuple, tuple): - raise Exception, _("setAuthInfo needs a tuple (user, pass)") - self.__authinfo = authTuple - - def auth_info(self): - return self.__authinfo - - def scheme(self): - return self.__scheme - - def location(self): - return self.__location - - def path(self): - return self.__path - - def filename(self): - return self.__filename - - def params(self): - return self.__params - - def query(self): - return self.__query - - def fragment(self): - return self.__fragment - - def __str__(self): - return self.get_uri() - - uri = property(get_uri, set_uri) diff --git a/tags/pisi-1.1_beta13/pisi/util.py b/tags/pisi-1.1_beta13/pisi/util.py deleted file mode 100644 index c7bbab96..00000000 --- a/tags/pisi-1.1_beta13/pisi/util.py +++ /dev/null @@ -1,673 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# - -# misc. utility functions, including process and file utils - -# Authors: Eray Ozkural -# Baris Metin -# S. Caglar Onur -# A. Murat Eren - -# standard python modules -import os -import re -import sys -import sha -import shutil -import string -import statvfs -import operator -import subprocess - -import gettext -__trans = gettext.translation('pisi', fallback=True) -_ = __trans.ugettext - -# pisi modules -import pisi -import pisi.context as ctx - -class Error(pisi.Error): - pass - -class FileError(Error): - pass - - -######################### -# spec validation utility # -######################### - -class Checks: - def __init__(self): - self.list = [] - - def add(self, err): - self.list.append(err) - - def join(self, list): - self.list.extend(list) - - def has_tag(self, var, section, name): - if not var: - self.list.append(_("%s section should have a '%s' tag") % (section, name)) - - def has_error(): - return len(self.list)>0 - - def print_errors(list): - for x in list: - ctx.ui.error(x) - print_errors = staticmethod(print_errors) - -######################### -# string/list/functional# -######################### - -def every(pred, seq): - return reduce(operator.and_, map(pred, seq), True) - -def any(pred, seq): - return reduce(operator.or_, map(pred, seq), False) - -def unzip(seq): - return zip(*seq) - -def concat(l): - '''concatenate a list of lists''' - return reduce( operator.concat, l ) - -def strlist(l): - """concatenate string reps of l's elements""" - return "".join(map(lambda x: str(x) + ' ', l)) - -def multisplit(str, chars): - """ split str with any of chars""" - l = [str] - for c in chars: - l = concat(map(lambda x:x.split(c), l)) - return l - -def same(l): - '''check if all elements of a sequence are equal''' - if len(l)==0: - return True - else: - last = l.pop() - for x in l: - if x!=last: - return False - return True - -def prefix(a, b): - '''check if sequence a is a prefix of sequence b''' - if len(a)>len(b): - return False - for i in range(0,len(a)): - if a[i]!=b[i]: - return False - return True - -def remove_prefix(a,b): - "remove prefix a from sequence b" - assert prefix(a,b) - return b[len(a):] - -def human_readable_size(size = 0): - symbols, depth = [' B', 'KB', 'MB', 'GB'], 0 - - while size > 1000 and depth < 3: - size = float(size / 1024) - depth += 1 - - return size, symbols[depth] - -def human_readable_rate(size = 0): - x = human_readable_size(size) - return x[0], x[1] + '/s' - -############################## -# Process Releated Functions # -############################## - -def run_batch(cmd): - """run command and report return value and output""" - ctx.ui.info(_('Running ') + cmd, verbose=True) - p = subprocess.Popen(cmd, shell=True, - stdout=subprocess.PIPE, stderr=subprocess.PIPE) - out, err = p.communicate() - ctx.ui.debug(_('return value for "%s" is %s') % (cmd, p.returncode)) - return (p.returncode, out, err) - -# you can't use the following for Popen, oops -class TeeOutFile: - def __init__(self, file): - self.file = file - - def write(self, str): - self.write(str) - ctx.ui.debug(str) - -# TODO: it might be worthwhile to try to remove the -# use of ctx.stdout, and use run_batch()'s return -# values instead. but this is good enough :) -def run_logged(cmd): - """run command and get return value""" - ctx.ui.info(_('Running ') + cmd, verbose=True) - if ctx.stdout: - stdout = ctx.stdout - else: - if ctx.get_option('debug'): - stdout = None - else: - stdout = subprocess.PIPE - if ctx.stderr: - stderr = ctx.stderr - else: - if ctx.get_option('debug'): - stderr = None - else: - stderr = subprocess.STDOUT - - p = subprocess.Popen(cmd, shell=True, stdout=stdout, stderr=stderr) - out, err = p.communicate() - ctx.ui.debug(_('return value for "%s" is %s') % (cmd, p.returncode)) - - return p.returncode - - -###################### -# Terminal functions # -###################### - -def has_xterm(): - return os.environ.has_key("TERM") and sys.stderr.isatty() - -def xterm_title(message): - """sets message as a console window's title""" - if os.environ.has_key("TERM") and sys.stderr.isatty(): - terminalType = os.environ["TERM"] - for term in ["xterm", "Eterm", "aterm", "rxvt", "screen", "kterm", "rxvt-unicode"]: - if terminalType.startswith(term): - sys.stderr.write("\x1b]2;"+str(message)+"\x07") - sys.stderr.flush() - break - -def xterm_title_reset(): - """resets console window's title""" - if os.environ.has_key("TERM"): - terminalType = os.environ["TERM"] - xterm_title(os.environ["TERM"]) - - -############################# -# Path Processing Functions # -############################# - -def splitpath(a): - """split path into components and return as a list - os.path.split doesn't do what I want like removing trailing /""" - comps = a.split(os.path.sep) - if comps[len(comps)-1]=='': - comps.pop() - return comps - -def makepath(comps, relative = False, sep = os.path.sep): - """reconstruct a path from components""" - path = reduce(lambda x,y: x + sep + y, comps, '') - if relative: - return path[len(sep):] - else: - return path - -def parentpath(a, sep = os.path.sep): - # remove trailing '/' - a = a.rstrip(sep) - return a[:a.rfind(sep)] - -def parenturi(a): - return parentpath(a, '/') - -# I'm not sure how necessary this is. Ahem. -def commonprefix(l): - """an improved version of os.path.commonprefix, - returns a list of path components""" - common = [] - comps = map(splitpath, l) - for i in range(0, min(len,l)): - compi = map(lambda x: x[i], comps) # get ith slice - if same(compi): - common.append(compi[0]) - return common - -# but this one is necessary -def subpath(a, b): - "find if path a is before b in the directory tree" - return prefix(splitpath(a), splitpath(b)) - -def removepathprefix(prefix, path): - "remove path prefix a from b, finding the pathname rooted at a" - comps = remove_prefix(splitpath(prefix), splitpath(path)) - if len(comps) > 0: - return join_path(*tuple(comps)) - else: - return "" - -def absolute_path(path): - "determine if given @path is absolute" - comps = splitpath(path) - return comps[0] == '' - -def join_path(a, *p): - """Join two or more pathname components, inserting '/' as needed""" - """The python original version has a silly logic""" - path = a - for b in p: - b = b.lstrip('/') - if path == '' or path.endswith('/'): - path += b - else: - path += '/' + b - return path - -#################################### -# File/Directory Related Functions # -#################################### - -def check_file(file, mode = os.F_OK): - "shorthand to check if a file exists" - if not os.access(file, mode): - raise FileError("File " + file + " not found") - return True - -def check_dir(dir): - """check if directory exists, and create if it doesn't. - works recursively""" - dir = dir.strip().rstrip("/") - if not os.access(dir, os.F_OK): - os.makedirs(dir) - -def clean_dir(path): - "Remove all content of a directory (top)" - # don't reimplement the wheel - if os.path.exists(path): - shutil.rmtree(path) - -def creation_time(file): - """returns the creation time of the given file""" - if check_file(file): - import time - st = os.stat(file) - return time.localtime(st.st_ctime) - -def dir_size(dir): - """ calculate the size of files under a dir - based on the os module example""" - # It's really hard to give an approximate value for package's - # installed size. Gettin a sum of all files' sizes if far from - # being true. Using 'du' command (like Debian does) can be a - # better solution :(. - # Not really, du calculates size on disk, this is much better -- exa - from os.path import getsize, islink, isdir, exists - join = join_path - - if exists(dir) and (not isdir(dir) and not islink(dir)): - #so, this is not a directory but file.. - return getsize(dir) - - if islink(dir): - return long(len(os.readlink(dir))) - - def sizes(): - for root, dirs, files in os.walk(dir): - yield sum([getsize(join(root, name)) for name in files if not islink(join(root,name))]) - yield sum([long(len(os.readlink((join(root, name))))) for name in files if islink(join(root,name))]) - return sum( sizes() ) - -def copy_file(src,dest): - """copy source file to destination file""" - check_file(src) - check_dir(os.path.dirname(dest)) - shutil.copyfile(src, dest) - -def is_ar_file(file_path): - return open(file_path).readline().strip() == '!' - -def clean_ar_timestamps(ar_file): - """clean the timestamps of the ar files""" - if not is_ar_file(ar_file): - return - content = open(ar_file).readlines() - fp = open(ar_file, 'w') - for line in content: - pos = line.rfind(chr(32) + chr(96)) - if pos > -1 and line[pos - 57:pos + 2].find(chr(47)) > -1: - line = line[:pos - 41] + '0000000000' + line[pos - 31:] - fp.write(line) - fp.close() - -# FIXME: this should be done in a much much simpler way -# as it stands, it seems to be a kludge to solve -# an unrelated problem -def get_file_hashes(top, excludePrefix=None, removePrefix=None): - """Generator function iterates over a toplevel path and returns the - (filePath, sha1Hash) tuples for all files. If excludePrefixes list - is given as a parameter, function will exclude the filePaths - matching those prefixes. The removePrefix string parameter will be - used to remove prefix from filePath while matching excludes, if - given.""" - - def sha1_sum(f, data=False): - if not data and f.endswith('.a'): - #workaround for .a issue.. - #don't skip .a files, - #but pad their timestamps with '0'.. - clean_ar_timestamps(f) - - func = None - - if data: - func = sha1_data - else: - func = sha1_file - - try: - return func(f) - except FileError, e: - if os.path.islink(f): - ctx.ui.info(_("Including external link '%s'") % f) - elif os.path.isdir(f): - ctx.ui.info(_("Including directory '%s'") % f) - else: - raise e - return None - - def has_excluded_prefix(filename): - if excludePrefix and removePrefix: - tempfnam = remove_prefix(removePrefix, filename) - for p in excludePrefix: - if tempfnam.startswith(p): - return 1 - return 0 - - # handle single file - if os.path.isfile(top): - yield (top, sha1_sum(top)) - return - - # handle single symlink declaration here. - if os.path.islink(top): - yield (top, sha1_sum(os.readlink(top), True)) - return - - for root, dirs, files in os.walk(top, topdown=False): - #bug 339 - if os.path.islink(root) and not has_excluded_prefix(root): - #yield the symlink.. - #bug 373 - yield (root, sha1_sum(os.readlink(root), True)) - excludePrefix.append(remove_prefix(removePrefix, root) + "/") - continue - - #bug 397 - for dir in dirs: - d = join_path(root, dir) - if os.path.islink(d) and not has_excluded_prefix(d): - yield (d, sha1_sum(os.readlink(d), True)) - excludePrefix.append(remove_prefix(removePrefix, d) + "/") - - #bug 340 - if os.path.isdir(root) and not has_excluded_prefix(root): - parent, r, d, f = root, '', '', '' - for r, d, f in os.walk(parent, topdown=False): pass - if not f and not d: - yield (parent, sha1_sum(parent)) - - for fname in files: - f = join_path(root, fname) - if has_excluded_prefix(f): - continue - #bug 373 - elif os.path.islink(f): - yield (f, sha1_sum(os.readlink(f), True)) - else: - yield (f, sha1_sum(f)) - -def copy_dir(src, dest): - """copy source dir to destination dir recursively""" - shutil.copytree(src, dest) - -def check_file_hash(filename, hash): - """Check the files integrity with a given hash""" - return sha1_file(filename) == hash - -def sha1_file(filename): - """calculate sha1 hash of filename""" - # Broken links can cause problem! - try: - m = sha.new() - f = file(filename, 'rb') - for line in f: - m.update(line) - return m.hexdigest() - except IOError: - raise FileError(_("I/O Error: Cannot calculate SHA1 hash of %s") % filename) - -def sha1_data(data): - """calculate sha1 hash of given data""" - try: - m = sha.new() - m.update(data) - return m.hexdigest() - except: - raise Error(_("Cannot calculate SHA1 hash of given data")) - -def uncompress(patchFile, compressType="gz", targetDir=None): - """uncompresses a file and returns the path of the uncompressed - file""" - if targetDir: - filePath = join_path(targetDir, - os.path.basename(patchFile)) - else: - filePath = os.path.basename(patchFile) - - if compressType == "gz": - from gzip import GzipFile - obj = GzipFile(patchFile) - elif compressType == "bz2": - from bz2 import BZ2File - obj = BZ2File(patchFile) - - open(filePath, "w").write(obj.read()) - return filePath - - -def do_patch(sourceDir, patchFile, level = 0, target = ''): - """simple function to apply patches..""" - cwd = os.getcwd() - os.chdir(sourceDir) - - if level == None: - level = 0 - if target == None: - target = '' - - check_file(patchFile) - (ret, out, err) = run_batch("patch -p%d %s < %s" % - (level, target, patchFile)) - if ret: - if out is None and err is None: - # Which means stderr and stdout directed so they are None - raise Error(_("ERROR: patch (%s) failed") % (patchFile)) - else: - raise Error(_("ERROR: patch (%s) failed: %s") % (patchFile, out)) - - os.chdir(cwd) - - -def strip_directory(top, excludelist=[]): - for root, dirs, files in os.walk(top): - for fn in files: - frpath = join_path(root, fn) - drpath = join_path(os.path.dirname(top), - ctx.const.debug_dir_suffix, - remove_prefix(top, frpath)) - - # Some upstream sources have buggy libtool and ltmain.sh with them, - # which causes wrong path entries in *.la files. And these wrong path - # entries sometimes triggers compile-time errors or linkage problems. - # Instead of patching all these buggy sources and maintain these patches, - # PISI removes wrong paths... - extension = os.path.splitext(frpath)[1] - if extension == ".la": - # FIXME: I'm regular expr. idiot, so one can convert this to python... - os.system("sed -i -e 's~-L/var/tmp/pisi/[[:graph:]]*~~g' %s" % frpath) - os.system("sed -i -e 's~/var/tmp/pisi/[[:graph:]]*/install/~/~g' %s" % frpath) - - # real path in .pisi package - p = '/' + removepathprefix(top, frpath) - strip = True - for exclude in excludelist: - if p.startswith(exclude): - strip = False - ctx.ui.debug("%s [%s]" %(p, "NoStrip")) - - if strip: - if strip_file(frpath, drpath): - ctx.ui.debug("%s [%s]" %(p, "stripped")) - - -def strip_file(filepath, outpath): - """strip a file""" - p = os.popen("file \"%s\"" % filepath) - o = p.read() - - def run_strip(f, flags=""): - p = os.popen("strip %s %s" %(flags, f)) - ret = p.close() - if ret: - ctx.ui.warning(_("strip command failed for file '%s'!") % f) - - def save_elf_debug(f, o): - """copy debug info into file.debug file""" - p = os.popen("objcopy --only-keep-debug %s %s%s" % (f, o, ctx.const.debug_file_suffix)) - ret = p.close() - if ret: - ctx.ui.warning(_("objcopy (keep-debug) command failed for file '%s'!") % f) - - """mark binary/shared objects to use file.debug""" - p = os.popen("objcopy --add-gnu-debuglink=%s%s %s" % (o, ctx.const.debug_file_suffix, f)) - ret = p.close() - if ret: - ctx.ui.warning(_("objcopy (add-debuglink) command failed for file '%s'!") % f) - - if "current ar archive" in o: - run_strip(filepath, "-g") - return True - - elif "SB executable" in o: - if ctx.config.values.build.generatedebug: - check_dir(os.path.dirname(outpath)) - save_elf_debug(filepath, outpath) - run_strip(filepath) - return True - - elif "SB shared object" in o: - if ctx.config.values.build.generatedebug: - check_dir(os.path.dirname(outpath)) - save_elf_debug(filepath, outpath) - run_strip(filepath, "--strip-unneeded") - # FIXME: warn for TEXTREL - return True - - return False - -def partition_freespace(directory): - """ returns free space of given directory's partition """ - st = os.statvfs(directory) - return st[statvfs.F_BSIZE] * st[statvfs.F_BFREE] - -def clean_locks(top = '.'): - for root, dirs, files in os.walk(top): - for fn in files: - if fn.endswith('.lock'): - path = join_path(root, fn) - ctx.ui.info(_('Removing lock %s'), path) - os.unlink(path) - -######################################## -# Package/Repository Related Functions # -######################################## - -def package_name(name, version, release, build, prependSuffix=True): - fn = name + '-' + version + '-' + release - if build: - fn += '-' + str(build) - if prependSuffix: - fn += ctx.const.package_suffix - return fn - -def is_package_name(fn, package_name = None): - "check if fn is a valid filename for given package_name" - "if not given a package name, see if fn fits the package name rules" - if (package_name==None) or fn.startswith(package_name + '-'): - if fn.endswith(ctx.const.package_suffix): - # get version string, skip separator '-' - verstr = fn[len(package_name) + 1: - len(fn)-len(ctx.const.package_suffix)] - import string - for x in verstr.split('-'): - # weak rule: version components after '-' start with a digit - if x is '' or (not x[0] in string.digits): - return False - return True - return False - -def env_update(): - import pisi.environment - ctx.ui.info(_('Updating environment...')) - - env_dir = join_path(ctx.config.dest_dir(), "/etc/env.d") - if not os.path.exists(env_dir): - os.makedirs(env_dir, 0755) - - pisi.environment.update_environment(ctx.config.dest_dir()) - -def pure_package_name(package_name): - "return pure package name from given string" - "ex: package_name=tasma-1.0.3-5-2.pisi, returns tasma" - - if package_name.endswith(ctx.const.package_suffix): - package_name = package_name.rstrip(ctx.const.package_suffix) - - return parse_package_name(package_name)[0] - -def parse_package_name(package_name): - "return package name and version string" - "ex: package_name=tasma-1.0.3-5-2, returns (tasma, 1.0.3-5-2)" - - # but we should handle package names like 855resolution - name = [] - for part in package_name.split("-"): - if name != [] and part[0] in string.digits: - break - else: - name.append(part) - name = "-".join(name) - version = package_name[len(name) + 1:] - - return (name, version) - -def generate_pisi_file(patchFile, fromFile, toFile): - if run_batch("xdelta patch %s %s %s" % (patchFile, fromFile, toFile))[0]: - raise Error(_("ERROR: xdelta patch %s %s %s failed") % (patchFile, fromFile, toFile)) - diff --git a/tags/pisi-1.1_beta13/pisi/version.py b/tags/pisi-1.1_beta13/pisi/version.py deleted file mode 100644 index d151a381..00000000 --- a/tags/pisi-1.1_beta13/pisi/version.py +++ /dev/null @@ -1,199 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# -# Authors: Eray Ozkural -# Baris Metin -# -# History: -# Eray wrote the first version -# Baris added support for the fancy keywords and -# alphanumeric version string components - - -"""version structure""" - - -import re -import string - -import pisi.util as util - - -# Basic rule is: -# p > (no suffix) > m > rc > pre > beta > alpha -# m: milestone. this was added for OO.o -# p: patch-level -keywords = {"alpha": 0, - "beta" : 1, - "pre" : 2, - "rc" : 3, - "m" : 4, - "NOKEY" : 5, - "p" : 6} - -# helper functions -def has_keyword(versionitem): - if versionitem._keyword != "NOKEY": - return True - - return False - - -class VersionItem: - _keyword = "NOKEY" - _value = 0 - - def __init__(self, itemstring): - - # special-case: 1.5p - # here "p" comes as a separate itemstring and conflicts with - # keyword "p". But keyword should allways contain an integer prefix. - # So, skipping looking for keywords if the length() is 1 makes the - # trick. - if len(itemstring) > 1: - - for keyword in keywords.keys(): - if itemstring.startswith(keyword): - - if self._keyword == "NOKEY": - self._keyword = keyword - else: - # longer match is correct - if len(keyword) > len(self._keyword): - self._keyword = keyword - - if self._keyword == "NOKEY": - if len(itemstring) == 1 and itemstring in string.ascii_letters: - # single letter version item ('a' to 'Z') - self._value = itemstring - else: - self._value = int(itemstring) - else: - # rest is the version item's value. And each must have - # one! - self._value = int(itemstring[len(self._keyword):]) - - def __str__(self): - return str(self._value) - - def __lt__(self,rhs): - l = keywords[self._keyword] - r = keywords[rhs._keyword] - if l < r: - return True - elif l == r: - return self._value < rhs._value - else: # l > r - return False - - def __le__(self,rhs): - l = keywords[self._keyword] - r = keywords[rhs._keyword] - if l < r: - return True - elif l == r: - return self._value <= rhs._value - else: # l > r - return False - - def __gt__(self,rhs): - l = keywords[self._keyword] - r = keywords[rhs._keyword] - if l > r: - return True - elif l == r: - return self._value > rhs._value - else: # l < r - return False - - def __ge__(self,rhs): - l = keywords[self._keyword] - r = keywords[rhs._keyword] - if l > r: - return True - elif l == r: - return self._value >= rhs._value - else: # l < r - return False - - def __eq__(self,rhs): - l = keywords[self._keyword] - r = keywords[rhs._keyword] - if l == r and self._value == rhs._value: - return True - return False - - - -class Version: - - def __init__(self, verstring): - self.comps = [] - for i in util.multisplit(verstring,'.-_'): - # some version strings can contain ascii chars at the - # back. As an example: 2.11a - # We split '11a' as two items like '11' and 'a' - s = re.compile("[a-z-A-Z]$").search(i) - if s: - head = i[:s.start()] - tail = s.group() - self.comps.append(VersionItem(head)) - self.comps.append(VersionItem(tail)) - else: - self.comps.append(VersionItem(i)) - - self.verstring = verstring - - def string(self): - return self.verstring - - def compare(self, rhs): - """this comparison routine is essentially a comparison routine - for two rationals in (0,1) interval. we compare two sequences - of digits one by one. We start with the leftmost digit - in the expansion. If they are equal, we proceed to the next. If - not we use the comparison operator. And we iterate to the left. - The result is, 0 if two are equal, -1 if self < rhs, and +1 - if self>rhs""" - lhs = self.comps - rhs = rhs.comps - # pad the short version string with zeros - if len(lhs) < len(rhs): - lhs.extend( [VersionItem('0')] * (len(rhs) - len(lhs)) ) - elif len(lhs) > len(rhs): - rhs.extend( [VersionItem('0')] * (len(lhs) - len(rhs)) ) - # now let's iterate from left to right - for (litem, ritem) in zip(lhs, rhs): - if litem < ritem: - return -1 - elif litem > ritem: - return +1 - return 0 - - # premature optimization is the root of all evil - - def __lt__(self,rhs): - return self.compare(rhs) < 0 - - def __le__(self,rhs): - return self.compare(rhs) <= 0 - - def __gt__(self,rhs): - return self.compare(rhs) > 0 - - def __ge__(self,rhs): - return self.compare(rhs) >= 0 - - def __eq__(self,rhs): - return self.compare(rhs) == 0 - - def __str__(self): - return self.verstring diff --git a/tags/pisi-1.1_beta13/po/pisi.pot b/tags/pisi-1.1_beta13/po/pisi.pot deleted file mode 100644 index ec26779c..00000000 --- a/tags/pisi-1.1_beta13/po/pisi.pot +++ /dev/null @@ -1,2167 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR ORGANIZATION -# FIRST AUTHOR , YEAR. -# -msgid "" -msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2006-07-06 12:16+EEST\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=CHARSET\n" -"Content-Transfer-Encoding: ENCODING\n" -"Generated-By: pygettext.py 1.5\n" - - -#: pisi-cli:37 -msgid "Keyboard Interrupt: Exiting..." -msgstr "" - -#: pisi-cli:40 -msgid "Program Terminated." -msgstr "" - -#: pisi-cli:43 -msgid "" -"A database operation has been aborted. You should run pisi\n" -"again for normal DB recovery procedure. Make sure you have free disk space. \n" -"You have to run rebuild-db only when there is file corruption and database upgrades." -msgstr "" - -#: pisi-cli:48 -msgid "" -"Unhandled internal exception.\n" -"Please file a bug report. (http://bugs.uludag.org.tr)" -msgstr "" - -#: pisi-cli:54 -msgid "System Error. Program Terminated." -msgstr "" - -#: pisi-cli:61 -msgid "Please use 'pisi help' for general help." -msgstr "" - -#: pisi-cli:64 -msgid "Traceback:" -msgstr "" - -#: pisi-cli:68 -msgid "Use --debug to see a traceback." -msgstr "" - -#: pisi-cli:81 -msgid "PISI has been upgraded." -msgstr "" - -#: pisi/actionsapi/autotools.py:37 -msgid "" -"Please attach the config.log to your bug report:\n" -"%s/config.log" -msgstr "" - -#: pisi/actionsapi/autotools.py:76 pisi/actionsapi/autotools.py:86 -#: pisi/actionsapi/kde.py:66 pisi/actionsapi/perlmodules.py:54 -#: pisi/actionsapi/perlmodules.py:57 -msgid "Configure failed." -msgstr "" - -#: pisi/actionsapi/autotools.py:78 pisi/actionsapi/autotools.py:88 -#: pisi/actionsapi/kde.py:68 -msgid "No configure script found." -msgstr "" - -#: pisi/actionsapi/autotools.py:97 pisi/actionsapi/kde.py:73 -#: pisi/actionsapi/perlmodules.py:63 pisi/actionsapi/perlmodules.py:72 -#: pisi/actionsapi/pythonmodules.py:50 pisi/actionsapi/scons.py:40 -msgid "Make failed." -msgstr "" - -#: pisi/actionsapi/autotools.py:125 pisi/actionsapi/autotools.py:135 -#: pisi/actionsapi/kde.py:80 pisi/actionsapi/pythonmodules.py:55 -#: pisi/actionsapi/scons.py:44 -msgid "Install failed." -msgstr "" - -#: pisi/actionsapi/autotools.py:127 pisi/actionsapi/autotools.py:137 -#: pisi/actionsapi/kde.py:82 -msgid "No Makefile found." -msgstr "" - -#: pisi/actionsapi/autotools.py:144 -msgid "Running aclocal failed." -msgstr "" - -#: pisi/actionsapi/autotools.py:149 pisi/actionsapi/autotools.py:154 -msgid "Running autoconf failed." -msgstr "" - -#: pisi/actionsapi/autotools.py:159 -msgid "Running automake failed." -msgstr "" - -#: pisi/actionsapi/autotools.py:164 -msgid "Running autoheader failed." -msgstr "" - -#: pisi/actionsapi/get.py:164 -msgid "Util %s cannot be found" -msgstr "" - -#: pisi/actionsapi/get.py:166 -msgid "Warning: %s does not exist, using plain name %s" -msgstr "" - -#: pisi/actionsapi/kde.py:35 -msgid "" -"\n" -"!!! Please attach the config.log to your bug report:\n" -"%s/config.log" -msgstr "" - -#: pisi/actionsapi/libtools.py:39 -msgid "Running ldconfig failed." -msgstr "" - -#: pisi/actionsapi/libtools.py:50 -msgid "GNU Config Update Finished." -msgstr "" - -#: pisi/actionsapi/libtools.py:54 -msgid "Running libtoolize failed." -msgstr "" - -#: pisi/actionsapi/perlmodules.py:66 -msgid "perl build failed." -msgstr "" - -#: pisi/actionsapi/perlmodules.py:75 -msgid "perl install failed." -msgstr "" - -#: pisi/actionsapi/pisitools.py:127 -msgid "ActionsAPI [doman]: Wrong man page file: %s" -msgstr "" - -#: pisi/actionsapi/pisitools.py:165 -msgid "ActionsAPI [rename]: No such file or directory: %s" -msgstr "" - -#: pisi/actionsapi/pisitools.py:182 -msgid "File does not exist or permission denied: %s" -msgstr "" - -#: pisi/actionsapi/pisitools.py:199 -msgid "ActionsAPI [dosym]: File exists: %s" -msgstr "" - -#: pisi/actionsapi/pisitoolsfunctions.py:46 -#: pisi/actionsapi/pisitoolsfunctions.py:60 -#: pisi/actionsapi/pisitoolsfunctions.py:73 -msgid "Insufficient arguments." -msgstr "" - -#: pisi/actionsapi/pythonmodules.py:67 -msgid "Running %s failed." -msgstr "" - -#: pisi/actionsapi/shelltools.py:50 -msgid "Cannot create directory %s" -msgstr "" - -#: pisi/actionsapi/shelltools.py:58 -msgid "ActionsAPI [echo]: Can't append to file %s." -msgstr "" - -#: pisi/actionsapi/shelltools.py:67 -msgid "ActionsAPI [chmod]: Operation not permitted: %s (mode: %s)" -msgstr "" - -#: pisi/actionsapi/shelltools.py:70 -msgid "ActionsAPI [chmod]: File %s doesn't exists." -msgstr "" - -#: pisi/actionsapi/shelltools.py:78 -msgid "ActionsAPI [chown]: Operation not permitted: %s (uid: %s, gid: %s)" -msgstr "" - -#: pisi/actionsapi/shelltools.py:81 -msgid "ActionsAPI [chown]: File %s doesn't exists." -msgstr "" - -#: pisi/actionsapi/shelltools.py:88 -msgid "ActionsAPI [sym]: Permission denied: %s to %s" -msgstr "" - -#: pisi/actionsapi/shelltools.py:96 -msgid "ActionsAPI [unlink]: Permission denied: %s." -msgstr "" - -#: pisi/actionsapi/shelltools.py:100 -msgid "ActionsAPI [unlink]: File %s doesn't exists." -msgstr "" - -#: pisi/actionsapi/shelltools.py:108 -msgid "ActionsAPI [unlinkDir]: Operation not permitted: %s" -msgstr "" - -#: pisi/actionsapi/shelltools.py:112 -msgid "ActionsAPI [unlinkDir]: Directory %s doesn't exists." -msgstr "" - -#: pisi/actionsapi/shelltools.py:121 -msgid "ActionsAPI [move]: Permission denied: %s to %s" -msgstr "" - -#: pisi/actionsapi/shelltools.py:123 -msgid "ActionsAPI [move]: File %s doesn't exists." -msgstr "" - -#: pisi/actionsapi/shelltools.py:133 -msgid "ActionsAPI [copy]: Permission denied: %s to %s" -msgstr "" - -#: pisi/actionsapi/shelltools.py:149 -msgid "ActionsAPI [copy]: File %s does not exist." -msgstr "" - -#: pisi/actionsapi/shelltools.py:164 -msgid "ActionsAPI [copytree] %s to %s: %s" -msgstr "" - -#: pisi/actionsapi/shelltools.py:166 -msgid "ActionsAPI [copytree]: Directory %s doesn't exists." -msgstr "" - -#: pisi/actionsapi/shelltools.py:178 -msgid "ActionsAPI [touch]: Permission denied: %s" -msgstr "" - -#: pisi/api.py:243 -msgid "COMAR: comard not fully installed" -msgstr "" - -#: pisi/api.py:255 -msgid "File %s not found" -msgstr "" - -#: pisi/api.py:320 -msgid "Checking %s " -msgstr "" - -#: pisi/api.py:337 -msgid "* Building index of PISI files under %s" -msgstr "" - -#: pisi/api.py:344 -msgid "* Index file written" -msgstr "" - -#: pisi/api.py:348 -msgid "Repo %s already present." -msgstr "" - -#: pisi/api.py:352 -msgid "Repo %s added to system." -msgstr "" - -#: pisi/api.py:358 -msgid "Repo %s removed from system." -msgstr "" - -#: pisi/api.py:360 -msgid "Repository %s does not exist. Cannot remove." -msgstr "" - -#: pisi/api.py:367 -msgid "* Updating repository: %s" -msgstr "" - -#: pisi/api.py:374 -msgid "No updates available for repository %s." -msgstr "" - -#: pisi/api.py:376 -msgid "Updating database at any rate as requested" -msgstr "" - -#: pisi/api.py:387 -msgid "* Package database updated." -msgstr "" - -#: pisi/api.py:389 pisi/api.py:415 -msgid "No repository named %s found." -msgstr "" - -#: pisi/api.py:397 -msgid "* Rebuilding '%s' named repo... " -msgstr "" - -#: pisi/api.py:410 -msgid "Input/Output error while reading %s: %s" -msgstr "" - -#: pisi/api.py:413 pisi/atomicoperations.py:548 -msgid "OK." -msgstr "" - -#: pisi/archive.py:36 -msgid "" -"An error has occured while running LZMA:\n" -"%s" -msgstr "" - -#: pisi/archive.py:100 pisi/archive.py:142 -msgid "Archive type not recognized" -msgstr "" - -#: pisi/atomicoperations.py:67 -msgid "Package %s found in repository %s" -msgstr "" - -#: pisi/atomicoperations.py:79 -msgid "Package URI: %s" -msgstr "" - -#: pisi/atomicoperations.py:83 -msgid "Package %s not found in any active repository." -msgstr "" - -#: pisi/atomicoperations.py:100 -msgid "Installing %s, version %s, release %s, build %s" -msgstr "" - -#: pisi/atomicoperations.py:142 -msgid "Package conflicts %s" -msgstr "" - -#: pisi/atomicoperations.py:147 -msgid "Dependencies for %s not satisfied" -msgstr "" - -#: pisi/atomicoperations.py:149 -msgid "Package not installable" -msgstr "" - -#: pisi/atomicoperations.py:167 -msgid "%s from %s package" -msgstr "" - -#: pisi/atomicoperations.py:168 -msgid "" -"File conflicts:\n" -"%s" -msgstr "" - -#: pisi/atomicoperations.py:203 -msgid "Re-install same version package?" -msgstr "" - -#: pisi/atomicoperations.py:204 -msgid "Package re-install declined" -msgstr "" - -#: pisi/atomicoperations.py:210 -msgid "Upgrading to new upstream version" -msgstr "" - -#: pisi/atomicoperations.py:213 -msgid "Upgrading to new distribution release" -msgstr "" - -#: pisi/atomicoperations.py:217 -msgid "Upgrading to new distribution build" -msgstr "" - -#: pisi/atomicoperations.py:227 -msgid "Downgrade to old distribution release?" -msgstr "" - -#: pisi/atomicoperations.py:229 -msgid "Downgrade to old distribution build?" -msgstr "" - -#: pisi/atomicoperations.py:231 -msgid "Package downgrade declined" -msgstr "" - -#: pisi/atomicoperations.py:323 -msgid "Storing %s, " -msgstr "" - -#: pisi/atomicoperations.py:326 -msgid "Storing %s." -msgstr "" - -#: pisi/atomicoperations.py:333 -msgid "Storing %s" -msgstr "" - -#: pisi/atomicoperations.py:389 -msgid "File list could not be read for package %s, continuing removal." -msgstr "" - -#: pisi/atomicoperations.py:395 -msgid "Removing package %s" -msgstr "" - -#: pisi/atomicoperations.py:398 -msgid "Trying to remove nonexistent package " -msgstr "" - -#: pisi/atomicoperations.py:437 -msgid "Not removing conflicted file : %s" -msgstr "" - -#: pisi/atomicoperations.py:457 -msgid "Not removing non-file, non-link %s" -msgstr "" - -#: pisi/atomicoperations.py:518 -msgid "Metadata XML '%s' cannot be found" -msgstr "" - -#: pisi/atomicoperations.py:526 -msgid "MetaData format wrong (%s)" -msgstr "" - -#: pisi/atomicoperations.py:528 -msgid "* Adding '%s' to db... " -msgstr "" - -#: pisi/atomicoperations.py:534 -msgid "Files XML '%s' cannot be found" -msgstr "" - -#: pisi/atomicoperations.py:539 pisi/package.py:157 -msgid "Invalid %s" -msgstr "" - -#: pisi/build.py:89 -msgid "Path %s belongs in multiple packages" -msgstr "" - -#: pisi/build.py:115 -msgid "Source URI: %s" -msgstr "" - -#: pisi/build.py:119 -msgid "Source %s not found in any active repository." -msgstr "" - -#: pisi/build.py:185 -msgid "Building PISI source package: %s" -msgstr "" - -#: pisi/build.py:230 -msgid "IceCream detected. Make sure your daemon is up and running..." -msgstr "" - -#: pisi/build.py:235 -msgid "CCache detected..." -msgstr "" - -#: pisi/build.py:288 -msgid "PartOf tag not defined, looking for component" -msgstr "" - -#: pisi/build.py:298 -msgid "Cannot find component.xml in upper directory" -msgstr "" - -#: pisi/build.py:302 -msgid "Source is part of %s component" -msgstr "" - -#: pisi/build.py:307 -msgid "Fetching source from: %s" -msgstr "" - -#: pisi/build.py:309 -msgid "Source archive is stored: %s/%s" -msgstr "" - -#: pisi/build.py:313 -msgid "Unpacking archive..." -msgstr "" - -#: pisi/build.py:315 -msgid " unpacked (%s)" -msgstr "" - -#: pisi/build.py:320 -msgid "Setting up source..." -msgstr "" - -#: pisi/build.py:325 -msgid "Building source..." -msgstr "" - -#: pisi/build.py:330 -msgid "Installing..." -msgstr "" - -#: pisi/build.py:373 -msgid "Unable to read Action Script (%s): %s" -msgstr "" - -#: pisi/build.py:375 -msgid "SyntaxError in Action Script (%s): %s" -msgstr "" - -#: pisi/build.py:405 -msgid "unable to call function from actions: %s" -msgstr "" - -#: pisi/build.py:421 -msgid "Safety switch: following extra packages in system.devel will be installed: " -msgstr "" - -#: pisi/build.py:426 -msgid "Safety switch: system.devel is already installed" -msgstr "" - -#: pisi/build.py:428 -msgid "Safety switch: the component system.devel cannot be found" -msgstr "" - -#: pisi/build.py:437 -msgid "Unsatisfied Build Dependencies:" -msgstr "" - -#: pisi/build.py:441 -msgid "Cannot build package due to unsatisfied build dependencies" -msgstr "" - -#: pisi/build.py:449 -msgid "Build dependency %s cannot be satisfied" -msgstr "" - -#: pisi/build.py:451 -msgid "Do you want to install the unsatisfied build dependencies" -msgstr "" - -#: pisi/build.py:452 -msgid "Installing build dependencies." -msgstr "" - -#: pisi/build.py:457 -msgid "Ignoring build dependencies." -msgstr "" - -#: pisi/build.py:467 -msgid "" -"Patch file is missing: %s\n" -msgstr "" - -#: pisi/build.py:480 -msgid "* Applying patch: %s" -msgstr "" - -#: pisi/build.py:538 -msgid "Stripping files.." -msgstr "" - -#: pisi/build.py:635 -msgid "(found old version %s)" -msgstr "" - -#: pisi/build.py:637 -msgid "Skipping %s with wrong pkg name " -msgstr "" - -#: pisi/build.py:658 -msgid "(no previous build found, setting build no to 1.)" -msgstr "" - -#: pisi/build.py:699 -msgid "(old package lacks a build no, setting build no to 1.)" -msgstr "" - -#: pisi/build.py:702 -msgid "There are changes, incrementing build no to %d" -msgstr "" - -#: pisi/build.py:705 -msgid "There is no change from previous build %d" -msgstr "" - -#: pisi/build.py:745 -msgid "** Building package %s" -msgstr "" - -#: pisi/build.py:747 pisi/build.py:758 -msgid "Generating %s," -msgstr "" - -#: pisi/build.py:754 -msgid "Build number is not available. For repo builds you must enable buildno in pisi.conf." -msgstr "" - -#: pisi/build.py:779 -msgid "Creating PISI package %s." -msgstr "" - -#: pisi/build.py:824 -msgid "Done." -msgstr "" - -#: pisi/build.py:830 -msgid "Abandoned files under the install dir (%s):" -msgstr "" - -#: pisi/build.py:834 -msgid "All of the files under the install dir (%s) has been collected by package(s)" -msgstr "" - -#: pisi/build.py:838 -msgid "Cleaning Build Directory..." -msgstr "" - -#: pisi/build.py:841 -msgid "Keeping Build Directory" -msgstr "" - -#: pisi/cli/__init__.py:79 -msgid "Warning: " -msgstr "" - -#: pisi/cli/__init__.py:88 -msgid "Error: " -msgstr "" - -#: pisi/cli/__init__.py:120 -msgid " (yes/no)" -msgstr "" - -#: pisi/cli/__init__.py:134 -msgid "" -" [complete]\n" -msgstr "" - -#: pisi/cli/__init__.py:144 -msgid "Installed %s" -msgstr "" - -#: pisi/cli/__init__.py:146 -msgid "Removed %s" -msgstr "" - -#: pisi/cli/__init__.py:148 -msgid "Upgraded %s" -msgstr "" - -#: pisi/cli/__init__.py:150 -msgid "Configured %s" -msgstr "" - -#: pisi/cli/__init__.py:152 -msgid "Extracting the files of %s" -msgstr "" - -#: pisi/cli/commands.py:34 -#, docstring -msgid "generic help string for any command" -msgstr "" - -#: pisi/cli/commands.py:63 pisi/cli/pisicli.py:104 -msgid "Unrecognized command: %s" -msgstr "" - -#: pisi/cli/commands.py:84 -#, docstring -msgid "common options" -msgstr "" - -#: pisi/cli/commands.py:87 -msgid "change the system root for pisi commands" -msgstr "" - -#: pisi/cli/commands.py:89 -msgid "assume yes in all yes/no queries" -msgstr "" - -#: pisi/cli/commands.py:94 -msgid "detailed output" -msgstr "" - -#: pisi/cli/commands.py:96 -msgid "show debugging information" -msgstr "" - -#: pisi/cli/commands.py:98 -msgid "print like a man" -msgstr "" - -#: pisi/cli/commands.py:102 -#, docstring -msgid "" -"This is a fall back function. If the implementer module provides an\n" -" options function it will be called" -msgstr "" - -#: pisi/cli/commands.py:114 -msgid "" -"Destination directory %s does not exist. Creating directory.\n" -msgstr "" - -#: pisi/cli/commands.py:136 -msgid "Password: " -msgstr "" - -#: pisi/cli/commands.py:142 -#, docstring -msgid "initialize PiSi components" -msgstr "" - -#: pisi/cli/commands.py:150 -#, docstring -msgid "do cleanup work for PiSi components" -msgstr "" - -#: pisi/cli/commands.py:164 -#, docstring -msgid "print help for the command" -msgstr "" - -#: pisi/cli/commands.py:171 -#, docstring -msgid "exit program" -msgstr "" - -#: pisi/cli/commands.py:173 -msgid "Command terminated abnormally." -msgstr "" - -#: pisi/cli/commands.py:183 -msgid "Command lacks name" -msgstr "" - -#: pisi/cli/commands.py:187 -msgid "Duplicate command %s" -msgstr "" - -#: pisi/cli/commands.py:196 -#, docstring -msgid "" -"Prints help for given commands\n" -"\n" -"Usage: help [ ... ]\n" -"\n" -"If run without parameters, it prints the general help." -msgstr "" - -#: pisi/cli/commands.py:230 -#, docstring -msgid "" -"Clean stale locks\n" -"\n" -"Usage: clean\n" -"\n" -"PISI uses filesystem locks for managing database access.\n" -"This command deletes unused locks from the database directory." -msgstr "" - -#: pisi/cli/commands.py:251 -#, docstring -msgid "" -"Delete cache files\n" -" \n" -"Usage: delete-cache\n" -"\n" -"Sources, packages and temporary files are stored\n" -"under /var directory. Since these accumulate they can \n" -"consume a lot of disk space." -msgstr "" - -#: pisi/cli/commands.py:272 -#, docstring -msgid "" -"Graph package relations\n" -"\n" -"Usage: graph [ ...]\n" -"\n" -"Write a graph of package relations, tracking dependency and\n" -"conflicts relations starting from given packages. By default\n" -"shows the package relations among repository packages, and writes\n" -"the package in graphviz format to 'pgraph.dot'.\n" -msgstr "" - -#: pisi/cli/commands.py:290 -msgid "specify a particular repository" -msgstr "" - -#: pisi/cli/commands.py:293 -msgid "graph of installed packages" -msgstr "" - -#: pisi/cli/commands.py:296 -msgid "do not show installed packages" -msgstr "" - -#: pisi/cli/commands.py:299 -msgid "dot output file" -msgstr "" - -#: pisi/cli/commands.py:308 -msgid "Plotting packages in repository %s" -msgstr "" - -#: pisi/cli/commands.py:314 -msgid "Plotting a graph of relations among all repository packages" -msgstr "" - -#: pisi/cli/commands.py:321 -msgid "Plotting a graph of relations among all installed packages" -msgstr "" - -#: pisi/cli/commands.py:334 -msgid "do not take build no into account." -msgstr "" - -#: pisi/cli/commands.py:339 -msgid "show abandoned files under the install directory after build." -msgstr "" - -#: pisi/cli/commands.py:345 -msgid "do not take dependency information into account" -msgstr "" - -#: pisi/cli/commands.py:349 -#, docstring -msgid "" -"Build PISI packages\n" -"\n" -"Usage: build [ | ] ...\n" -"\n" -"You can give a URI of the pspec.xml file. PISI will\n" -"fetch all necessary files and build the package for you.\n" -"\n" -"Alternatively, you can give the name of a source package\n" -"to be downloaded from a repository containing sources.\n" -"\n" -"If you would like to run the build process partially, \n" -"provide the --until option where is one of \n" -"unpack, setup, build, install, package.\n" -msgstr "" - -#: pisi/cli/commands.py:379 -msgid "output directory for produced packages" -msgstr "" - -#: pisi/cli/commands.py:383 -msgid "perform until and including specified step" -msgstr "" - -#: pisi/cli/commands.py:386 -msgid "bypass errors from ActionsAPI" -msgstr "" - -#: pisi/cli/commands.py:388 pisi/cli/commands.py:482 -msgid "bypass safety switch" -msgstr "" - -#: pisi/cli/commands.py:390 pisi/cli/commands.py:480 -msgid "bypass comar configuration agent" -msgstr "" - -#: pisi/cli/commands.py:392 -msgid "create a static package with ar files" -msgstr "" - -#: pisi/cli/commands.py:394 -msgid "don't create a debug package with debug files" -msgstr "" - -#: pisi/cli/commands.py:396 -msgid "don't install build dependencies, fail if a build dependency is present" -msgstr "" - -#: pisi/cli/commands.py:398 -msgid "pisi package format" -msgstr "" - -#: pisi/cli/commands.py:409 -msgid "Step must be one of %s " -msgstr "" - -#: pisi/cli/commands.py:417 -msgid "package_format must be one of %s " -msgstr "" - -#: pisi/cli/commands.py:420 pisi/cli/commands.py:461 -msgid "Output directory: %s" -msgstr "" - -#: pisi/cli/commands.py:422 -msgid "Outputting packages in the working directory." -msgstr "" - -#: pisi/cli/commands.py:434 -#, docstring -msgid "" -"Build and install PISI source packages from repository\n" -"\n" -"Usage: emerge ...\n" -"\n" -"You should give the name of a source package to be \n" -"downloaded from a repository containing sources.\n" -"\n" -"You can also give the name of a component.\n" -msgstr "" - -#: pisi/cli/commands.py:463 -msgid "Outputting binary packages in the package cache." -msgstr "" - -#: pisi/cli/commands.py:471 -#, docstring -msgid "Abstract package operation command" -msgstr "" - -#: pisi/cli/commands.py:484 -msgid "do not perform any action, just show what would be done" -msgstr "" - -#: pisi/cli/commands.py:496 -#, docstring -msgid "" -"Install PISI packages\n" -"\n" -"Usage: install ... \n" -"\n" -"You may use filenames, URI's or package names for packages. If you have\n" -"specified a package name, it should exist in a specified repository.\n" -"\n" -"You can also specify components instead of package names, which will be\n" -"expanded to package names.\n" -msgstr "" - -#: pisi/cli/commands.py:517 -msgid "Reinstall already installed packages" -msgstr "" - -#: pisi/cli/commands.py:519 -msgid "Ignore file conflicts" -msgstr "" - -#: pisi/cli/commands.py:533 -#, docstring -msgid "" -"Upgrade PISI packages\n" -"\n" -"Usage: Upgrade [ ... ]\n" -"\n" -": package name\n" -"\n" -"Upgrades the entire system if no package names are given\n" -"\n" -"You may use only package names to specify packages because\n" -"the package upgrade operation is defined only with respect \n" -"to repositories. If you have specified a package name, it\n" -"should exist in the package repositories. If you just want to\n" -"reinstall a package from a pisi file, use the install command.\n" -"\n" -"You can also specify components instead of package names, which will be\n" -"expanded to package names.\n" -msgstr "" - -#: pisi/cli/commands.py:563 -msgid "select only security upgrades" -msgstr "" - -#: pisi/cli/commands.py:565 -msgid "Do not update repositories" -msgstr "" - -#: pisi/cli/commands.py:567 -msgid "eager upgrades" -msgstr "" - -#: pisi/cli/commands.py:573 -msgid "Updating repositories" -msgstr "" - -#: pisi/cli/commands.py:578 -msgid "Will not update repositories" -msgstr "" - -#: pisi/cli/commands.py:590 -#, docstring -msgid "" -"Remove PISI packages\n" -"\n" -"Usage: remove ... \n" -"\n" -"Remove package(s) from your system. Just give the package names to remove.\n" -"\n" -"You can also specify components instead of package names, which will be\n" -"expanded to package names.\n" -msgstr "" - -#: pisi/cli/commands.py:617 -#, docstring -msgid "" -"Configure pending packages\n" -"\n" -"If COMAR configuration of some packages were not\n" -"done at installation time, they are added to a list\n" -"of packages waiting to be configured. This command\n" -"configures those packages. \n" -msgstr "" - -#: pisi/cli/commands.py:640 -#, docstring -msgid "" -"Display package information\n" -"\n" -"Usage: info ... \n" -"\n" -" is either a package name or a .pisi file, \n" -msgstr "" - -#: pisi/cli/commands.py:656 -msgid "show a list of package files." -msgstr "" - -#: pisi/cli/commands.py:659 -msgid "show only paths." -msgstr "" - -#: pisi/cli/commands.py:661 -msgid "do not show details" -msgstr "" - -#: pisi/cli/commands.py:663 -msgid "output in xml format" -msgstr "" - -#: pisi/cli/commands.py:703 -msgid "Package file: %s" -msgstr "" - -#: pisi/cli/commands.py:709 -msgid "[inst] " -msgstr "" - -#: pisi/cli/commands.py:711 -msgid "Installed package:" -msgstr "" - -#: pisi/cli/commands.py:717 -msgid "[repo] " -msgstr "" - -#: pisi/cli/commands.py:719 -msgid "Package found in repository:" -msgstr "" - -#: pisi/cli/commands.py:733 -msgid "Reverse Dependencies:" -msgstr "" - -#: pisi/cli/commands.py:736 -msgid "" -"\n" -"Files:" -msgstr "" - -#: pisi/cli/commands.py:744 -msgid "File information not available" -msgstr "" - -#: pisi/cli/commands.py:750 -#, docstring -msgid "" -"Verify installation\n" -"\n" -"Usage: check [ ... ]\n" -"\n" -": package name\n" -"\n" -"A cryptographic checksum is stored for each installed\n" -"file. Check command uses the checksums to verify a package.\n" -"Just give the names of packages.\n" -"\n" -"If no packages are given, checks all installed packages.\n" -msgstr "" - -#: pisi/cli/commands.py:774 -msgid "Checking all installed packages" -msgstr "" - -#: pisi/cli/commands.py:780 -msgid "Package %s is corrupt." -msgstr "" - -#: pisi/cli/commands.py:782 -msgid "Package %s not installed" -msgstr "" - -#: pisi/cli/commands.py:787 -#, docstring -msgid "" -"Index PISI files in a given directory\n" -"\n" -"Usage: index ...\n" -"\n" -"This command searches for all PISI files in a directory, collects PISI\n" -"tags from them and accumulates the information in an output XML file,\n" -"named by default 'pisi-index.xml'. In particular, it indexes both\n" -"source and binary packages.\n" -"\n" -"If you give multiple directories, the command still works, but puts\n" -"everything in a single index file.\n" -msgstr "" - -#: pisi/cli/commands.py:809 -msgid "store absolute links for indexed files." -msgstr "" - -#: pisi/cli/commands.py:812 -msgid "index output file" -msgstr "" - -#: pisi/cli/commands.py:815 -msgid "do not index pisi spec files." -msgstr "" - -#: pisi/cli/commands.py:818 -msgid "do not sign index." -msgstr "" - -#: pisi/cli/commands.py:821 -msgid "do not recurse into directories." -msgstr "" - -#: pisi/cli/commands.py:833 -msgid "Indexing current directory." -msgstr "" - -#: pisi/cli/commands.py:842 -#, docstring -msgid "" -"Print the list of all installed packages \n" -"\n" -"Usage: list-installed\n" -msgstr "" - -#: pisi/cli/commands.py:856 pisi/cli/commands.py:1059 -#: pisi/cli/commands.py:1117 pisi/cli/commands.py:1154 -#: pisi/cli/commands.py:1191 pisi/cli/commands.py:1304 -msgid "show in long format" -msgstr "" - -#: pisi/cli/commands.py:858 pisi/cli/commands.py:1193 -msgid "show detailed install info" -msgstr "" - -#: pisi/cli/commands.py:865 pisi/cli/commands.py:1203 -msgid "Package Name |St| Version| Rel.| Build| Distro| Date" -msgstr "" - -#: pisi/cli/commands.py:881 -#, docstring -msgid "" -"Rebuild Databases\n" -"\n" -"Usage: rebuilddb [ ... ]\n" -"\n" -"Rebuilds the PISI databases\n" -"\n" -"If package specs are given, they should be the names of package \n" -"dirs under /var/lib/pisi\n" -msgstr "" - -#: pisi/cli/commands.py:899 -msgid "rebuild files database" -msgstr "" - -#: pisi/cli/commands.py:908 -msgid "Rebuild PISI databases?" -msgstr "" - -#: pisi/cli/commands.py:915 -#, docstring -msgid "" -"Update repository databases\n" -"\n" -"Usage: update-repo [ ... ]\n" -"\n" -": repository name\n" -"\n" -"Synchronizes the PISI databases with the current repository.\n" -"If no repository is given, all repositories are updated.\n" -msgstr "" - -#: pisi/cli/commands.py:934 -msgid "update database in any case" -msgstr "" - -#: pisi/cli/commands.py:950 -#, docstring -msgid "" -"Add a repository\n" -"\n" -"Usage: add-repo \n" -"\n" -": name of repository to add\n" -": URI of index file\n" -"\n" -"If no repo is given, add-repo pardus-devel repo is added by default\n" -"\n" -"NB: We support only local files (e.g., /a/b/c) and http:// URIs at the moment\n" -msgstr "" - -#: pisi/cli/commands.py:971 -msgid "add repository at given position (0 is first)" -msgstr "" - -#: pisi/cli/commands.py:984 -msgid "Update PISI database for repository %s?" -msgstr "" - -#: pisi/cli/commands.py:993 -#, docstring -msgid "" -"Remove repositories\n" -"\n" -"Usage: remove-repo ... \n" -"\n" -"Remove all repository information from the system.\n" -msgstr "" - -#: pisi/cli/commands.py:1019 -#, docstring -msgid "" -"List repositories\n" -"\n" -"Usage: list-repo\n" -"\n" -"Lists currently tracked repositories.\n" -msgstr "" - -#: pisi/cli/commands.py:1042 -#, docstring -msgid "" -"List available packages in the repositories\n" -"\n" -"Usage: list-available [ ... repon ]\n" -"\n" -"Gives a brief list of PISI packages published in the specified\n" -"repositories. If no repository is specified, we list packages in\n" -"all repositories. \n" -msgstr "" - -#: pisi/cli/commands.py:1061 -msgid "show uninstalled packages only" -msgstr "" - -#: pisi/cli/commands.py:1068 -msgid "Installed packages are shown in this color" -msgstr "" - -#: pisi/cli/commands.py:1076 -msgid "" -"Repository : %s\n" -msgstr "" - -#: pisi/cli/commands.py:1101 -#, docstring -msgid "" -"List available components\n" -"\n" -"Usage: list-components\n" -"\n" -"Gives a brief list of PISI components published in the \n" -"repositories.\n" -msgstr "" - -#: pisi/cli/commands.py:1139 -#, docstring -msgid "" -"List available sources\n" -"\n" -"Usage: list-sources\n" -"\n" -"Gives a brief list of sources published in the repositories.\n" -msgstr "" - -#: pisi/cli/commands.py:1176 -#, docstring -msgid "" -"List packages to be upgraded\n" -"\n" -"Usage: list-upgrades\n" -"\n" -"Lists the packages that will be upgraded.\n" -msgstr "" - -#: pisi/cli/commands.py:1200 pisi/operations.py:414 -msgid "No packages to upgrade." -msgstr "" - -#: pisi/cli/commands.py:1219 -#, docstring -msgid "" -"List pending packages\n" -" \n" -"Lists packages waiting to be configured.\n" -msgstr "" - -#: pisi/cli/commands.py:1241 -#, docstring -msgid "" -"Search packages\n" -"\n" -"Usage: search ... \n" -"\n" -"Finds a package containing specified search terms\n" -"in summary, description, and package name fields.\n" -msgstr "" - -#: pisi/cli/commands.py:1258 -msgid "set search language" -msgstr "" - -#: pisi/cli/commands.py:1261 -msgid "show details" -msgstr "" - -#: pisi/cli/commands.py:1280 -msgid "%s packages found" -msgstr "" - -#: pisi/cli/commands.py:1289 -#, docstring -msgid "" -"Search for a file\n" -"\n" -"Usage: search-file ... \n" -"\n" -"Finds the installed package which contains the specified file.\n" -msgstr "" - -#: pisi/cli/commands.py:1306 -msgid "fuzzy search" -msgstr "" - -#: pisi/cli/commands.py:1323 -msgid "Package %s has file %s" -msgstr "" - -#: pisi/cli/commands.py:1325 -msgid "Type: %s, Hash: %s" -msgstr "" - -#: pisi/cli/commands.py:1328 -msgid "Path '%s' does not belong to an installed package" -msgstr "" - -#: pisi/cli/commands.py:1340 -msgid "Searching for %s" -msgstr "" - -#: pisi/cli/commands.py:1350 -msgid "" -"%prog [options] [arguments]\n" -"\n" -"where is one of:\n" -"\n" -msgstr "" - -#: pisi/cli/commands.py:1356 -msgid "" -"\n" -"Use \"%prog help \" for help on a specific command.\n" -msgstr "" - -#: pisi/cli/pisicli.py:56 -msgid "Options must precede non-option arguments" -msgstr "" - -#: pisi/cli/pisicli.py:97 -msgid "No command given" -msgstr "" - -#: pisi/cli/pisicli.py:100 -msgid "Command line parsing error" -msgstr "" - -#: pisi/comariface.py:36 -msgid "comar package is not fully installed" -msgstr "" - -#: pisi/comariface.py:38 -msgid "cannot connect to comar" -msgstr "" - -#: pisi/comariface.py:66 -msgid "Could not restart comar" -msgstr "" - -#: pisi/comariface.py:69 -msgid "connection with comar unexpectedly closed" -msgstr "" - -#: pisi/comariface.py:82 -msgid "Configuration error: %s" -msgstr "" - -#: pisi/comariface.py:85 -msgid "Script error: %s" -msgstr "" - -#: pisi/comariface.py:88 -msgid "comar denied our access" -msgstr "" - -#: pisi/comariface.py:91 -msgid "Configuring package" -msgstr "" - -#: pisi/comariface.py:96 -msgid "Registering %s comar script" -msgstr "" - -#: pisi/comariface.py:102 -msgid "Calling post install handlers" -msgstr "" - -#: pisi/comariface.py:107 -msgid "Running package's post install script" -msgstr "" - -#: pisi/comariface.py:112 -msgid "Configuring package for removal" -msgstr "" - -#: pisi/comariface.py:115 -msgid "Running package's pre remove script" -msgstr "" - -#: pisi/comariface.py:119 -msgid "Calling pre remove handlers" -msgstr "" - -#: pisi/comariface.py:123 -msgid "Unregistering comar scripts" -msgstr "" - -#: pisi/component.py:116 pisi/component.py:123 -msgid "Component %s not found" -msgstr "" - -#: pisi/component.py:168 pisi/component.py:193 -msgid "Information for component %s not available" -msgstr "" - -#: pisi/config.py:60 -msgid "Destination directory %s does not exist. Creating it." -msgstr "" - -#: pisi/configfile.py:107 -msgid "No section by name '%s'" -msgstr "" - -#: pisi/constants.py:32 -msgid "Can't rebind constant: %s" -msgstr "" - -#: pisi/constants.py:38 -msgid "Can't unbind constant: %s" -msgstr "" - -#: pisi/dependency.py:42 -msgid " version >= " -msgstr "" - -#: pisi/dependency.py:44 -msgid " version <= " -msgstr "" - -#: pisi/dependency.py:46 -msgid " release >= " -msgstr "" - -#: pisi/dependency.py:48 -msgid " release <= " -msgstr "" - -#: pisi/dependency.py:105 -msgid "Package %s does not satisfy dependency %s" -msgstr "" - -#: pisi/dependency.py:118 -msgid "Package %s is not present in the package database" -msgstr "" - -#: pisi/fetcher.py:84 -msgid "Filename error" -msgstr "" - -#: pisi/fetcher.py:87 -msgid "Access denied to write to destination directory: \"%s\"" -msgstr "" - -#: pisi/fetcher.py:92 -msgid "Access denied to destination file: \"%s\"" -msgstr "" - -#: pisi/fetcher.py:103 -msgid "A problem occured. Please check the archive address and/or permissions again." -msgstr "" - -#: pisi/fetcher.py:161 -msgid "No such file or no permission to read" -msgstr "" - -#: pisi/fetcher.py:186 -msgid "Requested range not satisfiable, starting again." -msgstr "" - -#: pisi/fetcher.py:193 -msgid "Cannot fetch %s; value error: %s" -msgstr "" - -#: pisi/fetcher.py:195 pisi/fetcher.py:197 pisi/fetcher.py:199 -msgid "Cannot fetch %s; %s" -msgstr "" - -#: pisi/fetcher.py:201 -msgid "Cannot fetch %s; (%s): %s" -msgstr "" - -#: pisi/fetcher.py:245 -msgid "Proxy configuration has been found for '%s' protocol" -msgstr "" - -#: pisi/fetcher.py:329 pisi/fetcher.py:350 pisi/fetcher.py:363 -msgid "ftp error" -msgstr "" - -#: pisi/file.py:67 -msgid "uri must have type either URI or string" -msgstr "" - -#: pisi/file.py:90 -msgid "zip compression not supported yet" -msgstr "" - -#: pisi/file.py:118 -msgid "Fetching %s" -msgstr "" - -#: pisi/file.py:123 -msgid "Copying %s to transfer dir" -msgstr "" - -#: pisi/file.py:128 -msgid "File '%s' not found." -msgstr "" - -#: pisi/file.py:136 -msgid "File integrity of %s compromised." -msgstr "" - -#: pisi/file.py:157 -msgid "File mode must be either File.read or File.write" -msgstr "" - -#: pisi/file.py:162 -msgid "Remote write not implemented" -msgstr "" - -#: pisi/file.py:189 -msgid "gzip compression not supported yet" -msgstr "" - -#: pisi/file.py:204 pisi/file.py:207 -msgid "ERROR: gpg --detach-sig %s failed" -msgstr "" - -#: pisi/graph.py:31 -msgid "Encountered cycle %s" -msgstr "" - -#: pisi/index.py:94 -msgid "Adding %s to package index" -msgstr "" - -#: pisi/index.py:97 -msgid "Adding %s to component index" -msgstr "" - -#: pisi/index.py:136 -msgid "Package %s: metadata corrupt, skipping..." -msgstr "" - -#: pisi/index.py:161 -msgid "Adding %s to source index" -msgstr "" - -#: pisi/installdb.py:59 -msgid "installed" -msgstr "" - -#: pisi/installdb.py:59 -msgid "installed-pending" -msgstr "" - -#: pisi/installdb.py:60 -msgid "purged" -msgstr "" - -#: pisi/installdb.py:60 -msgid "removed" -msgstr "" - -#: pisi/installdb.py:63 -msgid "" -"State: %s\n" -"Version: %s, Release: %s, Build: %s\n" -msgstr "" - -#: pisi/installdb.py:68 -msgid "" -"Distribution: %s, Install Time: %s\n" -msgstr "" - -#: pisi/installdb.py:155 -msgid "Already installed" -msgstr "" - -#: pisi/itembyrepodb.py:121 -msgid "Invalid repository string" -msgstr "" - -#: pisi/itembyrepodb.py:143 -msgid "Key %s not found" -msgstr "" - -#: pisi/itembyrepodb.py:153 -msgid "Key %s in repo %s not found" -msgstr "" - -#: pisi/lockeddbshelve.py:50 -msgid "Database version for %s insufficient. Please run rebuild-db command." -msgstr "" - -#: pisi/lockeddbshelve.py:54 -msgid "Database version for %s greater than PiSi version. You need a newer PiSi." -msgstr "" - -#: pisi/lockeddbshelve.py:61 -msgid "Writing current database version for %s" -msgstr "" - -#: pisi/lockeddbshelve.py:66 -msgid "Cannot attain write access to database environment" -msgstr "" - -#: pisi/lockeddbshelve.py:68 -msgid "Database version %s not present." -msgstr "" - -#: pisi/lockeddbshelve.py:75 pisi/lockeddbshelve.py:164 -msgid "Another instance of PISI is running. Only one instance is allowed to modify the PISI database at a time." -msgstr "" - -#: pisi/lockeddbshelve.py:85 -msgid "Cannot attain read access to database environment" -msgstr "" - -#: pisi/lockeddbshelve.py:99 -msgid "Cannot write to PISI database." -msgstr "" - -#: pisi/lockeddbshelve.py:122 -msgid "Cannot attain read or write access to database %s" -msgstr "" - -#: pisi/lockeddbshelve.py:150 -msgid "Flags should be one of 'r', 'w', 'c' or 'n' or use the bsddb.db.DB_* flags" -msgstr "" - -#: pisi/metadata.py:62 -msgid "" -"Distribution: %s, Dist. Release: %s\n" -msgstr "" - -#: pisi/metadata.py:64 -msgid "Architecture: %s, Installed Size: %s" -msgstr "" - -#: pisi/operations.py:45 -msgid "Upgrading PISI requires database rebuild and restart" -msgstr "" - -#: pisi/operations.py:48 -msgid "PISI package has been upgraded. Rebuilding PISI database." -msgstr "" - -#: pisi/operations.py:79 -msgid "Mixing file names and package names not supported yet." -msgstr "" - -#: pisi/operations.py:121 -msgid "" -"The following packages will be installed\n" -"in the respective order to satisfy extra dependencies:\n" -msgstr "" - -#: pisi/operations.py:124 pisi/operations.py:566 -msgid "Do you want to continue?" -msgstr "" - -#: pisi/operations.py:125 -msgid "External dependencies not satisfied" -msgstr "" - -#: pisi/operations.py:137 pisi/operations.py:294 -msgid "No packages to install." -msgstr "" - -#: pisi/operations.py:165 -msgid "Installation order: " -msgstr "" - -#: pisi/operations.py:213 -msgid "Selected packages [%s] are in conflict with each other." -msgstr "" - -#: pisi/operations.py:219 -msgid "[%s conflicts with: %s]" -msgstr "" - -#: pisi/operations.py:221 -msgid "The following packages have conflicts: %s" -msgstr "" - -#: pisi/operations.py:224 -msgid "Remove the following conflicting packages?" -msgstr "" - -#: pisi/operations.py:225 pisi/operations.py:228 -msgid "Conflicts remain" -msgstr "" - -#: pisi/operations.py:259 -msgid "Safety switch: Following packages in system.base will be installed: " -msgstr "" - -#: pisi/operations.py:265 -msgid "Safety switch: Following packages in system.base will be upgraded: " -msgstr "" - -#: pisi/operations.py:271 pisi/operations.py:542 -msgid "Safety switch: the component system.base cannot be found" -msgstr "" - -#: pisi/operations.py:289 -msgid "Not re-installing the following packages: " -msgstr "" - -#: pisi/operations.py:305 -msgid "" -"Following packages will be installed\n" -"in the respective order to satisfy dependencies:\n" -msgstr "" - -#: pisi/operations.py:311 pisi/operations.py:432 -msgid "Total size of packages: %.2f %s" -msgstr "" - -#: pisi/operations.py:317 pisi/operations.py:438 pisi/operations.py:726 -msgid "There are extra packages due to dependencies. Do you want to continue?" -msgstr "" - -#: pisi/operations.py:380 -msgid "Warning: package *name* ends with '.pisi'" -msgstr "" - -#: pisi/operations.py:383 -msgid "Package %s is not installed." -msgstr "" - -#: pisi/operations.py:389 -msgid "Package %s is not available in repositories." -msgstr "" - -#: pisi/operations.py:401 -msgid "Package %s is already at the latest release %s." -msgstr "" - -#: pisi/operations.py:407 -msgid "Package %s is already at the latest build %s." -msgstr "" - -#: pisi/operations.py:427 -msgid "The following packages will be upgraded: " -msgstr "" - -#: pisi/operations.py:489 -msgid "Dependency %s of %s cannot be satisfied" -msgstr "" - -#: pisi/operations.py:490 -msgid "Upgrade is not possible." -msgstr "" - -#: pisi/operations.py:512 -msgid "Reverse dependency %s of %s cannot be satisfied" -msgstr "" - -#: pisi/operations.py:538 -msgid "Safety switch: cannot remove the following packages in system.base: " -msgstr "" - -#: pisi/operations.py:549 -msgid "Package %s does not exist. Cannot remove." -msgstr "" - -#: pisi/operations.py:553 -msgid "No packages to remove." -msgstr "" - -#: pisi/operations.py:562 -msgid "" -"The following minimal list of packages will be removed\n" -"in the respective order to satisfy dependencies:\n" -msgstr "" - -#: pisi/operations.py:567 -msgid "Package removal declined" -msgstr "" - -#: pisi/operations.py:579 -msgid "Package %s is not installed. Cannot remove." -msgstr "" - -#: pisi/operations.py:700 -msgid "No packages to emerge." -msgstr "" - -#: pisi/operations.py:715 -msgid "" -"The following minimal list of packages will be installed \n" -"from repository in the respective order to satisfy dependencies:\n" -msgstr "" - -#: pisi/operations.py:718 -msgid "" -"The following minimal list of packages will be built and\n" -"installed in the respective order to satisfy dependencies:\n" -msgstr "" - -#: pisi/operations.py:760 -msgid "Cannot find source package: %s" -msgstr "" - -#: pisi/package.py:75 -msgid "Trying to fetch xdelta: %s" -msgstr "" - -#: pisi/package.py:79 -msgid "XDelta %s: not exists" -msgstr "" - -#: pisi/package.py:91 pisi/sourcearchive.py:59 -msgid "%s [cached]" -msgstr "" - -#: pisi/package.py:152 -msgid "MetaData format wrong" -msgstr "" - -#: pisi/packagedb.py:68 -msgid "Package %s not found" -msgstr "" - -#: pisi/pxml/autoxml.py:83 -msgid "At least one '%s' tag should have local text" -msgstr "" - -#: pisi/pxml/autoxml.py:90 -msgid "'%s' language of tag '%s' is empty" -msgstr "" - -#: pisi/pxml/autoxml.py:116 -msgid "LocalText: unable to get either current or default locale" -msgstr "" - -#: pisi/pxml/autoxml.py:122 pisi/pxml/autoxml.py:137 -msgid "Tag should have at least the current locale, or failing that an English or Turkish version" -msgstr "" - -#: pisi/pxml/autoxml.py:375 -msgid "autoxml.check: '%s' errors" -msgstr "" - -#: pisi/pxml/autoxml.py:430 pisi/pxml/autoxml.py:440 -msgid "autoxml.read: File '%s' has errors" -msgstr "" - -#: pisi/pxml/autoxml.py:448 -msgid "autoxml.write: object validation has failed" -msgstr "" - -#: pisi/pxml/autoxml.py:456 -msgid "autoxml.write: File encoding '%s' has errors" -msgstr "" - -#: pisi/pxml/autoxml.py:506 -msgid "gen_tag: unrecognized tag type %s in spec" -msgstr "" - -#: pisi/pxml/autoxml.py:554 pisi/pxml/autoxml.py:565 -msgid "Mandatory variable %s not available" -msgstr "" - -#: pisi/pxml/autoxml.py:633 -msgid "Type mismatch: read text cannot be decoded" -msgstr "" - -#: pisi/pxml/autoxml.py:637 pisi/pxml/autoxml.py:646 -msgid "Mandatory token %s not available" -msgstr "" - -#: pisi/pxml/autoxml.py:651 -msgid "Type mismatch. Expected %s, got %s" -msgstr "" - -#: pisi/pxml/autoxml.py:681 pisi/pxml/autoxml.py:802 -msgid "Type mismatch: DOM cannot be decoded" -msgstr "" - -#: pisi/pxml/autoxml.py:684 pisi/pxml/autoxml.py:700 pisi/pxml/autoxml.py:710 -#: pisi/pxml/autoxml.py:805 pisi/pxml/autoxml.py:819 pisi/pxml/autoxml.py:829 -msgid "Mandatory argument not available" -msgstr "" - -#: pisi/pxml/autoxml.py:697 pisi/pxml/autoxml.py:816 -msgid "Object cannot be encoded" -msgstr "" - -#: pisi/pxml/autoxml.py:722 -msgid "List type must contain only one element" -msgstr "" - -#: pisi/pxml/autoxml.py:735 pisi/pxml/autoxml.py:756 -msgid "Mandatory list empty" -msgstr "" - -#: pisi/pxml/xmlextcdom.py:61 pisi/pxml/xmlfilecdom.py:77 -msgid "File '%s' has invalid XML: %s" -msgstr "" - -#: pisi/pxml/xmlextcdom.py:113 pisi/pxml/xmlextmdom.py:92 -#: pisi/pxml/xmlextpiks.py:83 -msgid "getNodeText: Expected text node, got something else!" -msgstr "" - -#: pisi/pxml/xmlextmdom.py:53 pisi/pxml/xmlfilemdom.py:69 -msgid "" -"File '%s' has invalid XML: %s\n" -msgstr "" - -#: pisi/pxml/xmlfilecdom.py:79 -msgid "File '%s' not found" -msgstr "" - -#: pisi/pxml/xmlfilecdom.py:89 pisi/pxml/xmlfilemdom.py:80 -msgid "Root tagname %s not identical to %s as expected" -msgstr "" - -#: pisi/pxml/xmlfilepiks.py:64 pisi/pxml/xmlfilepiks.py:79 -msgid "File '%s' has invalid XML" -msgstr "" - -#: pisi/repodb.py:82 -msgid "Repository %s already exists" -msgstr "" - -#: pisi/repodb.py:89 -msgid "Cannot add repository at position %s" -msgstr "" - -#: pisi/sourcearchive.py:68 -msgid "unpack: check_file_hash failed" -msgstr "" - -#: pisi/sourcedb.py:60 pisi/sourcedb.py:66 -msgid "Source package %s not found" -msgstr "" - -#: pisi/specfile.py:143 -msgid "URI: %s, type: %s, sha1sum: %s" -msgstr "" - -#: pisi/specfile.py:210 -msgid "" -"Name: %s, version: %s, release: %s, build %s\n" -msgstr "" - -#: pisi/specfile.py:212 -msgid "" -"Summary: %s\n" -msgstr "" - -#: pisi/specfile.py:213 -msgid "" -"Description: %s\n" -msgstr "" - -#: pisi/specfile.py:214 -msgid "" -"Component: %s\n" -msgstr "" - -#: pisi/specfile.py:215 -msgid "Provides: " -msgstr "" - -#: pisi/specfile.py:219 -msgid "Dependencies: " -msgstr "" - -#: pisi/uri.py:79 -msgid "setAuthInfo needs a tuple (user, pass)" -msgstr "" - -#: pisi/util.py:62 -msgid "%s section should have a '%s' tag" -msgstr "" - -#: pisi/util.py:144 pisi/util.py:165 -msgid "Running " -msgstr "" - -#: pisi/util.py:148 pisi/util.py:183 -msgid "return value for \"%s\" is %s" -msgstr "" - -#: pisi/util.py:387 -msgid "Including external link '%s'" -msgstr "" - -#: pisi/util.py:389 -msgid "Including directory '%s'" -msgstr "" - -#: pisi/util.py:463 -msgid "I/O Error: Cannot calculate SHA1 hash of %s" -msgstr "" - -#: pisi/util.py:472 -msgid "Cannot calculate SHA1 hash of given data" -msgstr "" - -#: pisi/util.py:510 -msgid "ERROR: patch (%s) failed" -msgstr "" - -#: pisi/util.py:512 -msgid "ERROR: patch (%s) failed: %s" -msgstr "" - -#: pisi/util.py:558 -msgid "strip command failed for file '%s'!" -msgstr "" - -#: pisi/util.py:565 -msgid "objcopy (keep-debug) command failed for file '%s'!" -msgstr "" - -#: pisi/util.py:571 -msgid "objcopy (add-debuglink) command failed for file '%s'!" -msgstr "" - -#: pisi/util.py:604 -msgid "Removing lock %s" -msgstr "" - -#: pisi/util.py:637 -msgid "Updating environment..." -msgstr "" - -#: pisi/util.py:672 -msgid "ERROR: xdelta patch %s %s %s failed" -msgstr "" - -#: scripts/repostats.py:361 -msgid "" -"Duplicate binary packages:\n" -"%s\n" -"%s\n" -msgstr "" - -#: scripts/repostats.py:366 -msgid "Unknown file type '%s' in package '%s'" -msgstr "" - -#: scripts/repostats.py:422 -msgid "" -"Duplicate source packages:\n" -"%s\n" -"%s\n" -msgstr "" - -#: scripts/repostats.py:442 -msgid "Source package '%s' has wrong date format '%s'" -msgstr "" - -#: scripts/repostats.py:455 -msgid "Source package '%s' has wrong release numbers" -msgstr "" - -#: scripts/repostats.py:459 -msgid "Source package '%s' lacks release %d" -msgstr "" - -#: scripts/repostats.py:467 -msgid "Source package '%s' has no first release" -msgstr "" - -#: scripts/repostats.py:502 -msgid "Developer '%s <%s>' has another mail address '%s' in source package '%s'" -msgstr "" - -#: scripts/repostats.py:585 -msgid "" -"Cannot parse '%s':\n" -"%s\n" -msgstr "" - -#: scripts/repostats.py:663 -msgid "" -"Usage: repostats.py [OPTIONS] source-repo-path [binary-repo-path]\n" -msgstr "" - -#: scripts/repostats.py:664 -msgid "" -"Dont generate the web site.\n" -msgstr "" - -#: scripts/repostats.py:685 -msgid "" -"Scanning source repository...\n" -msgstr "" - -#: scripts/repostats.py:689 -msgid "" -"Scanning binary packages...\n" -msgstr "" - -#: scripts/repostats.py:694 -msgid "" -"Encountered %d errors! Fix them immediately!\n" -msgstr "" - -#: scripts/repostats.py:702 -msgid "" -"These dependencies are not available in repository:\n" -msgstr "" - diff --git a/tags/pisi-1.1_beta13/po/tr.po b/tags/pisi-1.1_beta13/po/tr.po deleted file mode 100644 index b1daa8c5..00000000 --- a/tags/pisi-1.1_beta13/po/tr.po +++ /dev/null @@ -1,2390 +0,0 @@ -# translation of tr.po to Turkish -# PiSi Translation -# Copyright (C) 2005, 2006 Free Software Foundation, Inc. -# Eray Ozkural , 2005,2006. -# Furkan Duman , 2006. -msgid "" -msgstr "" -"Project-Id-Version: tr\n" -"POT-Creation-Date: 2006-07-06 12:16+EEST\n" -"PO-Revision-Date: 2006-06-10 07:53+0300\n" -"Last-Translator: Furkan Duman \n" -"Language-Team: Turkish \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: KBabel 1.11\n" - -#: pisi-cli:37 -msgid "Keyboard Interrupt: Exiting..." -msgstr "Klavye kesmesi: Çıkıyor..." - -#: pisi-cli:40 -msgid "Program Terminated." -msgstr "Program sonlandırıldı." - -#: pisi-cli:43 -msgid "" -"A database operation has been aborted. You should run pisi\n" -"again for normal DB recovery procedure. Make sure you have free disk " -"space. \n" -"You have to run rebuild-db only when there is file corruption and database " -"upgrades." -msgstr "" -"Bir veritabanı işlemi yarıda kesildi. PİSİ'yi normal veritabanı \n" -"düzeltme işlemi için yeniden çalıştırmalısınız. Boş disk \n" -"alanınızın bulunduğuna emin olun.\n" -"Sadece dosya bozulması ve veritabanı versiyon değişimi oluğu zaman rebuild-" -"db komutunu kullanmanız gerekir." - -#: pisi-cli:48 -msgid "" -"Unhandled internal exception.\n" -"Please file a bug report. (http://bugs.uludag.org.tr)" -msgstr "" -"Eksik hata denetlemesi.\n" -"Lütfen bir hata raporu bildiriniz. (http://bugs.uludag.org.tr)" - -#: pisi-cli:54 -msgid "System Error. Program Terminated." -msgstr "Sistem Hatası: Program Sonlandırıldı. " - -#: pisi-cli:61 -msgid "Please use 'pisi help' for general help." -msgstr "Genel yardım için lütfen 'pisi help' komutunu kullanınız. " - -#: pisi-cli:64 -msgid "Traceback:" -msgstr "Geri-iz:" - -#: pisi-cli:68 -msgid "Use --debug to see a traceback." -msgstr "" -"Bir geri-iz (traceback) görmek için lütfen --debug seçeneğini kullanın." - -#: pisi-cli:81 -msgid "PISI has been upgraded." -msgstr "PİSİ yükseltildi." - -#: pisi/actionsapi/autotools.py:37 -msgid "" -"Please attach the config.log to your bug report:\n" -"%s/config.log" -msgstr "" -"Lütfen hata raporunuza config.log dosyasını ekleyin:\n" -"%s/config.log" - -# pisi/actionsapi/autotools.py:75 :85 -#: pisi/actionsapi/autotools.py:76 pisi/actionsapi/autotools.py:86 -#: pisi/actionsapi/kde.py:66 pisi/actionsapi/perlmodules.py:54 -#: pisi/actionsapi/perlmodules.py:57 -msgid "Configure failed." -msgstr "Yapılandırma başarısızlığa uğradı." - -# pisi/actionsapi/autotools.py:77 :87 -#: pisi/actionsapi/autotools.py:78 pisi/actionsapi/autotools.py:88 -#: pisi/actionsapi/kde.py:68 -msgid "No configure script found." -msgstr "Yapılandırma betiği bulunamadı." - -#: pisi/actionsapi/autotools.py:97 pisi/actionsapi/kde.py:73 -#: pisi/actionsapi/perlmodules.py:63 pisi/actionsapi/perlmodules.py:72 -#: pisi/actionsapi/pythonmodules.py:50 pisi/actionsapi/scons.py:40 -msgid "Make failed." -msgstr "İnşa başarısızlığa uğradı." - -# pisi/actionsapi/autotools.py:119 :127 -#: pisi/actionsapi/autotools.py:125 pisi/actionsapi/autotools.py:135 -#: pisi/actionsapi/kde.py:80 pisi/actionsapi/pythonmodules.py:55 -#: pisi/actionsapi/scons.py:44 -msgid "Install failed." -msgstr "Kurulum başarısızlığa uğradı." - -# pisi/actionsapi/autotools.py:121 :129 -#: pisi/actionsapi/autotools.py:127 pisi/actionsapi/autotools.py:137 -#: pisi/actionsapi/kde.py:82 -msgid "No Makefile found." -msgstr "Makefile bulunamadı." - -#: pisi/actionsapi/autotools.py:144 -msgid "Running aclocal failed." -msgstr "aclocal çalıştırılamadı." - -# pisi/actionsapi/autotools.py:139 :144 -#: pisi/actionsapi/autotools.py:149 pisi/actionsapi/autotools.py:154 -msgid "Running autoconf failed." -msgstr "autoconf çalıştırılamadı." - -#: pisi/actionsapi/autotools.py:159 -msgid "Running automake failed." -msgstr "automake çalıştırılamadı." - -#: pisi/actionsapi/autotools.py:164 -msgid "Running autoheader failed." -msgstr "autoheader çalıştırılamadı." - -#: pisi/actionsapi/get.py:164 -msgid "Util %s cannot be found" -msgstr "Araç %s bulunamıyor" - -#: pisi/actionsapi/get.py:166 -msgid "Warning: %s does not exist, using plain name %s" -msgstr "Uyarı: %s yok, düz ad %s kullanılıyor" - -#: pisi/actionsapi/kde.py:35 -msgid "" -"\n" -"!!! Please attach the config.log to your bug report:\n" -"%s/config.log" -msgstr "" -"\n" -"Lütfen hata raporunuza config.log dosyasını ekleyin:\n" -"%s/config.log" - -#: pisi/actionsapi/libtools.py:39 -msgid "Running ldconfig failed." -msgstr "ldconfig çalıştırılamadı" - -#: pisi/actionsapi/libtools.py:50 -msgid "GNU Config Update Finished." -msgstr "GNU yapılandırma güncellemesi bitti" - -#: pisi/actionsapi/libtools.py:54 -msgid "Running libtoolize failed." -msgstr "libtoolize çalıştırılamadı" - -# pisi/actionsapi/autotools.py:119 :127 -#: pisi/actionsapi/perlmodules.py:66 -msgid "perl build failed." -msgstr "perl inşası başarısızlığa uğgradı." - -# pisi/actionsapi/autotools.py:119 :127 -#: pisi/actionsapi/perlmodules.py:75 -msgid "perl install failed." -msgstr "perl kurma işlemi başarısızlığa uğgradı." - -#: pisi/actionsapi/pisitools.py:127 -msgid "ActionsAPI [doman]: Wrong man page file: %s" -msgstr "ActionsAPI [doman]: Yanlış kılavuz sayfası dosyası: %s" - -#: pisi/actionsapi/pisitools.py:165 -msgid "ActionsAPI [rename]: No such file or directory: %s" -msgstr "ActionsAPI [rename]: Böyle bir dosya ya da dizin bulunamadı: %s" - -#: pisi/actionsapi/pisitools.py:182 -msgid "File does not exist or permission denied: %s" -msgstr "Dosya yok ya da erişim engellendi: %s" - -#: pisi/actionsapi/pisitools.py:199 -msgid "ActionsAPI [dosym]: File exists: %s" -msgstr "ActionsAPI [dosym]: %s dosyası sistemde var" - -# pisi/actionsapi/pisitoolsfunctions.py:46 :59 -#: pisi/actionsapi/pisitoolsfunctions.py:46 -#: pisi/actionsapi/pisitoolsfunctions.py:60 -#: pisi/actionsapi/pisitoolsfunctions.py:73 -msgid "Insufficient arguments." -msgstr "Yetersiz argümanlar" - -#: pisi/actionsapi/pythonmodules.py:67 -msgid "Running %s failed." -msgstr "%s çalıştırılamadı" - -#: pisi/actionsapi/shelltools.py:50 -msgid "Cannot create directory %s" -msgstr "%s dizini yaratılamıyor." - -#: pisi/actionsapi/shelltools.py:58 -msgid "ActionsAPI [echo]: Can't append to file %s." -msgstr "ActionsAPI [echo]: %s dosyasına eklenemiyor." - -#: pisi/actionsapi/shelltools.py:67 -msgid "ActionsAPI [chmod]: Operation not permitted: %s (mode: %s)" -msgstr "ActionsAPI [chmod]: İşleme izin verilmedi: %s (mod: %s)" - -#: pisi/actionsapi/shelltools.py:70 -msgid "ActionsAPI [chmod]: File %s doesn't exists." -msgstr "ActionsAPI [chmod]: %s dosyası bulunamadı." - -#: pisi/actionsapi/shelltools.py:78 -msgid "ActionsAPI [chown]: Operation not permitted: %s (uid: %s, gid: %s)" -msgstr "ActionsAPI [chown]: İşleme izin verilmedi: %s (uid: %s, gid: %s)" - -#: pisi/actionsapi/shelltools.py:81 -msgid "ActionsAPI [chown]: File %s doesn't exists." -msgstr "ActionsAPI [chown]: %s dosyası bulunamadı." - -#: pisi/actionsapi/shelltools.py:88 -msgid "ActionsAPI [sym]: Permission denied: %s to %s" -msgstr "ActionsAPI [sym]: Erişim engellendi: %s -> %s" - -#: pisi/actionsapi/shelltools.py:96 -msgid "ActionsAPI [unlink]: Permission denied: %s." -msgstr "ActionsAPI [unlink]: İzin verilmedi: %s." - -#: pisi/actionsapi/shelltools.py:100 -msgid "ActionsAPI [unlink]: File %s doesn't exists." -msgstr "ActionsAPI [unlink]: %s dosyası bulunamadı." - -#: pisi/actionsapi/shelltools.py:108 -msgid "ActionsAPI [unlinkDir]: Operation not permitted: %s" -msgstr "ActionsAPI [unlinkDir]: İşleme izin verilmedi: %s" - -#: pisi/actionsapi/shelltools.py:112 -msgid "ActionsAPI [unlinkDir]: Directory %s doesn't exists." -msgstr "ActionsAPI [unlinkDir]: %s dizini bulunamadı." - -#: pisi/actionsapi/shelltools.py:121 -msgid "ActionsAPI [move]: Permission denied: %s to %s" -msgstr "ActionsAPI [move]: Erişim engellendi: %s -> %s" - -#: pisi/actionsapi/shelltools.py:123 -msgid "ActionsAPI [move]: File %s doesn't exists." -msgstr "ActionsAPI [move]: %s dosyası bulunamadı." - -#: pisi/actionsapi/shelltools.py:133 -msgid "ActionsAPI [copy]: Permission denied: %s to %s" -msgstr "ActionsAPI [copy]: Erişim engellendi: %s -> %s" - -#: pisi/actionsapi/shelltools.py:149 -msgid "ActionsAPI [copy]: File %s does not exist." -msgstr "ActionsAPI [copy]: %s dosyası bulunamadı." - -#: pisi/actionsapi/shelltools.py:164 -msgid "ActionsAPI [copytree] %s to %s: %s" -msgstr "ActionsAPI [copytree]: %s konumundan %s konumuna: %s" - -#: pisi/actionsapi/shelltools.py:166 -msgid "ActionsAPI [copytree]: Directory %s doesn't exists." -msgstr "ActionsAPI [copytree]: %s dizini bulunamadı." - -#: pisi/actionsapi/shelltools.py:178 -msgid "ActionsAPI [touch]: Permission denied: %s" -msgstr "ActionsAPI [touch]: Erişim engellendi: %s" - -#: pisi/api.py:243 -msgid "COMAR: comard not fully installed" -msgstr "COMAR: comard tam olarak kurulmamış" - -#: pisi/api.py:255 -msgid "File %s not found" -msgstr "Dosya %s bulunamadı." - -#: pisi/api.py:320 -msgid "Checking %s " -msgstr "%s kontrol ediliyor " - -#: pisi/api.py:337 -msgid "* Building index of PISI files under %s" -msgstr "* %s altındaki PİSİ dosyalarının bir indeksi yapılıyor" - -#: pisi/api.py:344 -msgid "* Index file written" -msgstr "* İndeks dosyası yazıldı" - -#: pisi/api.py:348 -msgid "Repo %s already present." -msgstr "Depo %s halihazırda var." - -#: pisi/api.py:352 -msgid "Repo %s added to system." -msgstr "%s isimli depo sisteme eklendi." - -#: pisi/api.py:358 -msgid "Repo %s removed from system." -msgstr "%s isimli depo sistemden çıkarıldı." - -#: pisi/api.py:360 -msgid "Repository %s does not exist. Cannot remove." -msgstr "%s deposu yok. Kaldırılamıyor." - -#: pisi/api.py:367 -msgid "* Updating repository: %s" -msgstr "* %s deposu güncelleniyor" - -#: pisi/api.py:374 -msgid "No updates available for repository %s." -msgstr "%s deposu için güncelleme yok." - -#: pisi/api.py:376 -msgid "Updating database at any rate as requested" -msgstr "Veritabanı istek üzerine güncelleniyor" - -#: pisi/api.py:387 -msgid "* Package database updated." -msgstr "* Paket veritabanı güncellendi." - -#: pisi/api.py:389 pisi/api.py:415 -msgid "No repository named %s found." -msgstr "%s adında bir depo bulunamadı." - -#: pisi/api.py:397 -msgid "* Rebuilding '%s' named repo... " -msgstr "* '%s' isimli depo yeniden inşa ediliyor... " - -#: pisi/api.py:410 -msgid "Input/Output error while reading %s: %s" -msgstr "%s okunurken girdi/çıktı hatası: %s" - -#: pisi/api.py:413 pisi/atomicoperations.py:548 -msgid "OK." -msgstr "Tamam." - -#: pisi/archive.py:36 -msgid "" -"An error has occured while running LZMA:\n" -"%s" -msgstr "" -"LZMA çalıştırılırken bir hata oluştu:\n" -"%s" - -#: pisi/archive.py:100 pisi/archive.py:142 -msgid "Archive type not recognized" -msgstr "Arşiv tipi tanınmadı" - -#: pisi/atomicoperations.py:67 -msgid "Package %s found in repository %s" -msgstr "Paket %s, %s deposunda bulundu" - -#: pisi/atomicoperations.py:79 -msgid "Package URI: %s" -msgstr "Paket adresi: %s" - -#: pisi/atomicoperations.py:83 -msgid "Package %s not found in any active repository." -msgstr "%s isimli paket hiç bir etkin depoda bulunamadı." - -#: pisi/atomicoperations.py:100 -msgid "Installing %s, version %s, release %s, build %s" -msgstr "%s paketi, versiyon %s, sürüm %s, inşa %s kuruluyor" - -#: pisi/atomicoperations.py:142 -msgid "Package conflicts %s" -msgstr "Paket %s ile çatışmakta" - -#: pisi/atomicoperations.py:147 -msgid "Dependencies for %s not satisfied" -msgstr "%s paketi için bağımlılıklar sağlanmadı" - -#: pisi/atomicoperations.py:149 -msgid "Package not installable" -msgstr "Paket kurulabilir durumda değil" - -#: pisi/atomicoperations.py:167 -msgid "%s from %s package" -msgstr "" - -#: pisi/atomicoperations.py:168 -msgid "" -"File conflicts:\n" -"%s" -msgstr "" -"Dosya çakışmaları:\n" -"%s" - -#: pisi/atomicoperations.py:203 -msgid "Re-install same version package?" -msgstr "Aynı versiyona sahip paketi yeniden yerleştireyim mi?" - -#: pisi/atomicoperations.py:204 -msgid "Package re-install declined" -msgstr "Paketi yeniden yerleştirmeye izin verilmedi" - -#: pisi/atomicoperations.py:210 -msgid "Upgrading to new upstream version" -msgstr "Yeni orijinal versiyona yükseltiliyor" - -#: pisi/atomicoperations.py:213 -msgid "Upgrading to new distribution release" -msgstr "Yeni dağıtım sürümüne yukseltiliyor" - -#: pisi/atomicoperations.py:217 -msgid "Upgrading to new distribution build" -msgstr "Yeni dağıtım inşasına yukseltiliyor" - -#: pisi/atomicoperations.py:227 -msgid "Downgrade to old distribution release?" -msgstr "Eski dağıtım sürümüne dönülsün mü?" - -#: pisi/atomicoperations.py:229 -msgid "Downgrade to old distribution build?" -msgstr "Eski dağıtım inşasına dönülsün mü?" - -#: pisi/atomicoperations.py:231 -msgid "Package downgrade declined" -msgstr "Paket eskileştirilmesine izin verilmedi" - -#: pisi/atomicoperations.py:323 -msgid "Storing %s, " -msgstr "%s saklanıyor, " - -#: pisi/atomicoperations.py:326 -msgid "Storing %s." -msgstr "%s saklanıyor." - -#: pisi/atomicoperations.py:333 -msgid "Storing %s" -msgstr "%s saklanıyor" - -#: pisi/atomicoperations.py:389 -msgid "File list could not be read for package %s, continuing removal." -msgstr "" -"%s paketi için dosya listesi okunamadı, kaldırma işlemine devam ediliyor. " - -#: pisi/atomicoperations.py:395 -msgid "Removing package %s" -msgstr "%s paketi kaldırılıyor" - -#: pisi/atomicoperations.py:398 -msgid "Trying to remove nonexistent package " -msgstr "Varolmayan paket kaldırılmaya çalışıldı" - -#: pisi/atomicoperations.py:437 -msgid "Not removing conflicted file : %s" -msgstr "Çakışan dosya silinmiyor : %s" - -#: pisi/atomicoperations.py:457 -msgid "Not removing non-file, non-link %s" -msgstr "Dosya ya da bağ olmayan '%s' kaldırılmıyor" - -#: pisi/atomicoperations.py:518 -msgid "Metadata XML '%s' cannot be found" -msgstr "'%s' isimli metadata XML bulunamıyor" - -#: pisi/atomicoperations.py:526 -msgid "MetaData format wrong (%s)" -msgstr "MetaData biçimi yanlış (%s)" - -#: pisi/atomicoperations.py:528 -msgid "* Adding '%s' to db... " -msgstr "* '%s' veritabanına ekleniyor... " - -#: pisi/atomicoperations.py:534 -msgid "Files XML '%s' cannot be found" -msgstr "Files XML '%s' bulunamıyor" - -#: pisi/atomicoperations.py:539 pisi/package.py:157 -msgid "Invalid %s" -msgstr "Geçersiz %s" - -#: pisi/build.py:89 -msgid "Path %s belongs in multiple packages" -msgstr "Yol %s birden çok pakete ait" - -#: pisi/build.py:115 -msgid "Source URI: %s" -msgstr "Kaynak adresi: %s" - -#: pisi/build.py:119 -msgid "Source %s not found in any active repository." -msgstr "%s isimli kaynak paket hiç bir etkin depoda bulunamadı." - -#: pisi/build.py:185 -msgid "Building PISI source package: %s" -msgstr "PİSİ kaynak paketi %s inşa ediliyor" - -#: pisi/build.py:230 -msgid "IceCream detected. Make sure your daemon is up and running..." -msgstr "" -"IceCream bulundu. Lütfen artalan sürecinizin çalıştığından emin olunuz." - -#: pisi/build.py:235 -msgid "CCache detected..." -msgstr "Derleme zamanını kısaltan ccache bulundu..." - -#: pisi/build.py:288 -msgid "PartOf tag not defined, looking for component" -msgstr "PartOf imi tanımlanmamış, bileşen araştırılyor" - -#: pisi/build.py:298 -msgid "Cannot find component.xml in upper directory" -msgstr "component.xml üst dizinde bulunamıyor" - -#: pisi/build.py:302 -msgid "Source is part of %s component" -msgstr "Kaynak %s bileşeninin parçası" - -#: pisi/build.py:307 -msgid "Fetching source from: %s" -msgstr "Kaynak %s adresinden indiriliyor" - -#: pisi/build.py:309 -msgid "Source archive is stored: %s/%s" -msgstr "Kaynak arşivi saklandı: %s/%s" - -#: pisi/build.py:313 -msgid "Unpacking archive..." -msgstr "Arşiv açılıyor..." - -#: pisi/build.py:315 -msgid " unpacked (%s)" -msgstr " açıldı (%s)" - -#: pisi/build.py:320 -msgid "Setting up source..." -msgstr "Kaynak yapılandırılıyor" - -#: pisi/build.py:325 -msgid "Building source..." -msgstr "Kaynak inşa ediliyor..." - -#: pisi/build.py:330 -msgid "Installing..." -msgstr "Kuruluyor..." - -#: pisi/build.py:373 -msgid "Unable to read Action Script (%s): %s" -msgstr "Action betiği okunamıyor (%s): %s" - -#: pisi/build.py:375 -msgid "SyntaxError in Action Script (%s): %s" -msgstr "Action betiğinde sözdizimi hatası (%s): %s" - -#: pisi/build.py:405 -msgid "unable to call function from actions: %s" -msgstr "fonksiyon eylemlerden çağırılamıyor: %s" - -#: pisi/build.py:421 -msgid "" -"Safety switch: following extra packages in system.devel will be installed: " -msgstr "" -"Emniyet mandalı: taban geliştirme sistemi system.devel içindeki bu paketler " -"ek olarak kurulacak:" - -#: pisi/build.py:426 -msgid "Safety switch: system.devel is already installed" -msgstr "" -"Emniyet mandalı: taban geliştirme sistemi system.devel halihazırda kurulu" - -#: pisi/build.py:428 -msgid "Safety switch: the component system.devel cannot be found" -msgstr "Emniyet mandalı: geliştirme sistemi bileşeni system.devel bulunamadı" - -#: pisi/build.py:437 -msgid "Unsatisfied Build Dependencies:" -msgstr "Sağlanmamış inşa bağımlılıkları" - -#: pisi/build.py:441 -msgid "Cannot build package due to unsatisfied build dependencies" -msgstr "Sağlanmamış inşa bağımlılıkları yüzünden paket inşa edilemiyor" - -#: pisi/build.py:449 -msgid "Build dependency %s cannot be satisfied" -msgstr "İnşa bağımlılığı %s sağlanamadı" - -#: pisi/build.py:451 -msgid "Do you want to install the unsatisfied build dependencies" -msgstr "Sağlanmamış inşa bağımlılıklarını kurmak istiyor musunuz? " - -#: pisi/build.py:452 -msgid "Installing build dependencies." -msgstr "İnşa bağımlılıkları kuruluyor. " - -#: pisi/build.py:457 -msgid "Ignoring build dependencies." -msgstr "İnşa bağımlılıkları yoksayılıyor." - -#: pisi/build.py:467 -msgid "Patch file is missing: %s\n" -msgstr "Yama dosyası eksik: %s\n" - -#: pisi/build.py:480 -msgid "* Applying patch: %s" -msgstr "* Yama uygulanıyor: %s" - -#: pisi/build.py:538 -msgid "Stripping files.." -msgstr "Semboller çıkarılıyor.." - -#: pisi/build.py:635 -msgid "(found old version %s)" -msgstr "(%s numaralı eski versiyon bulundu)" - -#: pisi/build.py:637 -msgid "Skipping %s with wrong pkg name " -msgstr "Yanlış paket adına sahip %s atlanıyor" - -#: pisi/build.py:658 -msgid "(no previous build found, setting build no to 1.)" -msgstr "(önceki bir inşa bulunamadı, inşa numarası 1 yapılıyor)" - -#: pisi/build.py:699 -msgid "(old package lacks a build no, setting build no to 1.)" -msgstr "(önceki paketin bir inşa numarası yok, inşa numarası 1 yapılıyor)" - -#: pisi/build.py:702 -msgid "There are changes, incrementing build no to %d" -msgstr "Değişiklikler var, inşa numarası bir arttırılarak %d yapıldı." - -#: pisi/build.py:705 -msgid "There is no change from previous build %d" -msgstr "Bir önceki %d numaralı inşadan beri bir değişiklik yok." - -#: pisi/build.py:745 -msgid "** Building package %s" -msgstr "** Paket %s inşa ediliyor" - -# pisi/build.py:503 :506 -#: pisi/build.py:747 pisi/build.py:758 -msgid "Generating %s," -msgstr "%s yaratılıyor," - -#: pisi/build.py:754 -msgid "" -"Build number is not available. For repo builds you must enable buildno in " -"pisi.conf." -msgstr "" -"İnşa (build) sayısı koyulmayacak. Depo inşaları için buildno seçeneğini pisi." -"conf dosyasında etkinleştirmelisiniz." - -#: pisi/build.py:779 -msgid "Creating PISI package %s." -msgstr "%s adlı PİSİ paketi yaratılıyor." - -#: pisi/build.py:824 -msgid "Done." -msgstr "Bitti." - -#: pisi/build.py:830 -msgid "Abandoned files under the install dir (%s):" -msgstr "kurulum dizini (%s) altındaki terkedilmiş dosyalar:" - -#: pisi/build.py:834 -msgid "" -"All of the files under the install dir (%s) has been collected by package(s)" -msgstr "" -"Kurulum dizini (%s) altındaki bütün dosyalar paket(ler) tarafından " -"toplanmıştır" - -#: pisi/build.py:838 -msgid "Cleaning Build Directory..." -msgstr "İnşa dizini siliniyor..." - -#: pisi/build.py:841 -msgid "Keeping Build Directory" -msgstr "İnşa dizini bırakılıyor" - -#: pisi/cli/__init__.py:79 -msgid "Warning: " -msgstr "Uyarı: " - -#: pisi/cli/__init__.py:88 -msgid "Error: " -msgstr "Hata: " - -#: pisi/cli/__init__.py:120 -msgid " (yes/no)" -msgstr " (evet/hayır)" - -#: pisi/cli/__init__.py:134 -msgid " [complete]\n" -msgstr " [bitti]\n" - -#: pisi/cli/__init__.py:144 -msgid "Installed %s" -msgstr "%s paketi kuruldu" - -#: pisi/cli/__init__.py:146 -msgid "Removed %s" -msgstr "%s paketi kaldırıldı" - -#: pisi/cli/__init__.py:148 -msgid "Upgraded %s" -msgstr "%s paketi yükseltildi" - -# pisi/actionsapi/autotools.py:75 :85 -#: pisi/cli/__init__.py:150 -msgid "Configured %s" -msgstr "%s paketi yapılandırıldı" - -#: pisi/cli/__init__.py:152 -msgid "Extracting the files of %s" -msgstr "%s paketinin dosyaları arşivden çıkartılıyor" - -#: pisi/cli/commands.py:34 -msgid "generic help string for any command" -msgstr "herhangi bir komut yardımı için yer tutucu" - -#: pisi/cli/commands.py:63 pisi/cli/pisicli.py:104 -msgid "Unrecognized command: %s" -msgstr "Tanınmayan komut: %s" - -#: pisi/cli/commands.py:84 -msgid "common options" -msgstr "ortak seçenekler" - -#: pisi/cli/commands.py:87 -msgid "change the system root for pisi commands" -msgstr "pisi komutları için sistem kök dizinini değiştir" - -#: pisi/cli/commands.py:89 -msgid "assume yes in all yes/no queries" -msgstr "bütün evet/hayır sorularında evet varsay" - -#: pisi/cli/commands.py:94 -msgid "detailed output" -msgstr "detaylı çıktı" - -#: pisi/cli/commands.py:96 -msgid "show debugging information" -msgstr "hata ayıklama bilgisini göster" - -#: pisi/cli/commands.py:98 -msgid "print like a man" -msgstr "renkli yazma" - -#: pisi/cli/commands.py:102 -msgid "" -"This is a fall back function. If the implementer module provides an\n" -" options function it will be called" -msgstr "" - -#: pisi/cli/commands.py:114 -msgid "Destination directory %s does not exist. Creating directory.\n" -msgstr "%s isimli hedef dizini bulunamadı. Dizin yaratılıyor.\n" - -#: pisi/cli/commands.py:136 -msgid "Password: " -msgstr "Parola: " - -#: pisi/cli/commands.py:142 -msgid "initialize PiSi components" -msgstr "PiSi bileşenlerini hazırla" - -#: pisi/cli/commands.py:150 -msgid "do cleanup work for PiSi components" -msgstr "" - -#: pisi/cli/commands.py:164 -msgid "print help for the command" -msgstr "komut için yardım yaz" - -#: pisi/cli/commands.py:171 -msgid "exit program" -msgstr "programdan çık" - -#: pisi/cli/commands.py:173 -msgid "Command terminated abnormally." -msgstr "Komut anormal biçimde sonlandı." - -#: pisi/cli/commands.py:183 -msgid "Command lacks name" -msgstr "Komut adı eksik" - -#: pisi/cli/commands.py:187 -msgid "Duplicate command %s" -msgstr "Aynı adlı komut: %s" - -#: pisi/cli/commands.py:196 -msgid "" -"Prints help for given commands\n" -"\n" -"Usage: help [ ... ]\n" -"\n" -"If run without parameters, it prints the general help." -msgstr "" -"Verilen komutlar için yardım metnini gösterir\n" -"\n" -"Kullanım: help [ ... ]\n" -"\n" -"Eğer parametre verilmezse genel yardımı yazar." - -#: pisi/cli/commands.py:230 -msgid "" -"Clean stale locks\n" -"\n" -"Usage: clean\n" -"\n" -"PISI uses filesystem locks for managing database access.\n" -"This command deletes unused locks from the database directory." -msgstr "" -"Bayat kilitleri temizler\n" -"\n" -"Kullanım: clean\n" -"\n" -"PİSİ veritabanı erişimini yönetmek için dosyasistemi kilitlerini kullanır.\n" -"Bu komut veritabanı dizinindeki kullanılmayan kilitleri siler." - -#: pisi/cli/commands.py:251 -msgid "" -"Delete cache files\n" -" \n" -"Usage: delete-cache\n" -"\n" -"Sources, packages and temporary files are stored\n" -"under /var directory. Since these accumulate they can \n" -"consume a lot of disk space." -msgstr "" -"Cep dosyalarını sil\n" -"\n" -"Kullanım: delete-cache\n" -"\n" -"Kaynaklar, paketler ve geçici dosyalar /var dizini altında \n" -"saklanır. Bunlar biriktiğinden çok disk alanı kaplayabilirler." - -#: pisi/cli/commands.py:272 -msgid "" -"Graph package relations\n" -"\n" -"Usage: graph [ ...]\n" -"\n" -"Write a graph of package relations, tracking dependency and\n" -"conflicts relations starting from given packages. By default\n" -"shows the package relations among repository packages, and writes\n" -"the package in graphviz format to 'pgraph.dot'.\n" -msgstr "" -"Paket ilişkilerini çiz\n" -"Kullanım: graph ...\n" -"\n" -"Paket ilişkilerinin bir çizgesini, bağımlılık ve çatışma\n" -"ilişkilerini verilen paketlerden takip ederek yaz.\n" -"Öntanımlı olarak depo paketlerdeki paket ilişkilerini gösterir\n" -"ve paketi graphviz biçiminde 'pgraph.dot' dosyasına yazar.\n" - -#: pisi/cli/commands.py:290 -msgid "specify a particular repository" -msgstr "bir depoyu belirt" - -#: pisi/cli/commands.py:293 -msgid "graph of installed packages" -msgstr "kurulu paketlerin çizgesi" - -#: pisi/cli/commands.py:296 -msgid "do not show installed packages" -msgstr "kurulu paketleri gösterme" - -#: pisi/cli/commands.py:299 -msgid "dot output file" -msgstr "dot çıktı dosyası" - -#: pisi/cli/commands.py:308 -msgid "Plotting packages in repository %s" -msgstr "%s deposundaki paketler çiziliyor" - -#: pisi/cli/commands.py:314 -msgid "Plotting a graph of relations among all repository packages" -msgstr "Depolardaki bütün paketlerin arasındaki ilişkiler çiziliyor" - -#: pisi/cli/commands.py:321 -msgid "Plotting a graph of relations among all installed packages" -msgstr "Bütün kurulu paketler arasındaki ilişkiler çiziliyor" - -#: pisi/cli/commands.py:334 -msgid "do not take build no into account." -msgstr "inşa numarasını dikkate alma" - -#: pisi/cli/commands.py:339 -msgid "show abandoned files under the install directory after build." -msgstr "inşa sonrası kurulum dizini altındaki terkedilmiş dosyaları göster" - -#: pisi/cli/commands.py:345 -msgid "do not take dependency information into account" -msgstr "bağımlılık bilgilerini dikkate alma" - -#: pisi/cli/commands.py:349 -msgid "" -"Build PISI packages\n" -"\n" -"Usage: build [ | ] ...\n" -"\n" -"You can give a URI of the pspec.xml file. PISI will\n" -"fetch all necessary files and build the package for you.\n" -"\n" -"Alternatively, you can give the name of a source package\n" -"to be downloaded from a repository containing sources.\n" -"\n" -"If you would like to run the build process partially, \n" -"provide the --until option where is one of \n" -"unpack, setup, build, install, package.\n" -msgstr "" -"PİSİ paketlerini inşa et\n" -"\n" -"Kullanım: build [ | ] ...\n" -"\n" -"pspec.xml dosyasının URI'ını verebilirsiniz. PİSİ \n" -"gerekli tüm dosyaları sizin için indirip paketleri\n" -"inşa edecektir.\n" -"Yahut, kaynaklar içeren bir depodan indirilmesi için \n" -"kayna paketinin adını verebilirsiniz. \n" -"\n" -"Eğer inşa sürecini kısmi olarak çalıştırmak isterseniz\n" -"--until seçeneğini kullanınız, ki burada \n" -"unpack, setup, build, install, package 'den birisi olabilir.\n" - -#: pisi/cli/commands.py:379 -msgid "output directory for produced packages" -msgstr "üretilecek paketler için çıktı dizini" - -#: pisi/cli/commands.py:383 -msgid "perform until and including specified step" -msgstr "verilen adıma kadar ve adım dahil çalıştır" - -#: pisi/cli/commands.py:386 -msgid "bypass errors from ActionsAPI" -msgstr "ActionsAPI kaynaklı hataları esgeç" - -#: pisi/cli/commands.py:388 pisi/cli/commands.py:482 -msgid "bypass safety switch" -msgstr "emniyet mandalını esgeç" - -#: pisi/cli/commands.py:390 pisi/cli/commands.py:480 -msgid "bypass comar configuration agent" -msgstr "çomar yapılandırma aygıtını kullanma" - -#: pisi/cli/commands.py:392 -msgid "create a static package with ar files" -msgstr "ar dosyaları içeren bir statik paket yarat" - -#: pisi/cli/commands.py:394 -msgid "don't create a debug package with debug files" -msgstr "hata ayıklama dosyaları içeren bir debug paketi yaratma" - -#: pisi/cli/commands.py:396 -msgid "don't install build dependencies, fail if a build dependency is present" -msgstr "" -"inşa bağımlılıklarını kurma, eğer bir inşa bağımlılığı yoksa hatayla çık" - -#: pisi/cli/commands.py:398 -msgid "pisi package format" -msgstr "pisi paketi biçimi" - -#: pisi/cli/commands.py:409 -msgid "Step must be one of %s " -msgstr "Adım bunlardan birisi olmalı: %s" - -#: pisi/cli/commands.py:417 -msgid "package_format must be one of %s " -msgstr "package_format, bunlardan birisi olmalı: %s" - -#: pisi/cli/commands.py:420 pisi/cli/commands.py:461 -msgid "Output directory: %s" -msgstr "Çıktı dizini: %s" - -#: pisi/cli/commands.py:422 -msgid "Outputting packages in the working directory." -msgstr "Paketler çalışma dizinine yazılıyor." - -#: pisi/cli/commands.py:434 -msgid "" -"Build and install PISI source packages from repository\n" -"\n" -"Usage: emerge ...\n" -"\n" -"You should give the name of a source package to be \n" -"downloaded from a repository containing sources.\n" -"\n" -"You can also give the name of a component.\n" -msgstr "" -"Depodan PİSİ paketlerini inşa et ve kur\n" -"\n" -"Kullanım: emerge ...\n" -"\n" -"Kaynaklar içeren bir depodan indirilmesi için \n" -"kaynak paketinin adını vermelisiniz. \n" -"\n" -"Bir bileşen adı da verebilirsiniz.\n" - -#: pisi/cli/commands.py:463 -msgid "Outputting binary packages in the package cache." -msgstr "İkili paketler paket cebine yazılıyor." - -#: pisi/cli/commands.py:471 -msgid "Abstract package operation command" -msgstr "" - -#: pisi/cli/commands.py:484 -msgid "do not perform any action, just show what would be done" -msgstr "hiç bir eylem gerçekleştirme, sadece ne yapılacağını göster" - -#: pisi/cli/commands.py:496 -msgid "" -"Install PISI packages\n" -"\n" -"Usage: install ... \n" -"\n" -"You may use filenames, URI's or package names for packages. If you have\n" -"specified a package name, it should exist in a specified repository.\n" -"\n" -"You can also specify components instead of package names, which will be\n" -"expanded to package names.\n" -msgstr "" -"PİSİ paketlerini kur\n" -"\n" -"Kullanım: install ... \n" -"\n" -"Paketler için dosya adları, URI'lar veya paket adları kullanabilirsiniz.\n" -"Eğer bir paket adı verdiyseniz, bu paket depoda bulunmalıdır.\n" -"\n" -"Paket adları yerine bileşenler de verebilirsiniz.\n" - -#: pisi/cli/commands.py:517 -msgid "Reinstall already installed packages" -msgstr "Halihazırda kurulu paketi yeniden kur" - -#: pisi/cli/commands.py:519 -msgid "Ignore file conflicts" -msgstr "Dosya çakışmalarına aldırma" - -#: pisi/cli/commands.py:533 -msgid "" -"Upgrade PISI packages\n" -"\n" -"Usage: Upgrade [ ... ]\n" -"\n" -": package name\n" -"\n" -"Upgrades the entire system if no package names are given\n" -"\n" -"You may use only package names to specify packages because\n" -"the package upgrade operation is defined only with respect \n" -"to repositories. If you have specified a package name, it\n" -"should exist in the package repositories. If you just want to\n" -"reinstall a package from a pisi file, use the install command.\n" -"\n" -"You can also specify components instead of package names, which will be\n" -"expanded to package names.\n" -msgstr "" -"PİSİ paketlerini yükselt\n" -"\n" -"Kullanım: Upgrade ... \n" -"\n" -"Paketleri belirtmek için şimdilik sadece paket adları kullanabilirsiniz\n" -"Verdiğiniz paket adları depolarda yer almalıdır. Eğer sadece\n" -"bir dosyayı yeniden kurmak istiyorsanız install komutunu kullanın. \n" -"Paket adları yerine bileşenler de verebilirsiniz.\n" - -#: pisi/cli/commands.py:563 -msgid "select only security upgrades" -msgstr "sadece güvenlik yükseltmelerini seç" - -#: pisi/cli/commands.py:565 -msgid "Do not update repositories" -msgstr "Depoları güncelleme" - -#: pisi/cli/commands.py:567 -msgid "eager upgrades" -msgstr "istekli yükseltmeler" - -#: pisi/cli/commands.py:573 -msgid "Updating repositories" -msgstr "Depolar güncelleniyor" - -#: pisi/cli/commands.py:578 -msgid "Will not update repositories" -msgstr "Depolar güncellenmeyecek" - -#: pisi/cli/commands.py:590 -msgid "" -"Remove PISI packages\n" -"\n" -"Usage: remove ... \n" -"\n" -"Remove package(s) from your system. Just give the package names to remove.\n" -"\n" -"You can also specify components instead of package names, which will be\n" -"expanded to package names.\n" -msgstr "" -"PİSİ paketlerini kaldır\n" -"\n" -"Kullanım: remove ... \n" -"\n" -"Paket(leri) sisteminizden kaldırır. Sadece kaldırılacak paketlerin adlarını " -"verin.\n" -"Paket adları yerine bileşenler de verebilirsiniz.\n" - -#: pisi/cli/commands.py:617 -msgid "" -"Configure pending packages\n" -"\n" -"If COMAR configuration of some packages were not\n" -"done at installation time, they are added to a list\n" -"of packages waiting to be configured. This command\n" -"configures those packages. \n" -msgstr "" -"Bekleyen paketleri yapılandır\n" -"\n" -"Eğer bazı paketlerin ÇOMAR yapılandırması kurulum zamanında\n" -"yapılmadıysa, yapılandırmayı bekleyen paketler listesine eklenirler.\n" -"Bu komut bekleyen paketleri yapılandırır.\n" - -#: pisi/cli/commands.py:640 -msgid "" -"Display package information\n" -"\n" -"Usage: info ... \n" -"\n" -" is either a package name or a .pisi file, \n" -msgstr "" -"Paket bilgisini göster\n" -"\n" -"Kullanım: info ... \n" -"\n" -" ya bir paket adıdır ya da bir .pisi dosyasıdır.\n" - -#: pisi/cli/commands.py:656 -msgid "show a list of package files." -msgstr "paketteki dosyaların bir listesini göster." - -#: pisi/cli/commands.py:659 -msgid "show only paths." -msgstr "sadece yolları göster" - -#: pisi/cli/commands.py:661 -msgid "do not show details" -msgstr "detayları gösterme" - -#: pisi/cli/commands.py:663 -msgid "output in xml format" -msgstr "xml biçiminde çıktı" - -#: pisi/cli/commands.py:703 -msgid "Package file: %s" -msgstr "Paket dosyası: %s" - -#: pisi/cli/commands.py:709 -msgid "[inst] " -msgstr "[yüklü]" - -#: pisi/cli/commands.py:711 -msgid "Installed package:" -msgstr "Yüklü paket:" - -#: pisi/cli/commands.py:717 -msgid "[repo] " -msgstr "[depo] " - -#: pisi/cli/commands.py:719 -msgid "Package found in repository:" -msgstr "Paket depoda bulundu:" - -#: pisi/cli/commands.py:733 -msgid "Reverse Dependencies:" -msgstr "Ters bağımlılıklar:" - -#: pisi/cli/commands.py:736 -msgid "" -"\n" -"Files:" -msgstr "" -"\n" -"Dosyalar:" - -#: pisi/cli/commands.py:744 -msgid "File information not available" -msgstr "Dosya bilgisi bulunamadı" - -#: pisi/cli/commands.py:750 -#, fuzzy -msgid "" -"Verify installation\n" -"\n" -"Usage: check [ ... ]\n" -"\n" -": package name\n" -"\n" -"A cryptographic checksum is stored for each installed\n" -"file. Check command uses the checksums to verify a package.\n" -"Just give the names of packages.\n" -"\n" -"If no packages are given, checks all installed packages.\n" -msgstr "" -"Kurulumu doğrula\n" -"\n" -"Kurulum: check ... \n" -"\n" -": paket adı \n" -"\n" -"Her kurulu dosya için bir kriptografik kontrol toplamı \n" -"tutulur. Check komutu paket doğrulama işlemi için \n" -"bu kontrol toplamlarını kullanır. \n" - -#: pisi/cli/commands.py:774 -msgid "Checking all installed packages" -msgstr "Tüm kurulu paketler denetleniyor" - -#: pisi/cli/commands.py:780 -msgid "Package %s is corrupt." -msgstr "Paket %s bozuk." - -#: pisi/cli/commands.py:782 -msgid "Package %s not installed" -msgstr "Paket %s kurulmamış" - -#: pisi/cli/commands.py:787 -msgid "" -"Index PISI files in a given directory\n" -"\n" -"Usage: index ...\n" -"\n" -"This command searches for all PISI files in a directory, collects PISI\n" -"tags from them and accumulates the information in an output XML file,\n" -"named by default 'pisi-index.xml'. In particular, it indexes both\n" -"source and binary packages.\n" -"\n" -"If you give multiple directories, the command still works, but puts\n" -"everything in a single index file.\n" -msgstr "" -"Verilen bir dizindeki PİSİ dosyalarını indeksle\n" -"\n" -"Kullanım: index \n" -"\n" -"Bu komut bir dizindeki bütün PİSİ dosyalarını araştırır, PİSİ\n" -"etiketlerini toplar ve bilgiyi çıktı, varsayılan adı 'pisi-index.xml',olan " -"XML dosyasında birleştirir. Özellikle, hem ikili hem kaynak\n" -"paketlerini indeksler.\n" -"\n" -"Eğer birden çok dizin verirseniz, komut hala çalışır, ama herşeyi\n" -"tek bir indeks dosyasına koyar.\n" - -#: pisi/cli/commands.py:809 -msgid "store absolute links for indexed files." -msgstr "indekslenmiş dosyalar için mutlak bağlar sakla." - -#: pisi/cli/commands.py:812 -msgid "index output file" -msgstr "indeks çıktı dosyası" - -#: pisi/cli/commands.py:815 -msgid "do not index pisi spec files." -msgstr "pisi spec dosyalarını indeksleme." - -#: pisi/cli/commands.py:818 -msgid "do not sign index." -msgstr "indeksi imzalama." - -#: pisi/cli/commands.py:821 -msgid "do not recurse into directories." -msgstr "dizinlerin içine girme." - -#: pisi/cli/commands.py:833 -msgid "Indexing current directory." -msgstr "Şu andaki dizini indeksliyor." - -#: pisi/cli/commands.py:842 -msgid "" -"Print the list of all installed packages \n" -"\n" -"Usage: list-installed\n" -msgstr "" -"Kurulu paketlerin bir listesini yaz \n" -"\n" -"Kullanım: list-installed\n" - -#: pisi/cli/commands.py:856 pisi/cli/commands.py:1059 -#: pisi/cli/commands.py:1117 pisi/cli/commands.py:1154 -#: pisi/cli/commands.py:1191 pisi/cli/commands.py:1304 -msgid "show in long format" -msgstr "uzun biçimde göster" - -#: pisi/cli/commands.py:858 pisi/cli/commands.py:1193 -msgid "show detailed install info" -msgstr "detaylı kurulum bilgisi göster" - -# pisi/cli/commands.py:542 :729 -#: pisi/cli/commands.py:865 pisi/cli/commands.py:1203 -msgid "" -"Package Name |St| Version| Rel.| Build| Distro| Date" -msgstr "" -"Paket Adı |Dm| Versiyon| Sürüm| İnşa| Dağıt.| Tarih" - -#: pisi/cli/commands.py:881 -msgid "" -"Rebuild Databases\n" -"\n" -"Usage: rebuilddb [ ... ]\n" -"\n" -"Rebuilds the PISI databases\n" -"\n" -"If package specs are given, they should be the names of package \n" -"dirs under /var/lib/pisi\n" -msgstr "" -"Veritabanlarını yeniden inşa et\n" -"\n" -"Kullanım: rebuilddb [ ... ]\n" -"\n" -"PİSİ veritabanlarını yeniden inşa eder\n" -"\n" -"Eğer paket tanımları verildiyse /var/lib/pisi altındaki paket dizinlerinin " -"adları olmalılar\n" - -#: pisi/cli/commands.py:899 -msgid "rebuild files database" -msgstr "dosya veritabanını yeniden inşa et" - -#: pisi/cli/commands.py:908 -msgid "Rebuild PISI databases?" -msgstr "PİSİ veritabanı yeniden inşa edilsin mi?" - -#: pisi/cli/commands.py:915 -msgid "" -"Update repository databases\n" -"\n" -"Usage: update-repo [ ... ]\n" -"\n" -": repository name\n" -"\n" -"Synchronizes the PISI databases with the current repository.\n" -"If no repository is given, all repositories are updated.\n" -msgstr "" -"Depo veritabanlarını güncelle\n" -"\n" -"Kullanım: update-repo [ ... ]\n" -"\n" -": depo adı\n" -"\n" -"PİSİ veritabanlarını depo ile eşzamanlı hale getirir.\n" -" Eğer bir depo verilmediyse, bütün depolar güncellenir.\n" - -#: pisi/cli/commands.py:934 -msgid "update database in any case" -msgstr "veritabanını her halde güncelle" - -#: pisi/cli/commands.py:950 -msgid "" -"Add a repository\n" -"\n" -"Usage: add-repo \n" -"\n" -": name of repository to add\n" -": URI of index file\n" -"\n" -"If no repo is given, add-repo pardus-devel repo is added by default\n" -"\n" -"NB: We support only local files (e.g., /a/b/c) and http:// URIs at the " -"moment\n" -msgstr "" -"Bir depo ekle\n" -"\n" -"Kullanım: add-repo \n" -"\n" -": eklenecek deponun adı\n" -": indeks dosyasının URI'ı\n" -"\n" -"Eğer depo verilmezse pardus-devel deposu öntanımlı olarak eklenir. Not: \n" -"Şimdilik sadece yerel dosyalar (örn. /a/b/c) ve http:// veya ftp:// türü \n" -"adresler desteklenir\n" - -#: pisi/cli/commands.py:971 -msgid "add repository at given position (0 is first)" -msgstr "" - -#: pisi/cli/commands.py:984 -msgid "Update PISI database for repository %s?" -msgstr "%s isimli depo için PİSİ veritabanı güncellensin mi?" - -#: pisi/cli/commands.py:993 -msgid "" -"Remove repositories\n" -"\n" -"Usage: remove-repo ... \n" -"\n" -"Remove all repository information from the system.\n" -msgstr "" -"Depoları kaldır\n" -"\n" -"Kullanım: remove-repo ... \n" -"\n" -"Sistemden ilgili bütün depo bilgisini kaldır.\n" - -#: pisi/cli/commands.py:1019 -msgid "" -"List repositories\n" -"\n" -"Usage: list-repo\n" -"\n" -"Lists currently tracked repositories.\n" -msgstr "" -"Depoları listele\n" -"\n" -"Kullanım: list-repo\n" -"\n" -"Şu anda izlenen bütün depoları gösterir.\n" - -#: pisi/cli/commands.py:1042 -msgid "" -"List available packages in the repositories\n" -"\n" -"Usage: list-available [ ... repon ]\n" -"\n" -"Gives a brief list of PISI packages published in the specified\n" -"repositories. If no repository is specified, we list packages in\n" -"all repositories. \n" -msgstr "" -"Depolardaki paketleri göster\n" -"\n" -"Kullanım: list-available [ ... depon ]\n" -"\n" -"Depoda yayımlanmış olan PİSİ bileşenlerinin kısa bir listesini verir.\n" -"Eğer bir depo verilmediyse, bütün depolardaki paketleri listeler.\n" - -#: pisi/cli/commands.py:1061 -msgid "show uninstalled packages only" -msgstr "sadece kurulu olmayan paketleri göster" - -#: pisi/cli/commands.py:1068 -msgid "Installed packages are shown in this color" -msgstr "Kurulu paketler bu renkle gösterilir" - -#: pisi/cli/commands.py:1076 -msgid "Repository : %s\n" -msgstr "Depo: %s\n" - -#: pisi/cli/commands.py:1101 -msgid "" -"List available components\n" -"\n" -"Usage: list-components\n" -"\n" -"Gives a brief list of PISI components published in the \n" -"repositories.\n" -msgstr "" -"Depolardaki bileşenleri göster\n" -"\n" -"Kullanım: list-components [ ... depon ]\n" -"\n" -"Depoda yayımlanmış olan PİSİ bileşenlerinin kısa bir listesini verir.\n" - -#: pisi/cli/commands.py:1139 -msgid "" -"List available sources\n" -"\n" -"Usage: list-sources\n" -"\n" -"Gives a brief list of sources published in the repositories.\n" -msgstr "" -"Kullanılabilir kaynakları gösterir\n" -"\n" -"Kullanım: list-sources\n" -"\n" -"Depolarda bulunan kaynakların kısa bir listesini verir.\n" - -#: pisi/cli/commands.py:1176 -msgid "" -"List packages to be upgraded\n" -"\n" -"Usage: list-upgrades\n" -"\n" -"Lists the packages that will be upgraded.\n" -msgstr "" -"Yükseltilecek paketleri listele\n" -"\n" -"Kullanım: list-upgrades [ ... depon ]\n" - -#: pisi/cli/commands.py:1200 pisi/operations.py:414 -msgid "No packages to upgrade." -msgstr "Yükseltilecek paket yok." - -#: pisi/cli/commands.py:1219 -msgid "" -"List pending packages\n" -" \n" -"Lists packages waiting to be configured.\n" -msgstr "" -"Bekleyen paketleri göster\n" -"\n" -"Yapılandırmayı bekleyen paketlerin bir listesini verir.\n" - -#: pisi/cli/commands.py:1241 -msgid "" -"Search packages\n" -"\n" -"Usage: search ... \n" -"\n" -"Finds a package containing specified search terms\n" -"in summary, description, and package name fields.\n" -msgstr "" -"Paketleri araştır\n" -"\n" -"Kullanım: search ... \n" -"\n" -"Belirtilen arama terimlerini özet, tanım ve paket adı \n" -"alanlarında içeren paketleri bulur.\n" - -#: pisi/cli/commands.py:1258 -msgid "set search language" -msgstr "arama dilini seç" - -#: pisi/cli/commands.py:1261 -msgid "show details" -msgstr "detayları göster" - -#: pisi/cli/commands.py:1280 -msgid "%s packages found" -msgstr "%s paket bulundu" - -#: pisi/cli/commands.py:1289 -msgid "" -"Search for a file\n" -"\n" -"Usage: search-file ... \n" -"\n" -"Finds the installed package which contains the specified file.\n" -msgstr "" -"Dosya araştır\n" -"\n" -"Kullanım: search-file ... \n" -"\n" -"Belirtilen dosyayı içeren paketi bulur.\n" - -#: pisi/cli/commands.py:1306 -msgid "fuzzy search" -msgstr "yaklaşık arama" - -#: pisi/cli/commands.py:1323 -msgid "Package %s has file %s" -msgstr "%s paketi içinde %s dosyası var" - -#: pisi/cli/commands.py:1325 -msgid "Type: %s, Hash: %s" -msgstr "Tip: %s, Hash: %s" - -#: pisi/cli/commands.py:1328 -msgid "Path '%s' does not belong to an installed package" -msgstr "Yol '%s' yerleştirilmiş bir pakete ait değil" - -#: pisi/cli/commands.py:1340 -msgid "Searching for %s" -msgstr "%s'i arıyor" - -#: pisi/cli/commands.py:1350 -msgid "" -"%prog [options] [arguments]\n" -"\n" -"where is one of:\n" -"\n" -msgstr "" -"%prog [seçenekler] [argümanlar]\n" -"\n" -" aşağıdakilerden birisi olabilir:\n" -"\n" - -#: pisi/cli/commands.py:1356 -msgid "" -"\n" -"Use \"%prog help \" for help on a specific command.\n" -msgstr "" -"\n" -"Belirli bir komut hakkında yardım için \"%prog help \"'u kullanınız.\n" - -#: pisi/cli/pisicli.py:56 -msgid "Options must precede non-option arguments" -msgstr "Seçenekler seçenek olmayan argümanlardan önce gelmeli" - -#: pisi/cli/pisicli.py:97 -msgid "No command given" -msgstr "Komut verilmedi" - -#: pisi/cli/pisicli.py:100 -msgid "Command line parsing error" -msgstr "Komut satırı ayrıştırma hatası" - -#: pisi/comariface.py:36 -msgid "comar package is not fully installed" -msgstr "comar paketi tam olarak kurulmamış" - -#: pisi/comariface.py:38 -msgid "cannot connect to comar" -msgstr "comar'a bağlanılamıyor" - -#: pisi/comariface.py:66 -msgid "Could not restart comar" -msgstr "Çomar yeniden başlatılamadı" - -#: pisi/comariface.py:69 -msgid "connection with comar unexpectedly closed" -msgstr "comar ile bağlantı beklenmedik bir şekilde koptu" - -# pisi/actionsapi/autotools.py:75 :85 -#: pisi/comariface.py:82 -msgid "Configuration error: %s" -msgstr "Yapılandırma hatası: %s" - -#: pisi/comariface.py:85 -msgid "Script error: %s" -msgstr "Betik hatası: %s" - -#: pisi/comariface.py:88 -msgid "comar denied our access" -msgstr "comar bize izin vermedi" - -#: pisi/comariface.py:91 -msgid "Configuring package" -msgstr "Paket yapılandırılıyor" - -#: pisi/comariface.py:96 -msgid "Registering %s comar script" -msgstr "comar betiği %s kayıt ediliyor" - -#: pisi/comariface.py:102 -msgid "Calling post install handlers" -msgstr "Yerleştirme sonrası betikleri çağrılıyor" - -#: pisi/comariface.py:107 -msgid "Running package's post install script" -msgstr "Paketin yerleştirme sonrası betiği çağrılıyor" - -#: pisi/comariface.py:112 -msgid "Configuring package for removal" -msgstr "Paket kaldırılmak üzere yapılandırılıyor" - -#: pisi/comariface.py:115 -msgid "Running package's pre remove script" -msgstr "Paketin kaldırma öncesi betiği çağrılıyor" - -#: pisi/comariface.py:119 -msgid "Calling pre remove handlers" -msgstr "Kaldırma öncesi betikleri çağrılıyor" - -#: pisi/comariface.py:123 -msgid "Unregistering comar scripts" -msgstr "comar betikleri siliniyor" - -#: pisi/component.py:116 pisi/component.py:123 -msgid "Component %s not found" -msgstr "%s bileşeni bulunamadı" - -#: pisi/component.py:168 pisi/component.py:193 -msgid "Information for component %s not available" -msgstr "Bileşen %s için bilgi bulunamadı" - -#: pisi/config.py:60 -msgid "Destination directory %s does not exist. Creating it." -msgstr "Hedef dizini %s bulunamadı. Yaratılıyor." - -#: pisi/configfile.py:107 -msgid "No section by name '%s'" -msgstr "'%s' diye bir bölüm yok." - -#: pisi/constants.py:32 -msgid "Can't rebind constant: %s" -msgstr "Sabit %s değiştirilemez" - -#: pisi/constants.py:38 -msgid "Can't unbind constant: %s" -msgstr "Sabit %s kaldırılamaz" - -#: pisi/dependency.py:42 -msgid " version >= " -msgstr " versiyon >= " - -#: pisi/dependency.py:44 -msgid " version <= " -msgstr " versiyon <= " - -#: pisi/dependency.py:46 -msgid " release >= " -msgstr " sürüm >= " - -#: pisi/dependency.py:48 -msgid " release <= " -msgstr " sürüm <= " - -#: pisi/dependency.py:105 -msgid "Package %s does not satisfy dependency %s" -msgstr "Paket %s %s bağımlılığını sağlamıyor." - -#: pisi/dependency.py:118 -msgid "Package %s is not present in the package database" -msgstr "Paket %s paket veritabanında bulunmamakta." - -#: pisi/fetcher.py:84 -msgid "Filename error" -msgstr "Dosya adı hatası" - -#: pisi/fetcher.py:87 -msgid "Access denied to write to destination directory: \"%s\"" -msgstr "\"%s\" hedef dizinine yazmaya izin verilmedi." - -#: pisi/fetcher.py:92 -msgid "Access denied to destination file: \"%s\"" -msgstr "\"%s\" hedef dosyasına erişim engellendi." - -#: pisi/fetcher.py:103 -msgid "" -"A problem occured. Please check the archive address and/or permissions again." -msgstr "" -"Bir hata oluştu. Lütfen arşiv adresini ve/veya kullanıcı izinlerini yeniden " -"kontrol edin." - -#: pisi/fetcher.py:161 -msgid "No such file or no permission to read" -msgstr "Öyle bir dosya yok ya da okuma izni yok." - -#: pisi/fetcher.py:186 -msgid "Requested range not satisfiable, starting again." -msgstr "İstenen aralık sağlanamıyor, yeniden başlatılıyor" - -#: pisi/fetcher.py:193 -msgid "Cannot fetch %s; value error: %s" -msgstr "%s indirilemiyor, hata: %s" - -#: pisi/fetcher.py:195 pisi/fetcher.py:197 pisi/fetcher.py:199 -msgid "Cannot fetch %s; %s" -msgstr "%s indirilemiyor; %s" - -#: pisi/fetcher.py:201 -msgid "Cannot fetch %s; (%s): %s" -msgstr "%s indirilemiyor; (%s): %s" - -#: pisi/fetcher.py:245 -msgid "Proxy configuration has been found for '%s' protocol" -msgstr "'%s' protokolü için vekil (proxy) yapılandırması bulundu" - -#: pisi/fetcher.py:329 pisi/fetcher.py:350 pisi/fetcher.py:363 -msgid "ftp error" -msgstr "ftp hatası" - -#: pisi/file.py:67 -msgid "uri must have type either URI or string" -msgstr "uri argümanı ya URI ya da string tipine sahip olmalı" - -#: pisi/file.py:90 -msgid "zip compression not supported yet" -msgstr "zip sıkıştırma henüz desteklenmiyor" - -#: pisi/file.py:118 -msgid "Fetching %s" -msgstr "%s'i indiriyor" - -#: pisi/file.py:123 -msgid "Copying %s to transfer dir" -msgstr "%s aktarım dizinine kopyalanıyor" - -#: pisi/file.py:128 -msgid "File '%s' not found." -msgstr "Dosya '%s' bulunamadı." - -#: pisi/file.py:136 -msgid "File integrity of %s compromised." -msgstr "%s in dosya bütünlüğü bozuk." - -#: pisi/file.py:157 -msgid "File mode must be either File.read or File.write" -msgstr "File modu ya File.read ya da File.write olmalı" - -#: pisi/file.py:162 -msgid "Remote write not implemented" -msgstr "Uzağa yazmalar henüz programlanmadı" - -#: pisi/file.py:189 -msgid "gzip compression not supported yet" -msgstr "gzip sıkıştırma henüz desteklenmiyor" - -#: pisi/file.py:204 pisi/file.py:207 -msgid "ERROR: gpg --detach-sig %s failed" -msgstr "HATA: gpg --detach-sig %s çalışmadı" - -#: pisi/graph.py:31 -msgid "Encountered cycle %s" -msgstr "Çember ile karşılaşıldı: %s" - -#: pisi/index.py:94 -msgid "Adding %s to package index" -msgstr "%s paket indeksine ekleniyor" - -#: pisi/index.py:97 -msgid "Adding %s to component index" -msgstr "%s bileşen indeksine ekleniyor" - -#: pisi/index.py:136 -msgid "Package %s: metadata corrupt, skipping..." -msgstr "Paket %s: metadata bozuk, atlanıyor..." - -#: pisi/index.py:161 -msgid "Adding %s to source index" -msgstr "%s kaynak indeksine ekleniyor" - -#: pisi/installdb.py:59 -msgid "installed" -msgstr "kurulu" - -#: pisi/installdb.py:59 -msgid "installed-pending" -msgstr "kurulu-beklemede" - -#: pisi/installdb.py:60 -msgid "purged" -msgstr "temizlenmiş" - -#: pisi/installdb.py:60 -msgid "removed" -msgstr "kaldırılmış" - -#: pisi/installdb.py:63 -msgid "" -"State: %s\n" -"Version: %s, Release: %s, Build: %s\n" -msgstr "" -"Durum: %s\n" -"Versiyon: %s, Sürüm: %s, İnşa: %s\n" - -#: pisi/installdb.py:68 -msgid "Distribution: %s, Install Time: %s\n" -msgstr "Dağıtım: %s, Yerleştime Zamanı: %s\n" - -#: pisi/installdb.py:155 -msgid "Already installed" -msgstr "Halihazırda yerleştirilmiş." - -#: pisi/itembyrepodb.py:121 -msgid "Invalid repository string" -msgstr "Geçersiz depo adı" - -#: pisi/itembyrepodb.py:143 -msgid "Key %s not found" -msgstr "%s anahtarı bulunamadı" - -#: pisi/itembyrepodb.py:153 -msgid "Key %s in repo %s not found" -msgstr "%s anahtarı %s deposunda bulunamadı" - -#: pisi/lockeddbshelve.py:50 -msgid "Database version for %s insufficient. Please run rebuild-db command." -msgstr "" -"Veritabanı versiyonu %s yetersiz. Lütfen rebuild-db komutunu çalıştırınız." - -#: pisi/lockeddbshelve.py:54 -msgid "" -"Database version for %s greater than PiSi version. You need a newer PiSi." -msgstr "" -"Veritabanı versiyonu %s PİSİ versiyonundan büyük. Yeni bir PİSİ'ye " -"gereksiniminiz var." - -#: pisi/lockeddbshelve.py:61 -msgid "Writing current database version for %s" -msgstr "Şu andaki veritabanı versiyonu %s yazılıyor" - -#: pisi/lockeddbshelve.py:66 -msgid "Cannot attain write access to database environment" -msgstr "Veritabanı ortamına yazma erişimi sağlanamadı" - -#: pisi/lockeddbshelve.py:68 -msgid "Database version %s not present." -msgstr "Veritabanı versiyonu %s bulunamadı." - -#: pisi/lockeddbshelve.py:75 pisi/lockeddbshelve.py:164 -msgid "" -"Another instance of PISI is running. Only one instance is allowed to modify " -"the PISI database at a time." -msgstr "" -"Sistemde başka bir yerde daha PiSi çalışıyor. Sadece tek bir PiSi'nin " -"veritabanını değiştirmesine izin verilir." - -#: pisi/lockeddbshelve.py:85 -msgid "Cannot attain read access to database environment" -msgstr "Veritabanı ortamına okuma erişimi sağlanamadı" - -#: pisi/lockeddbshelve.py:99 -msgid "Cannot write to PISI database." -msgstr "PİSİ veritabanına yazılamıyor." - -#: pisi/lockeddbshelve.py:122 -msgid "Cannot attain read or write access to database %s" -msgstr "Veritabanı %s için okuma ya da yazma erişimi sağlanamadı" - -#: pisi/lockeddbshelve.py:150 -msgid "" -"Flags should be one of 'r', 'w', 'c' or 'n' or use the bsddb.db.DB_* flags" -msgstr "" -"Bayraklar 'r', 'w', 'c' or 'n'den birisi olmalı ya da bsddb.db.DB_* " -"bayraklarını kullanmalı" - -#: pisi/metadata.py:62 -msgid "Distribution: %s, Dist. Release: %s\n" -msgstr "Dağıtım: %s, Dağıtım Sürümü: %s\n" - -#: pisi/metadata.py:64 -msgid "Architecture: %s, Installed Size: %s" -msgstr "Mimari: %s, Yerleşik Boyut: %s" - -#: pisi/operations.py:45 -msgid "Upgrading PISI requires database rebuild and restart" -msgstr "" -"PİSİ'yi yükseltmek veritabanını yeniden inşa etmeyi ve uygulamayı yeniden " -"başlatmayı gerektirir" - -#: pisi/operations.py:48 -msgid "PISI package has been upgraded. Rebuilding PISI database." -msgstr "PİSİ paketi yükseltilmiştir. PİSİ veritabanı yeniden inşa ediliyor." - -#: pisi/operations.py:79 -msgid "Mixing file names and package names not supported yet." -msgstr "Dosya ve paket adlarını karıştırmak henüz desteklenmiyor." - -#: pisi/operations.py:121 -msgid "" -"The following packages will be installed\n" -"in the respective order to satisfy extra dependencies:\n" -msgstr "" -"Ek bağımlılıkları sağlamak için bu paketler verilen sırada kurulacaktır:\n" - -#: pisi/operations.py:124 pisi/operations.py:566 -msgid "Do you want to continue?" -msgstr "Devam etmek istiyor musunuz?" - -#: pisi/operations.py:125 -msgid "External dependencies not satisfied" -msgstr "Dış bağımlılıklar sağlanamadı" - -# pisi/api.py:168 :215 -#: pisi/operations.py:137 pisi/operations.py:294 -msgid "No packages to install." -msgstr "Kurulacak paket yok." - -#: pisi/operations.py:165 -msgid "Installation order: " -msgstr "Kurulum sırası: " - -#: pisi/operations.py:213 -msgid "Selected packages [%s] are in conflict with each other." -msgstr "Seçili paketler [%s] birbirleriyle çakışıyorlar." - -#: pisi/operations.py:219 -msgid "[%s conflicts with: %s]" -msgstr "[%s: %s ile çakışıyor]" - -#: pisi/operations.py:221 -msgid "The following packages have conflicts: %s" -msgstr "Aşağıdaki paketlerde çakışmalar bulunuyor: %s" - -#: pisi/operations.py:224 -msgid "Remove the following conflicting packages?" -msgstr "Bu çakışan paketler kaldırılsın mı?" - -#: pisi/operations.py:225 pisi/operations.py:228 -msgid "Conflicts remain" -msgstr "Çakışmalar var" - -#: pisi/operations.py:259 -msgid "Safety switch: Following packages in system.base will be installed: " -msgstr "Emniyet mandalı: taban sistem system.base'den bu paketler kurulacak:" - -#: pisi/operations.py:265 -msgid "Safety switch: Following packages in system.base will be upgraded: " -msgstr "" -"Emniyet mandalı: taban sistem system.base'den bu paketler yükseltilecek:" - -#: pisi/operations.py:271 pisi/operations.py:542 -msgid "Safety switch: the component system.base cannot be found" -msgstr "Emniyet mandalı: taban sistem bileşeni system.base bulunamadı" - -#: pisi/operations.py:289 -msgid "Not re-installing the following packages: " -msgstr "İzleyen paketleri yeniden kurmuyorum: " - -#: pisi/operations.py:305 -msgid "" -"Following packages will be installed\n" -"in the respective order to satisfy dependencies:\n" -msgstr "" -"Bağımlılıkları sağlamak için bu paketler verilen sırada kurulacaktır:\n" - -#: pisi/operations.py:311 pisi/operations.py:432 -msgid "Total size of packages: %.2f %s" -msgstr "Paketlerin toplam boyu: %.2f %s" - -#: pisi/operations.py:317 pisi/operations.py:438 pisi/operations.py:726 -msgid "There are extra packages due to dependencies. Do you want to continue?" -msgstr "Bağımlılıklar yüzünden ek paketler var. Devam etmek istiyor musunuz?" - -#: pisi/operations.py:380 -msgid "Warning: package *name* ends with '.pisi'" -msgstr "Uyarı: paket *adı* '.pisi' ile bitiyor." - -#: pisi/operations.py:383 -msgid "Package %s is not installed." -msgstr "Paket %s kurulmamış." - -#: pisi/operations.py:389 -msgid "Package %s is not available in repositories." -msgstr "Paket %s depolarda mevcut değil." - -#: pisi/operations.py:401 -msgid "Package %s is already at the latest release %s." -msgstr "Paket %s zaten en son sürüm %s'de" - -#: pisi/operations.py:407 -msgid "Package %s is already at the latest build %s." -msgstr "Paket %s zaten en son inşa %s'de." - -#: pisi/operations.py:427 -msgid "The following packages will be upgraded: " -msgstr "Bu paketler yükseltilecektir: " - -#: pisi/operations.py:489 -msgid "Dependency %s of %s cannot be satisfied" -msgstr "İnşa bağımlılığı %s, %s paketi için sağlanamadı" - -#: pisi/operations.py:490 -msgid "Upgrade is not possible." -msgstr "" - -#: pisi/operations.py:512 -msgid "Reverse dependency %s of %s cannot be satisfied" -msgstr "Ters bağımlılık %s, %s paketi için sağlanamadı" - -#: pisi/operations.py:538 -msgid "Safety switch: cannot remove the following packages in system.base: " -msgstr "" -"Emniyet mandalı: taban sistem system.base deki bu paketler kaldırılamıyor: " - -#: pisi/operations.py:549 -msgid "Package %s does not exist. Cannot remove." -msgstr "Olmayan paket %s kaldırılamıyor." - -#: pisi/operations.py:553 -msgid "No packages to remove." -msgstr "Kaldıracak paket yok." - -#: pisi/operations.py:562 -msgid "" -"The following minimal list of packages will be removed\n" -"in the respective order to satisfy dependencies:\n" -msgstr "" -"Bağımlılıkları sağlamak için bu paketler verilen sırada kaldırılacaktır:\n" - -#: pisi/operations.py:567 -msgid "Package removal declined" -msgstr "Paket kaldırmaya izin verilmedi." - -#: pisi/operations.py:579 -msgid "Package %s is not installed. Cannot remove." -msgstr "Paket %s kurulu değil. Kaldırılamıyor." - -#: pisi/operations.py:700 -msgid "No packages to emerge." -msgstr "Derlenip, kurulacak paket yok." - -#: pisi/operations.py:715 -msgid "" -"The following minimal list of packages will be installed \n" -"from repository in the respective order to satisfy dependencies:\n" -msgstr "Bağımlılıkları sağlamak için bu paketler verilen sırada kurulacak:\n" - -#: pisi/operations.py:718 -msgid "" -"The following minimal list of packages will be built and\n" -"installed in the respective order to satisfy dependencies:\n" -msgstr "" -"Bağımlılıkları sağlamak için aşağıdaki paketler verilen sırada derlenip, " -"kurulacak:\n" - -#: pisi/operations.py:760 -msgid "Cannot find source package: %s" -msgstr "Kaynak paket bulunamadı: %s" - -#: pisi/package.py:75 -msgid "Trying to fetch xdelta: %s" -msgstr "xdelta bilgisi indirmeye çalışılıyor: %s" - -#: pisi/package.py:79 -msgid "XDelta %s: not exists" -msgstr "XDelta %s: bulunamadı" - -#: pisi/package.py:91 pisi/sourcearchive.py:59 -msgid "%s [cached]" -msgstr "%s [önbellekte]" - -#: pisi/package.py:152 -msgid "MetaData format wrong" -msgstr "MetaData biçimi yanlış" - -#: pisi/packagedb.py:68 -msgid "Package %s not found" -msgstr "Paket %s bulunamadı" - -#: pisi/pxml/autoxml.py:83 -msgid "At least one '%s' tag should have local text" -msgstr "En azından bir tane '%s' etiketi yerel metne sahip olmalı" - -#: pisi/pxml/autoxml.py:90 -msgid "'%s' language of tag '%s' is empty" -msgstr "'%s' dili metni, etiket %s içerisinde boş" - -#: pisi/pxml/autoxml.py:116 -msgid "LocalText: unable to get either current or default locale" -msgstr "" -"LocalText: şu andaki ya da ön tanımlı yerelleştirme seçenekleri (locale) " -"bulunamıyor" - -#: pisi/pxml/autoxml.py:122 pisi/pxml/autoxml.py:137 -msgid "" -"Tag should have at least the current locale, or failing that an English or " -"Turkish version" -msgstr "" -"Etiket en azından şu andaki yerelleştirme seçenekleri (locale) için bir " -"girdiye, o olmazsa bir Türkçe ya da İngilizce versiyona sahip olmalı" - -#: pisi/pxml/autoxml.py:375 -msgid "autoxml.check: '%s' errors" -msgstr "autoxml.check: '%s' hatalar" - -#: pisi/pxml/autoxml.py:430 pisi/pxml/autoxml.py:440 -msgid "autoxml.read: File '%s' has errors" -msgstr "autoxml.read: Dosya '%s' hatalara sahip" - -#: pisi/pxml/autoxml.py:448 -msgid "autoxml.write: object validation has failed" -msgstr "autoxml.write: nesne doğrulaması başarısızlığa uğradı" - -#: pisi/pxml/autoxml.py:456 -msgid "autoxml.write: File encoding '%s' has errors" -msgstr "autoxml.write: Dosya biçimlendirmesi '%s' hatalara sahip" - -#: pisi/pxml/autoxml.py:506 -msgid "gen_tag: unrecognized tag type %s in spec" -msgstr "gen_tag: tanınmayan im tipi %s" - -#: pisi/pxml/autoxml.py:554 pisi/pxml/autoxml.py:565 -msgid "Mandatory variable %s not available" -msgstr "Gerekli değişken %s bulunamadı" - -#: pisi/pxml/autoxml.py:633 -msgid "Type mismatch: read text cannot be decoded" -msgstr "Tip uyumsuzluğu: okunan metin çözülemedi" - -#: pisi/pxml/autoxml.py:637 pisi/pxml/autoxml.py:646 -msgid "Mandatory token %s not available" -msgstr "Gerekli im %s bulunamadı" - -#: pisi/pxml/autoxml.py:651 -msgid "Type mismatch. Expected %s, got %s" -msgstr "Tip uyumsuzluğu. %s beklerken, %s bulundu" - -# pisi/xmlfile.py:420 :521 -#: pisi/pxml/autoxml.py:681 pisi/pxml/autoxml.py:802 -msgid "Type mismatch: DOM cannot be decoded" -msgstr "Tip uyumsuzluğu: DOM okunamıyor" - -# pisi/xmlfile.py:392 :423 :439 :446 :524 :538 :545 -#: pisi/pxml/autoxml.py:684 pisi/pxml/autoxml.py:700 pisi/pxml/autoxml.py:710 -#: pisi/pxml/autoxml.py:805 pisi/pxml/autoxml.py:819 pisi/pxml/autoxml.py:829 -msgid "Mandatory argument not available" -msgstr "Gerekli argüman bulunamadı" - -# pisi/xmlfile.py:436 :535 -#: pisi/pxml/autoxml.py:697 pisi/pxml/autoxml.py:816 -msgid "Object cannot be encoded" -msgstr "Nesne kodlanamadı" - -#: pisi/pxml/autoxml.py:722 -msgid "List type must contain only one element" -msgstr "List tipi sadece bir eleman içermeli" - -# pisi/xmlfile.py:470 :485 -#: pisi/pxml/autoxml.py:735 pisi/pxml/autoxml.py:756 -msgid "Mandatory list empty" -msgstr "Zorunlu (mandatory) liste boş" - -#: pisi/pxml/xmlextcdom.py:61 pisi/pxml/xmlfilecdom.py:77 -msgid "File '%s' has invalid XML: %s" -msgstr "'%s' dosyasının XML sözdizimi geçersiz: %s" - -#: pisi/pxml/xmlextcdom.py:113 pisi/pxml/xmlextmdom.py:92 -#: pisi/pxml/xmlextpiks.py:83 -msgid "getNodeText: Expected text node, got something else!" -msgstr "getNodeText: metin beklenirken başka birşey alındı!" - -#: pisi/pxml/xmlextmdom.py:53 pisi/pxml/xmlfilemdom.py:69 -msgid "File '%s' has invalid XML: %s\n" -msgstr "'%s' dosyasının XML sözdizimi geçersiz: %s\n" - -#: pisi/pxml/xmlfilecdom.py:79 -msgid "File '%s' not found" -msgstr "Dosya '%s' bulunamadı" - -#: pisi/pxml/xmlfilecdom.py:89 pisi/pxml/xmlfilemdom.py:80 -msgid "Root tagname %s not identical to %s as expected" -msgstr "Kök im adı %s beklendiği gibi %s ile aynı değil" - -#: pisi/pxml/xmlfilepiks.py:64 pisi/pxml/xmlfilepiks.py:79 -msgid "File '%s' has invalid XML" -msgstr "'%s' dosyasının XML sözdizimi geçersiz" - -#: pisi/repodb.py:82 -msgid "Repository %s already exists" -msgstr "Depo %s halihazırda var" - -#: pisi/repodb.py:89 -msgid "Cannot add repository at position %s" -msgstr "%s konumundaki depo eklenemiyor" - -#: pisi/sourcearchive.py:68 -msgid "unpack: check_file_hash failed" -msgstr "unpack: check_file_hash başarısızlığa uğradı" - -#: pisi/sourcedb.py:60 pisi/sourcedb.py:66 -msgid "Source package %s not found" -msgstr "Kaynak paketi %s bulunamadı." - -#: pisi/specfile.py:143 -msgid "URI: %s, type: %s, sha1sum: %s" -msgstr "URI: %s, tip: %s, sha1sum: %s" - -#: pisi/specfile.py:210 -msgid "Name: %s, version: %s, release: %s, build %s\n" -msgstr "Ad: %s, versiyon %s, sürüm %s, inşa %s\n" - -#: pisi/specfile.py:212 -msgid "Summary: %s\n" -msgstr "Özet: %s\n" - -#: pisi/specfile.py:213 -msgid "Description: %s\n" -msgstr "Açıklama: %s\n" - -#: pisi/specfile.py:214 -msgid "Component: %s\n" -msgstr "Bileşen: %s\n" - -#: pisi/specfile.py:215 -msgid "Provides: " -msgstr "Sağladıkları: " - -#: pisi/specfile.py:219 -msgid "Dependencies: " -msgstr "Bağımlılıklar:" - -#: pisi/uri.py:79 -msgid "setAuthInfo needs a tuple (user, pass)" -msgstr "setAuthInfo bir (kullanıcı, parola) ikilisi ister" - -#: pisi/util.py:62 -msgid "%s section should have a '%s' tag" -msgstr "'%s' bölümünün bir '%s' etiketi olmalı" - -#: pisi/util.py:144 pisi/util.py:165 -msgid "Running " -msgstr "Çalışıyor: " - -#: pisi/util.py:148 pisi/util.py:183 -msgid "return value for \"%s\" is %s" -msgstr "\"%s\" için dönüş değeri %s" - -#: pisi/util.py:387 -msgid "Including external link '%s'" -msgstr "'%s' harici bağı ekleniyor" - -#: pisi/util.py:389 -msgid "Including directory '%s'" -msgstr "'%s' dizini içeriliyor" - -#: pisi/util.py:463 -msgid "I/O Error: Cannot calculate SHA1 hash of %s" -msgstr "Girdi/Çıktı hatası: %s dosyasının SHA1 kontrol toplamı hesaplanamıyor" - -#: pisi/util.py:472 -msgid "Cannot calculate SHA1 hash of given data" -msgstr "Verinin SHA1 kontrol toplamı hesaplanamıyor" - -#: pisi/util.py:510 -msgid "ERROR: patch (%s) failed" -msgstr "HATA: Yama (%s) başarısız" - -#: pisi/util.py:512 -msgid "ERROR: patch (%s) failed: %s" -msgstr "HATA: Yama (%s) başarısız: %s" - -#: pisi/util.py:558 -msgid "strip command failed for file '%s'!" -msgstr "strip komutu '%s' dosyası için çalışmadı!" - -#: pisi/util.py:565 -msgid "objcopy (keep-debug) command failed for file '%s'!" -msgstr "objcopy (keep-debug) komutu '%s' dosyası için çalışmadı!" - -#: pisi/util.py:571 -msgid "objcopy (add-debuglink) command failed for file '%s'!" -msgstr "objcopy (add-debuglink) komutu '%s' dosyası için çalışmadı!" - -#: pisi/util.py:604 -msgid "Removing lock %s" -msgstr "%s kilidi kaldırılıyor" - -#: pisi/util.py:637 -msgid "Updating environment..." -msgstr "Çevre güncelleniyor..." - -#: pisi/util.py:672 -msgid "ERROR: xdelta patch %s %s %s failed" -msgstr "HATA: xdelta yaması %s %s %s başarısız" - -#: scripts/repostats.py:361 -msgid "" -"Duplicate binary packages:\n" -"%s\n" -"%s\n" -msgstr "" -"Birden çok yerde aynı ikili paket var:\n" -"%s\n" -"%s\n" - -#: scripts/repostats.py:366 -msgid "Unknown file type '%s' in package '%s'" -msgstr "Bilinmeyen dosya tipi '%s', '%s' paketi içinde bulundu. " - -#: scripts/repostats.py:422 -msgid "" -"Duplicate source packages:\n" -"%s\n" -"%s\n" -msgstr "" -"Birden çok yerde aynı kaynak paketi var:\n" -"%s\n" -"%s\n" - -#: scripts/repostats.py:442 -msgid "Source package '%s' has wrong date format '%s'" -msgstr "Kaynak paketi '%s' yanlış tarih biçimlendirmesine sahip: '%s'" - -#: scripts/repostats.py:455 -msgid "Source package '%s' has wrong release numbers" -msgstr "Kaynak paketi '%s' hatalı sürüme sahip" - -#: scripts/repostats.py:459 -msgid "Source package '%s' lacks release %d" -msgstr "Kaynak paketi '%s' sürüm %d'ye sahip değil" - -#: scripts/repostats.py:467 -msgid "Source package '%s' has no first release" -msgstr "'%s' kaynak paketinin ilk sürüm bilgisi yok" - -#: scripts/repostats.py:502 -msgid "" -"Developer '%s <%s>' has another mail address '%s' in source package '%s'" -msgstr "" - -#: scripts/repostats.py:585 -msgid "" -"Cannot parse '%s':\n" -"%s\n" -msgstr "" -"'%s' ayrıştırılamıyor:\n" -"'%s'\n" - -#: scripts/repostats.py:663 -msgid "Usage: repostats.py [OPTIONS] source-repo-path [binary-repo-path]\n" -msgstr "" -"Kullanım: repostats.py [SEÇENEKLER] source-repo-path [ikili-depo-adresi]\n" - -#: scripts/repostats.py:664 -msgid "Dont generate the web site.\n" -msgstr "Web sayfasını oluşturma.\n" - -#: scripts/repostats.py:685 -msgid "Scanning source repository...\n" -msgstr "Kaynak deposu taranıyor...\n" - -#: scripts/repostats.py:689 -msgid "Scanning binary packages...\n" -msgstr "İkili dosyalar taranıyor...\n" - -#: scripts/repostats.py:694 -msgid "Encountered %d errors! Fix them immediately!\n" -msgstr "%d hata ile karşılaşıldı. Lütfen bunları en kısa zamanda düzeltin.\n" - -#: scripts/repostats.py:702 -msgid "These dependencies are not available in repository:\n" -msgstr "Bağımlılığa neden olan bu paketler depoda bulunmuyor:\n" - diff --git a/tags/pisi-1.1_beta13/scripts/calc-build-order.py b/tags/pisi-1.1_beta13/scripts/calc-build-order.py deleted file mode 100755 index 3c2fc06a..00000000 --- a/tags/pisi-1.1_beta13/scripts/calc-build-order.py +++ /dev/null @@ -1,81 +0,0 @@ -#! /usr/bin/python -# a simple tool to find the correct build order of source -# packages in the repository. this one works really fast. -# just give it the repository directory as an argument -# author: exa - -import sys -import os -sys.path.insert(0, '.') - -import gettext -__trans = gettext.translation('pisi', fallback=True) -_ = __trans.ugettext - -import pisi.context as ctx -import pisi -import pisi.api -import pisi.config -import pisi.specfile as specfile -import pisi.util -import pisi.graph - -options = pisi.config.Options() -if len(sys.argv) > 2: - options.destdir=sys.argv[2] -else: - options.destdir = '/' -pisi.api.init(database=False, options=options) -repo_uri = sys.argv[1] - -specfiles = [] - -print "reading pspecfiles, just a moment" -for root, dirs, files in os.walk(repo_uri): - for fn in files: - if fn == 'pspec.xml': - #ctx.ui.info(_('Adding %s to package index') % fn) - sf = specfile.SpecFile() - sf.read(pisi.util.join_path(root, fn)) - sf.check() - sys.stdout.write('.') - sys.stdout.flush() - specfiles.append(sf) - -def plan_build(specfiles): - # try to construct a pisi graph of packages to - # install / reinstall - - G_f = pisi.graph.Digraph() - pkgtosrc = {} - for sf in specfiles: - for pkg in sf.packages: - pkgtosrc[str(pkg.name)] = str(sf.source.name) - - for x in specfiles: - #G_f.add_package(x) - src = x.source - if not str(src.name) in G_f.vertices(): - G_f.add_vertex(str(src.name), (src.version, src.release)) - for builddep in src.buildDependencies: - G_f.add_edge(str(src.name), str(builddep.package)) - for pkg in x.packages: - for rtdep in pkg.packageDependencies: - tsrc = pkgtosrc[rtdep.package] - if not src.name == tsrc: # firefox - firefox-devel thing - G_f.add_edge(src.name, tsrc ) - - if ctx.config.get_option('debug'): - G_f.write_graphviz(sys.stdout) - order = G_f.topological_sort() - order.reverse() - return G_f, order - -print "planning build order" -try: - G_f, order = plan_build(specfiles) - print order -except pisi.graph.CycleException, e: - print e - -pisi.api.finalize() diff --git a/tags/pisi-1.1_beta13/scripts/cat-db.py b/tags/pisi-1.1_beta13/scripts/cat-db.py deleted file mode 100755 index 7f0819de..00000000 --- a/tags/pisi-1.1_beta13/scripts/cat-db.py +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/python -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# -# Author: Eray Ozkural - -import sys -import bsddb3.dbshelve as shelve -import bsddb3.db as db - -sys.path.append('.') - -import pisi -import pisi.cli - -d = shelve.open( sys.argv[1], 'r', 0660, filetype = db.DB_BTREE ) - -for key, data in d.items(): - pisi.cli.printu(u'%s: %s\n' % (key, data)) - -d.close() diff --git a/tags/pisi-1.1_beta13/scripts/check-source-repo.py b/tags/pisi-1.1_beta13/scripts/check-source-repo.py deleted file mode 100755 index 11fc6aef..00000000 --- a/tags/pisi-1.1_beta13/scripts/check-source-repo.py +++ /dev/null @@ -1,32 +0,0 @@ -#! /usr/bin/python -# a simple tool to list stuff in source repository -# author: exa - -import sys -import os - -import pisi -import pisi.api -import pisi.config -import pisi.specfile as specfile -import pisi.context as ctx -import pisi.util - -options = pisi.config.Options() -if len(sys.argv) > 2: - options.destdir=sys.argv[2] -else: - options.destdir = '/' -pisi.api.init(database=False, options=options) -repo_uri = sys.argv[1] - -for root, dirs, files in os.walk(repo_uri): - for fn in files: - if fn == 'pspec.xml': - #ctx.ui.info(_('Adding %s to package index') % fn) - sf = specfile.SpecFile() - sf.read(pisi.util.join_path(root, fn)) - sf.check() - print '%s: %s' % (sf.source.name, sf.source.version) - -pisi.api.finalize() diff --git a/tags/pisi-1.1_beta13/scripts/convert_history.py b/tags/pisi-1.1_beta13/scripts/convert_history.py deleted file mode 100755 index d4a64380..00000000 --- a/tags/pisi-1.1_beta13/scripts/convert_history.py +++ /dev/null @@ -1,84 +0,0 @@ -#!/usr/bin/python - -import sys -import os -import codecs -import xml.dom.minidom as mdom - -def find_pspecs(folder): - paks = [] - for root, dirs, files in os.walk(folder): - if "pspec.xml" in files: - paks.append(root) - # dont walk into the versioned stuff - if ".svn" in dirs: - dirs.remove(".svn") - return paks - -def addText(doc, parent, text): - cdata =doc.createTextNode(text) - parent.appendChild(cdata) - -def getTags(parent, childName): - return [x for x in parent.childNodes if x.nodeType == x.ELEMENT_NODE if x.tagName == childName] - -def getNodeText(node, tag, default=None): - try: - c = getTags(node, tag)[0].firstChild.data - except: - c = default - return c - -def newNode(doc, tag, text): - node = doc.createElement(tag) - cdata = doc.createTextNode(text) - node.appendChild(cdata) - return node - -def fixIndent(doc, node): - for x in node.childNodes: - if x.nodeType == x.ELEMENT_NODE: - if x.tagName == "Update": - fixIndent(doc, x) - else: - x.data = "\n" + x.data[5:] - -def fixTags(doc, hist): - for update in hist.childNodes: - if update.nodeType == update.ELEMENT_NODE: - rno = getNodeText(update, "Release") - update.setAttribute("release", rno) - if rno == "1": - comment = newNode(doc, "Comment", "First release.") - paker = getTags(getTags(doc.documentElement, "Source")[0], "Packager")[0] - name = newNode(doc, "Name", getNodeText(paker, "Name")) - email = newNode(doc, "Email", getNodeText(paker, "Email")) - else: - comment = newNode(doc, "Comment", "FIXHISTORY") - name = newNode(doc, "Name", "FIXHISTORY") - email = newNode(doc, "Email", "FIXHISTORY") - update.replaceChild(comment, getTags(update, "Release")[0]) - addText(doc, update, " ") - update.appendChild(name) - addText(doc, update, "\n ") - update.appendChild(email) - addText(doc, update, "\n ") - -def fixPspec(path): - doc = mdom.parse(path) - pisi = doc.documentElement - source = getTags(pisi, "Source")[0] - history = getTags(source, "History")[0] - item = source.removeChild(history) - addText(doc, pisi, "\n ") - fixIndent(doc, item) - fixTags(doc, item) - pisi.appendChild(item) - addText(doc, pisi, "\n") - f = codecs.open(path,'w', "utf-8") - f.write(doc.toxml()) - f.close() - -pakages = find_pspecs(sys.argv[1]) -for pak in pakages: - fixPspec(os.path.join(pak, "pspec.xml")) diff --git a/tags/pisi-1.1_beta13/scripts/fetchAll.py b/tags/pisi-1.1_beta13/scripts/fetchAll.py deleted file mode 100755 index e0ce3e09..00000000 --- a/tags/pisi-1.1_beta13/scripts/fetchAll.py +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/python -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. - -import os -import sys - -sys.path.append('.') - -import pisi.api -import pisi.uri -import pisi.context as ctx -import pisi.specfile -import pisi.util as util -from pisi.fetcher import fetch_url - -def scanPSPEC(folder): - packages = [] - for root, dirs, files in os.walk(folder): - if "pspec.xml" in files: - packages.append(root) - # dont walk into the versioned stuff - if ".svn" in dirs: - dirs.remove(".svn") - return packages - -def isCached(file, sha1sum): - try: - return util.check_file_hash(os.path.join(ctx.config.archives_dir(), file), sha1sum) - except: - pass - -if __name__ == "__main__": - pisi.api.init(database=False, options='') - try: - packages = scanPSPEC(sys.argv[1]) - except: - print "Usage: fetchAll.py path2repo" - sys.exit(1) - - for package in packages: - spec = pisi.specfile.SpecFile() - spec.read(os.path.join(package, "pspec.xml")) - - URI = pisi.uri.URI(spec.source.archive.uri) - - if not isCached(URI.filename(), spec.source.archive.sha1sum): - print URI, " -> " , os.path.join(ctx.config.archives_dir(), URI.filename()) - try: - fetch_url(URI, ctx.config.archives_dir()) - except pisi.fetcher.FetchError, e: - print e - pass - else: - print URI, "already downloaded..." - pisi.api.finalize() diff --git a/tags/pisi-1.1_beta13/scripts/find-lib-deps.py b/tags/pisi-1.1_beta13/scripts/find-lib-deps.py deleted file mode 100755 index dd624f49..00000000 --- a/tags/pisi-1.1_beta13/scripts/find-lib-deps.py +++ /dev/null @@ -1,64 +0,0 @@ -#! /usr/bin/python -# -*- coding: utf-8 -*- -# -# find library dependencies of a package -# author: exa (Eray Özkural) - -import locale -import sys -import os -import fnmatch - -import gettext -__trans = gettext.translation('pisi', fallback=True) -_ = __trans.ugettext - -import pisi -import pisi.api -import pisi.config -import pisi.specfile as specfile -import pisi.context as ctx -import pisi.util as util -from pisi.package import Package - -locale.setlocale(locale.LC_ALL, '') -options = pisi.config.Options() -if len(sys.argv) > 2: - options.destdir=sys.argv[2] -else: - options.destdir = '/' -pisi.api.init(database=True, comar=False, options=options) - -filename = sys.argv[1] -package = Package(filename) -package.read() -util.clean_dir('/tmp/install') -package.extract_dir_flat('install', '/tmp/install') -deps = set() -needed = set() -for file in package.files.list: - #print file.path, file.type - if file.type == 'executable': - (ret, lines) = util.run_batch('objdump -p %s' % util.join_path('/tmp/install', file.path)) - for x in lines: - if x.startswith(' NEEDED'): - needed.add(x[8:].strip()) - -#print 'needed guys', needed - -for lib in needed: - - (ret, out) = util.run_batch('locate %s' % lib) - path = out[0].strip().lstrip('/') - try: - (pkg_name, file_info) = ctx.filesdb.get_file(path) - ctx.ui.info("Library dependency: '%s' due to library '%s'" % (pkg_name, file_info.path)) - deps.add(pkg_name) - except: - ctx.ui.warning('Cannot find an installed package for library %s' % lib) - -ctx.ui.info('Found deps:') -for x in deps: - ctx.ui.info(x) - -pisi.api.finalize() diff --git a/tags/pisi-1.1_beta13/scripts/fix_old_metadata_files.py b/tags/pisi-1.1_beta13/scripts/fix_old_metadata_files.py deleted file mode 100755 index ed1305d1..00000000 --- a/tags/pisi-1.1_beta13/scripts/fix_old_metadata_files.py +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- - -import xml.dom.minidom as mdom -import codecs -import os - -folder = "/var/lib/pisi" - -def saveMetadata(data, file): - if data: - f = codecs.open(file, 'w', "utf-8") - f.write(data) - f.close() - return True - -def getNodeText(node, tag, default=None): - try : c = getTags(node, tag)[0].firstChild.data - except: c = default - return c - -def getTags(parent, childName): - return [x for x in parent.childNodes if x.nodeType == x.ELEMENT_NODE if x.tagName == childName] - -def addText(dom, parent, text): - cdata = dom.createTextNode(text) - parent.appendChild(cdata) - -def fixMetadata(metadata): - dom = mdom.parse(metadata) - pisi = dom.documentElement - - package = getTags(pisi, "Package")[0] - history = getTags(package, "History")[0] - item = package.removeChild(history) - - for update in history.childNodes: - if update.nodeType == update.ELEMENT_NODE: - try: - rno = getNodeText(update, "Release")[6:-5] - except TypeError: - return None - update.setAttribute("release", rno) - release = getTags(update, "Release")[0] - update.removeChild(release) - - addText(dom, package, " ") - package.appendChild(item) - addText(dom, package, "\n ") - return dom.toxml() - -def findMetadata(): - for root, dirs, files in os.walk(folder): - if "metadata.xml" in files: - yield (root + '/metadata.xml') - -for file in findMetadata(): - if saveMetadata(fixMetadata(file), file): - print "Güncellendi : ", file - else: - print "Hiç bir şey yapılmadı: ", file diff --git a/tags/pisi-1.1_beta13/scripts/lspisi b/tags/pisi-1.1_beta13/scripts/lspisi deleted file mode 100755 index 394a214d..00000000 --- a/tags/pisi-1.1_beta13/scripts/lspisi +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- -# -# Copyright (C) 2006, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. - -import os -import sys -import pisi - -def show_info(filename): - pisi.api.init(database=False, comar=False) - metadata, files = pisi.api.info_file(filename) - pisi.api.finalize() - - paths = [fileinfo.path for fileinfo in files.list] - paths.sort() - return paths - -def uniq(alist): - set = {} - return [set.setdefault(e, e) for e in alist if e not in set] - -def usage(errmsg): - print """ - Error: %s - - Usage: - lspisi PiSi_package.PiSi (lists the content of package) - lspisi dirs PiSi_package.PiSi (lists directories in the package for the package developer) - """ % (errmsg) - - sys.exit(1) - - -def main(): - if len(sys.argv) < 2 or ("dirs" in sys.argv and len(sys.argv) < 3): - usage("PiSi package required...") - - if sys.argv[1] == "dirs": - dirlist = [] - for file in show_info(sys.argv[2]): - dirlist.append(os.path.dirname(file)) - - for dir in uniq(dirlist): - print "%s" % dir - - else: - for file in show_info(sys.argv[1]): - print "/%s" % file - -if __name__ == "__main__": - sys.exit(main()) diff --git a/tags/pisi-1.1_beta13/scripts/missing-binary.py b/tags/pisi-1.1_beta13/scripts/missing-binary.py deleted file mode 100755 index b133db0f..00000000 --- a/tags/pisi-1.1_beta13/scripts/missing-binary.py +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. - -import os -import re -import sys - -from pisi.specfile import SpecFile -from pisi.util import join_path - -def findPspec(folder): - pspecList = [] - for root, dirs, files in os.walk(folder): - if "pspec.xml" in files: - pspecList.append(root) - # dont walk into the versioned stuff - if ".svn" in dirs: - dirs.remove(".svn") - return pspecList - -def getPackages(pspecList): - packages = [] - for pspec in pspecList: - specFile = SpecFile(join_path(pspec, "pspec.xml")) - for p in specFile.packages: - packages += [(p.name, - "%s-%s" % (specFile.history[0].version, specFile.history[0].release), - specFile.source.name)] - return packages - -def usage(miniMe): - print """Usage: - %s srcREP binREP (ex: %s /home/bahadir/repos/pardus/devel/kernel /home/bahadir/binary) - """ % (miniMe, miniMe) - - sys.exit(1) - -if __name__ == "__main__": - try: - repSRC = sys.argv[1] - except IndexError: - usage(sys.argv[0]) - - try: - repBIN = sys.argv[2] - except IndexError: - usage(sys.argv[0]) - - packages = getPackages(findPspec(repSRC)) - binaries = os.listdir(repBIN) - - print "Missing binary packages:" - for p, v, s in packages: - if not filter(lambda x: x.startswith("%s-%s" % (p, v)), binaries): - print " %s (%s)" % (p, s) diff --git a/tags/pisi-1.1_beta13/scripts/pisimedia b/tags/pisi-1.1_beta13/scripts/pisimedia deleted file mode 100755 index 3350162a..00000000 --- a/tags/pisi-1.1_beta13/scripts/pisimedia +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/python -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# -# Author: Eray Ozkural - -import sys -import os - -import pisi -import pisi.context as ctx - -usage = "Usage: pisimedia " - -if len(sys.argv)!=2: - print usage - sys.exit(1) - -#op = sys.argv[1] -#if not op in ['install', 'upgrade']: -# print usage -# sys.exit(2) - -idx = sys.argv[1] -if not os.path.exists(idx): - print "pisi index %s cannot be found" % idx - -pisi.api.init() - -try: - tmpid = 0 - tmprepo = 'pisimedia%d' % tmpid - while ctx.repodb.has_repo(tmprepo): - tmpid += 1 - tmprepo = 'pisimedia%d' % tmpid - pisi.api.add_repo(tmprepo, idx, at = 0) - pisi.api.update_repo(tmprepo) - packages = ctx.packagedb.list_packages(repo=tmprepo) - pisi.api.install(packages, reinstall=True) -except Exception, e: - ctx.ui.error(e) - -if ctx.repodb.has_repo(tmprepo): - pisi.api.remove_repo(tmprepo) -pisi.api.finalize() diff --git a/tags/pisi-1.1_beta13/scripts/pisish b/tags/pisi-1.1_beta13/scripts/pisish deleted file mode 100755 index 64c5dc2b..00000000 --- a/tags/pisi-1.1_beta13/scripts/pisish +++ /dev/null @@ -1,92 +0,0 @@ -#!/usr/bin/python -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# -# Authors: Eray, Baris - -import sys -import locale -import traceback -import exceptions -import signal -import bsddb3.db as db -import os - -import pisi.ui -import pisi.context as ctx -from pisi.cli.pisicli import PisiCLI - -import gettext -__trans = gettext.translation('pisi', fallback=True) -_ = __trans.ugettext - -def exit(retval = 0): - pisi.api.finalize() - sys.exit(retval) - -if __name__ == "__main__": - - locale.setlocale(locale.LC_ALL, '') - print """Welcome to the interactive PISI shell. -Type "help" to see a list of commands. -To end the session, type "exit". -You can run system commands by prefixing with '!' as in '!ls'. -Copyright 2006 (c) Pardus. -""" - while 1: - cmd = raw_input('pisi> ') - if cmd.strip()=='exit': - print 'Bye!' - exit() - if cmd.startswith('!'): - cmd = cmd[1:] - os.system(cmd) - continue - try: - cli = PisiCLI(cmd.split()) - cli.run_command() - except pisi.operations.PisiUpgradeException, e: - print _('PISI has been upgraded.') - except Exception, value: - signal.signal(signal.SIGINT, signal.SIG_IGN) # disable further interrupts - ui = pisi.cli.CLI() # make a temporary UI - show_traceback = False - if isinstance(value, exceptions.KeyboardInterrupt): - ui.error(_("Keyboard Interrupt: Exiting...")) - elif isinstance(value, pisi.Error): - ui.error(_("Program Terminated.")) - show_traceback = ctx.get_option('debug') - elif isinstance(value, db.DBRunRecoveryError): - ui.error(_("""A database operation has been aborted. You should run pisi -again for normal DB recovery procedure. Make sure you have free disk space. -You have to run rebuild-db only when there is file corruption and database upgrades.""")) - elif isinstance(value, pisi.Exception): - show_traceback = True - ui.error(_("""Unhandled internal exception. -Please file a bug report. (http://bugs.uludag.org.tr)""")) - else: - # For any other exception (possibly Python exceptions) show - # the traceback! - show_traceback = ctx.get_option('debug') - ui.error(_("System Error. Program Terminated.")) - - if ctx.get_option('debug'): - ui.error(u"%s: %s" % (exception, value)) - else: - ui.error(unicode(value)) - - ui.info(_("Please type 'help' for general help.")) - - if show_traceback: - ui.info(_("Traceback:")) - #traceback.print_exc(file=sys.stdout) - traceback.print_tb(sys.exc_traceback) - else: - ui.info(_("Use --debug to see a traceback.")) diff --git a/tags/pisi-1.1_beta13/scripts/repo-diff.py b/tags/pisi-1.1_beta13/scripts/repo-diff.py deleted file mode 100755 index 5ef5ea8b..00000000 --- a/tags/pisi-1.1_beta13/scripts/repo-diff.py +++ /dev/null @@ -1,92 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. - -import os -import sys -from pisi.specfile import SpecFile -from pisi.util import join_path - -def findPspec(folder): - pspecList = [] - for root, dirs, files in os.walk(folder): - if "pspec.xml" in files: - pspecList.append(root) - # dont walk into the versioned stuff - if ".svn" in dirs: - dirs.remove(".svn") - return pspecList - -def getVersion(pspecList): - sources = {} - for pspec in pspecList: - specFile = SpecFile(join_path(pspec, "pspec.xml")) - sources[specFile.source.name] = (specFile.source.version, specFile.source.release) - return sources - -def listIntersection(firstRepo, secondRepo): - keys = list(set(firstRepo.keys()).__and__(set(secondRepo.keys()))) - keys.sort() - for i in keys: - if firstRepo[i] != secondRepo[i]: - print " %s: %s (r%s) -> %s (r%s)" % (i, firstRepo[i][0], firstRepo[i][1], secondRepo[i][0], secondRepo[i][1]) - -def listComplement(firstRepo, secondRepo): - keys = list(set(firstRepo.keys()) - set(secondRepo.keys())) - keys.sort() - for i in keys: - print " %s" % i - -def usage(miniMe): - print """Usage: - %s pathToSvn component (ex: %s /home/caglar/svn/pardus/ system/devel) - """ % (miniMe, miniMe) - - sys.exit(1) - -if __name__ == "__main__": - try: - svnRoot = sys.argv[1] - except IndexError: - usage(sys.argv[0]) - - try: - postfix = sys.argv[2] - except IndexError: - postfix = "" - - tag = getVersion(findPspec(join_path(svnRoot, "tags/pardus-1.0/", postfix))) - stable = getVersion(findPspec(join_path(svnRoot,"stable/pardus-1/", postfix))) - devel = getVersion(findPspec(join_path(svnRoot, "devel/", postfix))) - - print "Tag --> Stable" - listIntersection(tag, stable) - print - - print "Tag has, Stable hasn't" - listComplement(tag, stable) - print - - print "Stable has, Tag hasn't" - listComplement(stable, tag) - print - - print "Stable --> Devel" - listIntersection(stable, devel) - print - - print "Stable has, Devel hasn't" - listComplement(stable, devel) - print - - print "Devel has, Stable hasn't" - listComplement(devel, stable) - print diff --git a/tags/pisi-1.1_beta13/scripts/repostats.py b/tags/pisi-1.1_beta13/scripts/repostats.py deleted file mode 100755 index 82594f0b..00000000 --- a/tags/pisi-1.1_beta13/scripts/repostats.py +++ /dev/null @@ -1,719 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# - -import sys -import os -import codecs -import re -import getopt - -import gettext -__trans = gettext.translation('pisi', fallback=True) -_ = __trans.ugettext - -from svn import core, client - -sys.path.append('.') -import pisi.specfile -import pisi.uri -import pisi.package -import pisi.metadata -import pisi.files -from pisi.cli import printu - -# default html templates - -def_table_html = u""" -%s%s -""" - -def_repo_sizes_html = u""" -

Boyutlar

-

Toplam kurulu boyut %(total)s

-

Dosya tiplerine göre liste:

- -%(sizes)s -
-""" - -def_repo_html = u""" - - Depo istatistikleri - - - -
-
-
-

-Depoda toplam %(nr_source)d -kaynak paket, ve bu paketlerden oluşturulacak -%(nr_packages)d ikili paket bulunmaktadır. Toplam %(nr_patches)d yama mevcuttur. -

- -

-%(errors)s -

- -

En fazla yamalanmış 5 kaynak paket:

-%(most_patched)s -

- -

En uzun actions.py betikli 5 kaynak paket:

-%(longpy)s -

- -

Eksik ikili paketler

-%(missing)s -

- -%(sizes)s - -

Paketçiler:

-%(packagers)s -

- -
- -""" - -def_packager_html = u""" - - Paketçi %(name)s - - - -
-
-
- -

%(name)s <%(email)s>

- -

Paketler:

-

%(sources)s

- -

Güncellemeler:

-

%(updates)s

-
- -""" - -def_package_html = u""" - - İkili paket %(name)s - - - - -
-
-
- -

İkili paket: %(name)s

-

Kaynak versiyon %(version)s, depo sürümü %(release)s

- -

Kaynak paket %(source)s

- -

Derlemek için gerekenler:

-

%(buildDeps)s

- -

Çalıştırmak için gerekenler:

-

%(runtimeDeps)s

- -

Bağımlı paketler (derlenmek için):

-

%(revBuildDeps)s

- -

Bağımlı paketler (çalışmak için):

-

%(revRuntimeDeps)s

-
- -""" - -def_history_html= u""" -
Sürüm %s

-Tarih: %s
-Yapan: %s
-Açıklama: %s -

-""" - -def_source_html = u""" - - Kaynak paket %(name)s - - - - -
-
-
- -

Kaynak paket: %(name)s

-

Kaynak versiyon %(version)s, depo sürümü %(release)s

-

%(homepage)s

- -

Açıklama

-

%(summary)s

- -

Lisanslar:

-

%(license)s

- -

İşlemler:

-

Paket dosyalarına bak

-

-Hata kayıtlarına bak

- -

Bu kaynaktan derlenen ikili paketler:

-

%(packages)s

- -

Tarihçe

-%(history)s - -

Yamalar

-%(patches)s -
- -""" - -def_sources_html = u""" - - Kaynak paketler listesi - - - - -
-
-
- -

Kaynak paketler listesi

-
- -

-%(source_list)s -

-
- -""" - -def_missing_html = u""" - - Eksik ikili paket %(name)s - - - - -
-
-
- -

Eksik ikili paket: %(name)s

- -

Bağımlı paketler (derlenmek için):

-

%(revBuildDeps)s

- -

Bağımlı paketler (çalışmak için):

-

%(revRuntimeDeps)s

-
- -""" - - -def svn_uri(path): - # init - core.apr_initialize() - pool = core.svn_pool_create(None) - core.svn_config_ensure(None, pool) - # get commit date - uri = client.svn_client_url_from_path(path, pool) - # cleanup - core.svn_pool_destroy(pool) - core.apr_terminate() - return uri - - -# FIXME: This check should be in specfile -valid_filetypes = [ - "executable", - "library", - "data", - "config", - "doc", - "man", - "info", - "localedata", - "header", - "all" -] - -def valuesort(x, y): - if x[1] > y[1]: - return -1 - elif x[1] == y[1]: - return 0 - else: - return 1 - -def find_pspecs(folder): - paks = [] - for root, dirs, files in os.walk(folder): - if "pspec.xml" in files: - paks.append(root) - # dont walk into the versioned stuff - if ".svn" in dirs: - dirs.remove(".svn") - return paks - -def template_get(tmpl_name): - try: - f = codecs.open(tmpl_name + ".html", "r", "utf-8") - data = f.read() - f.close() - return data - except: - return globals()["def_" + tmpl_name + "_html"] - -def template_write(filename, tmpl_name, dict): - f = codecs.open(filename, "w", "utf-8") - f.write(template_get(tmpl_name) % dict) - f.close() - -def template_table(tmpl_name, list): - tmpl = template_get(tmpl_name) - data = "" - for item in list: - data += (tmpl % item) - return data - -def mangle_email(email): - return re.sub("@", " [at] ", email) - - -class Histogram: - def __init__(self): - self.list = {} - - def add(self, name, value=None): - if value: - self.list[name] = value - else: - self.list[name] = self.list.get(name, 0) + 1 - - def note(self, name): - if not self.list.has_key(name): - self.list[name] = 0 - - def get_list(self, max=0): - items = self.list.items() - items.sort(valuesort) - if max != 0: - return items[:max] - else: - return items - - -# Dictionary of all source packages keyed by the source name -sources = {} - -# Dictionary of all binary packages keyed by the package name -packages = {} - -# Dictionary of all packagers keyed by the packager name -packagers = {} - -# Dictionary of missing depended binary packages keyed by the package name -missing = {} - -# List of all repository problems -errors = [] - - -class Missing: - def __init__(self, name): - missing[name] = self - self.name = name - self.revBuildDeps = [] - self.revRuntimeDeps = [] - - def report_html(self): - bDeps = map(lambda x: "%s" % (x, x), self.revBuildDeps) - rDeps = map(lambda x: "%s" % (x, x), self.revRuntimeDeps) - dict = { - "name": self.name, - "revBuildDeps": ", ".join(bDeps), - "revRuntimeDeps": ", ".join(rDeps) - } - template_write("paksite/package-%s.html" % self.name, "missing", dict) - - -class Package: - def __init__(self, source, pakspec): - name = pakspec.name - if packages.has_key(name): - errors.append(_("Duplicate binary packages:\n%s\n%s\n") % ( - source.name, packages[name].source.name)) - return - for p in pakspec.files: - if p.fileType not in valid_filetypes: - e = _("Unknown file type '%s' in package '%s'") % ( - p.fileType, source.name) - errors.append(e) - packages[name] = self - self.name = name - self.source = source - self.pakspec = pakspec - self.revBuildDeps = [] - self.revRuntimeDeps = [] - self.installedSize = 0 - - def markDeps(self): - # mark reverse build dependencies - for d in self.source.spec.source.buildDependencies: - p = d.package - if packages.has_key(p): - packages[p].revBuildDeps.append(self.name) - else: - if not missing.has_key(p): - Missing(p) - missing[p].revBuildDeps.append(self.name) - # mark reverse runtime dependencies - for d in self.pakspec.packageDependencies: - p = d.package - if packages.has_key(p): - packages[p].revRuntimeDeps.append(self.name) - else: - if not missing.has_key(p): - Missing(p) - missing[p].revRuntimeDeps.append(self.name) - - def report_html(self): - source = self.source.spec.source - bDeps = map(lambda x: "%s" % (x, x), - (map(lambda x: x.package, source.buildDependencies))) - rDeps = map(lambda x: "%s" % (x, x), - (map(lambda x: x.package, self.pakspec.packageDependencies))) - rbDeps = map(lambda x: "%s" % (x, x), self.revBuildDeps) - rrDeps = map(lambda x: "%s" % (x, x), self.revRuntimeDeps) - dict = { - "name": self.name, - "source": source.name, - "version": source.version, - "release": source.release, - "buildDeps": ", ".join(bDeps), - "runtimeDeps": ", ".join(rDeps), - "revBuildDeps": ", ".join(rbDeps), - "revRuntimeDeps": ", ".join(rrDeps) - } - template_write("paksite/package-%s.html" % self.name, "package", dict) - - -class Source: - def __init__(self, path, spec): - name = spec.source.name - if sources.has_key(name): - errors.append(_("Duplicate source packages:\n%s\n%s\n") % ( - path, sources[name].path)) - return - sources[name] = self - self.spec = spec - self.name = name - self.path = path - self.uri = svn_uri(path) - for p in spec.packages: - Package(self, p) - self.checkRelease() - - def validDate(self, date): - # yyyy-mm-dd - err = 0 - if len(date) != 10: - err = 1 - if date[4] != '-' or date[7] != '-': - err = 1 - if err: - e = _("Source package '%s' has wrong date format '%s'") % (self.name, date) - errors.append(e) - # more checks can be added, i.e. valid day month ranges, etc - - def checkRelease(self): - # FIXME: this check also belongs to specfile - prev = None - prevDate = None - for h in self.spec.source.history: - if prev: - prev -= 1 - self.validDate(h.date) - if prev <= 0: - e = _("Source package '%s' has wrong release numbers") % self.name - errors.append(e) - return - if int(h.release) != prev: - e = _("Source package '%s' lacks release %d") % (self.name, prev) - errors.append(e) - return - else: - prev = int(h.release) - prevDate = h.date - self.validDate(prevDate) - if prev != 1: - e = _("Source package '%s' has no first release") % self.name - errors.append(e) - - def report_html(self): - source = self.spec.source - paks = map(lambda x: "%s" % (x, x), - (map(lambda x: x.name, self.spec.packages))) - histdata = map(lambda x: (x.release, x.date, x.name, x.name, x.comment), self.spec.history) - ptch = map(lambda x: "%s" % (self.uri, - x.filename, x.filename), source.patches) - dict = { - "name": self.name, - "homepage": source.homepage, - "license": ", ".join(source.license), - "version": source.version, - "release": source.release, - "history": template_table("history", histdata), - "packages": "
".join(paks), - "summary": source.summary, - "patches": "
".join(ptch), - "uri": self.uri - } - template_write("paksite/source-%s.html" % self.name, "source", dict) - - -class Packager: - def __init__(self, spec, update=None): - if update: - name = update.name - email = update.email - else: - name = spec.source.packager.name - email = spec.source.packager.email - if packagers.has_key(name): - if email != packagers[name].email: - e = _("Developer '%s <%s>' has another mail address '%s' in source package '%s'") % ( - name, packagers[name].email, email, spec.source.name) - packagers[name].errors.append(e) - errors.append(e) - if update: - packagers[name].updates.append((spec.source.name, update.release, update.comment)) - else: - packagers[name].sources.append(spec.source.name) - else: - packagers[name] = self - self.name = name - self.email = email - if update: - self.sources = [] - self.updates = [(spec.source.name, update.release, update.comment)] - else: - self.sources = [spec.source.name] - self.updates = [] - self.errors = [] - if not update: - for update in spec.history: - Packager(spec, update) - - def report_html(self): - srcs = map(lambda x: "%s" % (x, x), self.sources) - srcs.sort() - upds = map(lambda x: "%s (%s)
%s
" % ( - x[0], x[0], x[1], x[2]), self.updates) - dict = { - "name": self.name, - "email": mangle_email(self.email), - "sources": "
".join(srcs), - "updates": " ".join(upds) - } - template_write("paksite/%s.html" % self.name, "packager", dict) - - -class Repository: - def __init__(self, path): - self.path = path - self.nr_sources = 0 - self.nr_packages = 0 - self.nr_patches = 0 - self.people = Histogram() - self.licenses = Histogram() - self.mostpatched = Histogram() - self.longpy = Histogram() - self.cscripts = Histogram() - self.total_installed_size = 0 - self.installed_sizes = {} - - def processPspec(self, path, spec): - # new classes - Packager(spec) - Source(path, spec) - # update global stats - self.nr_sources += 1 - self.nr_packages += len(spec.packages) - self.nr_patches += len(spec.source.patches) - # update top fives - self.people.add(spec.source.packager.name) - for u in spec.history: - self.people.note(u.name) - for p in spec.packages: - for cs in p.providesComar: - self.cscripts.add(cs.om) - for L in spec.source.license: - self.licenses.add(L) - self.mostpatched.add(spec.source.name, len(spec.source.patches)) - try: - f = file(os.path.join(path, "actions.py")) - L = len(f.readlines()) - self.longpy.add(spec.source.name, L) - f.close() - except: - pass - - def scan(self): - for pak in find_pspecs(self.path): - spec = pisi.specfile.SpecFile() - try: - spec.read(os.path.join(pak, "pspec.xml")) - except Exception, inst: - errors.append(_("Cannot parse '%s':\n%s\n") % (pak, inst.args[0])) - continue - self.processPspec(pak, spec) - for p in packages.values(): - p.markDeps() - - def processPisi(self, path): - p = pisi.package.Package(path) - p.extract_files(["metadata.xml", "files.xml"], ".") - md = pisi.metadata.MetaData() - md.read("metadata.xml") - self.total_installed_size += md.package.installedSize - if packages.has_key(md.package.name): - # FIXME: check version/release match too? - packages[md.package.name].installed_size = md.package.installedSize - else: - printu("Binary package '%s' has no source package in repository %s\n" % (path, self.path)) - fd = pisi.files.Files() - fd.read("files.xml") - for f in fd.list: - if self.installed_sizes.has_key(f.type): - # Emtpy directories and symlinks has None size - if not f.size is None: - self.installed_sizes[f.type] += int(f.size) - else: - self.installed_sizes[f.type] = int(f.size) - - def scan_bins(self, binpath): - for root, dirs, files in os.walk(binpath): - for fn in files: - if fn.endswith(".pisi"): - self.processPisi(os.path.join(root, fn)) - - def report_html(self): - miss = map(lambda x: "%s" % (x, x), missing.keys()) - upeople = [] - for p in self.people.get_list(): - upeople.append(("%s" % (p[0], p[0]), p[1])) - if errors: - e = "
".join(errors) - else: - e = "" - upatch = [] - for p in self.mostpatched.get_list(5): - upatch.append(("%s" % (p[0], p[0]), p[1])) - ulongpy = [] - for p in self.longpy.get_list(5): - ulongpy.append(("%s" % (p[0], p[0]), p[1])) - if self.total_installed_size: - items = self.installed_sizes.items() - items.sort(valuesort) - elts = "".join(map(lambda x: "%s%d" % (x[0], x[1]), items)) - sizes = template_get("repo_sizes") % { "total": self.total_installed_size, "sizes": elts } - else: - sizes = "" - dict = { - "nr_source": self.nr_sources, - "nr_packages": self.nr_packages, - "nr_patches": self.nr_patches, - "most_patched": template_table("table", upatch), - "longpy": template_table("table", ulongpy), - "packagers": template_table("table", upeople), - "missing": "\n".join(miss), - "sizes": sizes, - "errors": e - } - template_write("paksite/index.html", "repo", dict) - srclist = map(lambda x: "%s" % (x, x), sources) - srclist.sort() - dict = { - "source_list": "
".join(srclist) - } - template_write("paksite/sources.html", "sources", dict) - - -# command line driver - -def usage(): - printu(_("Usage: repostats.py [OPTIONS] source-repo-path [binary-repo-path]\n")) - printu(" -t, --test-only: %s" % _("Dont generate the web site.\n")) - sys.exit(0) - -if __name__ == "__main__": - try: - opts, args = getopt.gnu_getopt(sys.argv[1:], "ht", ["help", "test-only"]) - except: - usage() - - if args == []: - usage() - - do_web = True - - for o, v in opts: - if o in ("-h", "--help"): - usage() - if o in ("-t", "--test-only"): - do_web = False - - repo = Repository(args[0]) - printu(_("Scanning source repository...\n")) - repo.scan() - - if len(args) > 1: - printu(_("Scanning binary packages...\n")) - repo.scan_bins(args[1]) - - if errors: - printu("***\n") - printu(_("Encountered %d errors! Fix them immediately!\n") % len(errors)) - for e in errors: - printu(e) - printu("\n") - printu("\n") - printu("***\n") - - if missing: - printu(_("These dependencies are not available in repository:\n")) - for m in missing.keys(): - printu(" %s\n" % m) - - if do_web: - try: - os.mkdir("paksite") - except: - pass - repo.report_html() - for p in packagers.values(): - p.report_html() - for p in missing.values(): - p.report_html() - for p in packages.values(): - p.report_html() - for p in sources.values(): - p.report_html() diff --git a/tags/pisi-1.1_beta13/scripts/residuary-binary.py b/tags/pisi-1.1_beta13/scripts/residuary-binary.py deleted file mode 100755 index bf96cc54..00000000 --- a/tags/pisi-1.1_beta13/scripts/residuary-binary.py +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. - -import os -import re -import sys - -from pisi.specfile import SpecFile -from pisi.util import join_path, pure_package_name - -def findPspec(folder): - pspecList = [] - for root, dirs, files in os.walk(folder): - if "pspec.xml" in files: - pspecList.append(root) - # dont walk into the versioned stuff - if ".svn" in dirs: - dirs.remove(".svn") - return pspecList - -def getPackages(pspecList): - packages = [] - for pspec in pspecList: - specFile = SpecFile(join_path(pspec, "pspec.xml")) - for p in specFile.packages: - packages += [p.name] - return packages - -def usage(miniMe): - print """Usage: - %s srcREP binREP (ex: %s /home/bahadir/repos/pardus/devel/kernel /home/bahadir/binary) - """ % (miniMe, miniMe) - - sys.exit(1) - -if __name__ == "__main__": - try: - repSRC = sys.argv[1] - except IndexError: - usage(sys.argv[0]) - - try: - repBIN = sys.argv[2] - except IndexError: - usage(sys.argv[0]) - - packages = getPackages(findPspec(repSRC)) - - binaries = {} - for f in filter(lambda x: x.endswith(".pisi"), os.listdir(repBIN)): - binaries[pure_package_name(f)] = f - - print "Residuary binary packages:" - for b in binaries: - if b not in packages: - print " %s" % binaries[b] diff --git a/tags/pisi-1.1_beta13/scripts/rmcomp-source-repo.py b/tags/pisi-1.1_beta13/scripts/rmcomp-source-repo.py deleted file mode 100755 index bd7a2ff0..00000000 --- a/tags/pisi-1.1_beta13/scripts/rmcomp-source-repo.py +++ /dev/null @@ -1,46 +0,0 @@ -#! /usr/bin/python -# a simple tool to list stuff in source repository -# author: exa - -import sys -import os - -import pisi -import pisi.api -import pisi.config -import pisi.specfile as specfile -import pisi.context as ctx -import pisi.util -import pisi.pxml.xmlfilecdom as xmlfile - -options = pisi.config.Options() -if len(sys.argv) > 2: - options.destdir=sys.argv[2] -else: - options.destdir = '/' -pisi.api.init(database=False, options=options) -repo_uri = sys.argv[1] - -for root, dirs, files in os.walk(repo_uri): - for fn in files: - if fn == 'pspec.xml': - sf = xmlfile.XmlFile(tag = 'PISI') - path = pisi.util.join_path(root, fn) - ctx.ui.info('Looking at %s' % path) - ls = file(path).readlines() - ls = filter(lambda x:x.find('')==-1, ls) - f = file(path, 'w') - for x in ls: - f.write(x) - f.close() - #sf.readxml(path) - #src = sf.getNode('Source') - #comp = sf.getNode('Source/PartOf') - #print src, comp - #if comp: - # print 'removing partof tag' - # src.removeChild(comp) - #else: - # print 'no comp already' - #sf.writexml(path) -pisi.api.finalize() diff --git a/tags/pisi-1.1_beta13/scripts/unpisi b/tags/pisi-1.1_beta13/scripts/unpisi deleted file mode 100755 index 64868bf2..00000000 --- a/tags/pisi-1.1_beta13/scripts/unpisi +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- -# -# Copyright (C) 2006, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. - -import sys -import os - -import pisi -from pisi.archive import ArchiveZip, ArchiveTar -from pisi.zipfileext import BadZipfile -import pisi.context as ctx -import pisi.util as util - -def usage(errmsg): - print """ - Error: %s - - Usage: - unpisi PiSi_package.PiSi - """ % (errmsg) - - sys.exit(1) - -def main(): - - if len(sys.argv) < 2: - usage("PiSi package required..") - - pisi.api.init(database=False, options='') - - try: - arc = ArchiveZip(sys.argv[1], 'zip', 'r') - except BadZipfile, e: - print e - sys.exit(1) - - arc.unpack_files(['files.xml', 'metadata.xml'], '.') - arc.unpack_files("install.tar.lzma", ctx.config.tmp_dir()) - arc.unpack_dir_flat('comar','comar') - - tar_file = util.join_path(ctx.config.tmp_dir(), "install.tar.lzma") - tar = ArchiveTar(tar_file, 'tarlzma') - tar.unpack_dir('.') - - os.unlink(tar_file) - os.unlink(tar_file.rstrip('.lzma')) - - pisi.api.finalize() - return 0 - -if __name__ == "__main__": - sys.exit(main()) diff --git a/tags/pisi-1.1_beta13/setup.py b/tags/pisi-1.1_beta13/setup.py deleted file mode 100755 index 2d79bee2..00000000 --- a/tags/pisi-1.1_beta13/setup.py +++ /dev/null @@ -1,129 +0,0 @@ -#!/usr/bin/env python -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# -# Authors: {eray,gurer}@pardus.org.tr - -import os -import shutil -import glob -import sys -import inspect -from distutils.core import setup -from distutils.command.install import install - -sys.path.insert(0, '.') -import pisi - -i18n_domain = "pisi" -i18n_languages = "tr" - -class Install(install): - def run(self): - install.run(self) - self.installi18n() - self.installdoc() - self.generateConfigFile() - - def installi18n(self): - for lang in i18n_languages.split(' '): - print "Installing '%s' translations..." % lang - os.popen("msgfmt po/%s.po -o po/%s.mo" % (lang, lang)) - if not self.root: - self.root = "/" - destpath = os.path.join(self.root, "usr/share/locale/%s/LC_MESSAGES" % lang) - try: - os.makedirs(destpath) - except: - pass - shutil.copy("po/%s.mo" % lang, os.path.join(destpath, "%s.mo" % i18n_domain)) - - def installdoc(self): - destpath = os.path.join(self.root, "usr/share/doc/pisi") - try: - os.makedirs(destpath) - except: - pass - os.chdir('doc') - for pdf in glob.glob('*.pdf'): - print 'Installing', pdf - shutil.copy(pdf, os.path.join(destpath, pdf)) - os.chdir('..') - - def generateConfigFile(self): - import pisi.configfile - destpath = os.path.join(self.root, "etc/pisi/") - try: - os.makedirs(destpath) - except: - pass - pisiconf = open(os.path.join(destpath, "pisi.conf"), "w") - - klasses = inspect.getmembers(pisi.configfile, inspect.isclass) - defaults = [klass for klass in klasses if klass[0].endswith('Defaults')] - - for d in defaults: - section_name = d[0][:-len('Defaults')].lower() - pisiconf.write("[%s]\n" % section_name) - - section_members = [m for m in inspect.getmembers(d[1]) \ - if not m[0].startswith('__') \ - and not m[0].endswith('__')] - - for member in section_members: - pisiconf.write("# %s = %s\n" % (member[0], member[1])) - - pisiconf.write('\n') - - -setup(name="pisi", - version= pisi.__version__, - description="PISI (Packages Installed Successfully as Intended)", - long_description="PISI is the package management system of Pardus Linux.", - license="GNU GPL2", - author="Pardus Developers", - author_email="pisi@pardus.org.tr", - url="http://www.pardus.org.tr/eng/pisi/", - package_dir = {'': ''}, - packages = ['pisi', 'pisi.cli', 'pisi.actionsapi', 'pisi.pxml', 'pisi.search'], - scripts = ['pisi-cli', 'scripts/repostats.py', 'scripts/find-lib-deps.py', - 'scripts/lspisi', 'scripts/unpisi', - 'scripts/calc-build-order.py', 'scripts/pisish', 'scripts/pisimedia'], - cmdclass = { - 'install' : Install - } - ) - -# the below stuff is really nice but we already have a version -# we can use this stuff for svn snapshots in a separate -# script, or with a parameter I don't know -- exa - -PISI_VERSION = pisi.__version__ - -def getRevision(): - import os - try: - p = os.popen("svn info 2> /dev/null") - for line in p.readlines(): - line = line.strip() - if line.startswith("Revision:"): - return line.split(":")[1].strip() - except: - pass - - # doesn't working in a Subversion directory - return None - -def getVersion(): - rev = getRevision() - if rev: - return "-r".join([PISI_VERSION, rev]) - else: - return PISI_VERSION diff --git a/tags/pisi-1.1_beta13/tests/README b/tags/pisi-1.1_beta13/tests/README deleted file mode 100644 index 35feab83..00000000 --- a/tags/pisi-1.1_beta13/tests/README +++ /dev/null @@ -1,11 +0,0 @@ -PISI test suite ---------------- - - -There are python unit tests and shell scripts in this directory. - -Run the python tests with - -$ tests/run.py - -Shell scripts use the CLIs to perform package operations. diff --git a/tags/pisi-1.1_beta13/tests/a.xml b/tags/pisi-1.1_beta13/tests/a.xml deleted file mode 100644 index ee6a6e29..00000000 --- a/tags/pisi-1.1_beta13/tests/a.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - cıvık mantardır bu - Eray Ozkural - 868 - Lazy Tin - Tembel Teneke - pisi - noatun - kdevelop - - 18071976 - AI - - Baris - Gurer - Caglar - Meren - - - diff --git a/tags/pisi-1.1_beta13/tests/actionsapitests.py b/tags/pisi-1.1_beta13/tests/actionsapitests.py deleted file mode 100644 index 53f7335d..00000000 --- a/tags/pisi-1.1_beta13/tests/actionsapitests.py +++ /dev/null @@ -1,155 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. - -import unittest -import zipfile -import shutil -import os - -import testcase - -class ActionsAPITestCase(testcase.TestCase): - def setUp(self): - from pisi.actionsapi.variables import initVariables - - testcase.TestCase.setUp(self) - initVariables() - #FIXME: test incomplete - return - self.f = zipfile.ZipFile("helloworld-0.1-1.pisi", "r") - self.filelist = [] - - for file in self.f.namelist(): - self.filelist.append(file) - - def testFileList(self): - #FIXME: test incomplete - return - fileContent = ["files.xml", \ - "install/bin/helloworld", \ - "install/opt/PARDUS", \ - "install/opt/helloworld/helloworld", \ - "install/opt/uludag", \ - "install/sbin/helloworld", \ - "install/sys/PARDUS", \ - "install/sys/uludag", \ - "install/usr/bin/goodbye", \ - "install/usr/bin/helloworld", \ - "install/usr/lib/helloworld.o", \ - "install/usr/sbin/goodbye", \ - "install/usr/sbin/helloworld", \ - "install/usr/share/doc/helloworld-0.1-1/Makefile.am", \ - "install/usr/share/doc/helloworld-0.1-1/goodbyeworld.cpp", \ - "install/usr/share/info/Makefile.am", \ - "install/usr/share/info/Makefile.cvs", \ - "install/usr/share/info/Makefile.in", \ - "install/var/goodbye", \ - "install/var/hello", \ - "metadata.xml"] - - '''check number of files in package''' - self.assertEqual(fileContent.__len__(), self.filelist.__len__()) - - '''check file content''' - for file in self.filelist: - self.assert_(fileContent.__contains__(file)) - - def testShelltoolsCopy(self): - from pisi.actionsapi.shelltools import copy - - copy('tests/actionsapitests/brokenlink', 'tests/actionsapitests/brokenlink-copy') - self.assertEqual(os.path.islink('tests/actionsapitests/brokenlink-copy'), True) - os.remove('tests/actionsapitests/brokenlink-copy') - - copy('tests/actionsapitests/brokenlink', 'tests/actionsapitests/adirectory') - self.assertEqual(os.path.islink('tests/actionsapitests/adirectory/brokenlink'), True) - - copy('tests/actionsapitests/brokenlink', 'tests/actionsapitests/adirectory/brknlnk') - self.assertEqual(os.path.islink('tests/actionsapitests/adirectory/brknlnk'), True) - os.remove('tests/actionsapitests/adirectory/brknlnk') - - self.assertEqual(os.readlink('tests/actionsapitests/adirectory/brokenlink'), '/no/such/place') - os.remove('tests/actionsapitests/adirectory/brokenlink') - - copy('tests/actionsapitests/linktoadirectory', 'tests/actionsapitests/adirectory/', False) - self.assertEqual(os.path.exists('tests/actionsapitests/adirectory/linktoadirectory/file'), True) - self.assertEqual(os.path.getsize('tests/actionsapitests/adirectory/linktoadirectory/file'), 321) - shutil.rmtree('tests/actionsapitests/adirectory/linktoadirectory') - - copy('tests/actionsapitests/file', 'tests/actionsapitests/adirectory') - self.assertEqual(os.path.isfile('tests/actionsapitests/adirectory/file'), True) - #overwrite.. - copy('tests/actionsapitests/file', 'tests/actionsapitests/adirectory') - os.remove('tests/actionsapitests/adirectory/file') - - copy('tests/actionsapitests/linktoafile', 'tests/actionsapitests/adirectory', False) - ourguy = 'tests/actionsapitests/%s' % os.readlink('tests/actionsapitests/linktoafile') - self.assert_(os.path.exists(ourguy)) - - copy('tests/actionsapitests/file', 'tests/actionsapitests/file-copy') - self.assertEqual(os.path.exists('tests/actionsapitests/file-copy'), True) - os.remove('tests/actionsapitests/file-copy') - - copy('tests/actionsapitests/file', 'tests/actionsapitests/adirectory/filewithanothername') - self.assertEqual(os.path.exists('tests/actionsapitests/adirectory/filewithanothername'), True) - os.remove('tests/actionsapitests/adirectory/filewithanothername') - - copy('tests/actionsapitests/linkeddir', 'tests/actionsapitests/adirectory') - self.assertEqual(os.path.exists('tests/actionsapitests/adirectory/linkeddir/file'), True) - shutil.rmtree('tests/actionsapitests/adirectory/linkeddir') - - copy('tests/actionsapitests/linkeddir', 'tests/actionsapitests/adirectory/withanothername') - self.assertEqual(os.path.exists('tests/actionsapitests/adirectory/withanothername/file'), True) - shutil.rmtree('tests/actionsapitests/adirectory/withanothername') - - def testShelltoolsCanAccessFile(self): - from pisi.actionsapi.shelltools import can_access_file - - self.assert_(can_access_file('tests/actionsapitests/file')) - self.assert_(not can_access_file('tests/actionsapitests/fileX')) - self.assert_(can_access_file('tests/actionsapitests/linktoafile')) - - def testShelltoolsCanAccessDir(self): - from pisi.actionsapi.shelltools import can_access_directory - - self.assert_(can_access_directory('tests/actionsapitests/adirectory')) - self.assert_(not can_access_directory('tests/actionsapitests/adirectoryX')) - self.assert_(can_access_directory('tests/actionsapitests/linktoadirectory')) - - - def testShelltoolsMakedirs(self): - from pisi.actionsapi.shelltools import makedirs - - makedirs('tests/actionsapitests/testdirectory/into/a/directory') - self.assertEqual(os.path.exists('tests/actionsapitests/testdirectory/into/a/directory'), True) - shutil.rmtree('tests/actionsapitests/testdirectory') - - def testShelltoolsEcho(self): - from pisi.actionsapi.shelltools import echo - - echo('tests/actionsapitests/echo-file', 'hububat fiyatları') - self.assertEqual(os.path.exists('tests/actionsapitests/echo-file'), True) - self.assertEqual(open('tests/actionsapitests/echo-file').readlines()[0].strip(), "hububat fiyatları") - echo('tests/actionsapitests/echo-file', 'fiyat hububatları') - self.assertEqual(open('tests/actionsapitests/echo-file').readlines()[1].strip(), "fiyat hububatları") - os.remove('tests/actionsapitests/echo-file') - - - def testShelltoolsSystem(self): - from pisi.actionsapi.shelltools import system as s - - self.assertEqual(os.path.exists('tests/actionsapitests/systest'), False) - s('touch tests/actionsapitests/systest') - self.assertEqual(os.path.exists('tests/actionsapitests/systest'), True) - os.remove('tests/actionsapitests/systest') - - - -suite = unittest.makeSuite(ActionsAPITestCase) diff --git a/tags/pisi-1.1_beta13/tests/actionsapitests/brokenlink b/tags/pisi-1.1_beta13/tests/actionsapitests/brokenlink deleted file mode 120000 index 8f608d48..00000000 --- a/tags/pisi-1.1_beta13/tests/actionsapitests/brokenlink +++ /dev/null @@ -1 +0,0 @@ -/no/such/place \ No newline at end of file diff --git a/tags/pisi-1.1_beta13/tests/actionsapitests/file b/tags/pisi-1.1_beta13/tests/actionsapitests/file deleted file mode 100644 index 2c435ef3..00000000 --- a/tags/pisi-1.1_beta13/tests/actionsapitests/file +++ /dev/null @@ -1,6 +0,0 @@ -toplam 4 -drwxr-xr-x 2 meren users 4096 Mar 10 12:55 adirectory -lrwxrwxrwx 1 meren users 14 Mar 10 12:41 brokenlink -> /no/such/place --rw-r--r-- 1 meren users 0 Mar 10 12:57 file -lrwxrwxrwx 1 meren users 4 Mar 10 12:42 linktoadirectory -> /etc -lrwxrwxrwx 1 meren users 11 Mar 10 12:42 linktoafile -> /etc/passwd diff --git a/tags/pisi-1.1_beta13/tests/actionsapitests/linkeddir/file b/tags/pisi-1.1_beta13/tests/actionsapitests/linkeddir/file deleted file mode 100644 index 2c435ef3..00000000 --- a/tags/pisi-1.1_beta13/tests/actionsapitests/linkeddir/file +++ /dev/null @@ -1,6 +0,0 @@ -toplam 4 -drwxr-xr-x 2 meren users 4096 Mar 10 12:55 adirectory -lrwxrwxrwx 1 meren users 14 Mar 10 12:41 brokenlink -> /no/such/place --rw-r--r-- 1 meren users 0 Mar 10 12:57 file -lrwxrwxrwx 1 meren users 4 Mar 10 12:42 linktoadirectory -> /etc -lrwxrwxrwx 1 meren users 11 Mar 10 12:42 linktoafile -> /etc/passwd diff --git a/tags/pisi-1.1_beta13/tests/actionsapitests/linktoadirectory b/tags/pisi-1.1_beta13/tests/actionsapitests/linktoadirectory deleted file mode 120000 index 38d37cf7..00000000 --- a/tags/pisi-1.1_beta13/tests/actionsapitests/linktoadirectory +++ /dev/null @@ -1 +0,0 @@ -linkeddir/ \ No newline at end of file diff --git a/tags/pisi-1.1_beta13/tests/actionsapitests/linktoafile b/tags/pisi-1.1_beta13/tests/actionsapitests/linktoafile deleted file mode 120000 index 1a010b1c..00000000 --- a/tags/pisi-1.1_beta13/tests/actionsapitests/linktoafile +++ /dev/null @@ -1 +0,0 @@ -file \ No newline at end of file diff --git a/tags/pisi-1.1_beta13/tests/archivetests.py b/tags/pisi-1.1_beta13/tests/archivetests.py deleted file mode 100644 index 53e2e2e5..00000000 --- a/tags/pisi-1.1_beta13/tests/archivetests.py +++ /dev/null @@ -1,114 +0,0 @@ -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# - -import unittest -import os -from os.path import exists as pathexists -from os.path import basename, islink, join - -import pisi.context as ctx -import pisi.api -from pisi import archive -from pisi import sourcearchive -from pisi import fetcher -from pisi import util -from pisi.specfile import SpecFile -from pisi import uri - -import testcase - -class ArchiveFileTestCase(testcase.TestCase): - - def testUnpackTar(self): - spec = SpecFile("tests/popt/pspec.xml") - targetDir = '/tmp/pisitest' - achv = sourcearchive.SourceArchive(spec, targetDir) - - assert spec.source.archive.type == "targz" - - # skip fetching and directly unpack the previously fetched (by - # fetchertests) archive - if not achv.is_cached(interactive=False): - achv.fetch(interactive=False) - achv.unpack() - - # but testing is hard - # "var/tmp/pisi/popt-1.7-3/work" (targetDir) - assert pathexists(targetDir + "/popt-1.7") - - testfile = targetDir + "/popt-1.7/Makefile.am" - assert pathexists(testfile) - - # check file integrity - self.assertEqual(util.sha1_file(testfile), - "5af9dd7d754f788cf511c57ce0af3d555fed009d") - - def testUnpackZip(self): - spec = SpecFile("tests/pccts/pspec.xml") - targetDir = '/tmp/pisitest' - - assert spec.source.archive.type == "zip" - - achv = sourcearchive.SourceArchive(spec, targetDir) - achv.fetch(interactive=False) - achv.unpack(clean_dir=True) - - assert pathexists(targetDir + "/pccts") - - testfile = targetDir + "/pccts/history.txt" - assert pathexists(testfile) - - # check file integrity - self.assertEqual(util.sha1_file(testfile), - "f2be0f9783e84e98fe4e2b8201a8f506fcc07a4d") - -# TODO: no link file in pccts package. Need to find a ZIP file -# containing a symlink - # check for symbolic links -# testfile = targetDir + "/sandbox/testdir/link1" -# assert islink(testfile) - - def testMakeZip(self): - # first unpack our dear sandbox.zip - spec = SpecFile("tests/pccts/pspec.xml") - targetDir = '/tmp/pisitest' - achv = sourcearchive.SourceArchive(spec, targetDir) - achv.fetch(interactive=False) - achv.unpack(clean_dir=True) - del achv - - newZip = targetDir + "/new.zip" - zip = archive.ArchiveZip(newZip, 'zip', 'w') - sourceDir = targetDir + "/pccts" - zip.add_to_archive(sourceDir) - zip.close() - - #TODO: do some more work to test the integrity of new zip file - - def testUnpackZipCond(self): - spec = SpecFile("tests/pccts/pspec.xml") - targetDir = '/tmp' - achv = sourcearchive.SourceArchive(spec, targetDir) - url = uri.URI(spec.source.archive.uri) - filePath = join(ctx.config.archives_dir(), url.filename()) - - # check cached - if util.sha1_file(filePath) != spec.source.archive.sha1sum: - fetch = fetcher.Fetcher(spec.source.archive.uri, targetDir) - fetch.fetch() - assert spec.source.archive.type == "zip" - - achv = archive.Archive(filePath, spec.source.archive.type) - achv.unpack_files(["pccts/history.txt"], targetDir) - assert pathexists(targetDir + "/pccts") - testfile = targetDir + "/pccts/history.txt" - assert pathexists(testfile) - -suite = unittest.makeSuite(ArchiveFileTestCase) diff --git a/tags/pisi-1.1_beta13/tests/autoxmltests.py b/tags/pisi-1.1_beta13/tests/autoxmltests.py deleted file mode 100644 index c24400f5..00000000 --- a/tags/pisi-1.1_beta13/tests/autoxmltests.py +++ /dev/null @@ -1,102 +0,0 @@ -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# - -import unittest -import os -import xml.dom.minidom as mdom -from xml.parsers.expat import ExpatError -import types - -import pisi -import pisi.api -from pisi.pxml import xmlfile -from pisi.pxml import autoxml -import pisi.util as util - -class AutoXmlTestCase(unittest.TestCase): - - def setUp(self): - - class OtherInfo: - __metaclass__ = autoxml.autoxml - t_BirthDate = [types.StringType, autoxml.mandatory] - t_Interest = [types.StringType, autoxml.optional] - t_CodesWith = [ [types.StringType], autoxml.optional, 'CodesWith/Person'] - - class A(xmlfile.XmlFile): - __metaclass__ = autoxml.autoxml - t_Name = [types.StringType, autoxml.mandatory] - t_Description = [autoxml.LocalText, autoxml.mandatory] - t_Number = [types.IntType, autoxml.optional] - t_Email = [types.StringType, autoxml.optional] - a_href = [types.StringType, autoxml.mandatory] - t_Projects = [ [types.StringType], autoxml.mandatory, 'Project'] - t_OtherInfo = [ OtherInfo, autoxml.optional ] - s_Comment = [ autoxml.Text, autoxml.mandatory] - - self.A = A - - def testDeclaration(self): - self.assertEqual(len(self.A.decoders), 8) # how many fields in A? - self.assert_(hasattr(self.A, 'encode')) - - def testReadWrite(self): - a = self.A() - - # test initializer - self.assertEqual(a.href, None) - - # test read - a.read('tests/a.xml') - self.assert_(a.href.startswith('http')) - self.assertEqual(a.number, 868) - self.assertEqual(a.name, 'Eray Ozkural') - self.assertEqual(len(a.projects), 3) - self.assertEqual(len(a.otherInfo.codesWith), 4) - - self.assert_(not a.errors()) - - a.print_text(file('/tmp/a', 'w')) - la = file('/tmp/a').readlines() - self.assert_( util.any(lambda x:x.find('18071976')!=-1, la) ) - a.write('/tmp/a.xml') - - def testWriteRead(self): - a = self.A() - a.name = "Baris Metin" - a.email = "baris@uludag.org.tr" - a.description['tr'] = u'Melek, melek' - a.comment = u'Bu da zibidi aslinda ama caktirmiyor' - a.href = 'http://cekirdek.uludag.org.tr/~baris' - a.otherInfo.birthDate = '30101979' - a.projects = [ 'pisi', 'tasma', 'plasma' ] - errs = a.errors() - if errs: - self.fail( 'We got a bunch of errors: ' + str(errs)) - a.write('/tmp/a2.xml') - a2 = self.A() - a2.read('/tmp/a2.xml') - self.assertEqual(a, a2) - -class LocalTextTestCase(unittest.TestCase): - - def setUp(self): - a = autoxml.LocalText() - a['tr'] = u'Zibidi' - a['en'] = u'ingiliz hiyarlari ne anlar zibididen' - self.a = a - - def testStr(self): - s = str(self.a) - self.assert_(s!= None and len(s)>=6) - -suite1 = unittest.makeSuite(AutoXmlTestCase) -suite2 = unittest.makeSuite(LocalTextTestCase) -suite = unittest.TestSuite((suite1, suite2)) diff --git a/tags/pisi-1.1_beta13/tests/build.sh b/tags/pisi-1.1_beta13/tests/build.sh deleted file mode 100755 index a1276006..00000000 --- a/tags/pisi-1.1_beta13/tests/build.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/sh - -echo "beta functionality test script" -echo "working directory:" `pwd` -echo "cleaning destination dir: tmp" -PATH=$PATH:. -set -x # xtrace -set -e # errexit -rm -rf tmp -#echo "*** build tests" -pisi-cli -Dtmp build http://svn.uludag.org.tr/pardus/devel/system/base/zip/pspec.xml http://svn.uludag.org.tr/pardus/devel/system/base/unzip/pspec.xml - -#partial-builds -pisi-cli -Dtmp build --until=setup http://svn.uludag.org.tr/pardus/devel/system/base/hdparm/pspec.xml -pisi-cli -Dtmp build --until=build http://svn.uludag.org.tr/pardus/devel/system/base/hdparm/pspec.xml -pisi-cli -Dtmp build --until=install http://svn.uludag.org.tr/pardus/devel/system/base/hdparm/pspec.xml -pisi-cli -Dtmp build --until=package http://svn.uludag.org.tr/pardus/devel/system/base/hdparm/pspec.xml - -#echo "*** repository tests" - -pisi-cli -Dtmp index . -pisi-cli -Dtmp add-repo repo1 pisi-index.xml -pisi-cli -Dtmp update-repo repo1 -pisi-cli -Dtmp list-repo - -#echo "*** package ops" -pisi-cli -Dtmp info *.pisi -# pisi-cli list-available -pisi-cli -Dtmp install --ignore-comar zip -pisi-cli -Dtmp list-installed -pisi-cli -Dtmp remove --ignore-comar unzip -pisi-cli -Dtmp install --ignore-comar zip*.pisi -pisi-cli -Dtmp install --ignore-comar hdparm*.pisi flex*.pisi grep*.pisi -pisi-cli -Dtmp remove-repo repo1 -# pisi-cli list-available - -echo "*** database contents" -for x in `find tmp -iname '*.bdb'`; do - echo "contents of database " $x; - tools/cat-db.py $x; -done diff --git a/tags/pisi-1.1_beta13/tests/buildtests.py b/tags/pisi-1.1_beta13/tests/buildtests.py deleted file mode 100644 index a90e9236..00000000 --- a/tags/pisi-1.1_beta13/tests/buildtests.py +++ /dev/null @@ -1,59 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. - - -import unittest -import shutil -import glob -import os - -import testcase -from pisi.build import * - -class BuildTestCase(testcase.TestCase): - - def cleanOutput(self): - for x in glob.glob('tmp/a*.pisi'): - os.unlink(x) - - def setUp(self): - options = pisi.config.Options() - options.ignore_build_no = False - options.output_dir = 'tmp' - self.cleanOutput() - testcase.TestCase.setUp(self, options = options) - pisi.context.config.values.build.buildno = True - - def testBasicBuild(self): - shutil.copy('tests/buildtests/a/actions.py-1', 'tests/buildtests/a/actions.py') - pspec = 'tests/buildtests/a/pspec.xml' - pb = Builder(pspec) - pb.build() - self.assert_(os.path.exists('tmp/a-1.0-1-1.pisi')) - - def testBuildNumber(self): - self.cleanOutput() - self.testBasicBuild() - - pspec = 'tests/buildtests/a/pspec.xml' - shutil.copy('tests/buildtests/a/actions.py-2', 'tests/buildtests/a/actions.py') - pb = Builder(pspec) - pb.build() - self.assert_(os.path.exists('tmp/a-1.0-1-2.pisi')) - - pb = Builder(pspec) - pb.build() - # because nothing is changed - self.assert_(not os.path.exists('tmp/a-1.0-1-3.pisi')) - - os.remove('tests/buildtests/a/actions.py') - os.remove('tmp/a-1.0-1-2.pisi') - -suite = unittest.makeSuite(BuildTestCase) diff --git a/tags/pisi-1.1_beta13/tests/buildtests/a/actions.py-1 b/tags/pisi-1.1_beta13/tests/buildtests/a/actions.py-1 deleted file mode 100644 index 5a87e4b4..00000000 --- a/tags/pisi-1.1_beta13/tests/buildtests/a/actions.py-1 +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- -# -# Copyright 2005 TUBITAK/UEKAE -# Licensed under the GNU General Public License, version 2. -# See the file http://www.gnu.org/copyleft/gpl.txt. -# -# A. Murat Eren - -from pisi.actionsapi import pisitools - -WorkDir = "merhaba-pisi-1.0" - -def install(): - pisitools.dobin("merhaba-pisi.py") - - pisitools.rename("/usr/bin/merhaba-pisi.py", "merhaba-pisi") - - pisitools.dosym("./merhaba-pisi", "/usr/bin/justasysmlink") - pisitools.dosym("/thre/is/no/such/place", "/usr/bin/justabrokensymlink") diff --git a/tags/pisi-1.1_beta13/tests/buildtests/a/actions.py-2 b/tags/pisi-1.1_beta13/tests/buildtests/a/actions.py-2 deleted file mode 100644 index c8575662..00000000 --- a/tags/pisi-1.1_beta13/tests/buildtests/a/actions.py-2 +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- -# -# Copyright 2005 TUBITAK/UEKAE -# Licensed under the GNU General Public License, version 2. -# See the file http://www.gnu.org/copyleft/gpl.txt. -# -# A. Murat Eren - -from pisi.actionsapi import pisitools - -WorkDir = "merhaba-pisi-1.0" - -def install(): - pisitools.dobin("merhaba-pisi.py") - - pisitools.rename("/usr/bin/merhaba-pisi.py", "merhaba-pisi") - - pisitools.dosym("./merhaba-pisi", "/usr/bin/justasysmlink") - pisitools.dosym("/thre/is/no/such", "/usr/bin/justabrokensymlink") diff --git a/tags/pisi-1.1_beta13/tests/buildtests/a/pspec.xml b/tags/pisi-1.1_beta13/tests/buildtests/a/pspec.xml deleted file mode 100644 index cb49b179..00000000 --- a/tags/pisi-1.1_beta13/tests/buildtests/a/pspec.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - a - http://cekirdek.uludag.org.tr/~meren/merhaba-pisi.php - - A. Murat Eren - meren@uludag.org.tr - - As-Is - None - app:console - PiSi Hello World Application.. - PiSi için merhaba dünya uygulaması, süper bir konsol uygulaması - Just a basic application. Nothing to describe. - Sadece basit bir uygulama, açıklayacak bir ÅŸey yok - http://cekirdek.uludag.org.tr/~meren/merhaba-pisi-1.0.tar.gz - - - - a - - /usr/bin/ - - - - - - - 2006-02-01 - 1.0 - First release. - A. Murat Eren - meren@uludag.org.tr - - - diff --git a/tags/pisi-1.1_beta13/tests/configfiletests.py b/tags/pisi-1.1_beta13/tests/configfiletests.py deleted file mode 100644 index 5a136693..00000000 --- a/tags/pisi-1.1_beta13/tests/configfiletests.py +++ /dev/null @@ -1,61 +0,0 @@ -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# - -import unittest - -from pisi.configfile import ConfigurationFile - -# NB: no need for pisi testcase in these things that do well without pisi init -class ConfigFileTestCase(unittest.TestCase): - - def setUp(self): - self.cf = ConfigurationFile("tests/pisi.conf") - - def testSections(self): - cf = self.cf - if not cf.general: - self.fail("No 'general' section found in ConfigurationFile") - if not cf.build: - self.fail("No 'build' section found in ConfigurationFile") - if not cf.dirs: - self.fail("No 'dirs' section found in ConfigurationFile") - - def testValues(self): - cf = self.cf - - # test values from pisi.conf file - self.assertEqual(cf.general.destinationdirectory, "/testing") - self.assertEqual(cf.dirs.archives_dir, "/disk2/pisi/archives") - - # test default values - self.assertEqual(cf.dirs.tmp_dir, "/var/tmp/pisi") - - def testAccessMethods(self): - cf = self.cf - - self.assertEqual(cf.build.host, cf.build["host"]) - self.assertEqual(cf.dirs.index_dir, cf.dirs["index_dir"]) - - def testFlagsExists(self): - cf = self.cf - - #build - self.assert_(cf.build.cflags) - self.assert_(cf.build.cxxflags) - - #general - self.assert_(cf.general.destinationdirectory) - - #dirs - self.assert_(cf.dirs.index_dir) - self.assert_(cf.dirs.tmp_dir) - self.assert_(cf.dirs.packages_dir) - -suite = unittest.makeSuite(ConfigFileTestCase) diff --git a/tags/pisi-1.1_beta13/tests/conflicttests.py b/tags/pisi-1.1_beta13/tests/conflicttests.py deleted file mode 100644 index 0976f28b..00000000 --- a/tags/pisi-1.1_beta13/tests/conflicttests.py +++ /dev/null @@ -1,83 +0,0 @@ -# Copyright (C) 2006, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# -# Author: Faik Uygur - -import unittest -import pisi.context as ctx -import pisi.api -import pisi - -import testcase - -class ConflictTestCase(testcase.TestCase): - def setUp(self): - testcase.TestCase.setUp(self) - - d_t = {} - - # instx are the conflicting packages that are installed on the system. - # notinstx are conflicting packages that are not installed on the system. - # a-j are the packages to be installed. - packages = {"a": ["notinst1", "notinst2", "b"], - "b": ["a", "e", "f"], - "c": ["g", "h"], - "d": [], - "e": ["j"], - "f" : ["inst1", "notinst2", "f", "inst3", "notinst3"], - "g" : ["inst4", "notinst1"], - "h" : ["inst2", "inst3", "inst4", "notinst2"], - "i" : ["notinst2", "inst1"], - "j" : []} - - # packages that are installed on the system - ctx.installdb.purge('inst1') - ctx.installdb.purge('inst2') - ctx.installdb.purge('inst3') - ctx.installdb.purge('inst4') - ctx.installdb.install('inst1', '1.2', '2', '3') - ctx.installdb.install('inst2', '2.4', '2', '3') - ctx.installdb.install('inst3', '5.2', '2', '3') - ctx.installdb.install('inst4', '2.1', '2', '3') - - for name in packages.keys(): - pkg = pisi.specfile.Package() - pkg.name = name - pkg.conflicts = packages[name] - d_t[name] = pkg - - class PackageDB: - def get_package(self, key): - return d_t[str(key)] - - self.packagedb = PackageDB() - - def tearDown(self, ): - pisi.api.finalize() - - def testConflictWithEachOther(self): - packages = ["a", "b", "c", "d", "e"] - (C, D, pkg_conflicts) = pisi.operations.calculate_conflicts(packages, self.packagedb) - self.assert_(set(['a', 'b', 'e']) == D) - - def testConflictWithInstalled(self): - packages = ["g", "h", "i"] - (C, D, pkg_conflicts) = pisi.operations.calculate_conflicts(packages, self.packagedb) - self.assert_(not D) - self.assert_(set(['inst1', 'inst2', 'inst3', 'inst4']) == C) - self.assert_("notinst1" not in pkg_conflicts["g"]) - - def testConflictWithEachOtherAndInstalled(self): - packages = ["a", "b", "g", "h", "i"] - (C, D, pkg_conflicts) = pisi.operations.calculate_conflicts(packages, self.packagedb) - self.assert_(set(['a', 'b']) == D) - self.assert_(set(['inst1', 'inst2', 'inst3', 'inst4']) == C) - self.assert_(set(['inst2', 'inst3', 'inst4']) == pkg_conflicts["h"]) - -suite = unittest.makeSuite(ConflictTestCase) diff --git a/tags/pisi-1.1_beta13/tests/constantstests.py b/tags/pisi-1.1_beta13/tests/constantstests.py deleted file mode 100644 index 45a61b1c..00000000 --- a/tags/pisi-1.1_beta13/tests/constantstests.py +++ /dev/null @@ -1,67 +0,0 @@ -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# - -import unittest - -import pisi.context as ctx - -class ContextTestCase(unittest.TestCase): - - def testConstness(self): - const = ctx.const - - # test if we can get a const attribute? - try: - test = const.package_suffix - self.assertNotEqual(test, "") - except AttributeError: - self.fail("Couldn't get const attribute") - - # test binding a new constant - const.test = "test binding" - - # test re-binding (which is illegal) - try: - const.test = "test rebinding" - # we shouldn't reach here - self.fail("Rebinding a constant works. Something is wrong!") - except: - # we achived our goal with this error. infact, this is a - # ConstError but we can't catch it directly here - pass - - # test unbinding (which is also illegal) - try: - del const.test - # we shouldn't reach here - self.fail("Unbinding a constant works. Something is wrong!") - except: - # we achived our goal with this error. infact, this is a - # ConstError but we can't catch it directly here - pass - - def testConstValues(self): - const = ctx.const - - constDict = { - "actions_file": "actions.py", - "setup_func": "setup", - "metadata_xml": "metadata.xml" - } - - for k in constDict.keys(): - if hasattr(const, k): - value = getattr(const, k) - self.assertEqual(value, constDict[k]) - else: - self.fail("Constants does not have an attribute named %s" % k) - - -suite = unittest.makeSuite(ContextTestCase) diff --git a/tags/pisi-1.1_beta13/tests/dependencytests.py b/tags/pisi-1.1_beta13/tests/dependencytests.py deleted file mode 100644 index 3036d9a9..00000000 --- a/tags/pisi-1.1_beta13/tests/dependencytests.py +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# -# Author: Eray Ozkural - -import unittest -import os - -from pisi.dependency import * - -class DependencyTestCase(unittest.TestCase): - def setUp(self): - pass - - def testVersionFrom(self): - # a real life story bug #603 - gtkmmdep = Dependency() - gtkmmdep.versionFrom = '1.9.1' - gtkmmdep.package = 'atk' - self.assert_( not gtkmmdep.satisfies('atk', '1.8.0', '1') ) - self.assert_( gtkmmdep.satisfies('atk', '1.9.1', '2') ) - self.assert_( gtkmmdep.satisfies('atk', '1.10.5', '3') ) - - def testReleaseFrom(self): - # releaseFrom isn't taken into account #2294 - dep = Dependency() - dep.releaseFrom = '121' - dep.package = 'dbus' - self.assert_(not dep.satisfies('dbus', '1.2', '2')) - - def testReleaseTo(self): - dep = Dependency() - dep.releaseTo = '22' - dep.package = 'dbus' - self.assert_(not dep.satisfies('dbus', '1.2', '25')) - - def testReleaseIs(self): - dep = Dependency() - dep.release = '42' - dep.package = 'dbus' - self.assert_(dep.satisfies('dbus', '1.2', '42')) - -suite = unittest.makeSuite(DependencyTestCase) diff --git a/tags/pisi-1.1_beta13/tests/distribution.xml b/tags/pisi-1.1_beta13/tests/distribution.xml deleted file mode 100644 index ff3f04d6..00000000 --- a/tags/pisi-1.1_beta13/tests/distribution.xml +++ /dev/null @@ -1,6 +0,0 @@ - - Pardus-Devel - 1.1 - Devel - Core - diff --git a/tags/pisi-1.1_beta13/tests/fetchertests.py b/tags/pisi-1.1_beta13/tests/fetchertests.py deleted file mode 100644 index ed7b2f47..00000000 --- a/tags/pisi-1.1_beta13/tests/fetchertests.py +++ /dev/null @@ -1,51 +0,0 @@ -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# - -import unittest -import shutil -import os - -import pisi.context as ctx -import pisi.api -from pisi.specfile import SpecFile -from pisi import fetcher -from pisi import util -from pisi import uri - -import testcase -class FetcherTestCase(testcase.TestCase): - def setUp(self): - testcase.TestCase.setUp(self, database = False) - - self.spec = SpecFile() - self.spec.read("tests/helloworld/pspec.xml") - self.url = uri.URI(self.spec.source.archive.uri) - self.destpath = ctx.config.archives_dir() - self.fetch = fetcher.Fetcher(self.url, self.destpath) - - def testFetch(self): - self.fetch.fetch() - fetchedFile = os.path.join(self.destpath, self.url.filename()) - if os.access(fetchedFile, os.R_OK): - self.assertEqual(util.sha1_file(fetchedFile), - self.spec.source.archive.sha1sum) - os.remove(fetchedFile) - - def testResume(self): - resume_test_file = "tests/helloworld/hello-1.3.tar.gz.part" - shutil.copy(resume_test_file, ctx.config.archives_dir()) - self.fetch.fetch() - fetchedFile = os.path.join(self.destpath, self.url.filename()) - if os.access(fetchedFile, os.R_OK): - self.assertEqual(util.sha1_file(fetchedFile), - self.spec.source.archive.sha1sum) - os.remove(fetchedFile) - -suite = unittest.makeSuite(FetcherTestCase) diff --git a/tags/pisi-1.1_beta13/tests/filestests.py b/tags/pisi-1.1_beta13/tests/filestests.py deleted file mode 100644 index c1fd196b..00000000 --- a/tags/pisi-1.1_beta13/tests/filestests.py +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# - -import unittest -import os - -import pisi.context as ctx -import pisi.api -import pisi.installdb -import pisi.files as files -from pisi import util - -import testcase - -class FilesTestCase(testcase.TestCase): - - def setUp(self): - testcase.TestCase.setUp(self, database=False) - - def testFileInfo(self): - f1 = files.FileInfo(path = '/usr/bin/zibidi') - f2 = files.FileInfo(path = '/usr/bin/kopus', type='exec', size=13, hash="abugubu") - -suite = unittest.makeSuite(FilesTestCase) diff --git a/tags/pisi-1.1_beta13/tests/filetests.py b/tags/pisi-1.1_beta13/tests/filetests.py deleted file mode 100644 index 3ccde2bd..00000000 --- a/tags/pisi-1.1_beta13/tests/filetests.py +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# - -import unittest -import os - -from pisi.file import File - -import testcase - -class FileTestCase(testcase.TestCase): - - def setUp(self): - testcase.TestCase.setUp(self, database = False) - - def testLocalFile(self): - f = File("tests/popt/pspec.xml", File.read) - x = f.readlines() - self.assert_(len(x)>0) - - def testRemoteRead(self): - f = File("http://uludag.org.tr/haberler/rootfs0.2.html", File.read) - x = f.readlines() - self.assert_(len(x)>0) - -suite = unittest.makeSuite(FileTestCase) diff --git a/tags/pisi-1.1_beta13/tests/graphtests.py b/tags/pisi-1.1_beta13/tests/graphtests.py deleted file mode 100644 index 6249fd31..00000000 --- a/tags/pisi-1.1_beta13/tests/graphtests.py +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# - -import unittest -import os - -from pisi import graph - -class GraphTestCase(unittest.TestCase): - def setUp(self): - self.g0 = graph.Digraph() - self.g0.from_list([ (1,2), (1,3), (2,3), (3,4), (4, 5), (4,1)]) - - self.g1 = graph.Digraph() - self.g1.from_list([ (0,2), (0,3), (3,4), (2,4), (0,5), (5,4) ]) - - def testCycle(self): - self.assert_(not self.g0.cycle_free()) - self.assert_(self.g1.cycle_free()) - - def testTopologicalSort(self): - order = self.g1.topological_sort() - self.assertEqual(order[0], 0) - self.assertEqual(order[len(order)-1], 4) - -suite = unittest.makeSuite(GraphTestCase) diff --git a/tags/pisi-1.1_beta13/tests/helloworld/actions.py b/tags/pisi-1.1_beta13/tests/helloworld/actions.py deleted file mode 100644 index 410d41ee..00000000 --- a/tags/pisi-1.1_beta13/tests/helloworld/actions.py +++ /dev/null @@ -1,102 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. - -from pisi.actionsapi import autotools -from pisi.actionsapi import pisitools -from pisi.actionsapi import shelltools -from pisi.actionsapi import libtools -from pisi.actionsapi import get - -WorkDir = "hello-1.3" - -def setup(): - autotools.configure() - -def build(): - autotools.make() - -def install(): - autotools.install() - - '''/opt/helloworld/''' - pisitools.dodir("/opt/helloworld") - - '''/usr/share/doc/helloworld-0.1-1/Makefile.am''' - pisitools.dodoc("Makefile.am") - - '''/opt/helloworld/helloworld''' - pisitools.doexe("src/helloworld", "/opt/helloworld") - - '''/usr/share/info/Makefile.am''' - '''/usr/share/info/Makefile.cvs''' - '''/usr/share/info/Makefile.in''' - pisitools.doinfo("Makefile.*") - - '''/usr/lib/helloworld.o''' - pisitools.dolib("src/helloworld.o") - - '''/opt/hello''' - pisitools.insinto("/opt/", "src/helloworld", "hello") - '''/opt/hi''' - pisitools.insinto("/opt/", "src/helloworld", "hi") - - '''/opt/hello -> /var/hello''' - pisitools.domove("/opt/hello", "/var/") - '''/opt/hi -> /var/goodbye''' - pisitools.domove("/opt/hi", "/var/", "goodbye") - - '''/usr/bin/helloworld''' - pisitools.dobin("src/helloworld") - '''/bin/helloworld''' - pisitools.dobin("src/helloworld", "/bin") - - '''/usr/sbin/helloworld''' - pisitools.dosbin("src/helloworld") - '''/sbin/helloworld''' - pisitools.dosbin("src/helloworld", "/sbin") - - '''Hello, world! -> Goodbye, world!''' - pisitools.dosed("src/helloworld.cpp", "Hello, world!", "Goodbye, world!") - - '''/usr/sbin/goodbye --> helloworld''' - pisitools.dosym("helloworld", "/usr/sbin/goodbye") - '''/usr/bin/goodbye --> helloworld''' - pisitools.dosym("helloworld", "/usr/bin/goodbye") - - '''/home/pardus/''' - pisitools.dodir("/home/pardus") - '''delete pardus''' - pisitools.removeDir("/home/pardus") - '''delete home''' - pisitools.removeDir("/home") - - '''src/helloworld.cpp --> /usr/share/doc/helloworld-0.1-1/goodbyeworld.cpp''' - pisitools.newdoc("src/helloworld.cpp", "goodbyeworld.cpp") - - '''/opt/pardus''' - shelltools.touch("%s/opt/pardus" % get.installDIR()) - - '''/opt/pardus --> /opt/uludag''' - shelltools.copy("%s/opt/pardus" % get.installDIR(), "%s/opt/uludag" % get.installDIR()) - '''/opt/pardus --> /opt/Pardus''' - shelltools.move("%s/opt/pardus" % get.installDIR(), "%s/opt/PARDUS" % get.installDIR()) - - '''/opt/ --> /sys/''' - shelltools.copytree("%s/opt/" % get.installDIR(), "%s/sys/" % get.installDIR()) - - '''delete /sys/helloworld/helloworld''' - shelltools.unlink("%s/sys/helloworld/helloworld" % get.installDIR()) - '''delete /sys/helloworld''' - shelltools.unlinkDir("%s/sys/helloworld" % get.installDIR()) - - '''generate /usr/lib/helloworld.o''' - libtools.gen_usr_ldscript("helloworld.o") diff --git a/tags/pisi-1.1_beta13/tests/helloworld/hello-1.3.tar.gz.part b/tags/pisi-1.1_beta13/tests/helloworld/hello-1.3.tar.gz.part deleted file mode 100644 index 0ecf0493..00000000 Binary files a/tags/pisi-1.1_beta13/tests/helloworld/hello-1.3.tar.gz.part and /dev/null differ diff --git a/tags/pisi-1.1_beta13/tests/helloworld/pspec.xml b/tags/pisi-1.1_beta13/tests/helloworld/pspec.xml deleted file mode 100644 index 936871f2..00000000 --- a/tags/pisi-1.1_beta13/tests/helloworld/pspec.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - helloworld - http://www.uludag.org.tr - - S.ÇaÄŸlar Onur - caglar@uludag.org.tr - - GPL-2 - category - component - Dummy HelloWorld for testing ActionsAPI - Dummy HelloWorld for testing ActionsAPI - http://cekirdek.uludag.org.tr/~eray/hello-1.3.tar.gz - - - - helloworld - - / - - - - - - 2005-08-21 - 0.1 - - - - diff --git a/tags/pisi-1.1_beta13/tests/installdbtests.py b/tags/pisi-1.1_beta13/tests/installdbtests.py deleted file mode 100644 index ce66809f..00000000 --- a/tags/pisi-1.1_beta13/tests/installdbtests.py +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# - -import unittest -import os - -import pisi.context as ctx -import pisi.api -import pisi.installdb -from pisi import util - -import testcase -class InstallDBTestCase(testcase.TestCase): - - def testRemoveDummy(self): - ctx.installdb.remove('installtest') - self.assert_(not ctx.installdb.is_installed('installtest')) - - def testInstall(self): - ctx.installdb.purge('installtest') - ctx.installdb.install('installtest', '0.1', '2', '3') - self.assert_(ctx.installdb.is_recorded('installtest')) - self.assert_(ctx.installdb.is_installed('installtest')) - - def testRemovePurge(self): - ctx.installdb.install('installtest', '0.1', '2', '3') - self.assert_(ctx.installdb.is_installed('installtest')) - ctx.installdb.remove('installtest') - self.assert_(ctx.installdb.is_removed('installtest')) - ctx.installdb.purge('installtest') - self.assert_(not ctx.installdb.is_recorded('installtest')) - -suite = unittest.makeSuite(InstallDBTestCase) diff --git a/tags/pisi-1.1_beta13/tests/light.sh b/tags/pisi-1.1_beta13/tests/light.sh deleted file mode 100755 index 37d616a4..00000000 --- a/tags/pisi-1.1_beta13/tests/light.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh - -pwd -PATH=$PATH:. -set -x -rm -rf tmp -mkdir tmp -set -e -pisi-cli -Dtmp -E --ignore-build-no build tests/zip/pspec.xml tests/unzip/pspec.xml -pisi-cli -Dtmp index . -pisi-cli -Dtmp -d add-repo repo1 pisi-index.xml -pisi-cli -Dtmp list-repo -pisi-cli -Dtmp update-repo repo1 -pisi-cli -Dtmp list-available -pisi-cli -Dtmp --ignore-comar -y install zip -pisi-cli -Dtmp list-installed -pisi-cli -Dtmp --ignore-comar -y remove unzip -pisi-cli -Dtmp info zip*.pisi -pisi-cli -d -Dtmp --ignore-comar -y install zip*.pisi -pisi-cli -Dtmp list-pending -pisi-cli -Dtmp configure-pending -pisi-cli -Dtmp remove-repo repo1 -pisi-cli -Dtmp clean diff --git a/tags/pisi-1.1_beta13/tests/metadatatests.py b/tags/pisi-1.1_beta13/tests/metadatatests.py deleted file mode 100644 index b5514f5c..00000000 --- a/tags/pisi-1.1_beta13/tests/metadatatests.py +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# - -import unittest -import os - -from pisi import metadata -from pisi import util - -class MetaDataTestCase(unittest.TestCase): - - def testRead(self): - md = metadata.MetaData() - md.read('tests/popt/metadata.xml') - - self.assertEqual(md.package.license, ["As-Is"]) - - self.assertEqual(md.package.version, "1.7") - - self.assertEqual(md.package.installedSize, 149691) - return md - - def testWrite(self): - md = self.testRead() - md.write('/tmp/metadata-test.xml') - - def testVerify(self): - md = self.testRead() - if md.errors(): - self.fail("Couldn't verify!") - - -suite = unittest.makeSuite(MetaDataTestCase) diff --git a/tags/pisi-1.1_beta13/tests/ootests.py b/tags/pisi-1.1_beta13/tests/ootests.py deleted file mode 100644 index 8bbbde3a..00000000 --- a/tags/pisi-1.1_beta13/tests/ootests.py +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# - -import unittest -import os - -from pisi import version -from pisi.oo import * - -class OOTestCase(unittest.TestCase): - def setUp(self): - pass - - def testautosuper(self): - class A: - __metaclass__ = autosuper - def meth(self): - return "A" - class B(A): - def meth(self): - return "B" + self.__super.meth() - class C(A): - def meth(self): - return "C" + self.__super.meth() - class D(C, B): - def meth(self): - return "D" + self.__super.meth() - - self.assert_( D().meth() == "DCBA" ) - -suite = unittest.makeSuite(OOTestCase) - diff --git a/tags/pisi-1.1_beta13/tests/packagedbtests.py b/tags/pisi-1.1_beta13/tests/packagedbtests.py deleted file mode 100644 index e140940d..00000000 --- a/tags/pisi-1.1_beta13/tests/packagedbtests.py +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# - -import unittest -import os - -import pisi.context as ctx -import pisi.api -from pisi.packagedb import PackageDB -from pisi import util -from pisi.specfile import SpecFile - -import testcase -class PackageDBTestCase(testcase.TestCase): - - def setUp(self): - testcase.TestCase.setUp(self) - self.spec = SpecFile() - self.spec.read('tests/popt/pspec.xml') - self.spec.check() - - def testAdd(self): - if not ctx.repodb.has_repo('test'): - ctx.repodb.add_repo('test', pisi.repodb.Repo(pisi.uri.URI('fakerepo.xml')) ) - ctx.packagedb.add_package(self.spec.packages[1], 'test') - self.assert_(ctx.packagedb.has_package('popt-libs')) - # close the database and remove lock - #self.pdb.close() - - def testRemove(self): - ctx.packagedb.remove_package('popt-libs', 'test') - self.assert_(not ctx.packagedb.has_package('popt-libs', 'test')) - -suite = unittest.makeSuite(PackageDBTestCase) diff --git a/tags/pisi-1.1_beta13/tests/packagetests.py b/tags/pisi-1.1_beta13/tests/packagetests.py deleted file mode 100644 index 638223c8..00000000 --- a/tags/pisi-1.1_beta13/tests/packagetests.py +++ /dev/null @@ -1,50 +0,0 @@ -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# - -import unittest -import os - -from pisi import util -import pisi.context as ctx -from pisi import package - -import testcase -class PackageTestCase(testcase.TestCase): - - def setUp(self): - testcase.TestCase.setUp(self) - self.pkgName = util.package_name("testing", - "5.1", - "2", 3) - - def testAddExtract(self): - cur = os.getcwd() - tmpdir = ctx.config.tmp_dir() - testdir = os.path.join(cur, "tests/popt") - - pkg_path = os.path.join(tmpdir, self.pkgName) - pkg = package.Package(pkg_path, "w") - - os.chdir(testdir) - pkg.add_to_package("files.xml") - pkg.add_to_package("metadata.xml") - os.chdir(cur) - - pkg.close() - - pkg = package.Package(pkg_path) - pkg.extract_file("files.xml", cur) - if not os.path.exists("files.xml"): - self.fail("Package extract error") - - os.remove("files.xml") - os.remove(pkg_path) - -suite = unittest.makeSuite(PackageTestCase) diff --git a/tags/pisi-1.1_beta13/tests/pccts/actions.py b/tags/pisi-1.1_beta13/tests/pccts/actions.py deleted file mode 100644 index 50add5ca..00000000 --- a/tags/pisi-1.1_beta13/tests/pccts/actions.py +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# Timu EREN - -from pisi.actionsapi import autotools -from pisi.actionsapi import get -from pisi.actionsapi import pisitools -from pisi.actionsapi import shelltools - -WorkDir = "pccts" - -def setup(): - shelltools.export("COPT", get.CFLAGS()) - -def build(): -# autotools.make("COPT=%s" % (get.CFLAGS())) - autotools.make() - -def install(): - #autotools.install("") - - pisitools.dobin("bin/antlr") - pisitools.dobin("bin/dlg") - pisitools.dobin("bin/genmk") - pisitools.dobin("bin/sor") - - pisitools.insinto("/usr/include/pccts","h/*.h") - pisitools.insinto("/usr/include/pccts","h/*.c") - pisitools.insinto("/usr/include/pccts","h/*.cpp") - - - pisitools.insinto("/usr/include/pccts/sorcerer","sorcerer/h/*.h") - pisitools.insinto("/usr/include/pccts/sorcerer","sorcerer/h/*.c") - pisitools.insinto("/usr/include/pccts/sorcerer","sorcerer/h/*.cpp") - - - pisitools.insinto("/usr/include/pccts/sorcerer/lib","sorcerer/lib/*.h") - pisitools.insinto("/usr/include/pccts/sorcerer/lib","sorcerer/lib/*.c") - pisitools.insinto("/usr/include/pccts/sorcerer/lib","sorcerer/lib/*.cpp") - - pisitools.dodoc("CHANGES*", "KNOWN_PROBLEMS*", "README", "RIGHTS", "history.txt", "history.ps") - pisitools.dodoc("sorcerer/README", "sorcerer/UPDATES") - - pisitools.doman("dlg/dlg.1", "antlr/antlr.1") diff --git a/tags/pisi-1.1_beta13/tests/pccts/files/pccts-1.33.33-gentoo.diff b/tags/pisi-1.1_beta13/tests/pccts/files/pccts-1.33.33-gentoo.diff deleted file mode 100644 index 1594cd96..00000000 --- a/tags/pisi-1.1_beta13/tests/pccts/files/pccts-1.33.33-gentoo.diff +++ /dev/null @@ -1,69 +0,0 @@ ---- pccts-1.33.33/support/genmk/genmk.c Fri Aug 3 17:12:51 2001 -+++ pccts-1.33.33/support/genmk/genmk-gentoo.c Fri Aug 3 17:12:14 2001 -@@ -7,6 +7,11 @@ - * U of MN - */ - -+/* modified 20010803 by Peter Kadau -+ * for better fhs-compliance -+ * i.e. from "none" to "hmmm soso" ;-) -+ */ -+ - #include - #include - #include "pcctscfg.h" /* be sensitive to what ANTLR/DLG call the files */ -@@ -65,7 +70,7 @@ - static int nondef_comp = 0; /* 1=compiler is non default */ - static char *compilerCCC="CC"; - static char *compilerCC="cc"; --static char *pccts_path="/usr/local/pccts"; -+static char *pccts_path="/usr/include/pccts"; - - #ifdef __STDC__ - void help(void); -@@ -356,7 +361,7 @@ - { "-cfiles",1,pCFiles, "Additional files in C or C++ to compile"}, - { "-sor",0,pSor, "Start of sorcerer group"}, - { "-pccts_path",1,ppccts_path, -- "Path for $PCCTS directory (default is /usr/local/pccts)"}, -+ "Path for $PCCTS directory (default is /usr/include/pccts)"}, - { "-compiler",1,pCompiler, - "Default compiler (default is CC/cc)"}, - { "*", 0,pFile, "" }, /* anything else is a file */ -@@ -495,13 +500,13 @@ - else printf("SCAN = %s%s\n", DIR(), dlg_class); - - printf("PCCTS = %s\n",pccts_path); -- printf("ANTLR_H = $(PCCTS)%sh\n", DirectorySymbol); -+ printf("ANTLR_H = $(PCCTS)\n"); - if (num_sors>0) { -- printf("SOR_H = $(PCCTS)%ssorcerer%sh\n", DirectorySymbol, DirectorySymbol); -+ printf("SOR_H = $(PCCTS)%ssorcerer\n", DirectorySymbol); - printf("SOR_LIB = $(PCCTS)%ssorcerer%slib\n", - DirectorySymbol, DirectorySymbol); - } -- printf("BIN = $(PCCTS)%sbin\n", DirectorySymbol); -+ printf("BIN = %susr%sbin\n", DirectorySymbol, DirectorySymbol); - printf("ANTLR = $(BIN)%santlr\n", DirectorySymbol); - printf("DLG = $(BIN)%sdlg\n", DirectorySymbol); - if (num_sors>0) printf("SOR = $(BIN)%ssor\n", DirectorySymbol); ---- pccts-1.33.33/sorcerer/lib/sorlist.c 1999-06-30 03:15:56.000000000 +0200 -+++ pccts-1.33.33/sorcerer/lib/sorlist.c.new 2003-05-23 11:11:09.000000000 +0200 -@@ -28,6 +28,7 @@ - */ - #include - #include -+#include "pcctscfg.h" - - #ifdef PCCTS_USE_STDARG - #include ---- pccts-1.33.33/sorcerer/lib/sintstack.c 1999-06-30 15:08:06.000000000 +0200 -+++ pccts-1.33.33/sorcerer/lib/sintstack.c.new 2003-05-23 12:54:26.000000000 +0200 -@@ -28,6 +28,7 @@ - */ - #include - #include -+#include "pcctscfg.h" - - #ifdef PCCTS_USE_STDARG - #include diff --git a/tags/pisi-1.1_beta13/tests/pccts/pspec.xml b/tags/pisi-1.1_beta13/tests/pccts/pspec.xml deleted file mode 100644 index 7bbc03eb..00000000 --- a/tags/pisi-1.1_beta13/tests/pccts/pspec.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - pccts - http://www.polhode.com - - Timu EREN - selamtux@gmail.com - - BSD - category - component - Purdue Compiler Construction Tool Set is an embedded C/C++ parser generator - Purdue Compiler Construction Tool Set is an embedded C/C++ parser generator - http://www.polhode.com/pccts133mr33.zip - - pccts-1.33.33-gentoo.diff - - - unzip - patch - - - - pccts - - /usr/include - /usr/share/doc - /usr/bin - /usr/share/man - - - - - - 2005-09-16 - 1.33.33 - - - - diff --git a/tags/pisi-1.1_beta13/tests/pisi.conf b/tags/pisi-1.1_beta13/tests/pisi.conf deleted file mode 100644 index 560e8567..00000000 --- a/tags/pisi-1.1_beta13/tests/pisi.conf +++ /dev/null @@ -1,6 +0,0 @@ -[general] -destinationdirectory = /testing - -[directories] -archives_dir = /disk2/pisi/archives - diff --git a/tags/pisi-1.1_beta13/tests/popt/actions.py b/tags/pisi-1.1_beta13/tests/popt/actions.py deleted file mode 100644 index c8fc6046..00000000 --- a/tags/pisi-1.1_beta13/tests/popt/actions.py +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# - -from pisi.actionsapi import autotools - -WorkDir='popt-1.7' - -def setup(): - autotools.configure( '--with-nls' ) - -def build(): - autotools.make() - -def install(): - autotools.install() diff --git a/tags/pisi-1.1_beta13/tests/popt/files.xml b/tags/pisi-1.1_beta13/tests/popt/files.xml deleted file mode 100644 index 34564b0c..00000000 --- a/tags/pisi-1.1_beta13/tests/popt/files.xml +++ /dev/null @@ -1,507 +0,0 @@ - - - - - usr/share/locale/es/LC_MESSAGES/popt.mo - - - localedata - - - 1593 - - - 29481dbd4051e5c6a0f000436664ba00e47572ae - - - - - usr/share/locale/de/LC_MESSAGES/popt.mo - - - localedata - - - 345 - - - 6ceb513b02af4f612a20b49e5d615c158fdcee31 - - - - - usr/share/locale/is/LC_MESSAGES/popt.mo - - - localedata - - - 1793 - - - edbcbb430b122626216ea9f6bba268d5de8454b6 - - - - - usr/lib/libpopt.la - - - sharedLib - - - 699 - - - 04bac6fce89f2c84d4bb1c5adced729f7d312980 - - - - - usr/share/locale/sl/LC_MESSAGES/popt.mo - - - localedata - - - 514 - - - 2031bdefffcf57121e46f3f68f0747fe6b7f1fcc - - - - - usr/share/locale/fr/LC_MESSAGES/popt.mo - - - localedata - - - 345 - - - 6ceb513b02af4f612a20b49e5d615c158fdcee31 - - - - - usr/share/locale/it/LC_MESSAGES/popt.mo - - - localedata - - - 345 - - - 6ceb513b02af4f612a20b49e5d615c158fdcee31 - - - - - usr/share/locale/eu_ES/LC_MESSAGES/popt.mo - - - localedata - - - 345 - - - 6ceb513b02af4f612a20b49e5d615c158fdcee31 - - - - - usr/share/locale/da/LC_MESSAGES/popt.mo - - - localedata - - - 1599 - - - 3ae14880a8bc2cddd9dd0a03861a55d663ac8b0d - - - - - usr/share/locale/ko/LC_MESSAGES/popt.mo - - - localedata - - - 1916 - - - 2079233b9e3284c866e5d17e5aca001f678d4c23 - - - - - usr/share/locale/ja/LC_MESSAGES/popt.mo - - - localedata - - - 345 - - - 6ceb513b02af4f612a20b49e5d615c158fdcee31 - - - - - usr/share/locale/pt/LC_MESSAGES/popt.mo - - - localedata - - - 1870 - - - 7db5d457fa3cc169fea2f747f25ba0353ed5fb69 - - - - - usr/lib/libpopt.so - - - sharedLib - - - 38532 - - - 617c2afa4e79faee954cb95715470f875c044e5a - - - - - usr/share/locale/no/LC_MESSAGES/popt.mo - - - localedata - - - 1800 - - - b33d41a1fbde6b879f0cce06cf2d8395012cc0ec - - - - - usr/lib/libpopt.a - - - sharedLib - - - 36100 - - - f067421ebdb9a68f89c90526feb64a70763c95cf - - - - - usr/share/locale/wa/LC_MESSAGES/popt.mo - - - localedata - - - 517 - - - 92f1f582ae24dbf5631fee1ace8bfc99cb5c1b66 - - - - - usr/share/locale/tr/LC_MESSAGES/popt.mo - - - localedata - - - 1601 - - - 16e3e8e12af497102c75ccbb52edf8d1783545c3 - - - - - usr/share/locale/zh/LC_MESSAGES/popt.mo - - - localedata - - - 345 - - - 6ceb513b02af4f612a20b49e5d615c158fdcee31 - - - - - usr/share/locale/id/LC_MESSAGES/popt.mo - - - localedata - - - 345 - - - 6ceb513b02af4f612a20b49e5d615c158fdcee31 - - - - - usr/share/locale/ro/LC_MESSAGES/popt.mo - - - localedata - - - 1150 - - - 914729e4200d68e5c55d114e6a083c74e692707b - - - - - usr/share/locale/sr/LC_MESSAGES/popt.mo - - - localedata - - - 345 - - - 6ceb513b02af4f612a20b49e5d615c158fdcee31 - - - - - usr/share/locale/hu/LC_MESSAGES/popt.mo - - - localedata - - - 496 - - - 236bf8c1fea44a5a93c6e18e0c88b3dae1762264 - - - - - usr/share/locale/pt_BR/LC_MESSAGES/popt.mo - - - localedata - - - 345 - - - 6ceb513b02af4f612a20b49e5d615c158fdcee31 - - - - - usr/share/locale/sv/LC_MESSAGES/popt.mo - - - localedata - - - 1844 - - - 63517df43bd74c84496441d8894f2b67533c6060 - - - - - usr/lib/libpopt.so.0.0.0 - - - sharedLib - - - 38532 - - - 1f2d3c41ba8e4d6b1c4979225cdf2dd97d4a0aea - - - - - usr/share/locale/ru/LC_MESSAGES/popt.mo - - - localedata - - - 1955 - - - 4742785bd5235eb437922f76a9faa30ec314d09b - - - - - usr/share/locale/zh_CN.GB2312/LC_MESSAGES/popt.mo - - - localedata - - - 468 - - - 5e0a688794619278a452c851a3fc86b50b7f781e - - - - - usr/lib/libpopt.so.0 - - - sharedLib - - - 38532 - - - 617c2afa4e79faee954cb95715470f875c044e5a - - - - - usr/include/popt.h - - - header - - - 15982 - - - 091692391fd1c539b19298f30e8ae074e3210459 - - - - - usr/share/locale/sk/LC_MESSAGES/popt.mo - - - localedata - - - 510 - - - f7e081a22577eb5429809b7ce999b8b1e2b1f9b3 - - - - - usr/share/locale/pl/LC_MESSAGES/popt.mo - - - localedata - - - 345 - - - 6ceb513b02af4f612a20b49e5d615c158fdcee31 - - - - - usr/share/locale/uk/LC_MESSAGES/popt.mo - - - localedata - - - 504 - - - f91c695161926679401201fdaf3edcef4664f6ca - - - - - usr/share/locale/cs/LC_MESSAGES/popt.mo - - - localedata - - - 1806 - - - 920f5b99199361f1d169430bf13d2bfac1a02fab - - - - - usr/share/man/man3/popt.3 - - - doc - - - 31011 - - - 5c0014442b4ef38d71733c952884573071978328 - - - - - usr/share/locale/gl/LC_MESSAGES/popt.mo - - - localedata - - - 1636 - - - 8486430a6ecbb006b5d374cbcb109e8303c7d5f8 - - - - - usr/share/locale/fi/LC_MESSAGES/popt.mo - - - localedata - - - 345 - - - 6ceb513b02af4f612a20b49e5d615c158fdcee31 - - - diff --git a/tags/pisi-1.1_beta13/tests/popt/files/popt-1.7-uclibc.patch.gz b/tags/pisi-1.1_beta13/tests/popt/files/popt-1.7-uclibc.patch.gz deleted file mode 100644 index 83bbae58..00000000 Binary files a/tags/pisi-1.1_beta13/tests/popt/files/popt-1.7-uclibc.patch.gz and /dev/null differ diff --git a/tags/pisi-1.1_beta13/tests/popt/metadata.xml b/tags/pisi-1.1_beta13/tests/popt/metadata.xml deleted file mode 100644 index 286dfe84..00000000 --- a/tags/pisi-1.1_beta13/tests/popt/metadata.xml +++ /dev/null @@ -1,87 +0,0 @@ - - - - - popt - - - - Kırmızı kafalar - - - hotmail@redhat.com - - - - - - popt-libs - - - Command line option parsing library - - - library files for popt - - - As-Is - - - library:util:optparser - - - rpm:archive - - - - gettext - - - - - /usr/lib - - - /usr/share/doc - - - /usr/share/man - - - /usr/share/locale - - - /usr/include/popt.h - - - - - 2005-06-14 - 1.7 - - - 2005-06-10 - 1.7 - - - 2005-05-05 - 1.7 - - - - 0 - - - Pardus - - - 0.1 - - - Any - - - 149691 - - - diff --git a/tags/pisi-1.1_beta13/tests/popt/pspec.xml b/tags/pisi-1.1_beta13/tests/popt/pspec.xml deleted file mode 100644 index f74769e1..00000000 --- a/tags/pisi-1.1_beta13/tests/popt/pspec.xml +++ /dev/null @@ -1,80 +0,0 @@ - - - - - popt - http://www.rpm.org/ - - Kırmızı kafalar - hotmail@redhat.com - - as-is - app:console - system.base - Popt command line option parser - Command line option parsing library. - While it is similiar to getopt(3), it contains a number of enhancements, including: - - 1) popt is fully reentrant - 2) popt can parse arbitrary argv[] style arrays while - getopt(2) makes this quite difficult - 3) popt allows users to alias command line arguments - 4) popt provides convience functions for parsing strings - into argv[] style arrays - - ftp://ftp.pardus.org.tr/pub/pisi/source/popt-1.7.tar.gz - - popt-1.7-uclibc.patch.gz - - - make - - - - - popt - library files for popt - Command line option parsing library - Komut satırı seçenekleri iÅŸleme kütüphanesi - - gettext - - - /usr/lib - /usr/share/doc - /usr/share/man - /usr/share/locale - /usr/include/popt.h - - - - - popt-libs - Command line option parsing library - Komut satırı seçenekleri iÅŸleme kütüphanesi - - gettext - - library files for popt - - /usr/lib - /usr/share/doc - /usr/share/man - /usr/share/locale - /usr/include/popt.h - - - acpid.rc6 - - - - - - 2005-06-14 - 1.7 - First release. - Kırmızı kafalar - hotmail@redhat.com - - - diff --git a/tags/pisi-1.1_beta13/tests/remoterepo.sh b/tags/pisi-1.1_beta13/tests/remoterepo.sh deleted file mode 100755 index 1459ddd1..00000000 --- a/tags/pisi-1.1_beta13/tests/remoterepo.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh - -export PATH=$PATH:. -set -x # xtrace -set -e # errexit - -echo "beta functionality test script for testing remote repos" -echo "working directory:" `pwd` -echo "cleaning destination dir: tmp" -rm -rf tmp -#echo "*** repository tests" -pisi-cli -Dtmp add-repo pardus http://paketler.uludag.org.tr/pardus-1-test/pisi-index.xml -pisi-cli -Dtmp update-repo pardus -pisi-cli -Dtmp list-repo - -#echo "*** package ops" -pisi-cli -Dtmp list-available -pisi-cli -Dtmp info python -pisi-cli -Dtmp -By install python - -echo "*** database contents" -for x in `find tmp -iname '*.bdb'`; do - echo "contents of database " $x; - tools/cat-db.py $x; -done diff --git a/tags/pisi-1.1_beta13/tests/repodbtests.py b/tags/pisi-1.1_beta13/tests/repodbtests.py deleted file mode 100644 index 04f352e7..00000000 --- a/tags/pisi-1.1_beta13/tests/repodbtests.py +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# - -import unittest -import os - -import pisi.context as ctx -import pisi.api -import pisi.installdb -from pisi import util - -import testcase -class RepoDBTestCase(testcase.TestCase): - - def testAddRemoveCycle(self): - # written by cartman the celebrity, for bug #1909 - - for i in range(2): - print '\nTest %d\n' % (i) - pisi.api.add_repo("foo","bar") - pisi.api.remove_repo("foo") - -suite = unittest.makeSuite(RepoDBTestCase) diff --git a/tags/pisi-1.1_beta13/tests/run.py b/tags/pisi-1.1_beta13/tests/run.py deleted file mode 100755 index 65ca4207..00000000 --- a/tags/pisi-1.1_beta13/tests/run.py +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/python -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# - -import unittest -import sys -import os -import locale - -sys.path.insert(0, '.') -sys.path.insert(0, '..') - -import pisi.api -import pisi.context as ctx - -def run_test_suite(testsuite): - unittest.TextTestRunner(verbosity=2).run(testsuite) - if ctx.initialized: - pisi.api.finalize() - -def run_all(): - - print '** Running all tests' - #testsuite = unittest.TestSuite() - for root, dirs, files in os.walk('tests'): - testsources = filter(lambda x:x.endswith('tests.py'), files) - for testsource in testsources: - module = __import__(testsource[:len(testsource)-3]) - print '\n* Running tests in', testsource - run_test_suite(module.suite) - -if __name__ == "__main__": - - locale.setlocale(locale.LC_ALL, '') - args = sys.argv - if len(args) > 1: # run modules given from the command line - tests = sys.argv[1:] - for test in tests: - test += 'tests' - module = __import__(test) - print "* Running tests in", test - run_test_suite(module.suite) - else: # run all tests - run_all() diff --git a/tags/pisi-1.1_beta13/tests/searchtests.py b/tags/pisi-1.1_beta13/tests/searchtests.py deleted file mode 100644 index e39829b9..00000000 --- a/tags/pisi-1.1_beta13/tests/searchtests.py +++ /dev/null @@ -1,40 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# - -import unittest -import os - -import pisi.search -import pisi.lockeddbshelve - -import testcase - -class SearchTestCase(testcase.TestCase): - - def setUp(self): - testcase.TestCase.setUp(self, database = True) - - def testSearch(self): - doc1 = "A set object is an unordered collection of immutable values." - doc2 = "Being an unordered collection, sets do not record element position or order of insertion." - doc3 = "There are currently two builtin set types, set and frozenset" - pisi.search.init(['test'], ['en']) - pisi.search.add_doc('test', 'en', 1, doc1, repo = pisi.itembyrepodb.installed) - pisi.search.add_doc('test', 'en', 2, doc2, repo = pisi.itembyrepodb.installed) - pisi.search.add_doc('test', 'en', 3, doc3, repo = pisi.itembyrepodb.installed) - q1 = pisi.search.query('test', 'en', ['set'], repo = pisi.itembyrepodb.all) - self.assertEqual(q1, set([1,3])) - q2 = pisi.search.query('test', 'en', ['an', 'collection'], repo = pisi.itembyrepodb.all) - self.assertEqual(q2, set([1,2])) - pisi.search.finalize() - -suite = unittest.makeSuite(SearchTestCase) diff --git a/tags/pisi-1.1_beta13/tests/sourcedbtests.py b/tags/pisi-1.1_beta13/tests/sourcedbtests.py deleted file mode 100644 index 7a14c186..00000000 --- a/tags/pisi-1.1_beta13/tests/sourcedbtests.py +++ /dev/null @@ -1,38 +0,0 @@ -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# - -import unittest -import os - -import pisi.context as ctx -import pisi.api -import pisi.sourcedb -from pisi import util -from pisi.specfile import SpecFile - -import testcase -class SourceDBTestCase(testcase.TestCase): - - def setUp(self): - testcase.TestCase.setUp(self) - - self.sourcedb = pisi.sourcedb.init() - self.spec = SpecFile() - self.spec.read("tests/popt/pspec.xml") - if not ctx.repodb.has_repo('test'): - ctx.repodb.add_repo('test', pisi.repodb.Repo(pisi.uri.URI('fakerepo.xml')) ) - - def testAddRemove(self): - self.sourcedb.add_spec(self.spec, 'test') - self.assert_(self.sourcedb.has_spec("popt")) - self.sourcedb.remove_spec("popt", 'test') - self.assert_(not self.sourcedb.has_spec("popt")) - -suite = unittest.makeSuite(SourceDBTestCase) diff --git a/tags/pisi-1.1_beta13/tests/specfiletests.py b/tags/pisi-1.1_beta13/tests/specfiletests.py deleted file mode 100644 index 5e5ff46f..00000000 --- a/tags/pisi-1.1_beta13/tests/specfiletests.py +++ /dev/null @@ -1,78 +0,0 @@ -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# - -import unittest -import os - -import pisi.specfile as specfile -import pisi.util as util - -class SpecFileNewTestCase(unittest.TestCase): - - def setUp(self): - self.spec = specfile.SpecFile() - self.spec.read("tests/popt/pspec.xml") - - def testFields(self): - self.assertEqual(self.spec.source.name, "popt") - - self.assertEqual(self.spec.source.version, "1.7") - - self.assertEqual(self.spec.source.release, "1") - - self.assertEqual(self.spec.source.archive.sha1sum, - "66f3c77b87a160951b180447f4a6dce68ad2f71b") - - patches = self.spec.source.patches - self.assertEqual(len(patches), 1) - patch = patches[0] #get first and the only patch - self.assertEqual(patch.filename, "popt-1.7-uclibc.patch.gz") - self.assertEqual(patch.compressionType, "gz") - - packages = self.spec.packages - self.assertEqual(len(packages), 2) - package = packages[1] - self.assertEqual(package.name, "popt-libs") - - # search for a path in package.paths - pn = "/usr/lib" - matched = [p for p in package.files if p.path == pn] - if not matched: - self.fail("Failed to match pathname: %s" %pn) - - def testIsAPartOf(self): - # test existence in Source - if not "app:console" in self.spec.source.isA: - self.fail("Failed to match IsA in Source") - if not isinstance(self.spec.source.isA, list): - self.fail("source.isA is not a list, but it must be...") - - if "system.base" != self.spec.source.partOf: - self.fail("Failed to match PartOf in Source") - - # test existence in Package - pkg = self.spec.packages[0] - if not "app:console" in pkg.isA: - self.fail("Failed to match IsA in Package") - if not isinstance(pkg.isA, list): - self.fail("source.isA is not a list, but it must be...") - - if "system.base" != pkg.partOf: - self.fail("Failed to match PartOf in Package") - - def testVerify(self): - if self.spec.errors(): - self.fail("Failed to verify specfile") - - def testCopy(self): - self.spec.read("tests/popt/pspec.xml") - self.spec.write('/tmp/popt-copy.pspec.xml') - -suite = unittest.makeSuite(SpecFileNewTestCase) diff --git a/tags/pisi-1.1_beta13/tests/stress/comp/ab/actions.py b/tags/pisi-1.1_beta13/tests/stress/comp/ab/actions.py deleted file mode 100644 index 43687b2e..00000000 --- a/tags/pisi-1.1_beta13/tests/stress/comp/ab/actions.py +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- -# -# Copyright © 2005 TUBITAK/UEKAE -# Licensed under the GNU General Public License, version 2. -# See the file http://www.gnu.org/copyleft/gpl.txt. - -from pisi.actionsapi import autotools -from pisi.actionsapi import pisitools - -WorkDir = "bc-1.06" - -def setup(): - autotools.configure("--with-readline") - -def build(): - autotools.make() - -def install(): - pisitools.dobin("bc/bc") - pisitools.dobin("dc/dc") - pisitools.doman("man/*.1") - pisitools.doinfo("doc/*.info") - pisitools.dodoc("AUTHORS", "FAQ", "NEWS", "README", "ChangeLog") diff --git a/tags/pisi-1.1_beta13/tests/stress/comp/ab/comar/package.py b/tags/pisi-1.1_beta13/tests/stress/comp/ab/comar/package.py deleted file mode 100644 index b38b1bbf..00000000 --- a/tags/pisi-1.1_beta13/tests/stress/comp/ab/comar/package.py +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/python - -import os - -def postInstall(): - os.system("ls -al > /tmp/SIK") diff --git a/tags/pisi-1.1_beta13/tests/stress/comp/ab/files/bc-1.06-info-fix.diff b/tags/pisi-1.1_beta13/tests/stress/comp/ab/files/bc-1.06-info-fix.diff deleted file mode 100644 index e70736c0..00000000 --- a/tags/pisi-1.1_beta13/tests/stress/comp/ab/files/bc-1.06-info-fix.diff +++ /dev/null @@ -1,101 +0,0 @@ -diff -r -C2 bc-1.06.orig/doc/bc.texi bc-1.06/doc/bc.texi -*** bc-1.06.orig/doc/bc.texi Wed Sep 27 20:22:24 2000 ---- bc-1.06/doc/bc.texi Fri Aug 3 16:44:49 2001 -*************** -*** 14,29 **** - @c end tex - -! @titlepage -! @title @command{bc} -! @subtitle an arbitrary precision calculator language -! @subtitle version 1.06 -! -! @author Philip A. Nelson -! @page - - This manual documents @command{bc}, an arbitrary precision calculator language. - - This manual is part of GNU @command{bc}.@* -! @sp4 - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. ---- 14,26 ---- - @c end tex - -! @ifinfo -! @direntry -! * bc: (bc). An arbitrary precision calculator language. -! @end direntry - - This manual documents @command{bc}, an arbitrary precision calculator language. - - This manual is part of GNU @command{bc}.@* -! - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -*************** -*** 33,42 **** - are preserved on all copies. - -! @iftex - Permission is granted to process this file through TeX and print the - results, provided the printed document carries copying permission - notice identical to this one except for the removal of this paragraph - (this paragraph not being relevant to the printed manual). -! @end iftex - - Permission is granted to copy and distribute modified versions of this ---- 30,39 ---- - are preserved on all copies. - -! @ignore - Permission is granted to process this file through TeX and print the - results, provided the printed document carries copying permission - notice identical to this one except for the removal of this paragraph - (this paragraph not being relevant to the printed manual). -! @end ignore - - Permission is granted to copy and distribute modified versions of this -*************** -*** 49,52 **** ---- 46,59 ---- - except that this permission notice may be stated in a translation approved - by the Foundation. -+ @end ifinfo -+ -+ @titlepage -+ @title @command{bc} -+ @subtitle an arbitrary precision calculator language -+ @subtitle version 1.06 -+ -+ @author Philip A. Nelson -+ @page -+ - - You may contact the author by: -diff -r -C2 bc-1.06.orig/doc/dc.texi bc-1.06/doc/dc.texi -*** bc-1.06.orig/doc/dc.texi Thu Aug 31 11:57:43 2000 ---- bc-1.06/doc/dc.texi Fri Aug 3 16:42:34 2001 -*************** -*** 42,47 **** - notice identical to this one except for the removal of this paragraph - (this paragraph not being relevant to the printed manual). -- - @end ignore - Permission is granted to copy and distribute modified versions of this - manual under the conditions for verbatim copying, provided that the entire ---- 42,47 ---- - notice identical to this one except for the removal of this paragraph - (this paragraph not being relevant to the printed manual). - @end ignore -+ - Permission is granted to copy and distribute modified versions of this - manual under the conditions for verbatim copying, provided that the entire -*************** -*** 86,90 **** - - @end titlepage -- @page - - @node Top, Introduction, (dir), (dir) ---- 86,89 ---- diff --git a/tags/pisi-1.1_beta13/tests/stress/comp/ab/files/bc-1.06-longopts.patch b/tags/pisi-1.1_beta13/tests/stress/comp/ab/files/bc-1.06-longopts.patch deleted file mode 100644 index f450e3fa..00000000 --- a/tags/pisi-1.1_beta13/tests/stress/comp/ab/files/bc-1.06-longopts.patch +++ /dev/null @@ -1,28 +0,0 @@ -a bug in the argument processing of 'bc' (v1.06) prevents it from properly -reading long-format options. - -patch by joe bruin - -http://bugs.gentoo.org/show_bug.cgi?id=51525 - ---- bc-1.06.orig/bc/main.c -+++ bc-1.06/bc/main.c -@@ -63,7 +63,7 @@ - printf ("usage: %s [options] [file ...]\n%s%s%s%s%s%s%s", progname, - " -h --help print this usage and exit\n", - " -i --interactive force interactive mode\n", -- " -l --mathlib use the predefine math routnes\n", -+ " -l --mathlib use the predefined math routines\n", - " -q --quiet don't print initial banner\n", - " -s --standard non-standard bc constructs are errors\n", - " -w --warn warn about non-standard bc constructs\n", -@@ -93,6 +93,9 @@ - - switch (optch) - { -+ case 0: /* Long option setting a var. */ -+ break; -+ - case 'c': /* compile only */ - compile_only = TRUE; - break; diff --git a/tags/pisi-1.1_beta13/tests/stress/comp/ab/files/bc-1.06-readline42.diff b/tags/pisi-1.1_beta13/tests/stress/comp/ab/files/bc-1.06-readline42.diff deleted file mode 100644 index 97856d58..00000000 --- a/tags/pisi-1.1_beta13/tests/stress/comp/ab/files/bc-1.06-readline42.diff +++ /dev/null @@ -1,12 +0,0 @@ -this lets bc use readline-4.2, borrowed from redhat apparently. :) - ---- bc-1.06/bc/scan.l.sux Fri May 11 14:27:20 2001 -+++ bc-1.06/bc/scan.l Fri May 11 14:27:32 2001 -@@ -143,7 +143,6 @@ - - /* Definitions for readline access. */ - extern FILE *rl_instream; --_PROTOTYPE(char *readline, (char *)); - - /* rl_input puts upto MAX characters into BUF with the number put in - BUF placed in *RESULT. If the yy input file is the same as diff --git a/tags/pisi-1.1_beta13/tests/stress/comp/ab/files/bc-1.06-static-save.patch b/tags/pisi-1.1_beta13/tests/stress/comp/ab/files/bc-1.06-static-save.patch deleted file mode 100644 index 0ee543b2..00000000 --- a/tags/pisi-1.1_beta13/tests/stress/comp/ab/files/bc-1.06-static-save.patch +++ /dev/null @@ -1,16 +0,0 @@ -ripped from fedora ! - ---- bc-1.06/bc/load.c.s390 Wed Sep 13 20:22:38 2000 -+++ bc-1.06/bc/load.c Wed Sep 5 16:10:18 2001 -@@ -156,7 +156,10 @@ - long label_no; - long vaf_name; /* variable, array or function number. */ - long func; -- program_counter save_adr; -+ /* Make save_adr static. Otherwise the whole address save stuff doesn't make -+ any sense at all and break e.g. on S390. -+ 09/05/01 Phil Knirsch */ -+ static program_counter save_adr; - - /* Initialize. */ - str = code; diff --git a/tags/pisi-1.1_beta13/tests/stress/comp/ab/pspec.xml b/tags/pisi-1.1_beta13/tests/stress/comp/ab/pspec.xml deleted file mode 100644 index f9782fef..00000000 --- a/tags/pisi-1.1_beta13/tests/stress/comp/ab/pspec.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - ab - http://www.gnu.org/software/bc/bc.htm - - Pardus TestcioÄŸlu - bilgi@uludag.org.tr - - GPL-2 - category - Handy console-based calculator utility - Şık görünümlü bir konsol temelli hesap makinesı - Handy console-based calculator utility - Konsolda çalışan şık görünümlü bir hesap makinesı - ftp://ftp.ulak.net.tr/gnu/gnu/bc/bc-1.06.tar.gz - - bc-1.06-info-fix.diff - bc-1.06-longopts.patch - bc-1.06-readline42.diff - bc-1.06-static-save.patch - - - - - ab - - / - - - System.Package - - - - - - 2005-12-18 - 1.06 - First release. - Pardus TestcioÄŸlu - bilgi@uludag.org.tr - - - diff --git a/tags/pisi-1.1_beta13/tests/stress/comp/bc/actions.py b/tags/pisi-1.1_beta13/tests/stress/comp/bc/actions.py deleted file mode 100644 index b7978f35..00000000 --- a/tags/pisi-1.1_beta13/tests/stress/comp/bc/actions.py +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- -# -# Copyright © 2005 TUBITAK/UEKAE -# Licensed under the GNU General Public License, version 2. -# See the file http://www.gnu.org/copyleft/gpl.txt. - -from pisi.actionsapi import autotools -from pisi.actionsapi import pisitools - -def setup(): - autotools.configure("--with-readline") - -def build(): - autotools.make() - -def install(): - pisitools.dobin("bc/bc") - pisitools.dobin("dc/dc") - pisitools.doman("man/*.1") - pisitools.doinfo("doc/*.info") - pisitools.dodoc("AUTHORS", "FAQ", "NEWS", "README", "ChangeLog") diff --git a/tags/pisi-1.1_beta13/tests/stress/comp/bc/files/bc-1.06-info-fix.diff b/tags/pisi-1.1_beta13/tests/stress/comp/bc/files/bc-1.06-info-fix.diff deleted file mode 100644 index e70736c0..00000000 --- a/tags/pisi-1.1_beta13/tests/stress/comp/bc/files/bc-1.06-info-fix.diff +++ /dev/null @@ -1,101 +0,0 @@ -diff -r -C2 bc-1.06.orig/doc/bc.texi bc-1.06/doc/bc.texi -*** bc-1.06.orig/doc/bc.texi Wed Sep 27 20:22:24 2000 ---- bc-1.06/doc/bc.texi Fri Aug 3 16:44:49 2001 -*************** -*** 14,29 **** - @c end tex - -! @titlepage -! @title @command{bc} -! @subtitle an arbitrary precision calculator language -! @subtitle version 1.06 -! -! @author Philip A. Nelson -! @page - - This manual documents @command{bc}, an arbitrary precision calculator language. - - This manual is part of GNU @command{bc}.@* -! @sp4 - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. ---- 14,26 ---- - @c end tex - -! @ifinfo -! @direntry -! * bc: (bc). An arbitrary precision calculator language. -! @end direntry - - This manual documents @command{bc}, an arbitrary precision calculator language. - - This manual is part of GNU @command{bc}.@* -! - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -*************** -*** 33,42 **** - are preserved on all copies. - -! @iftex - Permission is granted to process this file through TeX and print the - results, provided the printed document carries copying permission - notice identical to this one except for the removal of this paragraph - (this paragraph not being relevant to the printed manual). -! @end iftex - - Permission is granted to copy and distribute modified versions of this ---- 30,39 ---- - are preserved on all copies. - -! @ignore - Permission is granted to process this file through TeX and print the - results, provided the printed document carries copying permission - notice identical to this one except for the removal of this paragraph - (this paragraph not being relevant to the printed manual). -! @end ignore - - Permission is granted to copy and distribute modified versions of this -*************** -*** 49,52 **** ---- 46,59 ---- - except that this permission notice may be stated in a translation approved - by the Foundation. -+ @end ifinfo -+ -+ @titlepage -+ @title @command{bc} -+ @subtitle an arbitrary precision calculator language -+ @subtitle version 1.06 -+ -+ @author Philip A. Nelson -+ @page -+ - - You may contact the author by: -diff -r -C2 bc-1.06.orig/doc/dc.texi bc-1.06/doc/dc.texi -*** bc-1.06.orig/doc/dc.texi Thu Aug 31 11:57:43 2000 ---- bc-1.06/doc/dc.texi Fri Aug 3 16:42:34 2001 -*************** -*** 42,47 **** - notice identical to this one except for the removal of this paragraph - (this paragraph not being relevant to the printed manual). -- - @end ignore - Permission is granted to copy and distribute modified versions of this - manual under the conditions for verbatim copying, provided that the entire ---- 42,47 ---- - notice identical to this one except for the removal of this paragraph - (this paragraph not being relevant to the printed manual). - @end ignore -+ - Permission is granted to copy and distribute modified versions of this - manual under the conditions for verbatim copying, provided that the entire -*************** -*** 86,90 **** - - @end titlepage -- @page - - @node Top, Introduction, (dir), (dir) ---- 86,89 ---- diff --git a/tags/pisi-1.1_beta13/tests/stress/comp/bc/files/bc-1.06-longopts.patch b/tags/pisi-1.1_beta13/tests/stress/comp/bc/files/bc-1.06-longopts.patch deleted file mode 100644 index f450e3fa..00000000 --- a/tags/pisi-1.1_beta13/tests/stress/comp/bc/files/bc-1.06-longopts.patch +++ /dev/null @@ -1,28 +0,0 @@ -a bug in the argument processing of 'bc' (v1.06) prevents it from properly -reading long-format options. - -patch by joe bruin - -http://bugs.gentoo.org/show_bug.cgi?id=51525 - ---- bc-1.06.orig/bc/main.c -+++ bc-1.06/bc/main.c -@@ -63,7 +63,7 @@ - printf ("usage: %s [options] [file ...]\n%s%s%s%s%s%s%s", progname, - " -h --help print this usage and exit\n", - " -i --interactive force interactive mode\n", -- " -l --mathlib use the predefine math routnes\n", -+ " -l --mathlib use the predefined math routines\n", - " -q --quiet don't print initial banner\n", - " -s --standard non-standard bc constructs are errors\n", - " -w --warn warn about non-standard bc constructs\n", -@@ -93,6 +93,9 @@ - - switch (optch) - { -+ case 0: /* Long option setting a var. */ -+ break; -+ - case 'c': /* compile only */ - compile_only = TRUE; - break; diff --git a/tags/pisi-1.1_beta13/tests/stress/comp/bc/files/bc-1.06-readline42.diff b/tags/pisi-1.1_beta13/tests/stress/comp/bc/files/bc-1.06-readline42.diff deleted file mode 100644 index 97856d58..00000000 --- a/tags/pisi-1.1_beta13/tests/stress/comp/bc/files/bc-1.06-readline42.diff +++ /dev/null @@ -1,12 +0,0 @@ -this lets bc use readline-4.2, borrowed from redhat apparently. :) - ---- bc-1.06/bc/scan.l.sux Fri May 11 14:27:20 2001 -+++ bc-1.06/bc/scan.l Fri May 11 14:27:32 2001 -@@ -143,7 +143,6 @@ - - /* Definitions for readline access. */ - extern FILE *rl_instream; --_PROTOTYPE(char *readline, (char *)); - - /* rl_input puts upto MAX characters into BUF with the number put in - BUF placed in *RESULT. If the yy input file is the same as diff --git a/tags/pisi-1.1_beta13/tests/stress/comp/bc/files/bc-1.06-static-save.patch b/tags/pisi-1.1_beta13/tests/stress/comp/bc/files/bc-1.06-static-save.patch deleted file mode 100644 index 0ee543b2..00000000 --- a/tags/pisi-1.1_beta13/tests/stress/comp/bc/files/bc-1.06-static-save.patch +++ /dev/null @@ -1,16 +0,0 @@ -ripped from fedora ! - ---- bc-1.06/bc/load.c.s390 Wed Sep 13 20:22:38 2000 -+++ bc-1.06/bc/load.c Wed Sep 5 16:10:18 2001 -@@ -156,7 +156,10 @@ - long label_no; - long vaf_name; /* variable, array or function number. */ - long func; -- program_counter save_adr; -+ /* Make save_adr static. Otherwise the whole address save stuff doesn't make -+ any sense at all and break e.g. on S390. -+ 09/05/01 Phil Knirsch */ -+ static program_counter save_adr; - - /* Initialize. */ - str = code; diff --git a/tags/pisi-1.1_beta13/tests/stress/comp/bc/pspec.xml b/tags/pisi-1.1_beta13/tests/stress/comp/bc/pspec.xml deleted file mode 100644 index bd02bfca..00000000 --- a/tags/pisi-1.1_beta13/tests/stress/comp/bc/pspec.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - bc - http://www.gnu.org/software/bc/bc.htm - - Pardus TestcioÄŸlu - bilgi@uludag.org.tr - - GPL-2 - category - Handy console-based calculator utility - Şık görünümlü bir konsol temelli hesap makinesı - Handy console-based calculator utility - Konsolda çalışan şık görünümlü bir hesap makinesı - ftp://ftp.ulak.net.tr/gnu/gnu/bc/bc-1.06.tar.gz - - ab - - - bc-1.06-info-fix.diff - bc-1.06-longopts.patch - bc-1.06-readline42.diff - bc-1.06-static-save.patch - - - - - bc - - ab - - - / - - - - - - 2005-12-18 - 1.06 - First release. - Pardus TestcioÄŸlu - bilgi@uludag.org.tr - - - diff --git a/tags/pisi-1.1_beta13/tests/stress/comp/cd/actions.py b/tags/pisi-1.1_beta13/tests/stress/comp/cd/actions.py deleted file mode 100644 index 43687b2e..00000000 --- a/tags/pisi-1.1_beta13/tests/stress/comp/cd/actions.py +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- -# -# Copyright © 2005 TUBITAK/UEKAE -# Licensed under the GNU General Public License, version 2. -# See the file http://www.gnu.org/copyleft/gpl.txt. - -from pisi.actionsapi import autotools -from pisi.actionsapi import pisitools - -WorkDir = "bc-1.06" - -def setup(): - autotools.configure("--with-readline") - -def build(): - autotools.make() - -def install(): - pisitools.dobin("bc/bc") - pisitools.dobin("dc/dc") - pisitools.doman("man/*.1") - pisitools.doinfo("doc/*.info") - pisitools.dodoc("AUTHORS", "FAQ", "NEWS", "README", "ChangeLog") diff --git a/tags/pisi-1.1_beta13/tests/stress/comp/cd/files/bc-1.06-info-fix.diff b/tags/pisi-1.1_beta13/tests/stress/comp/cd/files/bc-1.06-info-fix.diff deleted file mode 100644 index e70736c0..00000000 --- a/tags/pisi-1.1_beta13/tests/stress/comp/cd/files/bc-1.06-info-fix.diff +++ /dev/null @@ -1,101 +0,0 @@ -diff -r -C2 bc-1.06.orig/doc/bc.texi bc-1.06/doc/bc.texi -*** bc-1.06.orig/doc/bc.texi Wed Sep 27 20:22:24 2000 ---- bc-1.06/doc/bc.texi Fri Aug 3 16:44:49 2001 -*************** -*** 14,29 **** - @c end tex - -! @titlepage -! @title @command{bc} -! @subtitle an arbitrary precision calculator language -! @subtitle version 1.06 -! -! @author Philip A. Nelson -! @page - - This manual documents @command{bc}, an arbitrary precision calculator language. - - This manual is part of GNU @command{bc}.@* -! @sp4 - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. ---- 14,26 ---- - @c end tex - -! @ifinfo -! @direntry -! * bc: (bc). An arbitrary precision calculator language. -! @end direntry - - This manual documents @command{bc}, an arbitrary precision calculator language. - - This manual is part of GNU @command{bc}.@* -! - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -*************** -*** 33,42 **** - are preserved on all copies. - -! @iftex - Permission is granted to process this file through TeX and print the - results, provided the printed document carries copying permission - notice identical to this one except for the removal of this paragraph - (this paragraph not being relevant to the printed manual). -! @end iftex - - Permission is granted to copy and distribute modified versions of this ---- 30,39 ---- - are preserved on all copies. - -! @ignore - Permission is granted to process this file through TeX and print the - results, provided the printed document carries copying permission - notice identical to this one except for the removal of this paragraph - (this paragraph not being relevant to the printed manual). -! @end ignore - - Permission is granted to copy and distribute modified versions of this -*************** -*** 49,52 **** ---- 46,59 ---- - except that this permission notice may be stated in a translation approved - by the Foundation. -+ @end ifinfo -+ -+ @titlepage -+ @title @command{bc} -+ @subtitle an arbitrary precision calculator language -+ @subtitle version 1.06 -+ -+ @author Philip A. Nelson -+ @page -+ - - You may contact the author by: -diff -r -C2 bc-1.06.orig/doc/dc.texi bc-1.06/doc/dc.texi -*** bc-1.06.orig/doc/dc.texi Thu Aug 31 11:57:43 2000 ---- bc-1.06/doc/dc.texi Fri Aug 3 16:42:34 2001 -*************** -*** 42,47 **** - notice identical to this one except for the removal of this paragraph - (this paragraph not being relevant to the printed manual). -- - @end ignore - Permission is granted to copy and distribute modified versions of this - manual under the conditions for verbatim copying, provided that the entire ---- 42,47 ---- - notice identical to this one except for the removal of this paragraph - (this paragraph not being relevant to the printed manual). - @end ignore -+ - Permission is granted to copy and distribute modified versions of this - manual under the conditions for verbatim copying, provided that the entire -*************** -*** 86,90 **** - - @end titlepage -- @page - - @node Top, Introduction, (dir), (dir) ---- 86,89 ---- diff --git a/tags/pisi-1.1_beta13/tests/stress/comp/cd/files/bc-1.06-longopts.patch b/tags/pisi-1.1_beta13/tests/stress/comp/cd/files/bc-1.06-longopts.patch deleted file mode 100644 index f450e3fa..00000000 --- a/tags/pisi-1.1_beta13/tests/stress/comp/cd/files/bc-1.06-longopts.patch +++ /dev/null @@ -1,28 +0,0 @@ -a bug in the argument processing of 'bc' (v1.06) prevents it from properly -reading long-format options. - -patch by joe bruin - -http://bugs.gentoo.org/show_bug.cgi?id=51525 - ---- bc-1.06.orig/bc/main.c -+++ bc-1.06/bc/main.c -@@ -63,7 +63,7 @@ - printf ("usage: %s [options] [file ...]\n%s%s%s%s%s%s%s", progname, - " -h --help print this usage and exit\n", - " -i --interactive force interactive mode\n", -- " -l --mathlib use the predefine math routnes\n", -+ " -l --mathlib use the predefined math routines\n", - " -q --quiet don't print initial banner\n", - " -s --standard non-standard bc constructs are errors\n", - " -w --warn warn about non-standard bc constructs\n", -@@ -93,6 +93,9 @@ - - switch (optch) - { -+ case 0: /* Long option setting a var. */ -+ break; -+ - case 'c': /* compile only */ - compile_only = TRUE; - break; diff --git a/tags/pisi-1.1_beta13/tests/stress/comp/cd/files/bc-1.06-readline42.diff b/tags/pisi-1.1_beta13/tests/stress/comp/cd/files/bc-1.06-readline42.diff deleted file mode 100644 index 97856d58..00000000 --- a/tags/pisi-1.1_beta13/tests/stress/comp/cd/files/bc-1.06-readline42.diff +++ /dev/null @@ -1,12 +0,0 @@ -this lets bc use readline-4.2, borrowed from redhat apparently. :) - ---- bc-1.06/bc/scan.l.sux Fri May 11 14:27:20 2001 -+++ bc-1.06/bc/scan.l Fri May 11 14:27:32 2001 -@@ -143,7 +143,6 @@ - - /* Definitions for readline access. */ - extern FILE *rl_instream; --_PROTOTYPE(char *readline, (char *)); - - /* rl_input puts upto MAX characters into BUF with the number put in - BUF placed in *RESULT. If the yy input file is the same as diff --git a/tags/pisi-1.1_beta13/tests/stress/comp/cd/files/bc-1.06-static-save.patch b/tags/pisi-1.1_beta13/tests/stress/comp/cd/files/bc-1.06-static-save.patch deleted file mode 100644 index 0ee543b2..00000000 --- a/tags/pisi-1.1_beta13/tests/stress/comp/cd/files/bc-1.06-static-save.patch +++ /dev/null @@ -1,16 +0,0 @@ -ripped from fedora ! - ---- bc-1.06/bc/load.c.s390 Wed Sep 13 20:22:38 2000 -+++ bc-1.06/bc/load.c Wed Sep 5 16:10:18 2001 -@@ -156,7 +156,10 @@ - long label_no; - long vaf_name; /* variable, array or function number. */ - long func; -- program_counter save_adr; -+ /* Make save_adr static. Otherwise the whole address save stuff doesn't make -+ any sense at all and break e.g. on S390. -+ 09/05/01 Phil Knirsch */ -+ static program_counter save_adr; - - /* Initialize. */ - str = code; diff --git a/tags/pisi-1.1_beta13/tests/stress/comp/cd/pspec.xml b/tags/pisi-1.1_beta13/tests/stress/comp/cd/pspec.xml deleted file mode 100644 index 904a8cf4..00000000 --- a/tags/pisi-1.1_beta13/tests/stress/comp/cd/pspec.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - cd - http://www.gnu.org/software/bc/bc.htm - - Pardus TestcioÄŸlu - bilgi@uludag.org.tr - - GPL-2 - category - Handy console-based calculator utility - Şık görünümlü bir konsol temelli hesap makinesı - Handy console-based calculator utility - Konsolda çalışan şık görünümlü bir hesap makinesı - ftp://ftp.ulak.net.tr/gnu/gnu/bc/bc-1.06.tar.gz - - ab - bc - - - bc-1.06-info-fix.diff - bc-1.06-longopts.patch - bc-1.06-readline42.diff - bc-1.06-static-save.patch - - - - - cd - - ab - bc - - - / - - - - - - 2005-12-18 - 1.06 - First release. - Pardus TestcioÄŸlu - bilgi@uludag.org.tr - - - diff --git a/tags/pisi-1.1_beta13/tests/stress/comp/component.xml b/tags/pisi-1.1_beta13/tests/stress/comp/component.xml deleted file mode 100644 index c8511b01..00000000 --- a/tags/pisi-1.1_beta13/tests/stress/comp/component.xml +++ /dev/null @@ -1,6 +0,0 @@ - - test.comp - ... - ... - ... - diff --git a/tags/pisi-1.1_beta13/tests/stress/component.xml b/tags/pisi-1.1_beta13/tests/stress/component.xml deleted file mode 100644 index 4a3a79fb..00000000 --- a/tags/pisi-1.1_beta13/tests/stress/component.xml +++ /dev/null @@ -1,6 +0,0 @@ - - test - ... - ... - ... - diff --git a/tags/pisi-1.1_beta13/tests/stress/lang/component.xml b/tags/pisi-1.1_beta13/tests/stress/lang/component.xml deleted file mode 100644 index 2f75377a..00000000 --- a/tags/pisi-1.1_beta13/tests/stress/lang/component.xml +++ /dev/null @@ -1,6 +0,0 @@ - - test.lang - ... - ... - ... - diff --git a/tags/pisi-1.1_beta13/tests/stress/lang/de/actions.py b/tags/pisi-1.1_beta13/tests/stress/lang/de/actions.py deleted file mode 100644 index 43687b2e..00000000 --- a/tags/pisi-1.1_beta13/tests/stress/lang/de/actions.py +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- -# -# Copyright © 2005 TUBITAK/UEKAE -# Licensed under the GNU General Public License, version 2. -# See the file http://www.gnu.org/copyleft/gpl.txt. - -from pisi.actionsapi import autotools -from pisi.actionsapi import pisitools - -WorkDir = "bc-1.06" - -def setup(): - autotools.configure("--with-readline") - -def build(): - autotools.make() - -def install(): - pisitools.dobin("bc/bc") - pisitools.dobin("dc/dc") - pisitools.doman("man/*.1") - pisitools.doinfo("doc/*.info") - pisitools.dodoc("AUTHORS", "FAQ", "NEWS", "README", "ChangeLog") diff --git a/tags/pisi-1.1_beta13/tests/stress/lang/de/files/bc-1.06-info-fix.diff b/tags/pisi-1.1_beta13/tests/stress/lang/de/files/bc-1.06-info-fix.diff deleted file mode 100644 index e70736c0..00000000 --- a/tags/pisi-1.1_beta13/tests/stress/lang/de/files/bc-1.06-info-fix.diff +++ /dev/null @@ -1,101 +0,0 @@ -diff -r -C2 bc-1.06.orig/doc/bc.texi bc-1.06/doc/bc.texi -*** bc-1.06.orig/doc/bc.texi Wed Sep 27 20:22:24 2000 ---- bc-1.06/doc/bc.texi Fri Aug 3 16:44:49 2001 -*************** -*** 14,29 **** - @c end tex - -! @titlepage -! @title @command{bc} -! @subtitle an arbitrary precision calculator language -! @subtitle version 1.06 -! -! @author Philip A. Nelson -! @page - - This manual documents @command{bc}, an arbitrary precision calculator language. - - This manual is part of GNU @command{bc}.@* -! @sp4 - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. ---- 14,26 ---- - @c end tex - -! @ifinfo -! @direntry -! * bc: (bc). An arbitrary precision calculator language. -! @end direntry - - This manual documents @command{bc}, an arbitrary precision calculator language. - - This manual is part of GNU @command{bc}.@* -! - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -*************** -*** 33,42 **** - are preserved on all copies. - -! @iftex - Permission is granted to process this file through TeX and print the - results, provided the printed document carries copying permission - notice identical to this one except for the removal of this paragraph - (this paragraph not being relevant to the printed manual). -! @end iftex - - Permission is granted to copy and distribute modified versions of this ---- 30,39 ---- - are preserved on all copies. - -! @ignore - Permission is granted to process this file through TeX and print the - results, provided the printed document carries copying permission - notice identical to this one except for the removal of this paragraph - (this paragraph not being relevant to the printed manual). -! @end ignore - - Permission is granted to copy and distribute modified versions of this -*************** -*** 49,52 **** ---- 46,59 ---- - except that this permission notice may be stated in a translation approved - by the Foundation. -+ @end ifinfo -+ -+ @titlepage -+ @title @command{bc} -+ @subtitle an arbitrary precision calculator language -+ @subtitle version 1.06 -+ -+ @author Philip A. Nelson -+ @page -+ - - You may contact the author by: -diff -r -C2 bc-1.06.orig/doc/dc.texi bc-1.06/doc/dc.texi -*** bc-1.06.orig/doc/dc.texi Thu Aug 31 11:57:43 2000 ---- bc-1.06/doc/dc.texi Fri Aug 3 16:42:34 2001 -*************** -*** 42,47 **** - notice identical to this one except for the removal of this paragraph - (this paragraph not being relevant to the printed manual). -- - @end ignore - Permission is granted to copy and distribute modified versions of this - manual under the conditions for verbatim copying, provided that the entire ---- 42,47 ---- - notice identical to this one except for the removal of this paragraph - (this paragraph not being relevant to the printed manual). - @end ignore -+ - Permission is granted to copy and distribute modified versions of this - manual under the conditions for verbatim copying, provided that the entire -*************** -*** 86,90 **** - - @end titlepage -- @page - - @node Top, Introduction, (dir), (dir) ---- 86,89 ---- diff --git a/tags/pisi-1.1_beta13/tests/stress/lang/de/files/bc-1.06-longopts.patch b/tags/pisi-1.1_beta13/tests/stress/lang/de/files/bc-1.06-longopts.patch deleted file mode 100644 index f450e3fa..00000000 --- a/tags/pisi-1.1_beta13/tests/stress/lang/de/files/bc-1.06-longopts.patch +++ /dev/null @@ -1,28 +0,0 @@ -a bug in the argument processing of 'bc' (v1.06) prevents it from properly -reading long-format options. - -patch by joe bruin - -http://bugs.gentoo.org/show_bug.cgi?id=51525 - ---- bc-1.06.orig/bc/main.c -+++ bc-1.06/bc/main.c -@@ -63,7 +63,7 @@ - printf ("usage: %s [options] [file ...]\n%s%s%s%s%s%s%s", progname, - " -h --help print this usage and exit\n", - " -i --interactive force interactive mode\n", -- " -l --mathlib use the predefine math routnes\n", -+ " -l --mathlib use the predefined math routines\n", - " -q --quiet don't print initial banner\n", - " -s --standard non-standard bc constructs are errors\n", - " -w --warn warn about non-standard bc constructs\n", -@@ -93,6 +93,9 @@ - - switch (optch) - { -+ case 0: /* Long option setting a var. */ -+ break; -+ - case 'c': /* compile only */ - compile_only = TRUE; - break; diff --git a/tags/pisi-1.1_beta13/tests/stress/lang/de/files/bc-1.06-readline42.diff b/tags/pisi-1.1_beta13/tests/stress/lang/de/files/bc-1.06-readline42.diff deleted file mode 100644 index 97856d58..00000000 --- a/tags/pisi-1.1_beta13/tests/stress/lang/de/files/bc-1.06-readline42.diff +++ /dev/null @@ -1,12 +0,0 @@ -this lets bc use readline-4.2, borrowed from redhat apparently. :) - ---- bc-1.06/bc/scan.l.sux Fri May 11 14:27:20 2001 -+++ bc-1.06/bc/scan.l Fri May 11 14:27:32 2001 -@@ -143,7 +143,6 @@ - - /* Definitions for readline access. */ - extern FILE *rl_instream; --_PROTOTYPE(char *readline, (char *)); - - /* rl_input puts upto MAX characters into BUF with the number put in - BUF placed in *RESULT. If the yy input file is the same as diff --git a/tags/pisi-1.1_beta13/tests/stress/lang/de/files/bc-1.06-static-save.patch b/tags/pisi-1.1_beta13/tests/stress/lang/de/files/bc-1.06-static-save.patch deleted file mode 100644 index 0ee543b2..00000000 --- a/tags/pisi-1.1_beta13/tests/stress/lang/de/files/bc-1.06-static-save.patch +++ /dev/null @@ -1,16 +0,0 @@ -ripped from fedora ! - ---- bc-1.06/bc/load.c.s390 Wed Sep 13 20:22:38 2000 -+++ bc-1.06/bc/load.c Wed Sep 5 16:10:18 2001 -@@ -156,7 +156,10 @@ - long label_no; - long vaf_name; /* variable, array or function number. */ - long func; -- program_counter save_adr; -+ /* Make save_adr static. Otherwise the whole address save stuff doesn't make -+ any sense at all and break e.g. on S390. -+ 09/05/01 Phil Knirsch */ -+ static program_counter save_adr; - - /* Initialize. */ - str = code; diff --git a/tags/pisi-1.1_beta13/tests/stress/lang/de/pspec.xml b/tags/pisi-1.1_beta13/tests/stress/lang/de/pspec.xml deleted file mode 100644 index a381fd1e..00000000 --- a/tags/pisi-1.1_beta13/tests/stress/lang/de/pspec.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - de - http://www.gnu.org/software/bc/bc.htm - - Pardus TestcioÄŸlu - bilgi@uludag.org.tr - - GPL-2 - category - Handy console-based calculator utility - Şık görünümlü bir konsol temelli hesap makinesı - Handy console-based calculator utility - Konsolda çalışan şık görünümlü bir hesap makinesı - ftp://ftp.ulak.net.tr/gnu/gnu/bc/bc-1.06.tar.gz - - cd - - - bc-1.06-info-fix.diff - bc-1.06-longopts.patch - bc-1.06-readline42.diff - bc-1.06-static-save.patch - - - - - de - - ab - - - / - - - - - - 2005-12-18 - 1.06 - First release. - Pardus TestcioÄŸlu - bilgi@uludag.org.tr - - - diff --git a/tags/pisi-1.1_beta13/tests/stress/lang/ef/actions.py b/tags/pisi-1.1_beta13/tests/stress/lang/ef/actions.py deleted file mode 100644 index 43687b2e..00000000 --- a/tags/pisi-1.1_beta13/tests/stress/lang/ef/actions.py +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- -# -# Copyright © 2005 TUBITAK/UEKAE -# Licensed under the GNU General Public License, version 2. -# See the file http://www.gnu.org/copyleft/gpl.txt. - -from pisi.actionsapi import autotools -from pisi.actionsapi import pisitools - -WorkDir = "bc-1.06" - -def setup(): - autotools.configure("--with-readline") - -def build(): - autotools.make() - -def install(): - pisitools.dobin("bc/bc") - pisitools.dobin("dc/dc") - pisitools.doman("man/*.1") - pisitools.doinfo("doc/*.info") - pisitools.dodoc("AUTHORS", "FAQ", "NEWS", "README", "ChangeLog") diff --git a/tags/pisi-1.1_beta13/tests/stress/lang/ef/files/bc-1.06-info-fix.diff b/tags/pisi-1.1_beta13/tests/stress/lang/ef/files/bc-1.06-info-fix.diff deleted file mode 100644 index e70736c0..00000000 --- a/tags/pisi-1.1_beta13/tests/stress/lang/ef/files/bc-1.06-info-fix.diff +++ /dev/null @@ -1,101 +0,0 @@ -diff -r -C2 bc-1.06.orig/doc/bc.texi bc-1.06/doc/bc.texi -*** bc-1.06.orig/doc/bc.texi Wed Sep 27 20:22:24 2000 ---- bc-1.06/doc/bc.texi Fri Aug 3 16:44:49 2001 -*************** -*** 14,29 **** - @c end tex - -! @titlepage -! @title @command{bc} -! @subtitle an arbitrary precision calculator language -! @subtitle version 1.06 -! -! @author Philip A. Nelson -! @page - - This manual documents @command{bc}, an arbitrary precision calculator language. - - This manual is part of GNU @command{bc}.@* -! @sp4 - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. ---- 14,26 ---- - @c end tex - -! @ifinfo -! @direntry -! * bc: (bc). An arbitrary precision calculator language. -! @end direntry - - This manual documents @command{bc}, an arbitrary precision calculator language. - - This manual is part of GNU @command{bc}.@* -! - Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -*************** -*** 33,42 **** - are preserved on all copies. - -! @iftex - Permission is granted to process this file through TeX and print the - results, provided the printed document carries copying permission - notice identical to this one except for the removal of this paragraph - (this paragraph not being relevant to the printed manual). -! @end iftex - - Permission is granted to copy and distribute modified versions of this ---- 30,39 ---- - are preserved on all copies. - -! @ignore - Permission is granted to process this file through TeX and print the - results, provided the printed document carries copying permission - notice identical to this one except for the removal of this paragraph - (this paragraph not being relevant to the printed manual). -! @end ignore - - Permission is granted to copy and distribute modified versions of this -*************** -*** 49,52 **** ---- 46,59 ---- - except that this permission notice may be stated in a translation approved - by the Foundation. -+ @end ifinfo -+ -+ @titlepage -+ @title @command{bc} -+ @subtitle an arbitrary precision calculator language -+ @subtitle version 1.06 -+ -+ @author Philip A. Nelson -+ @page -+ - - You may contact the author by: -diff -r -C2 bc-1.06.orig/doc/dc.texi bc-1.06/doc/dc.texi -*** bc-1.06.orig/doc/dc.texi Thu Aug 31 11:57:43 2000 ---- bc-1.06/doc/dc.texi Fri Aug 3 16:42:34 2001 -*************** -*** 42,47 **** - notice identical to this one except for the removal of this paragraph - (this paragraph not being relevant to the printed manual). -- - @end ignore - Permission is granted to copy and distribute modified versions of this - manual under the conditions for verbatim copying, provided that the entire ---- 42,47 ---- - notice identical to this one except for the removal of this paragraph - (this paragraph not being relevant to the printed manual). - @end ignore -+ - Permission is granted to copy and distribute modified versions of this - manual under the conditions for verbatim copying, provided that the entire -*************** -*** 86,90 **** - - @end titlepage -- @page - - @node Top, Introduction, (dir), (dir) ---- 86,89 ---- diff --git a/tags/pisi-1.1_beta13/tests/stress/lang/ef/files/bc-1.06-longopts.patch b/tags/pisi-1.1_beta13/tests/stress/lang/ef/files/bc-1.06-longopts.patch deleted file mode 100644 index f450e3fa..00000000 --- a/tags/pisi-1.1_beta13/tests/stress/lang/ef/files/bc-1.06-longopts.patch +++ /dev/null @@ -1,28 +0,0 @@ -a bug in the argument processing of 'bc' (v1.06) prevents it from properly -reading long-format options. - -patch by joe bruin - -http://bugs.gentoo.org/show_bug.cgi?id=51525 - ---- bc-1.06.orig/bc/main.c -+++ bc-1.06/bc/main.c -@@ -63,7 +63,7 @@ - printf ("usage: %s [options] [file ...]\n%s%s%s%s%s%s%s", progname, - " -h --help print this usage and exit\n", - " -i --interactive force interactive mode\n", -- " -l --mathlib use the predefine math routnes\n", -+ " -l --mathlib use the predefined math routines\n", - " -q --quiet don't print initial banner\n", - " -s --standard non-standard bc constructs are errors\n", - " -w --warn warn about non-standard bc constructs\n", -@@ -93,6 +93,9 @@ - - switch (optch) - { -+ case 0: /* Long option setting a var. */ -+ break; -+ - case 'c': /* compile only */ - compile_only = TRUE; - break; diff --git a/tags/pisi-1.1_beta13/tests/stress/lang/ef/files/bc-1.06-readline42.diff b/tags/pisi-1.1_beta13/tests/stress/lang/ef/files/bc-1.06-readline42.diff deleted file mode 100644 index 97856d58..00000000 --- a/tags/pisi-1.1_beta13/tests/stress/lang/ef/files/bc-1.06-readline42.diff +++ /dev/null @@ -1,12 +0,0 @@ -this lets bc use readline-4.2, borrowed from redhat apparently. :) - ---- bc-1.06/bc/scan.l.sux Fri May 11 14:27:20 2001 -+++ bc-1.06/bc/scan.l Fri May 11 14:27:32 2001 -@@ -143,7 +143,6 @@ - - /* Definitions for readline access. */ - extern FILE *rl_instream; --_PROTOTYPE(char *readline, (char *)); - - /* rl_input puts upto MAX characters into BUF with the number put in - BUF placed in *RESULT. If the yy input file is the same as diff --git a/tags/pisi-1.1_beta13/tests/stress/lang/ef/files/bc-1.06-static-save.patch b/tags/pisi-1.1_beta13/tests/stress/lang/ef/files/bc-1.06-static-save.patch deleted file mode 100644 index 0ee543b2..00000000 --- a/tags/pisi-1.1_beta13/tests/stress/lang/ef/files/bc-1.06-static-save.patch +++ /dev/null @@ -1,16 +0,0 @@ -ripped from fedora ! - ---- bc-1.06/bc/load.c.s390 Wed Sep 13 20:22:38 2000 -+++ bc-1.06/bc/load.c Wed Sep 5 16:10:18 2001 -@@ -156,7 +156,10 @@ - long label_no; - long vaf_name; /* variable, array or function number. */ - long func; -- program_counter save_adr; -+ /* Make save_adr static. Otherwise the whole address save stuff doesn't make -+ any sense at all and break e.g. on S390. -+ 09/05/01 Phil Knirsch */ -+ static program_counter save_adr; - - /* Initialize. */ - str = code; diff --git a/tags/pisi-1.1_beta13/tests/stress/lang/ef/pspec.xml b/tags/pisi-1.1_beta13/tests/stress/lang/ef/pspec.xml deleted file mode 100644 index d422dd74..00000000 --- a/tags/pisi-1.1_beta13/tests/stress/lang/ef/pspec.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - ef - http://www.gnu.org/software/bc/bc.htm - - Pardus TestcioÄŸlu - bilgi@uludag.org.tr - - GPL-2 - category - Handy console-based calculator utility - Şık görünümlü bir konsol temelli hesap makinesı - Handy console-based calculator utility - Konsolda çalışan şık görünümlü bir hesap makinesı - ftp://ftp.ulak.net.tr/gnu/gnu/bc/bc-1.06.tar.gz - - de - - - bc-1.06-info-fix.diff - bc-1.06-longopts.patch - bc-1.06-readline42.diff - bc-1.06-static-save.patch - - - - - ef - - de - - - / - - - - - - 2005-12-18 - 1.06 - First release. - Pardus TestcioÄŸlu - bilgi@uludag.org.tr - - - diff --git a/tags/pisi-1.1_beta13/tests/stress/stress.sh b/tags/pisi-1.1_beta13/tests/stress/stress.sh deleted file mode 100755 index b2eb802a..00000000 --- a/tags/pisi-1.1_beta13/tests/stress/stress.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash - -rm -rf minime -mkdir minime -rm -f *.pisi - -pisi build comp/ab/pspec.xml -D./minime -pisi it ab-1.06-1.pisi -D./minime - -pisi build comp/bc/pspec.xml -D./minime -pisi it bc-1.06-1.pisi -D./minime - -pisi build comp/cd/pspec.xml -D./minime -pisi it cd-1.06-1.pisi -D./minime - -for i in `seq 1 10` -do - pisi it ab-1.06-1.pisi -D./minime --yes-all -done - -for i in `seq 1 10` -do - pisi remove cd -D./minime - pisi it cd-1.06-1.pisi -D./minime -done - -pisi build lang/de/pspec.xml -D./minime -pisi it de-1.06-1.pisi -D./minime - -pisi build lang/ef/pspec.xml -D./minime -pisi it ef-1.06-1.pisi -D./minime - -pisi rebuild-db -D./minime --yes-all - -pisi remove ab -D./minime --yes-all - -pisi li -D./minime diff --git a/tags/pisi-1.1_beta13/tests/testcase.py b/tags/pisi-1.1_beta13/tests/testcase.py deleted file mode 100644 index d861d4ec..00000000 --- a/tags/pisi-1.1_beta13/tests/testcase.py +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# - -import unittest -import os - -import pisi -import pisi.api -import pisi.util -import pisi.config - -class TestCase(unittest.TestCase): - - def setUp(self, comar = False, database = True, options = None): - if not options: - options = pisi.config.Options() - options.ignore_build_no = False - options.destdir = 'tmp' - pisi.api.init(options = options, comar = comar, - database = database, write = database) - - def tearDown(self, ): - pisi.api.finalize() diff --git a/tags/pisi-1.1_beta13/tests/unzip/actions.py b/tags/pisi-1.1_beta13/tests/unzip/actions.py deleted file mode 100644 index ed12a90d..00000000 --- a/tags/pisi-1.1_beta13/tests/unzip/actions.py +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# - -from pisi.actionsapi import autotools -from pisi.actionsapi import get -from pisi.actionsapi import pisitools - -def setup(): - pisitools.dosed("unix/Makefile", "-O3", get.CFLAGS()) - pisitools.dosed("unix/Makefile", "CC=gcc LD=gcc", "CC=${CC:-gcc} LD=${CC:-gcc}") - pisitools.dosed("unix/Makefile", "-O ", get.CFLAGS()) - pass - -def build(): - autotools.make("-f unix/Makefile linux") - -def install(): - pisitools.insinto("/usr/bin/", "unzip") - pisitools.insinto("/usr/bin/", "funzip") - pisitools.insinto("/usr/bin/", "unzipsfx") - pisitools.insinto("/usr/bin/", "unix/zipgrep") - - pisitools.dosym("/usr/bin/unzip", "/usr/bin/zipinfo") - pisitools.doman("man/*.1") - pisitools.dodoc("BUGS", "History*", "README", "ToDo", "WHERE") diff --git a/tags/pisi-1.1_beta13/tests/unzip/files/unzip-5.50-dotdot.patch b/tags/pisi-1.1_beta13/tests/unzip/files/unzip-5.50-dotdot.patch deleted file mode 100644 index 73441f7b..00000000 --- a/tags/pisi-1.1_beta13/tests/unzip/files/unzip-5.50-dotdot.patch +++ /dev/null @@ -1,85 +0,0 @@ -Only in unzip-5.50-lhh/: cscope.files -Only in unzip-5.50-lhh/: cscope.out -diff -ur unzip-5.50/unix/unix.c unzip-5.50-lhh/unix/unix.c ---- unzip-5.50/unix/unix.c 2002-01-21 17:54:42.000000000 -0500 -+++ unzip-5.50-lhh/unix/unix.c 2003-06-11 18:35:38.000000000 -0400 -@@ -421,7 +421,8 @@ - */ - { - char pathcomp[FILNAMSIZ]; /* path-component buffer */ -- char *pp, *cp=(char *)NULL; /* character pointers */ -+ char *pp, *cp=(char *)NULL, /* character pointers */ -+ *dp=(char *)NULL; - char *lastsemi=(char *)NULL; /* pointer to last semi-colon in pathcomp */ - #ifdef ACORN_FTYPE_NFS - char *lastcomma=(char *)NULL; /* pointer to last comma in pathcomp */ -@@ -429,6 +430,7 @@ - #endif - int quote = FALSE; /* flags */ - int killed_ddot = FALSE; /* is set when skipping "../" pathcomp */ -+ int snarf_ddot = FALSE; /* Is set while scanning for "../" */ - int error = MPN_OK; - register unsigned workch; /* hold the character being tested */ - -@@ -467,6 +469,9 @@ - while ((workch = (uch)*cp++) != 0) { - - if (quote) { /* if character quoted, */ -+ if ((pp == pathcomp) && (workch == '.')) -+ /* Oh no you don't... */ -+ goto ddot_hack; - *pp++ = (char)workch; /* include it literally */ - quote = FALSE; - } else -@@ -481,15 +486,44 @@ - break; - - case '.': -- if (pp == pathcomp) { /* nothing appended yet... */ -+ if (pp == pathcomp) { -+ddot_hack: -+ /* nothing appended yet... */ - if (*cp == '/') { /* don't bother appending "./" to */ - ++cp; /* the path: skip behind the '/' */ - break; -- } else if (!uO.ddotflag && *cp == '.' && cp[1] == '/') { -- /* "../" dir traversal detected */ -- cp += 2; /* skip over behind the '/' */ -- killed_ddot = TRUE; /* set "show message" flag */ -- break; -+ } else if (!uO.ddotflag) { -+ -+ /* -+ * SECURITY: Skip past control characters if the user -+ * didn't OK use of absolute pathnames. lhh - this is -+ * a very quick, ugly, inefficient fix. -+ */ -+ dp = cp; -+ do { -+ workch = (uch)(*dp); -+ if (workch == '/' && snarf_ddot) { -+ /* "../" dir traversal detected */ -+ cp = dp + 1; /* skip past the '/' */ -+ killed_ddot = TRUE; /* set "show msg" flag */ -+ break; -+ } else if (workch == '.' && !snarf_ddot) { -+ snarf_ddot = TRUE; -+ } else if (isprint(workch) || -+ ((workch > 127) && (workch <= 254))) { -+ /* -+ * Since we found a printable, non-ctrl char, -+ * we can stop looking for '../', the amount -+ * in ../! -+ */ -+ break; -+ } -+ -+ dp++; -+ } while (*dp != 0); -+ -+ if (killed_ddot) -+ break; - } - } - *pp++ = '.'; -Only in unzip-5.50-lhh/unix: .unix.c.swp diff --git a/tags/pisi-1.1_beta13/tests/unzip/pspec.xml b/tags/pisi-1.1_beta13/tests/unzip/pspec.xml deleted file mode 100644 index ed4188a0..00000000 --- a/tags/pisi-1.1_beta13/tests/unzip/pspec.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - unzip - ftp://ftp.info-zip.org/pub/infozip/UnZip.html - - A. Murat Eren - meren@uludag.org.tr - - Info-ZIP - category - component - Unzipper for pkzip-compressed files - Unzipper for pkzip-compressed files - ftp://ftp.linux.org.tr/pub/mirrors/gentoo/distfiles/unzip550.tar.gz - - unzip-5.50-dotdot.patch - - - libc - sed - patch - - - - - unzip - - - - - /usr/bin - /usr/share/doc - /usr/share/man - - - - - 2005-07-15 - 5.50 - - - - - diff --git a/tags/pisi-1.1_beta13/tests/unzip2/actions.py b/tags/pisi-1.1_beta13/tests/unzip2/actions.py deleted file mode 100644 index 09b91126..00000000 --- a/tags/pisi-1.1_beta13/tests/unzip2/actions.py +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# - -from pisi.actionsapi import autotools -from pisi.actionsapi import get -from pisi.actionsapi import pisitools - -WorkDir="unzip-5.50" - -def setup(): - pisitools.dosed("unix/Makefile", "-O3", get.CFLAGS()) - pisitools.dosed("unix/Makefile", "CC=gcc LD=gcc", "CC=${CC:-gcc} LD=${CC:-gcc}") - pisitools.dosed("unix/Makefile", "-O ", get.CFLAGS()) - pass - -def build(): - autotools.make("-f unix/Makefile linux") - -def install(): - pisitools.insinto("/usr/bin/", "unzip") - pisitools.insinto("/usr/bin/", "funzip") - pisitools.insinto("/usr/bin/", "unzipsfx") - pisitools.insinto("/usr/bin/", "unix/zipgrep") - - pisitools.dosym("/usr/bin/unzip", "/usr/bin/zipinfo") - pisitools.doman("man/*.1") - pisitools.dodoc("BUGS", "History*", "README", "ToDo", "WHERE") diff --git a/tags/pisi-1.1_beta13/tests/unzip2/files/unzip-5.50-dotdot.patch b/tags/pisi-1.1_beta13/tests/unzip2/files/unzip-5.50-dotdot.patch deleted file mode 100644 index 73441f7b..00000000 --- a/tags/pisi-1.1_beta13/tests/unzip2/files/unzip-5.50-dotdot.patch +++ /dev/null @@ -1,85 +0,0 @@ -Only in unzip-5.50-lhh/: cscope.files -Only in unzip-5.50-lhh/: cscope.out -diff -ur unzip-5.50/unix/unix.c unzip-5.50-lhh/unix/unix.c ---- unzip-5.50/unix/unix.c 2002-01-21 17:54:42.000000000 -0500 -+++ unzip-5.50-lhh/unix/unix.c 2003-06-11 18:35:38.000000000 -0400 -@@ -421,7 +421,8 @@ - */ - { - char pathcomp[FILNAMSIZ]; /* path-component buffer */ -- char *pp, *cp=(char *)NULL; /* character pointers */ -+ char *pp, *cp=(char *)NULL, /* character pointers */ -+ *dp=(char *)NULL; - char *lastsemi=(char *)NULL; /* pointer to last semi-colon in pathcomp */ - #ifdef ACORN_FTYPE_NFS - char *lastcomma=(char *)NULL; /* pointer to last comma in pathcomp */ -@@ -429,6 +430,7 @@ - #endif - int quote = FALSE; /* flags */ - int killed_ddot = FALSE; /* is set when skipping "../" pathcomp */ -+ int snarf_ddot = FALSE; /* Is set while scanning for "../" */ - int error = MPN_OK; - register unsigned workch; /* hold the character being tested */ - -@@ -467,6 +469,9 @@ - while ((workch = (uch)*cp++) != 0) { - - if (quote) { /* if character quoted, */ -+ if ((pp == pathcomp) && (workch == '.')) -+ /* Oh no you don't... */ -+ goto ddot_hack; - *pp++ = (char)workch; /* include it literally */ - quote = FALSE; - } else -@@ -481,15 +486,44 @@ - break; - - case '.': -- if (pp == pathcomp) { /* nothing appended yet... */ -+ if (pp == pathcomp) { -+ddot_hack: -+ /* nothing appended yet... */ - if (*cp == '/') { /* don't bother appending "./" to */ - ++cp; /* the path: skip behind the '/' */ - break; -- } else if (!uO.ddotflag && *cp == '.' && cp[1] == '/') { -- /* "../" dir traversal detected */ -- cp += 2; /* skip over behind the '/' */ -- killed_ddot = TRUE; /* set "show message" flag */ -- break; -+ } else if (!uO.ddotflag) { -+ -+ /* -+ * SECURITY: Skip past control characters if the user -+ * didn't OK use of absolute pathnames. lhh - this is -+ * a very quick, ugly, inefficient fix. -+ */ -+ dp = cp; -+ do { -+ workch = (uch)(*dp); -+ if (workch == '/' && snarf_ddot) { -+ /* "../" dir traversal detected */ -+ cp = dp + 1; /* skip past the '/' */ -+ killed_ddot = TRUE; /* set "show msg" flag */ -+ break; -+ } else if (workch == '.' && !snarf_ddot) { -+ snarf_ddot = TRUE; -+ } else if (isprint(workch) || -+ ((workch > 127) && (workch <= 254))) { -+ /* -+ * Since we found a printable, non-ctrl char, -+ * we can stop looking for '../', the amount -+ * in ../! -+ */ -+ break; -+ } -+ -+ dp++; -+ } while (*dp != 0); -+ -+ if (killed_ddot) -+ break; - } - } - *pp++ = '.'; -Only in unzip-5.50-lhh/unix: .unix.c.swp diff --git a/tags/pisi-1.1_beta13/tests/unzip2/pspec.xml b/tags/pisi-1.1_beta13/tests/unzip2/pspec.xml deleted file mode 100644 index b8841dcb..00000000 --- a/tags/pisi-1.1_beta13/tests/unzip2/pspec.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - unzip - ftp://ftp.info-zip.org/pub/infozip/UnZip.html - - A. Murat Eren - meren@uludag.org.tr - - Info-ZIP - category - component - Unzipper for pkzip-compressed files - Unzipper for pkzip-compressed files - ftp://ftp.linux.org.tr/pub/mirrors/gentoo/distfiles/unzip550.tar.gz - - unzip-5.50-dotdot.patch - - - libc - sed - patch - - - - - unzip - - - - - /usr/bin - /usr/share/doc - /usr/share/man - - - - - 2005-08-10 - 5.52 - - - - - diff --git a/tags/pisi-1.1_beta13/tests/upgrade.sh b/tags/pisi-1.1_beta13/tests/upgrade.sh deleted file mode 100755 index 6241c301..00000000 --- a/tags/pisi-1.1_beta13/tests/upgrade.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh - -pwd -PATH=$PATH:. -set -x -e - -pisi-cli -Dtmp -E --ignore-build-no build tests/zip/pspec.xml tests/unzip/pspec.xml -pisi-cli -Dtmp --yes-all --ignore-comar install unzip-5.50-1.pisi zip-2.3-1.pisi - -mkdir -p myrepo -cd myrepo -mkdir -p tmp -../pisi-cli -Dtmp -E --ignore-build-no build ../tests/zip2/pspec.xml ../tests/unzip2/pspec.xml -cd .. -pisi-cli -Dtmp --absolute-uris index myrepo -pisi-cli -Dtmp remove-repo repo1 -pisi-cli -Dtmp add-repo repo1 pisi-index.xml -pisi-cli -Dtmp list-repo -pisi-cli -Dtmp update-repo repo1 -pisi-cli -Dtmp list-available -pisi-cli -Dtmp --install-info list-installed -pisi-cli -Dtmp list-upgrades -pisi-cli -Dtmp --ignore-comar upgrade zip -pisi-cli -Dtmp --install-info list-installed diff --git a/tags/pisi-1.1_beta13/tests/utilfiles/arfilewithtimestamps.a b/tags/pisi-1.1_beta13/tests/utilfiles/arfilewithtimestamps.a deleted file mode 100644 index cf93fc0f..00000000 Binary files a/tags/pisi-1.1_beta13/tests/utilfiles/arfilewithtimestamps.a and /dev/null differ diff --git a/tags/pisi-1.1_beta13/tests/utilfiles/directory/file_74536 b/tags/pisi-1.1_beta13/tests/utilfiles/directory/file_74536 deleted file mode 100644 index 9f46a572..00000000 Binary files a/tags/pisi-1.1_beta13/tests/utilfiles/directory/file_74536 and /dev/null differ diff --git a/tags/pisi-1.1_beta13/tests/utilfiles/linktoarfile b/tags/pisi-1.1_beta13/tests/utilfiles/linktoarfile deleted file mode 120000 index 204e6f30..00000000 --- a/tags/pisi-1.1_beta13/tests/utilfiles/linktoarfile +++ /dev/null @@ -1 +0,0 @@ -arfilewithtimestamps.a \ No newline at end of file diff --git a/tags/pisi-1.1_beta13/tests/utilfiles/linktonowhere b/tags/pisi-1.1_beta13/tests/utilfiles/linktonowhere deleted file mode 120000 index afc14aa6..00000000 --- a/tags/pisi-1.1_beta13/tests/utilfiles/linktonowhere +++ /dev/null @@ -1 +0,0 @@ -/there/is/no/such/place \ No newline at end of file diff --git a/tags/pisi-1.1_beta13/tests/utiltests.py b/tags/pisi-1.1_beta13/tests/utiltests.py deleted file mode 100644 index 069aff15..00000000 --- a/tags/pisi-1.1_beta13/tests/utiltests.py +++ /dev/null @@ -1,86 +0,0 @@ -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# - -import unittest -import shutil -import os - -from pisi import version -from pisi.util import * - -import testcase - - -def get_svn_paths(path): - svn_paths = [] - for root, dirs, files in os.walk(path): - for d in dirs: - if d.find(".svn") > -1: - svn_paths.append(os.path.join(root, d)) - continue - continue - return svn_paths - -def move_svn_paths(paths): - [shutil.move(d, '/tmp/' + os.path.dirname(d).replace('/', '_')) for d in paths] - -def restore_svn_paths(paths): - [shutil.move('/tmp/' + os.path.dirname(d).replace('/', '_'), d) for d in paths] - - -class UtilTestCase(testcase.TestCase): - - def setUp(self): - testcase.TestCase.setUp(self, database = False) - - def testSubPath(self): - self.assert_(subpath('usr', 'usr')) - self.assert_(subpath('usr', 'usr/local/src')) - self.assert_(not subpath('usr/local', 'usr')) - - def testRemovePathPrefix(self): - a = removepathprefix('usr/local', 'usr/local/lib') - self.assertEqual(a, 'lib') - - a = removepathprefix('usr/local/', 'usr/local/lib') - self.assertEqual(a, 'lib') - - def testCleanArTimestamp(self): - shutil.copy('tests/utilfiles/arfilewithtimestamps.a', 'tests/utilfiles/cleanedarfile.a') - clean_ar_timestamps('tests/utilfiles/cleanedarfile.a') - for line in open('tests/utilfiles/cleanedarfile.a').readlines(): - pos = line.rfind(chr(32) + chr(96)) - if pos > -1 and line[pos-57:pos + 2].find(chr(47)) > -1: - self.assertEqual(line[pos-41:pos].split()[0], "0000000000") - - os.remove('tests/utilfiles/cleanedarfile.a') - - def testDirSize(self): - svn_paths = get_svn_paths('tests/utilfiles') - move_svn_paths(svn_paths) - self.assertEqual(dir_size('tests/utilfiles/arfilewithtimestamps.a'), 74536) - self.assertEqual(dir_size('tests/utilfiles/linktonowhere'), 23) - self.assertEqual(dir_size('tests/utilfiles/directory'), 74536) - self.assertEqual(dir_size('tests/utilfiles/linktoarfile'), 22) - self.assertEqual(dir_size('tests/utilfiles/'), 149117) - restore_svn_paths(svn_paths) - - def testGetFileHashes(self): - svn_paths = get_svn_paths('tests/utilfiles') - move_svn_paths(svn_paths) - self.assertEqual(len([x for x in get_file_hashes('tests/utilfiles/')]), 4) - for tpl in get_file_hashes('tests/utilfiles/'): - if os.path.basename(tpl[0]) == 'linktonowhere': - self.assertEqual(tpl[1], '2d3732ababb24b5dd040a192dc72841cb9684d4e') - if os.path.basename(tpl[0]) == 'linktoarfile': - self.assertEqual(tpl[1], '8be108bc4bfb7d18a10da6d6b76060f0409dc7c6') - restore_svn_paths(svn_paths) - -suite = unittest.makeSuite(UtilTestCase) diff --git a/tags/pisi-1.1_beta13/tests/versiontests.py b/tags/pisi-1.1_beta13/tests/versiontests.py deleted file mode 100644 index cae9ef1e..00000000 --- a/tags/pisi-1.1_beta13/tests/versiontests.py +++ /dev/null @@ -1,78 +0,0 @@ -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# - -import unittest -import os - -from pisi.version import Version - -class VersionTestCase(unittest.TestCase): - def setUp(self): - pass - - def testSingle(self): - v1 = Version("103") - v2 = Version("90") - self.assert_(v1 > v2) - - def testOpsNumerical(self): - v1 = Version("0.3.1") - v2 = Version("0.3.5") - v3 = Version("1.5.2-4") - v4 = Version("0.3.1-1") - v5 = Version("2.07") - self.assert_(v1 < v2) - self.assert_(v3 > v2) - self.assert_(v1 <= v3) - self.assert_(v4 >= v4) - self.assert_(v5 > v3) - - def testOpsKeywords(self): - # with keywords - v1 = Version("2.23_pre10") - v2 = Version("2.23") - v3 = Version("2.21") - v4 = Version("2.23_p1") - v5 = Version("2.23_beta1") - v6 = Version("2.23_m1") - v7 = Version("2.23_rc1") - v8 = Version("2.23_rc2") - self.assert_(v1 < v2) - self.assert_(v1 > v3) - self.assert_(v1 < v4) - self.assert_(v1 > v5) - self.assert_(v2 < v4) - self.assert_(v2 > v5) - self.assert_(v6 < v4) - self.assert_(v6 > v5) - self.assert_(v7 > v5) - self.assert_(v8 > v7) - - v1 = Version("1.0_alpha1") - v2 = Version("1.0_alpha2") - self.assert_(v2 > v1) - - def testOpsCharacters(self): - # with character - v1 = Version("2.10a") - v2 = Version("2.10") - v3 = Version("2.10d") - self.assert_(v1 > v2) - self.assert_(v1 < v3) - self.assert_(v2 < v3) - - def testGeBug(self): - # bug 603 - v1 = Version('1.8.0') - v2 = Version('1.9.1') - self.assert_( not v1 > v2 ) - self.assert_( not v1 >= v2 ) - -suite = unittest.makeSuite(VersionTestCase) diff --git a/tags/pisi-1.1_beta13/tests/xmlexttests.py b/tags/pisi-1.1_beta13/tests/xmlexttests.py deleted file mode 100644 index 0d5ccb7d..00000000 --- a/tags/pisi-1.1_beta13/tests/xmlexttests.py +++ /dev/null @@ -1,45 +0,0 @@ -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# - -import unittest -import os - -import pisi -import pisi.api -import pisi.context as ctx -import pisi.util as util -from pisi.pxml import xmlext - -import testcase - -class XmlExtTestCase(testcase.TestCase): - - def setUp(self): - testcase.TestCase.setUp(self, database=False) - - def testGet(self): - self.doc = xmlext.parse('tests/a.xml') - #self.doc = self.a.documentElement - self.assertEqual(xmlext.getNodeText(self.doc, 'Number'), '868') - self.assertEqual(xmlext.getNodeText(self.doc, 'OtherInfo/BirthDate'), '18071976') - codeswith = xmlext.getAllNodes(self.doc, 'OtherInfo/CodesWith/Person') - self.assertEqual(len(codeswith), 4) - self.assertEqual(xmlext.getNodeText(codeswith[2]), 'Caglar') - - def testAdd(self): - node = xmlext.newDocument('pardus') - #node = a.documentElement - xmlext.addText(node, 'team/coder', 'zibidi1') - xmlext.addText(node, 'team/coder', 'zibidi2') - xmlext.addText(node, 'team/coder', 'zibidi3') - reada = xmlext.getAllNodes(node, 'team/coder') - self.assertEqual(len(reada), 3) - -suite = unittest.makeSuite(XmlExtTestCase) diff --git a/tags/pisi-1.1_beta13/tests/zip/actions.py b/tags/pisi-1.1_beta13/tests/zip/actions.py deleted file mode 100644 index 730924b4..00000000 --- a/tags/pisi-1.1_beta13/tests/zip/actions.py +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# - -from pisi.actionsapi import autotools -from pisi.actionsapi import get -from pisi.actionsapi import pisitools - -def setup(): - pisitools.dosed("unix/Makefile", "-O2", get.CFLAGS()) - -def build(): - autotools.make("-f unix/Makefile CC=%s CPP=%s generic" % (get.CC(), get.CXX())) - -def install(): - pisitools.dobin("zip") - pisitools.dobin("zipcloak") - pisitools.dobin("zipnote") - pisitools.dobin("zipsplit") - - pisitools.doman("man/*.1") - pisitools.dodoc("BUGS", "CHANGES", "MANUAL", "README", "TODO", "WHATSNEW", "WHERE") - diff --git a/tags/pisi-1.1_beta13/tests/zip/files/zcrypt.patch b/tags/pisi-1.1_beta13/tests/zip/files/zcrypt.patch deleted file mode 100644 index 6b696af5..00000000 --- a/tags/pisi-1.1_beta13/tests/zip/files/zcrypt.patch +++ /dev/null @@ -1,752 +0,0 @@ -diff -ur zip-2.3.orig/crypt.c zip-2.3/crypt.c ---- zip-2.3.orig/crypt.c 1999-10-09 23:09:26.000000000 +0300 -+++ zip-2.3/crypt.c 2005-07-15 16:19:00.000000000 +0300 -@@ -1,20 +1,577 @@ - /* -- Copyright (c) 1990-1999 Info-ZIP. All rights reserved. -+ Copyright (c) 1990-2000 Info-ZIP. All rights reserved. - -- See the accompanying file LICENSE, version 1999-Oct-05 or later -+ See the accompanying file LICENSE, version 2000-Apr-09 or later - (the contents of which are also included in zip.h) for terms of use. -- If, for some reason, both of these files are missing, the Info-ZIP license -- also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html -+ If, for some reason, all these files are missing, the Info-ZIP license -+ also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html - */ - /* -- crypt.c (dummy version) by Info-ZIP. Last revised: 15 Aug 98 -+ crypt.c (full version) by Info-ZIP. Last revised: [see crypt.h] - -- This is a non-functional version of Info-ZIP's crypt.c encryption/ -- decryption code for Zip, ZipCloak, UnZip and fUnZip. This file is -- not copyrighted and may be distributed freely. :-) See the "WHERE" -- file for sites from which to obtain the full encryption/decryption -- sources (zcrypt28.zip or later). -+ The encryption/decryption parts of this source code (as opposed to the -+ non-echoing password parts) were originally written in Europe. The -+ whole source package can be freely distributed, including from the USA. -+ (Prior to January 2000, re-export from the US was a violation of US law.) - */ - -+/* -+ This encryption code is a direct transcription of the algorithm from -+ Roger Schlafly, described by Phil Katz in the file appnote.txt. This -+ file (appnote.txt) is distributed with the PKZIP program (even in the -+ version without encryption capabilities). -+ */ -+ -+#define ZCRYPT_INTERNAL -+#include "zip.h" -+#include "crypt.h" -+#include "ttyio.h" -+ -+#if CRYPT -+ -+#ifndef FALSE -+# define FALSE 0 -+#endif -+ -+#ifdef ZIP -+ /* For the encoding task used in Zip (and ZipCloak), we want to initialize -+ the crypt algorithm with some reasonably unpredictable bytes, see -+ the crypthead() function. The standard rand() library function is -+ used to supply these `random' bytes, which in turn is initialized by -+ a srand() call. The srand() function takes an "unsigned" (at least 16bit) -+ seed value as argument to determine the starting point of the rand() -+ pseudo-random number generator. -+ This seed number is constructed as "Seed = Seed1 .XOR. Seed2" with -+ Seed1 supplied by the current time (= "(unsigned)time()") and Seed2 -+ as some (hopefully) nondeterministic bitmask. On many (most) systems, -+ we use some "process specific" number, as the PID or something similar, -+ but when nothing unpredictable is available, a fixed number may be -+ sufficient. -+ NOTE: -+ 1.) This implementation requires the availability of the following -+ standard UNIX C runtime library functions: time(), rand(), srand(). -+ On systems where some of them are missing, the environment that -+ incorporates the crypt routines must supply suitable replacement -+ functions. -+ 2.) It is a very bad idea to use a second call to time() to set the -+ "Seed2" number! In this case, both "Seed1" and "Seed2" would be -+ (almost) identical, resulting in a (mostly) "zero" constant seed -+ number passed to srand(). -+ -+ The implementation environment defined in the "zip.h" header should -+ supply a reasonable definition for ZCR_SEED2 (an unsigned number; for -+ most implementations of rand() and srand(), only the lower 16 bits are -+ significant!). An example that works on many systems would be -+ "#define ZCR_SEED2 (unsigned)getpid()". -+ The default definition for ZCR_SEED2 supplied below should be regarded -+ as a fallback to allow successful compilation in "beta state" -+ environments. -+ */ -+# include /* time() function supplies first part of crypt seed */ -+ /* "last resort" source for second part of crypt seed pattern */ -+# ifndef ZCR_SEED2 -+# define ZCR_SEED2 (unsigned)3141592654L /* use PI as default pattern */ -+# endif -+# ifdef GLOBAL /* used in Amiga system headers, maybe others too */ -+# undef GLOBAL -+# endif -+# define GLOBAL(g) g -+#else /* !ZIP */ -+# define GLOBAL(g) G.g -+#endif /* ?ZIP */ -+ -+ -+#ifdef UNZIP -+ /* char *key = (char *)NULL; moved to globals.h */ -+# ifndef FUNZIP -+ local int testp OF((__GPRO__ ZCONST uch *h)); -+ local int testkey OF((__GPRO__ ZCONST uch *h, ZCONST char *key)); -+# endif -+#endif /* UNZIP */ -+ -+#ifndef UNZIP /* moved to globals.h for UnZip */ -+ local ulg keys[3]; /* keys defining the pseudo-random sequence */ -+#endif /* !UNZIP */ -+ -+#ifndef Trace -+# ifdef CRYPT_DEBUG -+# define Trace(x) fprintf x -+# else -+# define Trace(x) -+# endif -+#endif -+ -+#ifndef CRC_32_TAB -+# define CRC_32_TAB crc_32_tab -+#endif -+ -+#define CRC32(c, b) (CRC_32_TAB[((int)(c) ^ (b)) & 0xff] ^ ((c) >> 8)) -+ -+/*********************************************************************** -+ * Return the next byte in the pseudo-random sequence -+ */ -+int decrypt_byte(__G) -+ __GDEF -+{ -+ unsigned temp; /* POTENTIAL BUG: temp*(temp^1) may overflow in an -+ * unpredictable manner on 16-bit systems; not a problem -+ * with any known compiler so far, though */ -+ -+ temp = ((unsigned)GLOBAL(keys[2]) & 0xffff) | 2; -+ return (int)(((temp * (temp ^ 1)) >> 8) & 0xff); -+} -+ -+/*********************************************************************** -+ * Update the encryption keys with the next byte of plain text -+ */ -+int update_keys(__G__ c) -+ __GDEF -+ int c; /* byte of plain text */ -+{ -+ GLOBAL(keys[0]) = CRC32(GLOBAL(keys[0]), c); -+ GLOBAL(keys[1]) += GLOBAL(keys[0]) & 0xff; -+ GLOBAL(keys[1]) = GLOBAL(keys[1]) * 134775813L + 1; -+ { -+ register int keyshift = (int)(GLOBAL(keys[1]) >> 24); -+ GLOBAL(keys[2]) = CRC32(GLOBAL(keys[2]), keyshift); -+ } -+ return c; -+} -+ -+ -+/*********************************************************************** -+ * Initialize the encryption keys and the random header according to -+ * the given password. -+ */ -+void init_keys(__G__ passwd) -+ __GDEF -+ ZCONST char *passwd; /* password string with which to modify keys */ -+{ -+ GLOBAL(keys[0]) = 305419896L; -+ GLOBAL(keys[1]) = 591751049L; -+ GLOBAL(keys[2]) = 878082192L; -+ while (*passwd != '\0') { -+ update_keys(__G__ (int)*passwd); -+ passwd++; -+ } -+} -+ -+ -+#ifdef ZIP -+ -+/*********************************************************************** -+ * Write encryption header to file zfile using the password passwd -+ * and the cyclic redundancy check crc. -+ */ -+void crypthead(passwd, crc, zfile) -+ ZCONST char *passwd; /* password string */ -+ ulg crc; /* crc of file being encrypted */ -+ FILE *zfile; /* where to write header */ -+{ -+ int n; /* index in random header */ -+ int t; /* temporary */ -+ int c; /* random byte */ -+ int ztemp; /* temporary for zencoded value */ -+ uch header[RAND_HEAD_LEN-2]; /* random header */ -+ static unsigned calls = 0; /* ensure different random header each time */ -+ -+ /* First generate RAND_HEAD_LEN-2 random bytes. We encrypt the -+ * output of rand() to get less predictability, since rand() is -+ * often poorly implemented. -+ */ -+ if (++calls == 1) { -+ srand((unsigned)time(NULL) ^ ZCR_SEED2); -+ } -+ init_keys(passwd); -+ for (n = 0; n < RAND_HEAD_LEN-2; n++) { -+ c = (rand() >> 7) & 0xff; -+ header[n] = (uch)zencode(c, t); -+ } -+ /* Encrypt random header (last two bytes is high word of crc) */ -+ init_keys(passwd); -+ for (n = 0; n < RAND_HEAD_LEN-2; n++) { -+ ztemp = zencode(header[n], t); -+ putc(ztemp, zfile); -+ } -+ ztemp = zencode((int)(crc >> 16) & 0xff, t); -+ putc(ztemp, zfile); -+ ztemp = zencode((int)(crc >> 24) & 0xff, t); -+ putc(ztemp, zfile); -+} -+ -+ -+#ifdef UTIL -+ -+/*********************************************************************** -+ * Encrypt the zip entry described by z from file source to file dest -+ * using the password passwd. Return an error code in the ZE_ class. -+ */ -+int zipcloak(z, source, dest, passwd) -+ struct zlist far *z; /* zip entry to encrypt */ -+ FILE *source, *dest; /* source and destination files */ -+ ZCONST char *passwd; /* password string */ -+{ -+ int c; /* input byte */ -+ int res; /* result code */ -+ ulg n; /* holds offset and counts size */ -+ ush flag; /* previous flags */ -+ int t; /* temporary */ -+ int ztemp; /* temporary storage for zencode value */ -+ -+ /* Set encrypted bit, clear extended local header bit and write local -+ header to output file */ -+ if ((n = (ulg)ftell(dest)) == (ulg)-1L) return ZE_TEMP; -+ z->off = n; -+ flag = z->flg; -+ z->flg |= 1, z->flg &= ~8; -+ z->lflg |= 1, z->lflg &= ~8; -+ z->siz += RAND_HEAD_LEN; -+ if ((res = putlocal(z, dest)) != ZE_OK) return res; -+ -+ /* Initialize keys with password and write random header */ -+ crypthead(passwd, z->crc, dest); -+ -+ /* Skip local header in input file */ -+ if (fseek(source, (long)(4 + LOCHEAD + (ulg)z->nam + (ulg)z->ext), -+ SEEK_CUR)) { -+ return ferror(source) ? ZE_READ : ZE_EOF; -+ } -+ -+ /* Encrypt data */ -+ for (n = z->siz - RAND_HEAD_LEN; n; n--) { -+ if ((c = getc(source)) == EOF) { -+ return ferror(source) ? ZE_READ : ZE_EOF; -+ } -+ ztemp = zencode(c, t); -+ putc(ztemp, dest); -+ } -+ /* Skip extended local header in input file if there is one */ -+ if ((flag & 8) != 0 && fseek(source, 16L, SEEK_CUR)) { -+ return ferror(source) ? ZE_READ : ZE_EOF; -+ } -+ if (fflush(dest) == EOF) return ZE_TEMP; -+ return ZE_OK; -+} -+ -+/*********************************************************************** -+ * Decrypt the zip entry described by z from file source to file dest -+ * using the password passwd. Return an error code in the ZE_ class. -+ */ -+int zipbare(z, source, dest, passwd) -+ struct zlist far *z; /* zip entry to encrypt */ -+ FILE *source, *dest; /* source and destination files */ -+ ZCONST char *passwd; /* password string */ -+{ -+ int c0, c1; /* last two input bytes */ -+ ulg offset; /* used for file offsets */ -+ ulg size; /* size of input data */ -+ int r; /* size of encryption header */ -+ int res; /* return code */ -+ ush flag; /* previous flags */ -+ -+ /* Save position and skip local header in input file */ -+ if ((offset = (ulg)ftell(source)) == (ulg)-1L || -+ fseek(source, (long)(4 + LOCHEAD + (ulg)z->nam + (ulg)z->ext), -+ SEEK_CUR)) { -+ return ferror(source) ? ZE_READ : ZE_EOF; -+ } -+ /* Initialize keys with password */ -+ init_keys(passwd); -+ -+ /* Decrypt encryption header, save last two bytes */ -+ c1 = 0; -+ for (r = RAND_HEAD_LEN; r; r--) { -+ c0 = c1; -+ if ((c1 = getc(source)) == EOF) { -+ return ferror(source) ? ZE_READ : ZE_EOF; -+ } -+ Trace((stdout, " (%02x)", c1)); -+ zdecode(c1); -+ Trace((stdout, " %02x", c1)); -+ } -+ Trace((stdout, "\n")); -+ -+ /* If last two bytes of header don't match crc (or file time in the -+ * case of an extended local header), back up and just copy. For -+ * pkzip 2.0, the check has been reduced to one byte only. -+ */ -+#ifdef ZIP10 -+ if ((ush)(c0 | (c1<<8)) != -+ (z->flg & 8 ? (ush) z->tim & 0xffff : (ush)(z->crc >> 16))) { -+#else -+ c0++; /* avoid warning on unused variable */ -+ if ((ush)c1 != (z->flg & 8 ? (ush) z->tim >> 8 : (ush)(z->crc >> 24))) { -+#endif -+ if (fseek(source, offset, SEEK_SET)) { -+ return ferror(source) ? ZE_READ : ZE_EOF; -+ } -+ if ((res = zipcopy(z, source, dest)) != ZE_OK) return res; -+ return ZE_MISS; -+ } -+ -+ /* Clear encrypted bit and local header bit, and write local header to -+ output file */ -+ if ((offset = (ulg)ftell(dest)) == (ulg)-1L) return ZE_TEMP; -+ z->off = offset; -+ flag = z->flg; -+ z->flg &= ~9; -+ z->lflg &= ~9; -+ z->siz -= RAND_HEAD_LEN; -+ if ((res = putlocal(z, dest)) != ZE_OK) return res; -+ -+ /* Decrypt data */ -+ for (size = z->siz; size; size--) { -+ if ((c1 = getc(source)) == EOF) { -+ return ferror(source) ? ZE_READ : ZE_EOF; -+ } -+ zdecode(c1); -+ putc(c1, dest); -+ } -+ /* Skip extended local header in input file if there is one */ -+ if ((flag & 8) != 0 && fseek(source, 16L, SEEK_CUR)) { -+ return ferror(source) ? ZE_READ : ZE_EOF; -+ } -+ if (fflush(dest) == EOF) return ZE_TEMP; -+ -+ return ZE_OK; -+} -+ -+ -+#else /* !UTIL */ -+ -+/*********************************************************************** -+ * If requested, encrypt the data in buf, and in any case call fwrite() -+ * with the arguments to zfwrite(). Return what fwrite() returns. -+ */ -+unsigned zfwrite(buf, item_size, nb, f) -+ zvoid *buf; /* data buffer */ -+ extent item_size; /* size of each item in bytes */ -+ extent nb; /* number of items */ -+ FILE *f; /* file to write to */ -+{ -+ int t; /* temporary */ -+ -+ if (key != (char *)NULL) { /* key is the global password pointer */ -+ ulg size; /* buffer size */ -+ char *p = (char*)buf; /* steps through buffer */ -+ -+ /* Encrypt data in buffer */ -+ for (size = item_size*(ulg)nb; size != 0; p++, size--) { -+ *p = (char)zencode(*p, t); -+ } -+ } -+ /* Write the buffer out */ -+ return fwrite(buf, item_size, nb, f); -+} -+ -+#endif /* ?UTIL */ -+#endif /* ZIP */ -+ -+ -+#if (defined(UNZIP) && !defined(FUNZIP)) -+ -+/*********************************************************************** -+ * Get the password and set up keys for current zipfile member. -+ * Return PK_ class error. -+ */ -+int decrypt(__G__ passwrd) -+ __GDEF -+ ZCONST char *passwrd; -+{ -+ ush b; -+ int n, r; -+ uch h[RAND_HEAD_LEN]; -+ -+ Trace((stdout, "\n[incnt = %d]: ", GLOBAL(incnt))); -+ -+ /* get header once (turn off "encrypted" flag temporarily so we don't -+ * try to decrypt the same data twice) */ -+ GLOBAL(pInfo->encrypted) = FALSE; -+ defer_leftover_input(__G); -+ for (n = 0; n < RAND_HEAD_LEN; n++) { -+ b = NEXTBYTE; -+ h[n] = (uch)b; -+ Trace((stdout, " (%02x)", h[n])); -+ } -+ undefer_input(__G); -+ GLOBAL(pInfo->encrypted) = TRUE; -+ -+ if (GLOBAL(newzip)) { /* this is first encrypted member in this zipfile */ -+ GLOBAL(newzip) = FALSE; -+ if (passwrd != (char *)NULL) { /* user gave password on command line */ -+ if (!GLOBAL(key)) { -+ if ((GLOBAL(key) = (char *)malloc(strlen(passwrd)+1)) == -+ (char *)NULL) -+ return PK_MEM2; -+ strcpy(GLOBAL(key), passwrd); -+ GLOBAL(nopwd) = TRUE; /* inhibit password prompting! */ -+ } -+ } else if (GLOBAL(key)) { /* get rid of previous zipfile's key */ -+ free(GLOBAL(key)); -+ GLOBAL(key) = (char *)NULL; -+ } -+ } -+ -+ /* if have key already, test it; else allocate memory for it */ -+ if (GLOBAL(key)) { -+ if (!testp(__G__ h)) -+ return PK_COOL; /* existing password OK (else prompt for new) */ -+ else if (GLOBAL(nopwd)) -+ return PK_WARN; /* user indicated no more prompting */ -+ } else if ((GLOBAL(key) = (char *)malloc(IZ_PWLEN+1)) == (char *)NULL) -+ return PK_MEM2; -+ -+ /* try a few keys */ -+ n = 0; -+ do { -+ r = (*G.decr_passwd)((zvoid *)&G, &n, GLOBAL(key), IZ_PWLEN+1, -+ GLOBAL(zipfn), GLOBAL(filename)); -+ if (r == IZ_PW_ERROR) { /* internal error in fetch of PW */ -+ free (GLOBAL(key)); -+ GLOBAL(key) = NULL; -+ return PK_MEM2; -+ } -+ if (r != IZ_PW_ENTERED) { /* user replied "skip" or "skip all" */ -+ *GLOBAL(key) = '\0'; /* We try the NIL password, ... */ -+ n = 0; /* and cancel fetch for this item. */ -+ } -+ if (!testp(__G__ h)) -+ return PK_COOL; -+ if (r == IZ_PW_CANCELALL) /* User replied "Skip all" */ -+ GLOBAL(nopwd) = TRUE; /* inhibit any further PW prompt! */ -+ } while (n > 0); -+ -+ return PK_WARN; -+ -+} /* end function decrypt() */ -+ -+ -+ -+/*********************************************************************** -+ * Test the password. Return -1 if bad, 0 if OK. -+ */ -+local int testp(__G__ h) -+ __GDEF -+ ZCONST uch *h; -+{ -+ int r; -+ char *key_translated; -+ -+ /* On systems with "obscure" native character coding (e.g., EBCDIC), -+ * the first test translates the password to the "main standard" -+ * character coding. */ -+ -+#ifdef STR_TO_CP1 -+ /* allocate buffer for translated password */ -+ if ((key_translated = malloc(strlen(GLOBAL(key)) + 1)) == (char *)NULL) -+ return -1; -+ /* first try, test password translated "standard" charset */ -+ r = testkey(__G__ h, STR_TO_CP1(key_translated, GLOBAL(key))); -+#else /* !STR_TO_CP1 */ -+ /* first try, test password as supplied on the extractor's host */ -+ r = testkey(__G__ h, GLOBAL(key)); -+#endif /* ?STR_TO_CP1 */ -+ -+#ifdef STR_TO_CP2 -+ if (r != 0) { -+#ifndef STR_TO_CP1 -+ /* now prepare for second (and maybe third) test with translated pwd */ -+ if ((key_translated = malloc(strlen(GLOBAL(key)) + 1)) == (char *)NULL) -+ return -1; -+#endif -+ /* second try, password translated to alternate ("standard") charset */ -+ r = testkey(__G__ h, STR_TO_CP2(key_translated, GLOBAL(key))); -+#ifdef STR_TO_CP3 -+ if (r != 0) -+ /* third try, password translated to another "standard" charset */ -+ r = testkey(__G__ h, STR_TO_CP3(key_translated, GLOBAL(key))); -+#endif -+#ifndef STR_TO_CP1 -+ free(key_translated); -+#endif -+ } -+#endif /* STR_TO_CP2 */ -+ -+#ifdef STR_TO_CP1 -+ free(key_translated); -+ if (r != 0) { -+ /* last resort, test password as supplied on the extractor's host */ -+ r = testkey(__G__ h, GLOBAL(key)); -+ } -+#endif /* STR_TO_CP1 */ -+ -+ return r; -+ -+} /* end function testp() */ -+ -+ -+local int testkey(__G__ h, key) -+ __GDEF -+ ZCONST uch *h; /* decrypted header */ -+ ZCONST char *key; /* decryption password to test */ -+{ -+ ush b; -+#ifdef ZIP10 -+ ush c; -+#endif -+ int n; -+ uch *p; -+ uch hh[RAND_HEAD_LEN]; /* decrypted header */ -+ -+ /* set keys and save the encrypted header */ -+ init_keys(__G__ key); -+ memcpy(hh, h, RAND_HEAD_LEN); -+ -+ /* check password */ -+ for (n = 0; n < RAND_HEAD_LEN; n++) { -+ zdecode(hh[n]); -+ Trace((stdout, " %02x", hh[n])); -+ } -+ -+ Trace((stdout, -+ "\n lrec.crc= %08lx crec.crc= %08lx pInfo->ExtLocHdr= %s\n", -+ GLOBAL(lrec.crc32), GLOBAL(pInfo->crc), -+ GLOBAL(pInfo->ExtLocHdr) ? "true":"false")); -+ Trace((stdout, " incnt = %d unzip offset into zipfile = %ld\n", -+ GLOBAL(incnt), -+ GLOBAL(cur_zipfile_bufstart)+(GLOBAL(inptr)-GLOBAL(inbuf)))); -+ -+ /* same test as in zipbare(): */ -+ -+#ifdef ZIP10 /* check two bytes */ -+ c = hh[RAND_HEAD_LEN-2], b = hh[RAND_HEAD_LEN-1]; -+ Trace((stdout, -+ " (c | (b<<8)) = %04x (crc >> 16) = %04x lrec.time = %04x\n", -+ (ush)(c | (b<<8)), (ush)(GLOBAL(lrec.crc32) >> 16), -+ ((ush)GLOBAL(lrec.last_mod_dos_datetime) & 0xffff)))); -+ if ((ush)(c | (b<<8)) != (GLOBAL(pInfo->ExtLocHdr) ? -+ ((ush)GLOBAL(lrec.last_mod_dos_datetime) & 0xffff) : -+ (ush)(GLOBAL(lrec.crc32) >> 16))) -+ return -1; /* bad */ -+#else -+ b = hh[RAND_HEAD_LEN-1]; -+ Trace((stdout, " b = %02x (crc >> 24) = %02x (lrec.time >> 8) = %02x\n", -+ b, (ush)(GLOBAL(lrec.crc32) >> 24), -+ ((ush)GLOBAL(lrec.last_mod_dos_datetime) >> 8) & 0xff)); -+ if (b != (GLOBAL(pInfo->ExtLocHdr) ? -+ ((ush)GLOBAL(lrec.last_mod_dos_datetime) >> 8) & 0xff : -+ (ush)(GLOBAL(lrec.crc32) >> 24))) -+ return -1; /* bad */ -+#endif -+ /* password OK: decrypt current buffer contents before leaving */ -+ for (n = (long)GLOBAL(incnt) > GLOBAL(csize) ? -+ (int)GLOBAL(csize) : GLOBAL(incnt), -+ p = GLOBAL(inptr); n--; p++) -+ zdecode(*p); -+ return 0; /* OK */ -+ -+} /* end function testkey() */ -+ -+#endif /* UNZIP && !FUNZIP */ -+ -+#else /* !CRYPT */ -+ - /* something "externally visible" to shut up compiler/linker warnings */ - int zcr_dummy; -+ -+#endif /* ?CRYPT */ -diff -ur zip-2.3.orig/crypt.h zip-2.3/crypt.h ---- zip-2.3.orig/crypt.h 1999-10-09 23:10:00.000000000 +0300 -+++ zip-2.3/crypt.h 2005-07-15 16:19:00.000000000 +0300 -@@ -1,19 +1,13 @@ - /* -- Copyright (c) 1990-1999 Info-ZIP. All rights reserved. -+ Copyright (c) 1990-2000 Info-ZIP. All rights reserved. - -- See the accompanying file LICENSE, version 1999-Oct-05 or later -+ See the accompanying file LICENSE, version 2000-Apr-09 or later - (the contents of which are also included in zip.h) for terms of use. -- If, for some reason, both of these files are missing, the Info-ZIP license -- also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html -+ If, for some reason, all these files are missing, the Info-ZIP license -+ also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html - */ - /* -- crypt.h (dummy version) by Info-ZIP. Last revised: 15 Aug 98 -- -- This is a non-functional version of Info-ZIP's crypt.h encryption/ -- decryption header file for Zip, ZipCloak, UnZip and fUnZip. This -- file is not copyrighted and may be distributed without restriction. -- See the "WHERE" file for sites from which to obtain the full crypt -- sources (zcrypt28.zip or later). -+ crypt.h (full version) by Info-ZIP. Last revised: [see CR_VERSION_DATE] - */ - - #ifndef __crypt_h /* don't include more than once */ -@@ -22,11 +16,131 @@ - #ifdef CRYPT - # undef CRYPT - #endif --#define CRYPT 0 /* dummy version */ -+ -+#if !defined(NO_CRYPT) -+# define CRYPT 1 /* full version */ -+#else -+# define CRYPT 0 /* dummy version */ -+#endif -+ -+#if CRYPT -+/* full version */ -+ -+#ifdef CR_BETA -+# undef CR_BETA /* this is not a beta release */ -+#endif -+ -+#define CR_MAJORVER 2 -+#define CR_MINORVER 9 -+#ifdef CR_BETA -+# define CR_BETA_VER "a BETA" -+# define CR_VERSION_DATE "9 April 2000" /* last real code change */ -+#else -+# define CR_BETA_VER "" -+# define CR_VERSION_DATE "22 April 2000" /* last public release date */ -+# define CR_RELEASE -+#endif -+ -+#ifndef __G /* UnZip only, for now (DLL stuff) */ -+# define __G -+# define __G__ -+# define __GDEF -+# define __GPRO void -+# define __GPRO__ -+#endif -+ -+#if defined(MSDOS) || defined(OS2) || defined(WIN32) -+# ifndef DOS_OS2_W32 -+# define DOS_OS2_W32 -+# endif -+#endif -+ -+#if defined(DOS_OS2_W32) || defined(__human68k__) -+# ifndef DOS_H68_OS2_W32 -+# define DOS_H68_OS2_W32 -+# endif -+#endif -+ -+#if defined(VM_CMS) || defined(MVS) -+# ifndef CMS_MVS -+# define CMS_MVS -+# endif -+#endif -+ -+/* To allow combining of Zip and UnZip static libraries in a single binary, -+ * the Zip and UnZip versions of the crypt core functions have to be named -+ * differently. -+ */ -+#ifdef ZIP -+# ifdef REALLY_SHORT_SYMS -+# define decrypt_byte zdcrby -+# else -+# define decrypt_byte zp_decrypt_byte -+# endif -+# define update_keys zp_update_keys -+# define init_keys zp_init_keys -+#else /* !ZIP */ -+# ifdef REALLY_SHORT_SYMS -+# define decrypt_byte dcrbyt -+# endif -+#endif /* ?ZIP */ -+ -+#define IZ_PWLEN 80 /* input buffer size for reading encryption key */ -+#ifndef PWLEN /* for compatibility with previous zcrypt release... */ -+# define PWLEN IZ_PWLEN -+#endif -+#define RAND_HEAD_LEN 12 /* length of encryption random header */ -+ -+/* the crc_32_tab array has to be provided externally for the crypt calculus */ -+#ifndef CRC_32_TAB /* UnZip provides this in globals.h */ -+# if (!defined(USE_ZLIB) || defined(USE_OWN_CRCTAB)) -+ extern ZCONST ulg near *crc_32_tab; -+# else -+ extern ZCONST ulg Far *crc_32_tab; -+# endif -+#endif /* !CRC_32_TAB */ -+ -+/* encode byte c, using temp t. Warning: c must not have side effects. */ -+#define zencode(c,t) (t=decrypt_byte(__G), update_keys(c), t^(c)) -+ -+/* decode byte c in place */ -+#define zdecode(c) update_keys(__G__ c ^= decrypt_byte(__G)) -+ -+int decrypt_byte OF((__GPRO)); -+int update_keys OF((__GPRO__ int c)); -+void init_keys OF((__GPRO__ ZCONST char *passwd)); -+ -+#ifdef ZIP -+ void crypthead OF((ZCONST char *, ulg, FILE *)); -+# ifdef UTIL -+ int zipcloak OF((struct zlist far *, FILE *, FILE *, ZCONST char *)); -+ int zipbare OF((struct zlist far *, FILE *, FILE *, ZCONST char *)); -+# else -+ unsigned zfwrite OF((zvoid *, extent, extent, FILE *)); -+ extern char *key; -+# endif -+#endif /* ZIP */ -+ -+#if (defined(UNZIP) && !defined(FUNZIP)) -+ int decrypt OF((__GPRO__ ZCONST char *passwrd)); -+#endif -+ -+#ifdef FUNZIP -+ extern int encrypted; -+# ifdef NEXTBYTE -+# undef NEXTBYTE -+# endif -+# define NEXTBYTE \ -+ (encrypted? update_keys(__G__ getc(G.in)^decrypt_byte(__G)) : getc(G.in)) -+#endif /* FUNZIP */ -+ -+#else /* !CRYPT */ -+/* dummy version */ - - #define zencode - #define zdecode - - #define zfwrite fwrite - -+#endif /* ?CRYPT */ - #endif /* !__crypt_h */ diff --git a/tags/pisi-1.1_beta13/tests/zip/files/zip-2.3-unix_configure-pic.patch b/tags/pisi-1.1_beta13/tests/zip/files/zip-2.3-unix_configure-pic.patch deleted file mode 100644 index 45b137b0..00000000 --- a/tags/pisi-1.1_beta13/tests/zip/files/zip-2.3-unix_configure-pic.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- unix/configure.orig 2004-09-28 06:45:33.000000000 +0000 -+++ unix/configure 2004-09-28 06:54:53.000000000 +0000 -@@ -29,6 +29,9 @@ - - echo Check if we can use asm code - OBJA="" -+piclib="$(echo | $CPP -dM $CFLAGS - | grep -i __pic__)" -+echo "Checking if compiler wants to create pic code" -+[ "$piclib" == "" ] && \ - if eval "$CPP match.S > _match.s 2>/dev/null"; then - if test ! -s _match.s || grep error < _match.s > /dev/null; then - : diff --git a/tags/pisi-1.1_beta13/tests/zip/files/zip-CAN-2004-1010.patch b/tags/pisi-1.1_beta13/tests/zip/files/zip-CAN-2004-1010.patch deleted file mode 100644 index 150d6407..00000000 --- a/tags/pisi-1.1_beta13/tests/zip/files/zip-CAN-2004-1010.patch +++ /dev/null @@ -1,25 +0,0 @@ ---- zip-2.3/unix/unix.c.orig 2004-11-05 15:44:41.000000000 -0500 -+++ zip-2.3/unix/unix.c 2004-11-05 15:50:28.000000000 -0500 -@@ -319,8 +319,8 @@ iztimes *t; /* return value: - a file size of -1 */ - { - struct stat s; /* results of stat() */ -- char name[FNMAX]; -- int len = strlen(f); -+ char *name; -+ size_t len = strlen(f); - - if (f == label) { - if (a != NULL) -@@ -331,6 +331,11 @@ iztimes *t; /* return value: - t->atime = t->mtime = t->ctime = label_utim; - return label_time; - } -+ -+ name = malloc(len+1); -+ if (!name) -+ return 0; -+ - strcpy(name, f); - if (name[len - 1] == '/') - name[len - 1] = '\0'; diff --git a/tags/pisi-1.1_beta13/tests/zip/pspec.xml b/tags/pisi-1.1_beta13/tests/zip/pspec.xml deleted file mode 100644 index 513655ba..00000000 --- a/tags/pisi-1.1_beta13/tests/zip/pspec.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - zip - ftp://ftp.freesoftware.com/pub/infozip/Zip.html - - zibidi - himini@gmail.com - - Info-ZIP - category - component - Info ZIP (encryption support) - Info ZIP (ÅŸifre ÅŸeysi) - Info ZIP (encryption support) - ftp://ftp.linux.org.tr/pub/mirrors/gentoo/distfiles/zip23.tar.gz - - zip-2.3-unix_configure-pic.patch - zip-CAN-2004-1010.patch - zcrypt.patch - - - patch - - - - - zip - - unzip - - - /usr/bin - /usr/share/doc - /usr/share/man - - - - - 2005-07-15 - 2.3 - - - - - diff --git a/tags/pisi-1.1_beta13/tests/zip2/actions.py b/tags/pisi-1.1_beta13/tests/zip2/actions.py deleted file mode 100644 index a2c1b060..00000000 --- a/tags/pisi-1.1_beta13/tests/zip2/actions.py +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- -# -# Copyright (C) 2005, TUBITAK/UEKAE -# -# 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. -# -# Please read the COPYING file. -# - -from pisi.actionsapi import autotools -from pisi.actionsapi import get -from pisi.actionsapi import pisitools - -WorkDir="zip-2.3" - -def setup(): - pisitools.dosed("unix/Makefile", "-O2", get.CFLAGS()) - -def build(): - autotools.make("-f unix/Makefile CC=%s CPP=%s generic" % (get.CC(), get.CXX())) - -def install(): - pisitools.dobin("zip") - pisitools.dobin("zipcloak") - pisitools.dobin("zipnote") - pisitools.dobin("zipsplit") - - pisitools.doman("man/*.1") - pisitools.dodoc("BUGS", "CHANGES", "MANUAL", "README", "TODO", "WHATSNEW", "WHERE") - diff --git a/tags/pisi-1.1_beta13/tests/zip2/files/zcrypt.patch b/tags/pisi-1.1_beta13/tests/zip2/files/zcrypt.patch deleted file mode 100644 index 6b696af5..00000000 --- a/tags/pisi-1.1_beta13/tests/zip2/files/zcrypt.patch +++ /dev/null @@ -1,752 +0,0 @@ -diff -ur zip-2.3.orig/crypt.c zip-2.3/crypt.c ---- zip-2.3.orig/crypt.c 1999-10-09 23:09:26.000000000 +0300 -+++ zip-2.3/crypt.c 2005-07-15 16:19:00.000000000 +0300 -@@ -1,20 +1,577 @@ - /* -- Copyright (c) 1990-1999 Info-ZIP. All rights reserved. -+ Copyright (c) 1990-2000 Info-ZIP. All rights reserved. - -- See the accompanying file LICENSE, version 1999-Oct-05 or later -+ See the accompanying file LICENSE, version 2000-Apr-09 or later - (the contents of which are also included in zip.h) for terms of use. -- If, for some reason, both of these files are missing, the Info-ZIP license -- also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html -+ If, for some reason, all these files are missing, the Info-ZIP license -+ also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html - */ - /* -- crypt.c (dummy version) by Info-ZIP. Last revised: 15 Aug 98 -+ crypt.c (full version) by Info-ZIP. Last revised: [see crypt.h] - -- This is a non-functional version of Info-ZIP's crypt.c encryption/ -- decryption code for Zip, ZipCloak, UnZip and fUnZip. This file is -- not copyrighted and may be distributed freely. :-) See the "WHERE" -- file for sites from which to obtain the full encryption/decryption -- sources (zcrypt28.zip or later). -+ The encryption/decryption parts of this source code (as opposed to the -+ non-echoing password parts) were originally written in Europe. The -+ whole source package can be freely distributed, including from the USA. -+ (Prior to January 2000, re-export from the US was a violation of US law.) - */ - -+/* -+ This encryption code is a direct transcription of the algorithm from -+ Roger Schlafly, described by Phil Katz in the file appnote.txt. This -+ file (appnote.txt) is distributed with the PKZIP program (even in the -+ version without encryption capabilities). -+ */ -+ -+#define ZCRYPT_INTERNAL -+#include "zip.h" -+#include "crypt.h" -+#include "ttyio.h" -+ -+#if CRYPT -+ -+#ifndef FALSE -+# define FALSE 0 -+#endif -+ -+#ifdef ZIP -+ /* For the encoding task used in Zip (and ZipCloak), we want to initialize -+ the crypt algorithm with some reasonably unpredictable bytes, see -+ the crypthead() function. The standard rand() library function is -+ used to supply these `random' bytes, which in turn is initialized by -+ a srand() call. The srand() function takes an "unsigned" (at least 16bit) -+ seed value as argument to determine the starting point of the rand() -+ pseudo-random number generator. -+ This seed number is constructed as "Seed = Seed1 .XOR. Seed2" with -+ Seed1 supplied by the current time (= "(unsigned)time()") and Seed2 -+ as some (hopefully) nondeterministic bitmask. On many (most) systems, -+ we use some "process specific" number, as the PID or something similar, -+ but when nothing unpredictable is available, a fixed number may be -+ sufficient. -+ NOTE: -+ 1.) This implementation requires the availability of the following -+ standard UNIX C runtime library functions: time(), rand(), srand(). -+ On systems where some of them are missing, the environment that -+ incorporates the crypt routines must supply suitable replacement -+ functions. -+ 2.) It is a very bad idea to use a second call to time() to set the -+ "Seed2" number! In this case, both "Seed1" and "Seed2" would be -+ (almost) identical, resulting in a (mostly) "zero" constant seed -+ number passed to srand(). -+ -+ The implementation environment defined in the "zip.h" header should -+ supply a reasonable definition for ZCR_SEED2 (an unsigned number; for -+ most implementations of rand() and srand(), only the lower 16 bits are -+ significant!). An example that works on many systems would be -+ "#define ZCR_SEED2 (unsigned)getpid()". -+ The default definition for ZCR_SEED2 supplied below should be regarded -+ as a fallback to allow successful compilation in "beta state" -+ environments. -+ */ -+# include /* time() function supplies first part of crypt seed */ -+ /* "last resort" source for second part of crypt seed pattern */ -+# ifndef ZCR_SEED2 -+# define ZCR_SEED2 (unsigned)3141592654L /* use PI as default pattern */ -+# endif -+# ifdef GLOBAL /* used in Amiga system headers, maybe others too */ -+# undef GLOBAL -+# endif -+# define GLOBAL(g) g -+#else /* !ZIP */ -+# define GLOBAL(g) G.g -+#endif /* ?ZIP */ -+ -+ -+#ifdef UNZIP -+ /* char *key = (char *)NULL; moved to globals.h */ -+# ifndef FUNZIP -+ local int testp OF((__GPRO__ ZCONST uch *h)); -+ local int testkey OF((__GPRO__ ZCONST uch *h, ZCONST char *key)); -+# endif -+#endif /* UNZIP */ -+ -+#ifndef UNZIP /* moved to globals.h for UnZip */ -+ local ulg keys[3]; /* keys defining the pseudo-random sequence */ -+#endif /* !UNZIP */ -+ -+#ifndef Trace -+# ifdef CRYPT_DEBUG -+# define Trace(x) fprintf x -+# else -+# define Trace(x) -+# endif -+#endif -+ -+#ifndef CRC_32_TAB -+# define CRC_32_TAB crc_32_tab -+#endif -+ -+#define CRC32(c, b) (CRC_32_TAB[((int)(c) ^ (b)) & 0xff] ^ ((c) >> 8)) -+ -+/*********************************************************************** -+ * Return the next byte in the pseudo-random sequence -+ */ -+int decrypt_byte(__G) -+ __GDEF -+{ -+ unsigned temp; /* POTENTIAL BUG: temp*(temp^1) may overflow in an -+ * unpredictable manner on 16-bit systems; not a problem -+ * with any known compiler so far, though */ -+ -+ temp = ((unsigned)GLOBAL(keys[2]) & 0xffff) | 2; -+ return (int)(((temp * (temp ^ 1)) >> 8) & 0xff); -+} -+ -+/*********************************************************************** -+ * Update the encryption keys with the next byte of plain text -+ */ -+int update_keys(__G__ c) -+ __GDEF -+ int c; /* byte of plain text */ -+{ -+ GLOBAL(keys[0]) = CRC32(GLOBAL(keys[0]), c); -+ GLOBAL(keys[1]) += GLOBAL(keys[0]) & 0xff; -+ GLOBAL(keys[1]) = GLOBAL(keys[1]) * 134775813L + 1; -+ { -+ register int keyshift = (int)(GLOBAL(keys[1]) >> 24); -+ GLOBAL(keys[2]) = CRC32(GLOBAL(keys[2]), keyshift); -+ } -+ return c; -+} -+ -+ -+/*********************************************************************** -+ * Initialize the encryption keys and the random header according to -+ * the given password. -+ */ -+void init_keys(__G__ passwd) -+ __GDEF -+ ZCONST char *passwd; /* password string with which to modify keys */ -+{ -+ GLOBAL(keys[0]) = 305419896L; -+ GLOBAL(keys[1]) = 591751049L; -+ GLOBAL(keys[2]) = 878082192L; -+ while (*passwd != '\0') { -+ update_keys(__G__ (int)*passwd); -+ passwd++; -+ } -+} -+ -+ -+#ifdef ZIP -+ -+/*********************************************************************** -+ * Write encryption header to file zfile using the password passwd -+ * and the cyclic redundancy check crc. -+ */ -+void crypthead(passwd, crc, zfile) -+ ZCONST char *passwd; /* password string */ -+ ulg crc; /* crc of file being encrypted */ -+ FILE *zfile; /* where to write header */ -+{ -+ int n; /* index in random header */ -+ int t; /* temporary */ -+ int c; /* random byte */ -+ int ztemp; /* temporary for zencoded value */ -+ uch header[RAND_HEAD_LEN-2]; /* random header */ -+ static unsigned calls = 0; /* ensure different random header each time */ -+ -+ /* First generate RAND_HEAD_LEN-2 random bytes. We encrypt the -+ * output of rand() to get less predictability, since rand() is -+ * often poorly implemented. -+ */ -+ if (++calls == 1) { -+ srand((unsigned)time(NULL) ^ ZCR_SEED2); -+ } -+ init_keys(passwd); -+ for (n = 0; n < RAND_HEAD_LEN-2; n++) { -+ c = (rand() >> 7) & 0xff; -+ header[n] = (uch)zencode(c, t); -+ } -+ /* Encrypt random header (last two bytes is high word of crc) */ -+ init_keys(passwd); -+ for (n = 0; n < RAND_HEAD_LEN-2; n++) { -+ ztemp = zencode(header[n], t); -+ putc(ztemp, zfile); -+ } -+ ztemp = zencode((int)(crc >> 16) & 0xff, t); -+ putc(ztemp, zfile); -+ ztemp = zencode((int)(crc >> 24) & 0xff, t); -+ putc(ztemp, zfile); -+} -+ -+ -+#ifdef UTIL -+ -+/*********************************************************************** -+ * Encrypt the zip entry described by z from file source to file dest -+ * using the password passwd. Return an error code in the ZE_ class. -+ */ -+int zipcloak(z, source, dest, passwd) -+ struct zlist far *z; /* zip entry to encrypt */ -+ FILE *source, *dest; /* source and destination files */ -+ ZCONST char *passwd; /* password string */ -+{ -+ int c; /* input byte */ -+ int res; /* result code */ -+ ulg n; /* holds offset and counts size */ -+ ush flag; /* previous flags */ -+ int t; /* temporary */ -+ int ztemp; /* temporary storage for zencode value */ -+ -+ /* Set encrypted bit, clear extended local header bit and write local -+ header to output file */ -+ if ((n = (ulg)ftell(dest)) == (ulg)-1L) return ZE_TEMP; -+ z->off = n; -+ flag = z->flg; -+ z->flg |= 1, z->flg &= ~8; -+ z->lflg |= 1, z->lflg &= ~8; -+ z->siz += RAND_HEAD_LEN; -+ if ((res = putlocal(z, dest)) != ZE_OK) return res; -+ -+ /* Initialize keys with password and write random header */ -+ crypthead(passwd, z->crc, dest); -+ -+ /* Skip local header in input file */ -+ if (fseek(source, (long)(4 + LOCHEAD + (ulg)z->nam + (ulg)z->ext), -+ SEEK_CUR)) { -+ return ferror(source) ? ZE_READ : ZE_EOF; -+ } -+ -+ /* Encrypt data */ -+ for (n = z->siz - RAND_HEAD_LEN; n; n--) { -+ if ((c = getc(source)) == EOF) { -+ return ferror(source) ? ZE_READ : ZE_EOF; -+ } -+ ztemp = zencode(c, t); -+ putc(ztemp, dest); -+ } -+ /* Skip extended local header in input file if there is one */ -+ if ((flag & 8) != 0 && fseek(source, 16L, SEEK_CUR)) { -+ return ferror(source) ? ZE_READ : ZE_EOF; -+ } -+ if (fflush(dest) == EOF) return ZE_TEMP; -+ return ZE_OK; -+} -+ -+/*********************************************************************** -+ * Decrypt the zip entry described by z from file source to file dest -+ * using the password passwd. Return an error code in the ZE_ class. -+ */ -+int zipbare(z, source, dest, passwd) -+ struct zlist far *z; /* zip entry to encrypt */ -+ FILE *source, *dest; /* source and destination files */ -+ ZCONST char *passwd; /* password string */ -+{ -+ int c0, c1; /* last two input bytes */ -+ ulg offset; /* used for file offsets */ -+ ulg size; /* size of input data */ -+ int r; /* size of encryption header */ -+ int res; /* return code */ -+ ush flag; /* previous flags */ -+ -+ /* Save position and skip local header in input file */ -+ if ((offset = (ulg)ftell(source)) == (ulg)-1L || -+ fseek(source, (long)(4 + LOCHEAD + (ulg)z->nam + (ulg)z->ext), -+ SEEK_CUR)) { -+ return ferror(source) ? ZE_READ : ZE_EOF; -+ } -+ /* Initialize keys with password */ -+ init_keys(passwd); -+ -+ /* Decrypt encryption header, save last two bytes */ -+ c1 = 0; -+ for (r = RAND_HEAD_LEN; r; r--) { -+ c0 = c1; -+ if ((c1 = getc(source)) == EOF) { -+ return ferror(source) ? ZE_READ : ZE_EOF; -+ } -+ Trace((stdout, " (%02x)", c1)); -+ zdecode(c1); -+ Trace((stdout, " %02x", c1)); -+ } -+ Trace((stdout, "\n")); -+ -+ /* If last two bytes of header don't match crc (or file time in the -+ * case of an extended local header), back up and just copy. For -+ * pkzip 2.0, the check has been reduced to one byte only. -+ */ -+#ifdef ZIP10 -+ if ((ush)(c0 | (c1<<8)) != -+ (z->flg & 8 ? (ush) z->tim & 0xffff : (ush)(z->crc >> 16))) { -+#else -+ c0++; /* avoid warning on unused variable */ -+ if ((ush)c1 != (z->flg & 8 ? (ush) z->tim >> 8 : (ush)(z->crc >> 24))) { -+#endif -+ if (fseek(source, offset, SEEK_SET)) { -+ return ferror(source) ? ZE_READ : ZE_EOF; -+ } -+ if ((res = zipcopy(z, source, dest)) != ZE_OK) return res; -+ return ZE_MISS; -+ } -+ -+ /* Clear encrypted bit and local header bit, and write local header to -+ output file */ -+ if ((offset = (ulg)ftell(dest)) == (ulg)-1L) return ZE_TEMP; -+ z->off = offset; -+ flag = z->flg; -+ z->flg &= ~9; -+ z->lflg &= ~9; -+ z->siz -= RAND_HEAD_LEN; -+ if ((res = putlocal(z, dest)) != ZE_OK) return res; -+ -+ /* Decrypt data */ -+ for (size = z->siz; size; size--) { -+ if ((c1 = getc(source)) == EOF) { -+ return ferror(source) ? ZE_READ : ZE_EOF; -+ } -+ zdecode(c1); -+ putc(c1, dest); -+ } -+ /* Skip extended local header in input file if there is one */ -+ if ((flag & 8) != 0 && fseek(source, 16L, SEEK_CUR)) { -+ return ferror(source) ? ZE_READ : ZE_EOF; -+ } -+ if (fflush(dest) == EOF) return ZE_TEMP; -+ -+ return ZE_OK; -+} -+ -+ -+#else /* !UTIL */ -+ -+/*********************************************************************** -+ * If requested, encrypt the data in buf, and in any case call fwrite() -+ * with the arguments to zfwrite(). Return what fwrite() returns. -+ */ -+unsigned zfwrite(buf, item_size, nb, f) -+ zvoid *buf; /* data buffer */ -+ extent item_size; /* size of each item in bytes */ -+ extent nb; /* number of items */ -+ FILE *f; /* file to write to */ -+{ -+ int t; /* temporary */ -+ -+ if (key != (char *)NULL) { /* key is the global password pointer */ -+ ulg size; /* buffer size */ -+ char *p = (char*)buf; /* steps through buffer */ -+ -+ /* Encrypt data in buffer */ -+ for (size = item_size*(ulg)nb; size != 0; p++, size--) { -+ *p = (char)zencode(*p, t); -+ } -+ } -+ /* Write the buffer out */ -+ return fwrite(buf, item_size, nb, f); -+} -+ -+#endif /* ?UTIL */ -+#endif /* ZIP */ -+ -+ -+#if (defined(UNZIP) && !defined(FUNZIP)) -+ -+/*********************************************************************** -+ * Get the password and set up keys for current zipfile member. -+ * Return PK_ class error. -+ */ -+int decrypt(__G__ passwrd) -+ __GDEF -+ ZCONST char *passwrd; -+{ -+ ush b; -+ int n, r; -+ uch h[RAND_HEAD_LEN]; -+ -+ Trace((stdout, "\n[incnt = %d]: ", GLOBAL(incnt))); -+ -+ /* get header once (turn off "encrypted" flag temporarily so we don't -+ * try to decrypt the same data twice) */ -+ GLOBAL(pInfo->encrypted) = FALSE; -+ defer_leftover_input(__G); -+ for (n = 0; n < RAND_HEAD_LEN; n++) { -+ b = NEXTBYTE; -+ h[n] = (uch)b; -+ Trace((stdout, " (%02x)", h[n])); -+ } -+ undefer_input(__G); -+ GLOBAL(pInfo->encrypted) = TRUE; -+ -+ if (GLOBAL(newzip)) { /* this is first encrypted member in this zipfile */ -+ GLOBAL(newzip) = FALSE; -+ if (passwrd != (char *)NULL) { /* user gave password on command line */ -+ if (!GLOBAL(key)) { -+ if ((GLOBAL(key) = (char *)malloc(strlen(passwrd)+1)) == -+ (char *)NULL) -+ return PK_MEM2; -+ strcpy(GLOBAL(key), passwrd); -+ GLOBAL(nopwd) = TRUE; /* inhibit password prompting! */ -+ } -+ } else if (GLOBAL(key)) { /* get rid of previous zipfile's key */ -+ free(GLOBAL(key)); -+ GLOBAL(key) = (char *)NULL; -+ } -+ } -+ -+ /* if have key already, test it; else allocate memory for it */ -+ if (GLOBAL(key)) { -+ if (!testp(__G__ h)) -+ return PK_COOL; /* existing password OK (else prompt for new) */ -+ else if (GLOBAL(nopwd)) -+ return PK_WARN; /* user indicated no more prompting */ -+ } else if ((GLOBAL(key) = (char *)malloc(IZ_PWLEN+1)) == (char *)NULL) -+ return PK_MEM2; -+ -+ /* try a few keys */ -+ n = 0; -+ do { -+ r = (*G.decr_passwd)((zvoid *)&G, &n, GLOBAL(key), IZ_PWLEN+1, -+ GLOBAL(zipfn), GLOBAL(filename)); -+ if (r == IZ_PW_ERROR) { /* internal error in fetch of PW */ -+ free (GLOBAL(key)); -+ GLOBAL(key) = NULL; -+ return PK_MEM2; -+ } -+ if (r != IZ_PW_ENTERED) { /* user replied "skip" or "skip all" */ -+ *GLOBAL(key) = '\0'; /* We try the NIL password, ... */ -+ n = 0; /* and cancel fetch for this item. */ -+ } -+ if (!testp(__G__ h)) -+ return PK_COOL; -+ if (r == IZ_PW_CANCELALL) /* User replied "Skip all" */ -+ GLOBAL(nopwd) = TRUE; /* inhibit any further PW prompt! */ -+ } while (n > 0); -+ -+ return PK_WARN; -+ -+} /* end function decrypt() */ -+ -+ -+ -+/*********************************************************************** -+ * Test the password. Return -1 if bad, 0 if OK. -+ */ -+local int testp(__G__ h) -+ __GDEF -+ ZCONST uch *h; -+{ -+ int r; -+ char *key_translated; -+ -+ /* On systems with "obscure" native character coding (e.g., EBCDIC), -+ * the first test translates the password to the "main standard" -+ * character coding. */ -+ -+#ifdef STR_TO_CP1 -+ /* allocate buffer for translated password */ -+ if ((key_translated = malloc(strlen(GLOBAL(key)) + 1)) == (char *)NULL) -+ return -1; -+ /* first try, test password translated "standard" charset */ -+ r = testkey(__G__ h, STR_TO_CP1(key_translated, GLOBAL(key))); -+#else /* !STR_TO_CP1 */ -+ /* first try, test password as supplied on the extractor's host */ -+ r = testkey(__G__ h, GLOBAL(key)); -+#endif /* ?STR_TO_CP1 */ -+ -+#ifdef STR_TO_CP2 -+ if (r != 0) { -+#ifndef STR_TO_CP1 -+ /* now prepare for second (and maybe third) test with translated pwd */ -+ if ((key_translated = malloc(strlen(GLOBAL(key)) + 1)) == (char *)NULL) -+ return -1; -+#endif -+ /* second try, password translated to alternate ("standard") charset */ -+ r = testkey(__G__ h, STR_TO_CP2(key_translated, GLOBAL(key))); -+#ifdef STR_TO_CP3 -+ if (r != 0) -+ /* third try, password translated to another "standard" charset */ -+ r = testkey(__G__ h, STR_TO_CP3(key_translated, GLOBAL(key))); -+#endif -+#ifndef STR_TO_CP1 -+ free(key_translated); -+#endif -+ } -+#endif /* STR_TO_CP2 */ -+ -+#ifdef STR_TO_CP1 -+ free(key_translated); -+ if (r != 0) { -+ /* last resort, test password as supplied on the extractor's host */ -+ r = testkey(__G__ h, GLOBAL(key)); -+ } -+#endif /* STR_TO_CP1 */ -+ -+ return r; -+ -+} /* end function testp() */ -+ -+ -+local int testkey(__G__ h, key) -+ __GDEF -+ ZCONST uch *h; /* decrypted header */ -+ ZCONST char *key; /* decryption password to test */ -+{ -+ ush b; -+#ifdef ZIP10 -+ ush c; -+#endif -+ int n; -+ uch *p; -+ uch hh[RAND_HEAD_LEN]; /* decrypted header */ -+ -+ /* set keys and save the encrypted header */ -+ init_keys(__G__ key); -+ memcpy(hh, h, RAND_HEAD_LEN); -+ -+ /* check password */ -+ for (n = 0; n < RAND_HEAD_LEN; n++) { -+ zdecode(hh[n]); -+ Trace((stdout, " %02x", hh[n])); -+ } -+ -+ Trace((stdout, -+ "\n lrec.crc= %08lx crec.crc= %08lx pInfo->ExtLocHdr= %s\n", -+ GLOBAL(lrec.crc32), GLOBAL(pInfo->crc), -+ GLOBAL(pInfo->ExtLocHdr) ? "true":"false")); -+ Trace((stdout, " incnt = %d unzip offset into zipfile = %ld\n", -+ GLOBAL(incnt), -+ GLOBAL(cur_zipfile_bufstart)+(GLOBAL(inptr)-GLOBAL(inbuf)))); -+ -+ /* same test as in zipbare(): */ -+ -+#ifdef ZIP10 /* check two bytes */ -+ c = hh[RAND_HEAD_LEN-2], b = hh[RAND_HEAD_LEN-1]; -+ Trace((stdout, -+ " (c | (b<<8)) = %04x (crc >> 16) = %04x lrec.time = %04x\n", -+ (ush)(c | (b<<8)), (ush)(GLOBAL(lrec.crc32) >> 16), -+ ((ush)GLOBAL(lrec.last_mod_dos_datetime) & 0xffff)))); -+ if ((ush)(c | (b<<8)) != (GLOBAL(pInfo->ExtLocHdr) ? -+ ((ush)GLOBAL(lrec.last_mod_dos_datetime) & 0xffff) : -+ (ush)(GLOBAL(lrec.crc32) >> 16))) -+ return -1; /* bad */ -+#else -+ b = hh[RAND_HEAD_LEN-1]; -+ Trace((stdout, " b = %02x (crc >> 24) = %02x (lrec.time >> 8) = %02x\n", -+ b, (ush)(GLOBAL(lrec.crc32) >> 24), -+ ((ush)GLOBAL(lrec.last_mod_dos_datetime) >> 8) & 0xff)); -+ if (b != (GLOBAL(pInfo->ExtLocHdr) ? -+ ((ush)GLOBAL(lrec.last_mod_dos_datetime) >> 8) & 0xff : -+ (ush)(GLOBAL(lrec.crc32) >> 24))) -+ return -1; /* bad */ -+#endif -+ /* password OK: decrypt current buffer contents before leaving */ -+ for (n = (long)GLOBAL(incnt) > GLOBAL(csize) ? -+ (int)GLOBAL(csize) : GLOBAL(incnt), -+ p = GLOBAL(inptr); n--; p++) -+ zdecode(*p); -+ return 0; /* OK */ -+ -+} /* end function testkey() */ -+ -+#endif /* UNZIP && !FUNZIP */ -+ -+#else /* !CRYPT */ -+ - /* something "externally visible" to shut up compiler/linker warnings */ - int zcr_dummy; -+ -+#endif /* ?CRYPT */ -diff -ur zip-2.3.orig/crypt.h zip-2.3/crypt.h ---- zip-2.3.orig/crypt.h 1999-10-09 23:10:00.000000000 +0300 -+++ zip-2.3/crypt.h 2005-07-15 16:19:00.000000000 +0300 -@@ -1,19 +1,13 @@ - /* -- Copyright (c) 1990-1999 Info-ZIP. All rights reserved. -+ Copyright (c) 1990-2000 Info-ZIP. All rights reserved. - -- See the accompanying file LICENSE, version 1999-Oct-05 or later -+ See the accompanying file LICENSE, version 2000-Apr-09 or later - (the contents of which are also included in zip.h) for terms of use. -- If, for some reason, both of these files are missing, the Info-ZIP license -- also may be found at: ftp://ftp.cdrom.com/pub/infozip/license.html -+ If, for some reason, all these files are missing, the Info-ZIP license -+ also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html - */ - /* -- crypt.h (dummy version) by Info-ZIP. Last revised: 15 Aug 98 -- -- This is a non-functional version of Info-ZIP's crypt.h encryption/ -- decryption header file for Zip, ZipCloak, UnZip and fUnZip. This -- file is not copyrighted and may be distributed without restriction. -- See the "WHERE" file for sites from which to obtain the full crypt -- sources (zcrypt28.zip or later). -+ crypt.h (full version) by Info-ZIP. Last revised: [see CR_VERSION_DATE] - */ - - #ifndef __crypt_h /* don't include more than once */ -@@ -22,11 +16,131 @@ - #ifdef CRYPT - # undef CRYPT - #endif --#define CRYPT 0 /* dummy version */ -+ -+#if !defined(NO_CRYPT) -+# define CRYPT 1 /* full version */ -+#else -+# define CRYPT 0 /* dummy version */ -+#endif -+ -+#if CRYPT -+/* full version */ -+ -+#ifdef CR_BETA -+# undef CR_BETA /* this is not a beta release */ -+#endif -+ -+#define CR_MAJORVER 2 -+#define CR_MINORVER 9 -+#ifdef CR_BETA -+# define CR_BETA_VER "a BETA" -+# define CR_VERSION_DATE "9 April 2000" /* last real code change */ -+#else -+# define CR_BETA_VER "" -+# define CR_VERSION_DATE "22 April 2000" /* last public release date */ -+# define CR_RELEASE -+#endif -+ -+#ifndef __G /* UnZip only, for now (DLL stuff) */ -+# define __G -+# define __G__ -+# define __GDEF -+# define __GPRO void -+# define __GPRO__ -+#endif -+ -+#if defined(MSDOS) || defined(OS2) || defined(WIN32) -+# ifndef DOS_OS2_W32 -+# define DOS_OS2_W32 -+# endif -+#endif -+ -+#if defined(DOS_OS2_W32) || defined(__human68k__) -+# ifndef DOS_H68_OS2_W32 -+# define DOS_H68_OS2_W32 -+# endif -+#endif -+ -+#if defined(VM_CMS) || defined(MVS) -+# ifndef CMS_MVS -+# define CMS_MVS -+# endif -+#endif -+ -+/* To allow combining of Zip and UnZip static libraries in a single binary, -+ * the Zip and UnZip versions of the crypt core functions have to be named -+ * differently. -+ */ -+#ifdef ZIP -+# ifdef REALLY_SHORT_SYMS -+# define decrypt_byte zdcrby -+# else -+# define decrypt_byte zp_decrypt_byte -+# endif -+# define update_keys zp_update_keys -+# define init_keys zp_init_keys -+#else /* !ZIP */ -+# ifdef REALLY_SHORT_SYMS -+# define decrypt_byte dcrbyt -+# endif -+#endif /* ?ZIP */ -+ -+#define IZ_PWLEN 80 /* input buffer size for reading encryption key */ -+#ifndef PWLEN /* for compatibility with previous zcrypt release... */ -+# define PWLEN IZ_PWLEN -+#endif -+#define RAND_HEAD_LEN 12 /* length of encryption random header */ -+ -+/* the crc_32_tab array has to be provided externally for the crypt calculus */ -+#ifndef CRC_32_TAB /* UnZip provides this in globals.h */ -+# if (!defined(USE_ZLIB) || defined(USE_OWN_CRCTAB)) -+ extern ZCONST ulg near *crc_32_tab; -+# else -+ extern ZCONST ulg Far *crc_32_tab; -+# endif -+#endif /* !CRC_32_TAB */ -+ -+/* encode byte c, using temp t. Warning: c must not have side effects. */ -+#define zencode(c,t) (t=decrypt_byte(__G), update_keys(c), t^(c)) -+ -+/* decode byte c in place */ -+#define zdecode(c) update_keys(__G__ c ^= decrypt_byte(__G)) -+ -+int decrypt_byte OF((__GPRO)); -+int update_keys OF((__GPRO__ int c)); -+void init_keys OF((__GPRO__ ZCONST char *passwd)); -+ -+#ifdef ZIP -+ void crypthead OF((ZCONST char *, ulg, FILE *)); -+# ifdef UTIL -+ int zipcloak OF((struct zlist far *, FILE *, FILE *, ZCONST char *)); -+ int zipbare OF((struct zlist far *, FILE *, FILE *, ZCONST char *)); -+# else -+ unsigned zfwrite OF((zvoid *, extent, extent, FILE *)); -+ extern char *key; -+# endif -+#endif /* ZIP */ -+ -+#if (defined(UNZIP) && !defined(FUNZIP)) -+ int decrypt OF((__GPRO__ ZCONST char *passwrd)); -+#endif -+ -+#ifdef FUNZIP -+ extern int encrypted; -+# ifdef NEXTBYTE -+# undef NEXTBYTE -+# endif -+# define NEXTBYTE \ -+ (encrypted? update_keys(__G__ getc(G.in)^decrypt_byte(__G)) : getc(G.in)) -+#endif /* FUNZIP */ -+ -+#else /* !CRYPT */ -+/* dummy version */ - - #define zencode - #define zdecode - - #define zfwrite fwrite - -+#endif /* ?CRYPT */ - #endif /* !__crypt_h */ diff --git a/tags/pisi-1.1_beta13/tests/zip2/files/zip-2.3-unix_configure-pic.patch b/tags/pisi-1.1_beta13/tests/zip2/files/zip-2.3-unix_configure-pic.patch deleted file mode 100644 index 45b137b0..00000000 --- a/tags/pisi-1.1_beta13/tests/zip2/files/zip-2.3-unix_configure-pic.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- unix/configure.orig 2004-09-28 06:45:33.000000000 +0000 -+++ unix/configure 2004-09-28 06:54:53.000000000 +0000 -@@ -29,6 +29,9 @@ - - echo Check if we can use asm code - OBJA="" -+piclib="$(echo | $CPP -dM $CFLAGS - | grep -i __pic__)" -+echo "Checking if compiler wants to create pic code" -+[ "$piclib" == "" ] && \ - if eval "$CPP match.S > _match.s 2>/dev/null"; then - if test ! -s _match.s || grep error < _match.s > /dev/null; then - : diff --git a/tags/pisi-1.1_beta13/tests/zip2/files/zip-CAN-2004-1010.patch b/tags/pisi-1.1_beta13/tests/zip2/files/zip-CAN-2004-1010.patch deleted file mode 100644 index 150d6407..00000000 --- a/tags/pisi-1.1_beta13/tests/zip2/files/zip-CAN-2004-1010.patch +++ /dev/null @@ -1,25 +0,0 @@ ---- zip-2.3/unix/unix.c.orig 2004-11-05 15:44:41.000000000 -0500 -+++ zip-2.3/unix/unix.c 2004-11-05 15:50:28.000000000 -0500 -@@ -319,8 +319,8 @@ iztimes *t; /* return value: - a file size of -1 */ - { - struct stat s; /* results of stat() */ -- char name[FNMAX]; -- int len = strlen(f); -+ char *name; -+ size_t len = strlen(f); - - if (f == label) { - if (a != NULL) -@@ -331,6 +331,11 @@ iztimes *t; /* return value: - t->atime = t->mtime = t->ctime = label_utim; - return label_time; - } -+ -+ name = malloc(len+1); -+ if (!name) -+ return 0; -+ - strcpy(name, f); - if (name[len - 1] == '/') - name[len - 1] = '\0'; diff --git a/tags/pisi-1.1_beta13/tests/zip2/pspec.xml b/tags/pisi-1.1_beta13/tests/zip2/pspec.xml deleted file mode 100644 index 5c439849..00000000 --- a/tags/pisi-1.1_beta13/tests/zip2/pspec.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - zip - ftp://ftp.freesoftware.com/pub/infozip/Zip.html - - PACKAGER - PACKAGER_EMAIL - - Info-ZIP - category - component - Info ZIP (encryption support) - Info ZIP (encryption support) - ftp://ftp.linux.org.tr/pub/mirrors/gentoo/distfiles/zip23.tar.gz - - zip-2.3-unix_configure-pic.patch - - zcrypt.patch - - - unzip - patch - - - - - zip - - unzip - - - /usr/bin - /usr/share/doc - /usr/share/man - - - - - - 2005-08-11 - 2.4 - - - - - diff --git a/tags/pisi-1.1_beta13/tools/pygettext.py b/tags/pisi-1.1_beta13/tools/pygettext.py deleted file mode 100644 index bb0dd35d..00000000 --- a/tags/pisi-1.1_beta13/tools/pygettext.py +++ /dev/null @@ -1,669 +0,0 @@ -#! /usr/bin/env python -# -*- coding: iso-8859-1 -*- -# Originally written by Barry Warsaw -# -# Minimally patched to make it even more xgettext compatible -# by Peter Funk -# -# 2002-11-22 Jürgen Hermann -# Added checks that _() only contains string literals, and -# command line args are resolved to module lists, i.e. you -# can now pass a filename, a module or package name, or a -# directory (including globbing chars, important for Win32). -# Made docstring fit in 80 chars wide displays using pydoc. -# - -# for selftesting -try: - import fintl - _ = fintl.gettext -except ImportError: - _ = lambda s: s - -__doc__ = _("""pygettext -- Python equivalent of xgettext(1) - -Many systems (Solaris, Linux, Gnu) provide extensive tools that ease the -internationalization of C programs. Most of these tools are independent of -the programming language and can be used from within Python programs. -Martin von Loewis' work[1] helps considerably in this regard. - -There's one problem though; xgettext is the program that scans source code -looking for message strings, but it groks only C (or C++). Python -introduces a few wrinkles, such as dual quoting characters, triple quoted -strings, and raw strings. xgettext understands none of this. - -Enter pygettext, which uses Python's standard tokenize module to scan -Python source code, generating .pot files identical to what GNU xgettext[2] -generates for C and C++ code. From there, the standard GNU tools can be -used. - -A word about marking Python strings as candidates for translation. GNU -xgettext recognizes the following keywords: gettext, dgettext, dcgettext, -and gettext_noop. But those can be a lot of text to include all over your -code. C and C++ have a trick: they use the C preprocessor. Most -internationalized C source includes a #define for gettext() to _() so that -what has to be written in the source is much less. Thus these are both -translatable strings: - - gettext("Translatable String") - _("Translatable String") - -Python of course has no preprocessor so this doesn't work so well. Thus, -pygettext searches only for _() by default, but see the -k/--keyword flag -below for how to augment this. - - [1] http://www.python.org/workshops/1997-10/proceedings/loewis.html - [2] http://www.gnu.org/software/gettext/gettext.html - -NOTE: pygettext attempts to be option and feature compatible with GNU -xgettext where ever possible. However some options are still missing or are -not fully implemented. Also, xgettext's use of command line switches with -option arguments is broken, and in these cases, pygettext just defines -additional switches. - -Usage: pygettext [options] inputfile ... - -Options: - - -a - --extract-all - Extract all strings. - - -d name - --default-domain=name - Rename the default output file from messages.pot to name.pot. - - -E - --escape - Replace non-ASCII characters with octal escape sequences. - - -D - --docstrings - Extract module, class, method, and function docstrings. These do - not need to be wrapped in _() markers, and in fact cannot be for - Python to consider them docstrings. (See also the -X option). - - -h - --help - Print this help message and exit. - - -k word - --keyword=word - Keywords to look for in addition to the default set, which are: - %(DEFAULTKEYWORDS)s - - You can have multiple -k flags on the command line. - - -K - --no-default-keywords - Disable the default set of keywords (see above). Any keywords - explicitly added with the -k/--keyword option are still recognized. - - --no-location - Do not write filename/lineno location comments. - - -n - --add-location - Write filename/lineno location comments indicating where each - extracted string is found in the source. These lines appear before - each msgid. The style of comments is controlled by the -S/--style - option. This is the default. - - -o filename - --output=filename - Rename the default output file from messages.pot to filename. If - filename is `-' then the output is sent to standard out. - - -p dir - --output-dir=dir - Output files will be placed in directory dir. - - -S stylename - --style stylename - Specify which style to use for location comments. Two styles are - supported: - - Solaris # File: filename, line: line-number - GNU #: filename:line - - The style name is case insensitive. GNU style is the default. - - -v - --verbose - Print the names of the files being processed. - - -V - --version - Print the version of pygettext and exit. - - -w columns - --width=columns - Set width of output to columns. - - -x filename - --exclude-file=filename - Specify a file that contains a list of strings that are not be - extracted from the input files. Each string to be excluded must - appear on a line by itself in the file. - - -X filename - --no-docstrings=filename - Specify a file that contains a list of files (one per line) that - should not have their docstrings extracted. This is only useful in - conjunction with the -D option above. - -If `inputfile' is -, standard input is read. -""") - -import os -import imp -import sys -import glob -import time -import getopt -import token -import tokenize -import operator - -__version__ = '1.5' - -default_keywords = ['_'] -DEFAULTKEYWORDS = ', '.join(default_keywords) - -EMPTYSTRING = '' - - - -# The normal pot-file header. msgmerge and Emacs's po-mode work better if it's -# there. -pot_header = _('''\ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR ORGANIZATION -# FIRST AUTHOR , YEAR. -# -msgid "" -msgstr "" -"Project-Id-Version: PACKAGE VERSION\\n" -"POT-Creation-Date: %(time)s\\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\\n" -"Last-Translator: FULL NAME \\n" -"Language-Team: LANGUAGE \\n" -"MIME-Version: 1.0\\n" -"Content-Type: text/plain; charset=CHARSET\\n" -"Content-Transfer-Encoding: ENCODING\\n" -"Generated-By: pygettext.py %(version)s\\n" - -''') - - -def usage(code, msg=''): - print >> sys.stderr, __doc__ % globals() - if msg: - print >> sys.stderr, msg - sys.exit(code) - - - -escapes = [] - -def make_escapes(pass_iso8859): - global escapes - if pass_iso8859: - # Allow iso-8859 characters to pass through so that e.g. 'msgid - # "Höhe"' would result not result in 'msgid "H\366he"'. Otherwise we - # escape any character outside the 32..126 range. - mod = 128 - else: - mod = 256 - for i in range(256): - if 32 <= (i % mod) <= 126: - escapes.append(chr(i)) - else: - escapes.append("\\%03o" % i) - escapes[ord('\\')] = '\\\\' - escapes[ord('\t')] = '\\t' - escapes[ord('\r')] = '\\r' - escapes[ord('\n')] = '\\n' - escapes[ord('\"')] = '\\"' - - -def escape(s): - global escapes - s = list(s) - for i in range(len(s)): - s[i] = escapes[ord(s[i])] - return EMPTYSTRING.join(s) - - -def safe_eval(s): - # unwrap quotes, safely - return eval(s, {'__builtins__':{}}, {}) - - -def normalize(s): - # This converts the various Python string types into a format that is - # appropriate for .po files, namely much closer to C style. - lines = s.split('\n') - if len(lines) == 1: - s = '"' + escape(s) + '"' - else: - if not lines[-1]: - del lines[-1] - lines[-1] = lines[-1] + '\n' - for i in range(len(lines)): - lines[i] = escape(lines[i]) - lineterm = '\\n"\n"' - s = '""\n"' + lineterm.join(lines) + '"' - return s - - -def containsAny(str, set): - """Check whether 'str' contains ANY of the chars in 'set'""" - return 1 in [c in str for c in set] - - -def _visit_pyfiles(list, dirname, names): - """Helper for getFilesForName().""" - # get extension for python source files - if not globals().has_key('_py_ext'): - global _py_ext - _py_ext = [triple[0] for triple in imp.get_suffixes() - if triple[2] == imp.PY_SOURCE][0] - - # don't recurse into CVS directories - if 'CVS' in names: - names.remove('CVS') - - # add all *.py files to list - list.extend( - [os.path.join(dirname, file) for file in names - if os.path.splitext(file)[1] == _py_ext] - ) - - -def _get_modpkg_path(dotted_name, pathlist=None): - """Get the filesystem path for a module or a package. - - Return the file system path to a file for a module, and to a directory for - a package. Return None if the name is not found, or is a builtin or - extension module. - """ - # split off top-most name - parts = dotted_name.split('.', 1) - - if len(parts) > 1: - # we have a dotted path, import top-level package - try: - file, pathname, description = imp.find_module(parts[0], pathlist) - if file: file.close() - except ImportError: - return None - - # check if it's indeed a package - if description[2] == imp.PKG_DIRECTORY: - # recursively handle the remaining name parts - pathname = _get_modpkg_path(parts[1], [pathname]) - else: - pathname = None - else: - # plain name - try: - file, pathname, description = imp.find_module( - dotted_name, pathlist) - if file: - file.close() - if description[2] not in [imp.PY_SOURCE, imp.PKG_DIRECTORY]: - pathname = None - except ImportError: - pathname = None - - return pathname - - -def getFilesForName(name): - """Get a list of module files for a filename, a module or package name, - or a directory. - """ - if not os.path.exists(name): - # check for glob chars - if containsAny(name, "*?[]"): - files = glob.glob(name) - list = [] - for file in files: - list.extend(getFilesForName(file)) - return list - - # try to find module or package - name = _get_modpkg_path(name) - if not name: - return [] - - if os.path.isdir(name): - # find all python files in directory - list = [] - os.path.walk(name, _visit_pyfiles, list) - return list - elif os.path.exists(name): - # a single file - return [name] - - return [] - - -class TokenEater: - def __init__(self, options): - self.__options = options - self.__messages = {} - self.__state = self.__waiting - self.__data = [] - self.__lineno = -1 - self.__freshmodule = 1 - self.__curfile = None - - def __call__(self, ttype, tstring, stup, etup, line): - # dispatch -## import token -## print >> sys.stderr, 'ttype:', token.tok_name[ttype], \ -## 'tstring:', tstring - self.__state(ttype, tstring, stup[0]) - - def __waiting(self, ttype, tstring, lineno): - opts = self.__options - # Do docstring extractions, if enabled - if opts.docstrings and not opts.nodocstrings.get(self.__curfile): - # module docstring? - if self.__freshmodule: - if ttype == tokenize.STRING: - self.__addentry(safe_eval(tstring), lineno, isdocstring=1) - self.__freshmodule = 0 - elif ttype not in (tokenize.COMMENT, tokenize.NL): - self.__freshmodule = 0 - return - # class docstring? - if ttype == tokenize.NAME and tstring in ('class', 'def'): - self.__state = self.__suiteseen - return - if ttype == tokenize.NAME and tstring in opts.keywords: - self.__state = self.__keywordseen - - def __suiteseen(self, ttype, tstring, lineno): - # ignore anything until we see the colon - if ttype == tokenize.OP and tstring == ':': - self.__state = self.__suitedocstring - - def __suitedocstring(self, ttype, tstring, lineno): - # ignore any intervening noise - if ttype == tokenize.STRING: - self.__addentry(safe_eval(tstring), lineno, isdocstring=1) - self.__state = self.__waiting - elif ttype not in (tokenize.NEWLINE, tokenize.INDENT, - tokenize.COMMENT): - # there was no class docstring - self.__state = self.__waiting - - def __keywordseen(self, ttype, tstring, lineno): - if ttype == tokenize.OP and tstring == '(': - self.__data = [] - self.__lineno = lineno - self.__state = self.__openseen - else: - self.__state = self.__waiting - - def __openseen(self, ttype, tstring, lineno): - if ttype == tokenize.OP and tstring == ')': - # We've seen the last of the translatable strings. Record the - # line number of the first line of the strings and update the list - # of messages seen. Reset state for the next batch. If there - # were no strings inside _(), then just ignore this entry. - if self.__data: - self.__addentry(EMPTYSTRING.join(self.__data)) - self.__state = self.__waiting - elif ttype == tokenize.STRING: - self.__data.append(safe_eval(tstring)) - elif ttype not in [tokenize.COMMENT, token.INDENT, token.DEDENT, - token.NEWLINE, tokenize.NL]: - # warn if we see anything else than STRING or whitespace - print >> sys.stderr, _( - '*** %(file)s:%(lineno)s: Seen unexpected token "%(token)s"' - ) % { - 'token': tstring, - 'file': self.__curfile, - 'lineno': self.__lineno - } - self.__state = self.__waiting - - def __addentry(self, msg, lineno=None, isdocstring=0): - if lineno is None: - lineno = self.__lineno - if not msg in self.__options.toexclude: - entry = (self.__curfile, lineno) - self.__messages.setdefault(msg, {})[entry] = isdocstring - - def set_filename(self, filename): - self.__curfile = filename - self.__freshmodule = 1 - - def write(self, fp): - options = self.__options - timestamp = time.strftime('%Y-%m-%d %H:%M+%Z') - # The time stamp in the header doesn't have the same format as that - # generated by xgettext... - print >> fp, pot_header % {'time': timestamp, 'version': __version__} - # Sort the entries. First sort each particular entry's keys, then - # sort all the entries by their first item. - reverse = {} - for k, v in self.__messages.items(): - keys = v.keys() - keys.sort() - reverse.setdefault(tuple(keys), []).append((k, v)) - rkeys = reverse.keys() - rkeys.sort() - for rkey in rkeys: - rentries = reverse[rkey] - rentries.sort() - for k, v in rentries: - isdocstring = 0 - # If the entry was gleaned out of a docstring, then add a - # comment stating so. This is to aid translators who may wish - # to skip translating some unimportant docstrings. - if reduce(operator.__add__, v.values()): - isdocstring = 1 - # k is the message string, v is a dictionary-set of (filename, - # lineno) tuples. We want to sort the entries in v first by - # file name and then by line number. - v = v.keys() - v.sort() - if not options.writelocations: - pass - # location comments are different b/w Solaris and GNU: - elif options.locationstyle == options.SOLARIS: - for filename, lineno in v: - d = {'filename': filename, 'lineno': lineno} - print >>fp, _( - '# File: %(filename)s, line: %(lineno)d') % d - elif options.locationstyle == options.GNU: - # fit as many locations on one line, as long as the - # resulting line length doesn't exceeds 'options.width' - locline = '#:' - for filename, lineno in v: - d = {'filename': filename, 'lineno': lineno} - s = _(' %(filename)s:%(lineno)d') % d - if len(locline) + len(s) <= options.width: - locline = locline + s - else: - print >> fp, locline - locline = "#:" + s - if len(locline) > 2: - print >> fp, locline - if isdocstring: - print >> fp, '#, docstring' - print >> fp, 'msgid', normalize(k) - print >> fp, 'msgstr ""\n' - - - -def main(): - global default_keywords - try: - opts, args = getopt.getopt( - sys.argv[1:], - 'ad:DEhk:Kno:p:S:Vvw:x:X:', - ['extract-all', 'default-domain=', 'escape', 'help', - 'keyword=', 'no-default-keywords', - 'add-location', 'no-location', 'output=', 'output-dir=', - 'style=', 'verbose', 'version', 'width=', 'exclude-file=', - 'docstrings', 'no-docstrings', - ]) - except getopt.error, msg: - usage(1, msg) - - # for holding option values - class Options: - # constants - GNU = 1 - SOLARIS = 2 - # defaults - extractall = 0 # FIXME: currently this option has no effect at all. - escape = 0 - keywords = [] - outpath = '' - outfile = 'messages.pot' - writelocations = 1 - locationstyle = GNU - verbose = 0 - width = 78 - excludefilename = '' - docstrings = 0 - nodocstrings = {} - - options = Options() - locations = {'gnu' : options.GNU, - 'solaris' : options.SOLARIS, - } - - # parse options - for opt, arg in opts: - if opt in ('-h', '--help'): - usage(0) - elif opt in ('-a', '--extract-all'): - options.extractall = 1 - elif opt in ('-d', '--default-domain'): - options.outfile = arg + '.pot' - elif opt in ('-E', '--escape'): - options.escape = 1 - elif opt in ('-D', '--docstrings'): - options.docstrings = 1 - elif opt in ('-k', '--keyword'): - options.keywords.append(arg) - elif opt in ('-K', '--no-default-keywords'): - default_keywords = [] - elif opt in ('-n', '--add-location'): - options.writelocations = 1 - elif opt in ('--no-location',): - options.writelocations = 0 - elif opt in ('-S', '--style'): - options.locationstyle = locations.get(arg.lower()) - if options.locationstyle is None: - usage(1, _('Invalid value for --style: %s') % arg) - elif opt in ('-o', '--output'): - options.outfile = arg - elif opt in ('-p', '--output-dir'): - options.outpath = arg - elif opt in ('-v', '--verbose'): - options.verbose = 1 - elif opt in ('-V', '--version'): - print _('pygettext.py (xgettext for Python) %s') % __version__ - sys.exit(0) - elif opt in ('-w', '--width'): - try: - options.width = int(arg) - except ValueError: - usage(1, _('--width argument must be an integer: %s') % arg) - elif opt in ('-x', '--exclude-file'): - options.excludefilename = arg - elif opt in ('-X', '--no-docstrings'): - fp = open(arg) - try: - while 1: - line = fp.readline() - if not line: - break - options.nodocstrings[line[:-1]] = 1 - finally: - fp.close() - - # calculate escapes - make_escapes(options.escape) - - # calculate all keywords - options.keywords.extend(default_keywords) - - # initialize list of strings to exclude - if options.excludefilename: - try: - fp = open(options.excludefilename) - options.toexclude = fp.readlines() - fp.close() - except IOError: - print >> sys.stderr, _( - "Can't read --exclude-file: %s") % options.excludefilename - sys.exit(1) - else: - options.toexclude = [] - - # resolve args to module lists - expanded = [] - for arg in args: - if arg == '-': - expanded.append(arg) - else: - expanded.extend(getFilesForName(arg)) - args = expanded - - # slurp through all the files - eater = TokenEater(options) - for filename in args: - if filename == '-': - if options.verbose: - print _('Reading standard input') - fp = sys.stdin - closep = 0 - else: - if options.verbose: - print _('Working on %s') % filename - fp = open(filename) - closep = 1 - try: - eater.set_filename(filename) - try: - tokenize.tokenize(fp.readline, eater) - except tokenize.TokenError, e: - print >> sys.stderr, '%s: %s, line %d, column %d' % ( - e[0], filename, e[1][0], e[1][1]) - finally: - if closep: - fp.close() - - # write the output - if options.outfile == '-': - fp = sys.stdout - closep = 0 - else: - if options.outpath: - options.outfile = os.path.join(options.outpath, options.outfile) - fp = open(options.outfile, 'w') - closep = 1 - try: - eater.write(fp) - finally: - if closep: - fp.close() - - -if __name__ == '__main__': - main() - # some more test strings - _(u'a unicode string') - # this one creates a warning - _('*** Seen unexpected token "%(token)s"') % {'token': 'test'} - _('more' 'than' 'one' 'string') diff --git a/tags/pisi-1.1_beta13/tools/svndist.py b/tags/pisi-1.1_beta13/tools/svndist.py deleted file mode 100755 index dfc3896c..00000000 --- a/tags/pisi-1.1_beta13/tools/svndist.py +++ /dev/null @@ -1,31 +0,0 @@ -#! /usr/bin/python -# a script to preare PiSi source tarball from svn -# author: exa - -#TODO: arguments for svn snapshot with rev number, or a tag to override default - -import sys -import os -import shutil - -def run(cmd): - print 'running', cmd - os.system(cmd) - -sys.path.insert(0, '.') -import pisi -if not os.path.exists('svndist'): - os.makedirs('svndist') - -ver = pisi.__version__ - -if os.path.exists('svndist/pisi-%s' % ver): - shutil.rmtree('svndist/pisi-%s' % ver) - -print 'Exporting svn directory' -run('svn export http://svn.uludag.org.tr/uludag/trunk/pisi svndist/pisi-%s' % ver) - -os.chdir('svndist') -run('tar cjvf pisi-%s.tar.bz2 pisi-%s' % (ver, ver)) - -print 'Have a look at svndist directory' diff --git a/tags/pisi-1.1_beta13/tools/update-po.sh b/tags/pisi-1.1_beta13/tools/update-po.sh deleted file mode 100755 index eb502c59..00000000 --- a/tags/pisi-1.1_beta13/tools/update-po.sh +++ /dev/null @@ -1,5 +0,0 @@ - -find pisi -iname '*.py' | grep -v pisi/cli/commands.py >exclude -python tools/pygettext.py -D -X exclude -o po/pisi.pot pisi pisi-cli scripts -msgmerge -U po/tr.po po/pisi.pot -rm exclude