diff --git a/MANIFEST b/MANIFEST index abe9d50..1c23748 100644 --- a/MANIFEST +++ b/MANIFEST @@ -7,6 +7,7 @@ pkgbuilder.py setup.py docs/LICENSE.rst docs/README.rst +docs/classes.rst docs/conf.py docs/docs-pkgbuilder.zip docs/index.rst @@ -15,6 +16,7 @@ docs/pkgbuilder.8.gz docs/pkgbuilder.rst docs/_build/doctrees/LICENSE.doctree docs/_build/doctrees/README.doctree +docs/_build/doctrees/classes.doctree docs/_build/doctrees/environment.pickle docs/_build/doctrees/index.doctree docs/_build/doctrees/messagecodes.doctree @@ -25,8 +27,14 @@ docs/html/objects.inv docs/html/searchindex.js docs/html/LICENSE/index.html docs/html/README/index.html +docs/html/_modules/index.html +docs/html/_sources/AUR.txt +docs/html/_sources/Build.txt docs/html/_sources/LICENSE.txt +docs/html/_sources/PBDS.txt docs/html/_sources/README.txt +docs/html/_sources/Utils.txt +docs/html/_sources/classes.txt docs/html/_sources/index.txt docs/html/_sources/messagecodes.txt docs/html/_sources/pkgbuilder.txt @@ -41,8 +49,10 @@ docs/html/_static/pygments.css docs/html/_static/searchtools.js docs/html/_static/sidebar.js docs/html/_static/underscore.js +docs/html/classes/index.html docs/html/messagecodes/index.html docs/html/pkgbuilder/index.html +docs/html/py-modindex/index.html docs/html/search/index.html locale/en/LC_MESSAGES/pkgbuilder.mo locale/pl/LC_MESSAGES/pkgbuilder.mo diff --git a/PKGBUILD b/PKGBUILD index 7ed11de..36ebe65 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,6 +1,6 @@ # Maintainer: Kwpolska pkgname=pkgbuilder -pkgver=2.1.2.1 +pkgver=2.1.2.2 pkgrel=1 pkgdesc="A basic Python AUR helper/library." arch=('any') @@ -9,7 +9,7 @@ license=('BSD') depends=('python' 'pyalpm>=0.5.1-1' 'python-pyparsing' 'pacman>=4.0.0-1') options=(!emptydirs) source=("http://pypi.python.org/packages/source/p/${pkgname}/${pkgname}-${pkgver}.tar.gz") -md5sums=('0f790496c4905aba5999b867eb23c820') +md5sums=('fcfde418c55c4cab82b24874c73bf11e') package() { cd "${srcdir}/${pkgname}-${pkgver}" diff --git a/README.rst b/README.rst index b874727..8d55772 100644 --- a/README.rst +++ b/README.rst @@ -3,8 +3,8 @@ README for PKGBUILDer ===================== :Info: This is the README file for PKGBUILDer. :Author: Kwpolska -:Date: 2011-10-14 -:Version: 2.1.2.1 +:Date: 2011-10-15 +:Version: 2.1.2.2 PKGBUILDer. A Python AUR helper/library. ========================================= diff --git a/Rakefile b/Rakefile index 2c131d0..5507404 100644 --- a/Rakefile +++ b/Rakefile @@ -34,7 +34,6 @@ task :prepare, :ver do |t, args| sh "sed \"s/BUILDer .* do/BUILDer #{version} do/\" docs/index.rst -i" sh "sed \"s/# PKG.*/# PKGBUILDer v#{version}/\" pkgbuilder.py -i" sh "sed \"s/VERSION = .*/VERSION = '#{version}'/\" pkgbuilder.py -i" - sh "sed \"s/Version .*/Version #{version}/\" pkgbuilder.py -i" sh "sed \"s/pkgver=.*/pkgver=#{version}/\" PKGBUILD -i" sh "sed \"s/:Date: .*/:Date: #{date}/\" docs/*.rst -i" diff --git a/dist/pkgbuilder-2.1.2.2.tar.gz b/dist/pkgbuilder-2.1.2.2.tar.gz new file mode 100644 index 0000000..4b0a681 Binary files /dev/null and b/dist/pkgbuilder-2.1.2.2.tar.gz differ diff --git a/docs/LICENSE.rst b/docs/LICENSE.rst index e984136..260659b 100644 --- a/docs/LICENSE.rst +++ b/docs/LICENSE.rst @@ -3,8 +3,8 @@ Appendix B. License for PKGBUILDer ================================== :Info: This is an appendix to the PKGBUILDer documentation. :Author: Kwpolska -:Date: 2011-10-14 -:Version: 2.1.2.1 +:Date: 2011-10-15 +:Version: 2.1.2.2 Copyright (C) 2011, Kwpolska All rights reserved. diff --git a/docs/README.rst b/docs/README.rst index b874727..8d55772 100644 --- a/docs/README.rst +++ b/docs/README.rst @@ -3,8 +3,8 @@ README for PKGBUILDer ===================== :Info: This is the README file for PKGBUILDer. :Author: Kwpolska -:Date: 2011-10-14 -:Version: 2.1.2.1 +:Date: 2011-10-15 +:Version: 2.1.2.2 PKGBUILDer. A Python AUR helper/library. ========================================= diff --git a/docs/_build/doctrees/LICENSE.doctree b/docs/_build/doctrees/LICENSE.doctree index e36c64d..562596a 100644 Binary files a/docs/_build/doctrees/LICENSE.doctree and b/docs/_build/doctrees/LICENSE.doctree differ diff --git a/docs/_build/doctrees/README.doctree b/docs/_build/doctrees/README.doctree index e12f6f8..236ec1a 100644 Binary files a/docs/_build/doctrees/README.doctree and b/docs/_build/doctrees/README.doctree differ diff --git a/docs/_build/doctrees/classes.doctree b/docs/_build/doctrees/classes.doctree new file mode 100644 index 0000000..f5348a5 Binary files /dev/null and b/docs/_build/doctrees/classes.doctree differ diff --git a/docs/_build/doctrees/environment.pickle b/docs/_build/doctrees/environment.pickle index f813970..7a54c48 100644 Binary files a/docs/_build/doctrees/environment.pickle and b/docs/_build/doctrees/environment.pickle differ diff --git a/docs/_build/doctrees/index.doctree b/docs/_build/doctrees/index.doctree index 87dd40c..1bbbc4e 100644 Binary files a/docs/_build/doctrees/index.doctree and b/docs/_build/doctrees/index.doctree differ diff --git a/docs/_build/doctrees/messagecodes.doctree b/docs/_build/doctrees/messagecodes.doctree index 9ff0dfe..5af086e 100644 Binary files a/docs/_build/doctrees/messagecodes.doctree and b/docs/_build/doctrees/messagecodes.doctree differ diff --git a/docs/_build/doctrees/pkgbuilder.doctree b/docs/_build/doctrees/pkgbuilder.doctree index 4e04d74..1a19dbb 100644 Binary files a/docs/_build/doctrees/pkgbuilder.doctree and b/docs/_build/doctrees/pkgbuilder.doctree differ diff --git a/docs/classes.rst b/docs/classes.rst new file mode 100644 index 0000000..2bede20 --- /dev/null +++ b/docs/classes.rst @@ -0,0 +1,393 @@ +***** +title +***** + +:Author: Kwpolska +:Copyright: See Appendix B. +:Date: 2011-10-15 +:Version: 2.1.2.2 + +.. index:: classes +.. module:: PKGBUILDer + :synopsis: a Python AUR helper/library + +some introductory text + +PBDS +==== + +.. index:: PBDS; DS; Data Storage +.. versionadded:: 2.1.0.0 +.. class:: PBDS + +:Arguments: none. + +This is the class used for storing data. Currently, it stores this +information: + ++-----------+---------------------------------------+-------------------+ +| variable | contents/usage | default | ++===========+=======================================+===================+ +| colors | colors currently used in the script | [colors]_ | ++-----------+---------------------------------------+-------------------+ +| pacman | using wrapper-friendly behavior[beh]? | False | ++-----------+---------------------------------------+-------------------+ +| validate | validating package installation? | True | ++-----------+---------------------------------------+-------------------+ +| depcheck | checking if deps are installed? | True | ++-----------+---------------------------------------+-------------------+ + + +.. [beh] *wrapper-friendly behavior* (-S): building in /tmp; + :meth:`Utils.print_package` says aur/name + +.. [colors] Code below. + +:: + + self.colors = { + 'all_off': '\x1b[1;0m', + 'bold': '\x1b[1;1m', + 'blue': '\x1b[1;1m\x1b[1;34m', + 'green': '\x1b[1;1m\x1b[1;32m', + 'red': '\x1b[1;1m\x1b[1;31m', + 'yellow': '\x1b[1;1m\x1b[1;33m' + } + + +It also has two methods: + +.. method:: colorson() + +:Arguments: none. +:Input: none. +:Output: none. +:Returns: nothing. +:Exceptions: none. +:Message codes: none. + +Turns colors on. + +.. method:: colorsoff(). + +:Arguments: none. +:Input: none. +:Output: none. +:Returns: nothing. +:Exceptions: none. +:Message codes: none. + +Turns colors off. + + +AUR +=== + +.. index:: AUR; API; RPC +.. versionadded:: 2.1.0.0 +.. class:: AUR + +:Arguments: none. + +This is the class used for calling the AUR API. It defines four methods: + + +.. method:: request(rtype, arg[, prot]) +.. index:: request + +:Arguments: request type, argument (package name), protocol. +:Input: none. +:Output: none. +:Returns: data from the API. +:Exceptions: urllib.error.URLError, urllib.error.HTTPError. +:Message codes: none. + +Makes a request and returns data. Valid types of requests are listed on +the `AUR API's page`_. Currently tested and working ones are: + ++-------------+-----------------------------------+ ++ name | purpose | ++=============+===================================+ +| info | get info about `arg` | ++-------------+-----------------------------------+ +| search | search for `arg` in the AUR | ++-------------+-----------------------------------+ +| maintsearch | show packages maintained by `arg` | ++-------------+-----------------------------------+ + +multiinfo is implemented in another function, :meth:`multiinfo()`. + +.. _`AUR API's page`: http://aur.archlinux.org/rpc.php + +.. method:: multiinfo(args[, prot]) +.. index:: multiinfo + +:Arguments: a list of packages, protocol. +:Input: none. +:Output: none. +:Returns: data from the API. +:Exceptions: urllib.error.URLError, urllib.error.HTTPError. +:Message codes: none. + +Makes a multiinfo request. A multiinfo request can retrieve information +for multiple packages. + +.. method:: jsonreq(rtype, arg[, prot]) + +:Arguments: request type, argument (package name), protocol. +:Input: none. +:Output: none. +:Returns: JSON data from the API. +:Exceptions: urllib.error.URLError, urllib.error.HTTPError. +:Message codes: none. + +Makes a :meth:`request()`, but returns plain JSON data. Valid values of +`rtype` are listed in :meth:`request()`'s documentation. + +.. method:: jsonmultiinfo(args[, prot]) + +:Arguments: a list of packages, protocol. +:Input: none. +:Output: none. +:Returns: JSON data from the API. +:Exceptions: urllib.error.URLError, urllib.error.HTTPError. +:Message codes: none. + +Makes a :meth:`multiinfo()` request, but returns plain JSON data. + +Utils +===== + +.. index:: Utils; Utilities +.. versionadded:: 2.1.0.0 +.. class:: Utils + +:Arguments: none. + +This is the class with many random utilities. It defines three methods: + + +.. method:: info(pkgname) +.. index:: info + +:Arguments: package name. +:Input: none. +:Output: none. +:Returns: a dict OR None. +:Exceptions: none. +:Message codes: none. +:Former data: + 2.1.2.1 Returns: a dict OR False. + + 2.0 Returns: aur_pkgs, list->dict, not null. + + 2.0 Behavior: exception and quit when not found." + +Returns information about a package. Almost equivalent to +:meth:`AUR.request('info', pkgname)`, but returns **`None`** if the package +doesn't exist. + +.. method:: search(pkgname) +.. index:: search + +:Arguments: package name. +:Input: none. +:Output: none. +:Returns: a list. +:Exceptions: none. +:Message codes: none. + +Searches for AUR packages and returns them as a list. Almost equivalent +to :meth:`AUR.request('search', pkgname)`, but returns **`[]`** if no +packages were found. + +.. method:: print_package(pkg[, use_categories][, prefix]) +.. index:: print + +:Arguments: package name, use categories, line prefix. +:Input: none. +:Output: + :: + prefix category/name version (num votes) [installed: version] [out of date] + prefix description + +:Returns: nothing. +:Exceptions: none. +:Message codes: none. +:Former data: + 2.0 Name: showInfo. + +Prints data about `pkg`. Format specified above, in the Output field. + +Build +====== + +.. index:: Build; makepkg +.. versionadded:: 2.1.0.0 +.. class:: Build + +:Arguments: none. + +This is the class for building packages. It defines two base methods and +four additional ones. + +.. method:: auto_build(pkgname[, validate][, depcheck]) +.. index:: makepkg; build + +:Arguments: package name, validate installation, perform dependency checks. +:Input: none. +:Output: text. +:Returns: nothing. +:Exceptions: PBError. +:Message codes: + ERR3301, ERR34?? (ERR3401, ERR3450, ERR3451, ERR3452), INF3450. +:Former data: + 2.0 Name: build. + +This is a function that handles building packages automatically. This is +the recommended way of building packages through PKGBUILDer. + +.. method:: build_runner(pkgname[, depcheck]) +.. index:: makepkg; build; validate + +:Arguments: package, perform dependency checks. +:Input: none. +:Output: text. +:Returns: :: + + [makepkg's retcode OR 3 if fails OR 16 if needs an AUR dep, + [AUR deps or error source]] + +:Exceptions: PBError. +:Message codes: ERR3001, ERR3201, ERR3202. +:Former data: + 2.0 Behavior: all functions inside + + 2.0 Name: buildSub + +This is the function running building. It is not supposed to be used +standalone, because it is embedded by :meth:`auto_build()`. + +.. note:: + + The return codes of this function work bad. Using :meth:`auto_build()` + eliminates this problem. + +.. method:: download(urlpath, filename[, prot]) + +:Arguments: URL, filename for saving, protocol. +:Input: none. +:Output: none. +:Returns: bytes downloaded. +:Exceptions: + PBError, IOError, + urllib.error.URLError, urllib.error.HTTPError +:Message codes: ERR3101. + +Downloads an AUR tarball. Data normally provided by :meth:`build_runner()`. + +.. method:: extract(filename) + +:Arguments: filename. +:Input: none. +:Output: none. +:Returns: file count. +:Exceptions: PBError, IOError. +:Message codes: ERR3151. + +Extracts an AUR tarball. Data normally provided by :meth:`build_runner()`. + +.. method:: prepare_deps(pkgbuild) +.. index:: depcheck, dependency + +:Arguments: PKGBUILD contents +:Input: none. +:Output: none. +:Returns: + a list with entries from PKGBUILD's depends and makedepends + (can be empty.) +:Exceptions: IOError. +:Message codes: none. + +Gets (make)depends from a PKGBUILD and returns them. + +.. note:: + `pkgbuild` is a string, not a file handle. + +.. method:: depcheck(depends) +.. index:: depcheck, dependency + +:Arguments: a python dependency list. +:Input: none. +:Output: none. +:Returns: + a dict, key is the package name, and value is: -1 = nowhere, 0 = system, + 1 = repos, 2 = AUR. +:Exceptions: PBError. +:Message codes: ERR3201. +:Suggested way of handling: + :: + >>> types = ['system', 'repos', 'aur'] + >>> for pkg, pkgtype in depcheck([...]).items(): + ... print('{0}: found in {1}'.format(pkg, types[pkgtype]) + ... if pkgtype == 2: #AUR + ... #build pkg here + +:Former data: + 2.0 Returns: no -1 + +Performs a dependency check. Data normally provided by +:meth:`prepare_deps()`. + +.. TODO + +Upgrade +======= + +.. index:: Upgrade; Update; Syu +.. versionadded:: 2.1.0.0 +.. class:: Upgrade + +:Arguments: none. + +This is the class for upgrading the installed packages. It defines one base +method and two additional ones. + +.. method:: auto_upgrade() +.. index:: upgrade + +:Arguments: none. +:Input: user interaction. +:Output: text. +:Returns: 0 or nothing. +:Exceptions: none. +:Message codes: none. +:Notice: things break here A LOT. + +Upgrades packages. Simillar to :meth:`Build.auto_build()`. + +.. method:: gather_foreign_packages() +.. index:: foreign + +:Arguments: none. +:Input: none. +:Output: none. +:Returns: foreign packages. +:Exceptions: none. +:Message codes: none. + +Gathers a list of all foreign packages. + +.. method:: list_upgradeable(pkglist) + +:Arguments: a package list. +:Input: + a list of packages to be compared. + + suggestion: self.gather_foreign_pkgs().keys() +:Output: none. +:Returns: upgradeable packages. +:Exceptions: none. +:Message codes: none. + +Compares package versions and returns upgradeable ones. diff --git a/docs/conf.py b/docs/conf.py index 05911d5..9fa585b 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -25,7 +25,7 @@ # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. -extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.ifconfig'] #, 'sphinx.ext.viewcode'] +extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.ifconfig', 'sphinx.ext.viewcode', 'sphinx.ext.coverage'] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] @@ -50,7 +50,7 @@ # The short X.Y version. version = '2.1' # The full version, including alpha/beta/rc tags. -release = '2.1.2.1' +release = '2.1.2.2' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/docs/docs-pkgbuilder.zip b/docs/docs-pkgbuilder.zip index bce092e..d1ce49b 100644 Binary files a/docs/docs-pkgbuilder.zip and b/docs/docs-pkgbuilder.zip differ diff --git a/docs/html/.buildinfo b/docs/html/.buildinfo index 44b3039..83aecb7 100644 --- a/docs/html/.buildinfo +++ b/docs/html/.buildinfo @@ -1,4 +1,4 @@ # Sphinx build info version 1 # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. -config: 69984492ac1b03348441302991489f96 +config: dd4a0e747ba80f25ecdfe7485536e938 tags: fbb0d17656682115ca4d033fb2f83ba1 diff --git a/docs/html/LICENSE/index.html b/docs/html/LICENSE/index.html index b38c796..dfde743 100644 --- a/docs/html/LICENSE/index.html +++ b/docs/html/LICENSE/index.html @@ -7,13 +7,13 @@ - Appendix B. License for PKGBUILDer — PKGBUILDer v2.1.2.1 documentation + 5. Appendix B. License for PKGBUILDer — PKGBUILDer v2.1.2.2 documentation - - + + @@ -42,7 +45,7 @@

