Skip to content

Commit

Permalink
v2.1.2.31: switching over to kennethreitz/requests (actual release)
Browse files Browse the repository at this point in the history
Signed-off-by: Kwpolska <[email protected]>
  • Loading branch information
Kwpolska committed Jul 27, 2012
1 parent d3397f5 commit 1718f47
Show file tree
Hide file tree
Showing 16 changed files with 514 additions and 290 deletions.
7 changes: 0 additions & 7 deletions .travis.yml

This file was deleted.

91 changes: 72 additions & 19 deletions INSTALL.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/python3
# PKGBUILDer
# -*- encoding: utf-8 -*-
# PKGBUILDer installer
# Copyright (C) 2011, Kwpolska
# All rights reserved.
#
Expand Down Expand Up @@ -34,7 +35,7 @@
# There are no install instructions. If you want to install
# the script, run this script with python.

"""PKGBUILDer AUR installer. Use it if you dont have any AUR helpers installed."""
"""PKGBUILDer AUR installer. Use it if you don't have any AUR helpers installed."""

import subprocess
import os
Expand Down Expand Up @@ -67,23 +68,65 @@
os.mkdir(PATH)
os.chdir(PATH)


PKGDATA = json.loads(urllib.request.urlopen('http://aur.archlinux.org\
/rpc.php?type=info&arg=pkgbuilder').read().decode())
RHANDLE = urllib.request.urlopen('http://aur.archlinux.org'+
PKGDATA['results']['URLPath'])
open('pkgbuilder.tar.gz', 'wb').write(RHANDLE.read())
THANDLE = tarfile.open('pkgbuilder.tar.gz', 'r:gz')
THANDLE.extractall()
os.chdir('./pkgbuilder/')

ASROOT = ''
if os.geteuid() == 0:
ASROOT = ' --asroot'
MPKG = subprocess.call('/usr/bin/makepkg -si'+ASROOT, shell=True)

if MPKG == 1:
print(_("""
# Dependency check.

print(_("""Performing a dependency check..."""))

deps = {'pyparsing': None, 'pyalpm': None, 'certifi': None, 'requests': None}

print("""pyparsing | community | """, end='')
try:
import pyparsing
deps['pyparsing'] = True
print(_('found'))
except ImportError:
deps['pyparsing'] = False
print(_('not found'))

print("""pyalpm | extra | """, end='')
try:
import pyalpm
deps['pyalpm'] = True
print(_('found'))
except ImportError:
deps['pyalpm'] = False
print(_('not found'))

print("""certifi | AUR | """, end='')
try:
import certifi
deps['certifi'] = True
print(_('found'))
except ImportError:
deps['certifi'] = False
print(_('not found'))

print("""requests | AUR | """, end='')
try:
import requests
deps['requests'] = True
print(_('found'))
except ImportError:
deps['requests'] = False
print(_('not found'))

def install(pkgname):
PKGDATA = json.loads(urllib.request.urlopen('http://aur.archlinux\
.org/rpc.php?type=info&arg='+pkgname).read().decode())
RHANDLE = urllib.request.urlopen('http://aur.archlinux.org'+
PKGDATA['results']['URLPath'])
open(pkgname+'.tar.gz', 'wb').write(RHANDLE.read())
THANDLE = tarfile.open(pkgname+'.tar.gz', 'r:gz')
THANDLE.extractall()
os.chdir('./'+pkgname+'/')

ASROOT = ''
if os.geteuid() == 0:
ASROOT = ' --asroot'
MPKG = subprocess.call('/usr/bin/makepkg -si'+ASROOT, shell=True)

if MPKG == 1:
print(_("""
Something went wrong. Please read makepkg's output and try again.
You can also try to debug the work of this script yourself.
Expand All @@ -94,6 +137,16 @@
If I am wrong, though, congratulations!
""").format(PATH))

if deps['certifi'] == False or deps['requests'] == False:
print(_("""Installing missing AUR dependencies..."""))
if deps['certifi'] == False:
install('python-certifi')

if deps['requests'] == False:
install('python-requests')

install('pkgbuilder')

print(_("""
Read the above output. If the script had any problems, run it
Expand Down
1 change: 1 addition & 0 deletions MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ README
README.rst
pkgbuilder.py
setup.py
docs/CHANGELOG.rst
docs/LICENSE.rst
docs/README.rst
docs/classes.rst
Expand Down
2 changes: 1 addition & 1 deletion PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ license=('BSD')
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')
md5sums=('c5c1a6aae0d39b63df181bc617599173')

package() {
cd "${srcdir}/${pkgname}-${pkgver}"
Expand Down
6 changes: 5 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ task :help do
puts " docshtml Creates the docs in HTML."
puts " docszip Zips the docs made by docshtml."
puts " git Pushes the changes to GitHub."

puts " locale Prepares for translation."
end

task :prepare, :ver do |t, args|
Expand Down Expand Up @@ -105,6 +105,10 @@ task :git, :ver, :msg do |t, args|
sh "git push --tags"
end

task :locale do
sh "xgettext -c pkgbuilder.py INSTALL.py"
end

task :update, :ver do |t, args|
if args[:ver].to_s.chomp == ''
puts "Version number?"
Expand Down
Binary file added dist/pkgbuilder-2.1.2.31.tar.gz
Binary file not shown.
32 changes: 32 additions & 0 deletions docs/CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
=====================
Appendix C. Changelog
=====================
:Info: This is a partial changelog for PKGBUILDer.
:Author: Kwpolska <[email protected]>
:Date: 2012-07-27
:Version: 2.1.2.31

Versioning scheme
=================
PKGBUILDer uses the following versioning scheme:

generation.major.minor.revision

* generation: 1 is the first Perl version, 2 is the Python version.
* major: basic release number.
* minor: sub-release number.
* revision: changes that aren’t important enough to be new major versions.

Generation 2
============
:2.1.3.0: Planned after 2.1.2.31; contains test suite, requests and file division.
:2.1.2.0: Support for the new pyalpm.
:2.1.1.0: Introducing the Upgrade functionality.
:2.1.0.0: First OOP-based release.
:2.0.0.0: First release.

Generation 1
============

:1.1: A more advanced version, never released.
:1.0: First and only release.
Empty file removed docs/pkgbuilder.8
Empty file.
Binary file modified docs/pkgbuilder.8.gz
Binary file not shown.
Binary file modified locale/en/LC_MESSAGES/pkgbuilder.mo
Binary file not shown.
Loading

0 comments on commit 1718f47

Please sign in to comment.