From d7ede234d06ecf5d8e9da049635625727d630287 Mon Sep 17 00:00:00 2001 From: Kwpolska Date: Fri, 27 Jul 2012 12:15:57 +0200 Subject: [PATCH] =?UTF-8?q?preparing=20for=20release=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LICENSE | 2 +- PKGBUILD | 4 +- README | 6 +-- README.rst | 6 +-- docs/.messagecodes.rst.swp | Bin 0 -> 20480 bytes docs/LICENSE.rst | 6 +-- docs/README.rst | 6 +-- docs/classes.rst | 4 +- docs/conf.py | 2 +- docs/messagecodes.rst | 33 ++++++++----- docs/pkgbuilder.8 | 0 docs/pkgbuilder.rst | 4 +- locale/en/LC_MESSAGES/pkgbuilder.mo | Bin 8222 -> 8222 bytes locale/en/LC_MESSAGES/pkgbuilder.po | 4 +- locale/pl/LC_MESSAGES/pkgbuilder.mo | Bin 8410 -> 8410 bytes locale/pl/LC_MESSAGES/pkgbuilder.po | 4 +- messages.pot | 2 +- pkgbuilder.py | 74 ++++++++++++++++++---------- requirements.txt | 3 +- setup.py | 4 +- 20 files changed, 99 insertions(+), 65 deletions(-) create mode 100644 docs/.messagecodes.rst.swp create mode 100644 docs/pkgbuilder.8 diff --git a/LICENSE b/LICENSE index a1d3c90..16046e2 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (C) 2011, Kwpolska +Copyright (C) 2011-2012, Kwpolska. All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/PKGBUILD b/PKGBUILD index fc1f2a9..c6bd155 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,12 +1,12 @@ # Maintainer: Kwpolska pkgname=pkgbuilder -pkgver=2.1.2.27 +pkgver=2.1.2.31 pkgrel=1 pkgdesc="A basic Python AUR helper/library." arch=('any') url="https://github.com/Kwpolska/pkgbuilder" license=('BSD') -depends=('python' 'pyalpm>=0.5.1-1' 'python-pyparsing' 'pacman>=4.0.0-1') +depends=('python' 'pyalpm>=0.5.1-1' 'python-pyparsing' 'python-requests') options=(!emptydirs) source=("http://pypi.python.org/packages/source/p/${pkgname}/${pkgname}-${pkgver}.tar.gz") md5sums=('a39276443eb7351056f9e4708b5c4540') diff --git a/README b/README index 34ad367..92cc6b6 100644 --- a/README +++ b/README @@ -3,8 +3,8 @@ README for PKGBUILDer ===================== :Info: This is the README file for PKGBUILDer. :Author: Kwpolska -:Date: 2011-10-26 -:Version: 2.1.2.5 +:Date: 2012-07-14 +:Version: 2.1.2.27 PKGBUILDer. A Python AUR helper/library. ========================================= @@ -36,7 +36,7 @@ all the time at GitHub. COPYRIGHT --------- -Copyright (C) 2011, Kwpolska +Copyright (C) 2011-2012, Kwpolska. All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/README.rst b/README.rst index 4055bf1..70a0c4d 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: 2012-07-14 -:Version: 2.1.2.27 +:Date: 2012-07-27 +:Version: 2.1.2.31 PKGBUILDer. A Python AUR helper/library. ========================================= @@ -36,7 +36,7 @@ all the time at GitHub. COPYRIGHT --------- -Copyright (C) 2011, Kwpolska +Copyright (C) 2011-2012, Kwpolska. All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/docs/.messagecodes.rst.swp b/docs/.messagecodes.rst.swp new file mode 100644 index 0000000000000000000000000000000000000000..455e7ccaec3dcee27bd485b7d13f209f816102d3 GIT binary patch literal 20480 zcmeHOO^h5z6)yY}6XHM=O9bId1v`oz&9-NDZP^-Z@Wy{xjMvL%HxaVJZcTU1OtU>* zld5jd4l-bg1Bh!55D6p>2!SGk2uS1v3Pgen;)22fiGzhWAb|u);6Nn!URBrZ?ATtB ztVxJeBY&Fh>8e++zIyfZUOl(!Pt0B7$DwN9%{vqb76iHgk;h%llfW0gRbHpMLj zgr5Qffq}QiKv}e>PTb38rWv8`uT>ZZBis2EGD( z88`(z0DKU*8+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er ================================== :Info: This is an appendix to the PKGBUILDer documentation. :Author: Kwpolska -:Date: 2012-07-14 -:Version: 2.1.2.27 +:Date: 2012-07-27 +:Version: 2.1.2.31 -Copyright (C) 2011, Kwpolska +Copyright (C) 2011-2012, Kwpolska. All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/docs/README.rst b/docs/README.rst index 4055bf1..70a0c4d 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: 2012-07-14 -:Version: 2.1.2.27 +:Date: 2012-07-27 +:Version: 2.1.2.31 PKGBUILDer. A Python AUR helper/library. ========================================= @@ -36,7 +36,7 @@ all the time at GitHub. COPYRIGHT --------- -Copyright (C) 2011, Kwpolska +Copyright (C) 2011-2012, Kwpolska. All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/docs/classes.rst b/docs/classes.rst index 94715e5..c583d8d 100644 --- a/docs/classes.rst +++ b/docs/classes.rst @@ -4,8 +4,8 @@ Classes in PKGBUILDer :Author: Kwpolska :Copyright: See Appendix B. -:Date: 2012-07-14 -:Version: 2.1.2.27 +:Date: 2012-07-27 +:Version: 2.1.2.31 .. index:: classes .. module:: PKGBUILDer diff --git a/docs/conf.py b/docs/conf.py index 0302815..c908d39 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -50,7 +50,7 @@ # The short X.Y version. version = '2.1' # The full version, including alpha/beta/rc tags. -release = '2.1.2.27' +release = '2.1.2.31' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/docs/messagecodes.rst b/docs/messagecodes.rst index 392e5eb..8ada0e5 100644 --- a/docs/messagecodes.rst +++ b/docs/messagecodes.rst @@ -3,8 +3,8 @@ Appendix A. PKGBUILDer message numbers list =========================================== :Info: This is an appendix to the PKGBUILDer documentation. :Author: Kwpolska -:Date: 2012-07-14 -:Version: 2.1.2.27 +:Date: 2012-07-27 +:Version: 2.1.2.31 In order to help debugging, messages are numbered. Each message number has four digits: the first one is the @@ -21,7 +21,7 @@ Categories 3. makepkg 4. auto_build, validation 4. Update class -5. non-module problems +5. __main__ functionality (when run as an AUR helper) Usage instructions ------------------ @@ -51,7 +51,7 @@ Warnings ======== ======== =============== ========================================= -INF# Component Message +WRN# Component Message ======== =============== ========================================= 0 none Nothing there yet. ======== =============== ========================================= @@ -63,8 +63,10 @@ Errors ======== =============== ========================================= ERR# Component Message ======== =============== ========================================= +[1001]_ AUR HTTP Error %s [3001]_ build_runner package not found [3101]_ download 0 bytes downloaded +[3102]_ download HTTP Error %s [3151]_ extract 0 files extracted [3201]_ depcheck cannot find the requested dependency [3202]_ depcheck UnicodeDecodeError while reading file @@ -72,17 +74,24 @@ ERR# Component Message [3401]_ auto_build AUR dependency required [3451]_ validation not installed [3452]_ validation outdated +[5001]_ `__main__` Aborted by user! Exiting… [5002]_ search search string too short ======== =============== ========================================= Explainations: +.. [1001] occurs, when PKGBUILDer got a response other than 200 from + the AUR RPC. %s is replaced with the error code. + .. [3001] occurs, when PKGBUILDer cannot find the requested package. The name is probably mispelled or the package was deleted. .. [3101] occurs, when PKGBUILDer downloaded 0 bytes. It usually means that something bad happened during the download. +.. [3102] occurs, when PKGBUILDer got a response other than 200 during + a file download. %s is replaced with the error code. + .. [3151] occurs, when PKGBUILDer extracted 0 files from the downloaded tarball. It means that the tarball is broken. Please tell the maintainer about this problem. @@ -91,17 +100,17 @@ Explainations: PKGBUILD requests a package, that does not exist in the system, repositories, nor the AUR. -.. [3202] occurs, when Python cannot decode UTF-8 the PKGBUILD. If +.. [3202] occurs, when Python cannot decode UTF-8 in the PKGBUILD. If the PKGBUILD cannot be read, dependency checks cannot be performed. Possible reasons include incorrectly encoded characters in the Maintainer/Submitter field. Please inform the package maintainer through the comments. Include the output of `iconv PKGBUILD`. Example output: `# Maintainer: Juan Piconv: illegal input sequence at position - 20` The PKGBUILDer's error message is also valid and will help the + 20` PKGBUILDer’s error message is also valid and will help the maintainer. .. [3301] occurs, when makepkg exits with the return code 1. It means - that something bad happened. Refer to makepkg's output for more info. + that something bad happened. Refer to makepkg’s output for more info. .. [3401] occurs, when the $depends or $makedepends array of the PKGBUILD request a package, which exists in the AUR. It is plain @@ -110,16 +119,18 @@ Explainations: .. [3451] occurs, when PKGBUILDer finds out that the package is not installed on your system. It means that the package that was bulit - before this message was issued wasn't installed properly (eg. root - password wasn't provided at the right time, 'n' was hit when pacman was + before this message was issued wasn’t installed properly (eg. root + password wasn’t provided at the right time, “n” was hit when pacman was asking for proceeding). .. [3452] occurs, when PKGBUILDer finds out that the package is installed, but outdated. It means that the package that was bulit before - this message was issued wasn't installed properly (eg. root password - wasn't provided at the right time, 'n' was hit when pacman was asking for + this message was issued wasn’t installed properly (eg. root password + wasn’t provided at the right time, “n” was hit when pacman was asking for proceeding). +.. [5001] occurs, when the user presses ^C (SIGINT). + .. [5002] occurs, when your search string is shorter than 3 letters. The AUR API ignores these requests. However, the script searches for an exact match. If one is found, it is being shown. diff --git a/docs/pkgbuilder.8 b/docs/pkgbuilder.8 new file mode 100644 index 0000000..e69de29 diff --git a/docs/pkgbuilder.rst b/docs/pkgbuilder.rst index 62d65dd..adddf97 100644 --- a/docs/pkgbuilder.rst +++ b/docs/pkgbuilder.rst @@ -4,8 +4,8 @@ PKGBUILDer :Author: Kwpolska :Copyright: See Appendix B. -:Date: 2012-07-14 -:Version: 2.1.2.27 +:Date: 2012-07-27 +:Version: 2.1.2.31 :Manual section: 8 :Manual group: PKGBUILDer manual diff --git a/locale/en/LC_MESSAGES/pkgbuilder.mo b/locale/en/LC_MESSAGES/pkgbuilder.mo index d0ecfb265fa0e4bdda443ba665fa496c55e231db..048446a2fe3ad8088baba93d4647d8fbb8613d60 100644 GIT binary patch delta 126 zcmbQ|FwbFw0t+L0JJC@ga7~l delta 126 zcmbQ|FwbFw0t=(TWJMNtMvlpuEZT~?3=qHqq%4700LqsH()u9wQ?BP0GzIDM?MSQm9TVPTFk38O(=QI-3Ik^yVF8 diff --git a/locale/en/LC_MESSAGES/pkgbuilder.po b/locale/en/LC_MESSAGES/pkgbuilder.po index 2cc5ba8..9d55fa9 100644 --- a/locale/en/LC_MESSAGES/pkgbuilder.po +++ b/locale/en/LC_MESSAGES/pkgbuilder.po @@ -207,8 +207,8 @@ msgid "" "Votes : {cmv}\n" "Out of Date : {ood}\n" "Maintainer : {mnt}\n" -"Last Updated : {upd}\n" "First Submitted: {fsb}\n" +"Last Updated : {upd}\n" "Description : {dsc}\n" msgstr "" "Category : {cat}\n" @@ -219,8 +219,8 @@ msgstr "" "Votes : {cmv}\n" "Out of Date : {ood}\n" "Maintainer : {mnt}\n" -"Last Updated : {upd}\n" "First Submitted: {fsb}\n" +"Last Updated : {upd}\n" "Description : {dsc}\n" #: /home/kwpolska/git/pkgbuilder/pkgbuilder.py:854 diff --git a/locale/pl/LC_MESSAGES/pkgbuilder.mo b/locale/pl/LC_MESSAGES/pkgbuilder.mo index 1c15cbb93bb96c97296d34664b4ea49f9da88d74..0a0263b9feb324e5b8c139e25990ae2f04e2df99 100644 GIT binary patch delta 125 zcmccRc*}8v0t+LQ?BP0GzIDM?MSQm9TVPTFk3S-~gjUtFT6keFRknwXPWrKbRtDlJHv Nyh>bp^BwVj8~{L2A5{PV diff --git a/locale/pl/LC_MESSAGES/pkgbuilder.po b/locale/pl/LC_MESSAGES/pkgbuilder.po index 9a24ac9..cf8b02f 100644 --- a/locale/pl/LC_MESSAGES/pkgbuilder.po +++ b/locale/pl/LC_MESSAGES/pkgbuilder.po @@ -207,8 +207,8 @@ msgid "" "Votes : {cmv}\n" "Out of Date : {ood}\n" "Maintainer : {mnt}\n" -"Last Updated : {upd}\n" "First Submitted: {fsb}\n" +"Last Updated : {upd}\n" "Description : {dsc}\n" msgstr "" "Kategoria : {cat}\n" @@ -219,8 +219,8 @@ msgstr "" "Głosy : {cmv}\n" "Nieaktualny : {ood}\n" "Opiekun : {mnt}\n" -"Ost. aktualiz. : {upd}\n" "Wysłany : {fsb}\n" +"Ost. aktualiz. : {upd}\n" "Opis : {dsc}\n" #: /home/kwpolska/git/pkgbuilder/pkgbuilder.py:854 diff --git a/messages.pot b/messages.pot index 110be09..8140fe9 100644 --- a/messages.pot +++ b/messages.pot @@ -207,8 +207,8 @@ msgid "" "Votes : {cmv}\n" "Out of Date : {ood}\n" "Maintainer : {mnt}\n" -"Last Updated : {upd}\n" "First Submitted: {fsb}\n" +"Last Updated : {upd}\n" "Description : {dsc}\n" msgstr "" diff --git a/pkgbuilder.py b/pkgbuilder.py index 65337e3..eb62310 100755 --- a/pkgbuilder.py +++ b/pkgbuilder.py @@ -1,7 +1,7 @@ #!/usr/bin/python3 # -*- encoding: utf-8 -*- -# PKGBUILDer v2.1.2.30 -# A Python AUR helper/library. +# PKGBUILDer v2.1.2.31 +# An AUR helper/library. # Copyright (C) 2011-2012, Kwpolska. # All rights reserved. # @@ -35,7 +35,7 @@ # Names convention: pkg = a package object, pkgname = a package name. -"""PKGBUILDer. An AUR helper.""" +"""PKGBUILDer. An AUR helper/library.""" from pyparsing import OneOrMore, Word # python-pyparsing from [community] import pyalpm # pyalpm from [extra] import pycman # pyalpm from [extra] @@ -45,15 +45,13 @@ import os import json import re -#import urllib.request -#import urllib.error import tarfile import subprocess import datetime import gettext import functools -VERSION = '2.1.2.30' +VERSION = '2.1.2.31' T = gettext.translation('pkgbuilder', '/usr/share/locale', fallback='C') _ = T.gettext @@ -257,9 +255,13 @@ def jsonreq(self, rtype, arg, prot = 'http'): :Input: none. :Output: none. :Returns: JSON data from the API. -:Exceptions: requests.exceptions.*. +:Exceptions: requests.exceptions.*, PBError. :Message codes: none.""" - return requests.get(self.rpc.format(prot, rtype, arg)).text + r = requests.get(self.rpc.format(prot, rtype, arg)) + if r.status_code != 200: + raise PBError(_('[ERR1001] AUR: HTTP Error {0}').format(r.status_code)) + + return r.text def jsonmultiinfo(self, args, prot = 'http'): """Makes a multiinfo request and returns plain JSON data. @@ -268,10 +270,14 @@ def jsonmultiinfo(self, args, prot = 'http'): :Input: none. :Output: none. :Returns: JSON data from the API. -:Exceptions: requests.exceptions.*. +:Exceptions: requests.exceptions.*, PBError. :Message codes: none.""" urlargs = '&arg[]='+'&arg[]='.join(args) - return requests.get(self.mrpc.format(prot, urlargs)).text + r = requests.get(self.mrpc.format(prot, urlargs)) + if r.status_code != 200: + raise PBError(_('[ERR1001] AUR: HTTP Error {0}').format(r.status_code)) + + return r.text def request(self, rtype, arg, prot = 'http'): """Makes a request. @@ -363,7 +369,6 @@ def print_package(self, pkg, use_categories = True, prefix=''): H = pycman.config.init_with_config('/etc/pacman.conf') localdb = H.get_localdb() lpkg = localdb.get_pkg(pkg['Name']) - category = '' installed = '' if lpkg != None: @@ -371,7 +376,7 @@ def print_package(self, pkg, use_categories = True, prefix=''): installed = _(' [installed: {0}]').format(lpkg.version) else: installed = _(' [installed]') - if pkg['OutOfDate'] == 1: + if pkg['OutOfDate'] == '1': installed = (installed + ' '+DS.colors['red']+_( '[out of date]')+DS.colors['all_off']) if use_categories == True: @@ -470,16 +475,18 @@ def download(self, urlpath, filename, prot = 'http'): requests.exceptions.* :Message codes: ERR3101.""" r = requests.get(self.aururl.format(prot, urlpath)) - open(filename, 'wb').write(r.content) - if r.status != 200: - raise PBError(_('[ERR3102] download: HTTP Error {0}').format(r.status) - if r.headers['content-cength'] != 0: - return r.headers['content-length'] - else: + + # Error handling. + if r.status_code != 200: + raise PBError(_('[ERR3102] download: HTTP Error {0}').format(r.status_code)) + elif r.headers['content-length'] == '0': raise PBError(_('[ERR3101] download: 0 bytes downloaded')) + open(filename, 'wb').write(r.content) + return r.headers['content-length'] + def extract(self, filename): - """ Extracts an AUR tarball. + """Extracts an AUR tarball. :Arguments: filename. :Input: none. @@ -758,20 +765,35 @@ def auto_upgrade(self): :Message codes: none. :Notice: things break here A LOT.""" pblog('Ran auto_upgrade.') - fancy_msg(_('Gathering data about packages…')) + if DS.pacman: + print(':: '+_('Gathering data about packages…')) + else: + fancy_msg(_('Gathering data about packages…')) foreign = self.gather_foreign_pkgs() upgradeable = self.list_upgradeable(foreign.keys()) upglen = len(upgradeable) + if DS.pacman: + print(_('Targets ({0}): ').format(upglen), end='') + else: + fancy_msg(_('{0} upgradeable packages found:').format(upglen)) - fancy_msg(_('{0} upgradeable packages found:').format(upglen)) if upglen == 0: - fancy_msg2(_('there is nothing to do')) + if DS.pacman: + print(_('there is nothing to do')) + else: + fancy_msg2(_('there is nothing to do')) + return 0 - fancy_msg2(' '.join(upgradeable)) - query = (DS.colors['green']+'==>'+DS.colors['all_off']+ + if DS.pacman: + print(' '.join(upgradeable)) + query = _('Proceed with installation? [Y/n] ') + else: + fancy_msg2(' '.join(upgradeable)) + query = (DS.colors['green']+'==>'+DS.colors['all_off']+ DS.colors['bold']+' '+_('Proceed with installation? \ [Y/n] ')+DS.colors['all_off']) + yesno = input(query) yesno = yesno + ' ' # cheating… if yesno[0] == 'n' or yesno[0] == 'N': @@ -794,7 +816,7 @@ def main_routine(): :Message codes: ERR5002. """ pblog('Running argparse.') - parser = argparse.ArgumentParser(description=_('An AUR helper. \ + parser = argparse.ArgumentParser(description=_('An AUR helper/library. \ Wrapper-friendly (pacman-like output.)'), epilog=_('You can \ use pacman syntax if you want to.')) @@ -866,8 +888,8 @@ def main_routine(): Votes : {cmv} Out of Date : {ood} Maintainer : {mnt} -Last Updated : {upd} First Submitted: {fsb} +Last Updated : {upd} Description : {dsc} """).format( cat = DS.categories[int(pkg['CategoryID'])], diff --git a/requirements.txt b/requirements.txt index 4044ba7..f0788d2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,3 @@ pyparsing -pyalpm>=0.4.0 +pyalpm>=0.5.0 +requests diff --git a/setup.py b/setup.py index c4a2572..e6eb5ac 100755 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from distutils.core import setup setup(name='pkgbuilder', - version='2.1.2.27', + version='2.1.2.31', description='An AUR helper (and library) in python3', author='Kwpolska', author_email='kwpolska@kwpolska.tk', @@ -24,7 +24,7 @@ 'Topic :: Utilities' ], py_modules=['pkgbuilder'], - requires=['pyparsing', 'pyalpm'], + requires=['pyparsing', 'pyalpm', 'requests'], scripts=['scripts/pkgbuilder'], data_files=[ ('share/man/man8', ['docs/pkgbuilder.8.gz']),