Navigation

-

Appendix B. License for PKGBUILDer

+

5. Appendix B. License for PKGBUILDer

@@ -51,9 +54,9 @@

Appendix B. License for PKGBUILDer

- + - +
Author:Kwpolska <kwpolska@kwpolska.tk>
Date:2011-10-14
Date:2011-10-15
Version:2.1.2.1
Version:2.1.2.2
@@ -94,7 +97,7 @@

Appendix B. License for PKGBUILDer

Previous topic

Appendix A. PKGBUILDer message numbers list

+ title="previous chapter">4. Appendix A. PKGBUILDer message numbers list

diff --git a/docs/html/README/index.html b/docs/html/README/index.html index 53a86f4..67119e5 100644 --- a/docs/html/README/index.html +++ b/docs/html/README/index.html @@ -7,13 +7,13 @@ - README for PKGBUILDer — PKGBUILDer v2.1.2.1 documentation + 3. README for PKGBUILDer — PKGBUILDer v2.1.2.2 documentation - - - + + + @@ -46,7 +49,7 @@

Navigation

-

README for PKGBUILDer

+

3. README for PKGBUILDer

@@ -55,25 +58,25 @@

README for PKGBUILDer

- + - +
Author:Kwpolska <kwpolska@kwpolska.tk>
Date:2011-10-14
Date:2011-10-15
Version:2.1.2.1
Version:2.1.2.2
-

PKGBUILDer. A Python AUR helper/library.

+

3.1. PKGBUILDer. A Python AUR helper/library.

-

PURPOSE

+

3.1.1. PURPOSE

Building and installing AUR packages.

-

INSTALLATION

+

3.1.2. INSTALLATION

Copy pkgbuilder.py to /usr/bin or ~/bin. You need to install pyalpm from [extra] and python3-aur from the AUR.

-

NOTES

+

3.1.3. NOTES

This is Version 2 of PKGBUILDer. The original Perl version is included, but it shall not be used.

Version 2.1 is a big leap forward. It introduces many new features. @@ -83,7 +86,7 @@

NOTES docs/html.