diff --git a/PKGBUILD b/PKGBUILD index 4fd155c..b86a4d68 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,6 +1,6 @@ # Maintainer: Kwpolska pkgname=pkgbuilder -pkgver=2.1.1.1 +pkgver=2.1.1.3 pkgrel=1 pkgdesc="A basic Python AUR helper/library." arch=('any') @@ -9,7 +9,7 @@ license=('BSD') depends=('python' 'pyalpm' 'python-pyparsing') options=(!emptydirs) source=("http://pypi.python.org/packages/source/p/${pkgname}/${pkgname}-${pkgver}.tar.gz") -md5sums=('be6d2f31b0a13c7af4e0b1f88f1d0d2b') +md5sums=('82b4e53c06518dae8956ad8f794340f6') package() { cd "${srcdir}/${pkgname}-${pkgver}" diff --git a/Rakefile b/Rakefile index 73b2f8e..e73b427 100644 --- a/Rakefile +++ b/Rakefile @@ -4,7 +4,38 @@ aurcat = "16" task :default => [:help] task :help do - puts "Usage: rake [update/docs/docshtml/docszip]" + puts "Usage: rake command" + puts "Command is one of:" + puts " update Updates the package." + puts " docs Creates the docs." + puts "" + puts " prepare Prepares the package for being updated." + puts " pypi Creates and uploads the package to pypi." + puts " aur Uploads an AUR tarball." + puts " docshtml Creates the docs in HTML." + puts " docszip Zips the docs made by docshtml." + +end + +task :prepare, :ver do |t, args| + if args[:ver].to_s.chomp == '' + puts "Version number?" + version = STDIN.gets.chomp + else + version = args[:ver].chomp + end + + date = Time.now.strftime('%Y-%m-%d') + + sh "sed \"s/version=.*/version='#{version}',/\" setup.py -i" + sh "sed \"s/release = .*/release = '#{version}'/\" docs/conf.py -i" + sh "sed \"s/:Version: .*/:Version: #{version}/\" docs/*.rst -i" + sh "sed \"s/BUILDer .* do/BUILDer #{version} do/\" docs/index.rst -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" end task :docshtml do @@ -16,37 +47,52 @@ task :docszip do end task :docs do + sh "rm docs/pkgbuilder.8.gz" + sh "rst2man docs/pkgbuilder.rst > docs/pkgbuilder.8" + sh "gzip docs/pkgbuilder.8" + Rake::Task[:docshtml].invoke Rake::Task[:docszip].invoke end -task :update, :ver do |t, args| +task :pypi do + sh './setup.py sdist upload' +end + +task :aur, :ver do |t, args| if args[:ver].to_s.chomp == '' puts "Version number?" version = STDIN.gets.chomp else version = args[:ver].chomp end - date = Time.now.strftime('%Y-%m-%d') - sh "sed \"s/version=.*/version='#{version}',/\" setup.py -i" - sh "sed \"s/release = .*/release = '#{version}'/\" docs/conf.py -i" - sh "sed \"s/:Version: .*/:Version: #{version}/\" docs/*.rst -i" - sh "sed \"s/:Date: .*/:Date: #{date}/\" docs/*.rst -i" - sh "rm docs/pkgbuilder.8.gz" - sh "rst2man docs/pkgbuilder.rst > docs/pkgbuilder.8" - sh "gzip docs/pkgbuilder.8" + pbdir = "/tmp/#{project}-pkgbuild-#{version}" + sh "mkdir -p #{pbdir}" + sh "cp PKGBUILD #{pbdir}" + md5out = `cd #{pbdir} && makepkg -cg` + md5sums = md5out.split('\n').reverse[0].chomp! + sh "sed \"s/md5sums=.*/#{md5sums}/\" PKGBUILD -i" + sh "cp PKGBUILD #{pbdir}" + sh "cd #{pbdir} && makepkg -f --source" + sh "aurupload Kwpolska - system #{pbdir}/*.src.tar.gz" - Rake::Task[:docs].invoke - sh './setup.py sdist upload' - md5sum = `md5sum "dist/#{project}-#{version}.tar.gz"` - md5sum.chomp! - md5sum.sub!(" dist/#{project}-#{version}.tar.gz", "") - sh "sed \"s/md5sums=.*/md5sums=('#{md5sum}')/\" PKGBUILD -i" +end + +task :update, :ver do |t, args| + if args[:ver].to_s.chomp == '' + puts "Version number?" + version = STDIN.gets.chomp + else + version = args[:ver].chomp + end + #date = Time.now.strftime('%Y-%m-%d') + + Rake::Task[:prepare].invoke(version) - sh "tar -czvf /tmp/#{project}-#{version}-1.src.tar.gz PKGBUILD" - sh "aurploader /tmp/#{project}-#{version}-1.src.tar.gz" + Rake::Task[:docs].invoke(version) + Rake::Task[:pypi].invoke(version) puts "Done. Please upload the docs tarball to PyPI." end diff --git a/dist/pkgbuilder-2.1.1.2.tar.gz b/dist/pkgbuilder-2.1.1.2.tar.gz index 8917d70..4517c8d 100644 Binary files a/dist/pkgbuilder-2.1.1.2.tar.gz and b/dist/pkgbuilder-2.1.1.2.tar.gz differ diff --git a/dist/pkgbuilder-2.1.1.3.tar.gz b/dist/pkgbuilder-2.1.1.3.tar.gz new file mode 100644 index 0000000..0f3bf1f Binary files /dev/null and b/dist/pkgbuilder-2.1.1.3.tar.gz differ diff --git a/docs/README.rst b/docs/README.rst index 38edcd5..f715e2c 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-09-24 -:Version: 2.1.1.2 +:Date: 2011-10-04 +:Version: 2.1.1.3 PKGBUILDer. A Python AUR helper/library. ========================================= diff --git a/docs/_build/doctrees/README.doctree b/docs/_build/doctrees/README.doctree index 68b820c..1cfb6bf 100644 Binary files a/docs/_build/doctrees/README.doctree and b/docs/_build/doctrees/README.doctree differ diff --git a/docs/_build/doctrees/environment.pickle b/docs/_build/doctrees/environment.pickle index f6ef3fe..3d2e821 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 2463637..cd9c316 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 8d678ed..edd7a0c 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 076b2c4..97e5ad3 100644 Binary files a/docs/_build/doctrees/pkgbuilder.doctree and b/docs/_build/doctrees/pkgbuilder.doctree differ diff --git a/docs/conf.py b/docs/conf.py index 929ee3e..15ea69e 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.1.2' +release = '2.1.1.3' # 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 1912752..d750c9a 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 7f8226d..2b6ada1 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: 42e105a34029085cabb7716af3127781 +config: b980e1a36903d7b6497827440dd27e80 tags: fbb0d17656682115ca4d033fb2f83ba1 diff --git a/docs/html/README/index.html b/docs/html/README/index.html index 2a20ab0..e1f752c 100644 --- a/docs/html/README/index.html +++ b/docs/html/README/index.html @@ -7,13 +7,13 @@ - README for PKGBUILDer — PKGBUILDer v2.1.1.2 documentation + README for PKGBUILDer — PKGBUILDer v2.1.1.3 documentation - + @@ -36,7 +36,7 @@

Navigation

  • previous |
  • -
  • PKGBUILDer v2.1.1.2 documentation »
  • +
  • PKGBUILDer v2.1.1.3 documentation »
  • @@ -55,9 +55,9 @@

    README for PKGBUILDer Author:Kwpolska <kwpolska@kwpolska.tk> -Date:2011-09-24 +Date:2011-10-04 -Version:2.1.1.2 +Version:2.1.1.3 @@ -167,12 +167,12 @@

    Navigation

  • previous |
  • -
  • PKGBUILDer v2.1.1.2 documentation »
  • +
  • PKGBUILDer v2.1.1.3 documentation »
  • diff --git a/docs/html/_sources/README.txt b/docs/html/_sources/README.txt index 38edcd5..f715e2c 100644 --- a/docs/html/_sources/README.txt +++ b/docs/html/_sources/README.txt @@ -3,8 +3,8 @@ README for PKGBUILDer ===================== :Info: This is the README file for PKGBUILDer. :Author: Kwpolska -:Date: 2011-09-24 -:Version: 2.1.1.2 +:Date: 2011-10-04 +:Version: 2.1.1.3 PKGBUILDer. A Python AUR helper/library. ========================================= diff --git a/docs/html/_sources/index.txt b/docs/html/_sources/index.txt index a723f10..2442e2a 100644 --- a/docs/html/_sources/index.txt +++ b/docs/html/_sources/index.txt @@ -3,7 +3,7 @@ You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. -PKGBUILDer 2.1.1.1 documentation +PKGBUILDer 2.1.1.3 documentation ================================ Contents: diff --git a/docs/html/_sources/messagecodes.txt b/docs/html/_sources/messagecodes.txt index 80a2252..b2fda91 100644 --- a/docs/html/_sources/messagecodes.txt +++ b/docs/html/_sources/messagecodes.txt @@ -3,8 +3,8 @@ Appendix B. PKGBUILDer message numbers list =========================================== :Info: This is an appendix to the PKGBUILDer documentation. :Author: Kwpolska -:Date: 2011-09-24 -:Version: 2.1.1.2 +:Date: 2011-10-04 +:Version: 2.1.1.3 In order to help debugging, messages are numbered. Each message number has four digits: the first one is the diff --git a/docs/html/_sources/pkgbuilder.txt b/docs/html/_sources/pkgbuilder.txt index 6c50ad3..16da256 100644 --- a/docs/html/_sources/pkgbuilder.txt +++ b/docs/html/_sources/pkgbuilder.txt @@ -8,8 +8,8 @@ a Python AUR helper/library :Author: Kwpolska :Copyright: This document has been placed in the public domain. -:Date: 2011-09-24 -:Version: 2.1.1.2 +:Date: 2011-10-04 +:Version: 2.1.1.3 :Manual section: 8 :Manual group: PKGBUILDer manual diff --git a/docs/html/index.html b/docs/html/index.html index a31e4b9..dc1ca87 100644 --- a/docs/html/index.html +++ b/docs/html/index.html @@ -7,13 +7,13 @@ - PKGBUILDer 2.1.1.1 documentation — PKGBUILDer v2.1.1.2 documentation + PKGBUILDer 2.1.1.3 documentation — PKGBUILDer v2.1.1.3 documentation - + @@ -32,7 +32,7 @@

    Navigation

  • next
  • -
  • PKGBUILDer v2.1.1.2 documentation »
  • +
  • PKGBUILDer v2.1.1.3 documentation »
  • @@ -41,8 +41,8 @@

    Navigation

    -
    -

    PKGBUILDer 2.1.1.1 documentation

    +
    +

    PKGBUILDer 2.1.1.3 documentation

    Contents:

    diff --git a/docs/html/messagecodes/index.html b/docs/html/messagecodes/index.html index b8b9d59..23ebe87 100644 --- a/docs/html/messagecodes/index.html +++ b/docs/html/messagecodes/index.html @@ -7,13 +7,13 @@ - Appendix B. PKGBUILDer message numbers list — PKGBUILDer v2.1.1.2 documentation + Appendix B. PKGBUILDer message numbers list — PKGBUILDer v2.1.1.3 documentation - + @@ -32,7 +32,7 @@

    Navigation

  • previous
  • -
  • PKGBUILDer v2.1.1.2 documentation »
  • +
  • PKGBUILDer v2.1.1.3 documentation »
  • @@ -51,9 +51,9 @@

    Appendix B. PKGBUILDer message numbers listAuthor:Kwpolska <kwpolska@kwpolska.tk> -Date:2011-09-24 +Date:2011-10-04 -Version:2.1.1.2 +Version:2.1.1.3 @@ -331,12 +331,12 @@

    Navigation

  • previous
  • -
  • PKGBUILDer v2.1.1.2 documentation »
  • +
  • PKGBUILDer v2.1.1.3 documentation »
  • diff --git a/docs/html/pkgbuilder/index.html b/docs/html/pkgbuilder/index.html index 005e237..33f336d 100644 --- a/docs/html/pkgbuilder/index.html +++ b/docs/html/pkgbuilder/index.html @@ -7,13 +7,13 @@ - PKGBUILDer — PKGBUILDer v2.1.1.2 documentation + PKGBUILDer — PKGBUILDer v2.1.1.3 documentation - + - + @@ -57,9 +57,9 @@

    a Python AUR helper/libraryCopyright:This document has been placed in the public domain. -Date:2011-09-24 +Date:2011-10-04 -Version:2.1.1.2 +Version:2.1.1.3 Manual section:8 @@ -178,7 +178,7 @@

    Table Of Contents

    Previous topic

    PKGBUILDer 2.1.1.1 documentation

    + title="previous chapter">PKGBUILDer 2.1.1.3 documentation

    Next topic

    README for PKGBUILDer

    @@ -206,14 +206,14 @@

    Navigation

    next
  • - previous |
  • -
  • PKGBUILDer v2.1.1.2 documentation »
  • +
  • PKGBUILDer v2.1.1.3 documentation »
  • diff --git a/docs/html/search/index.html b/docs/html/search/index.html index e42e8fa..34bf5e2 100644 --- a/docs/html/search/index.html +++ b/docs/html/search/index.html @@ -7,13 +7,13 @@ - Search — PKGBUILDer v2.1.1.2 documentation + Search — PKGBUILDer v2.1.1.3 documentation - + @@ -34,7 +34,7 @@ @@ -79,12 +79,12 @@

    Search

    diff --git a/docs/html/searchindex.js b/docs/html/searchindex.js index 11f6661..e0e2161 100644 --- a/docs/html/searchindex.js +++ b/docs/html/searchindex.js @@ -1 +1 @@ -Search.setIndex({objects:{},terms:{all:0,code:[0,3,2],queri:2,four:3,follow:[0,2],content:1,iconv:3,procur:0,depend:3,friendli:2,send:2,aur:[0,1,2,3],skip:2,aris:0,neglig:0,introduc:0,merchant:0,digit:3,sourc:0,string:3,util:3,exact:3,pkgbuild:3,list:[0,1,3],pleas:3,impli:0,direct:0,maintain:[3,2],download:3,compat:[0,2],sub:3,section:2,calcul:3,current:2,version:[0,3,2],"new":0,order:3,"public":2,deriv:0,disclaim:0,met:0,modif:0,sinc:2,search:[3,2],prior:0,permit:0,extra:0,modul:[3,2],api:3,instal:[0,3,2],from:[0,3,2],proceed:3,visit:2,perl:0,usr:0,tell:3,more:[0,3,2],desir:3,notic:0,warn:[1,3],appendix:[1,3],particular:0,must:0,none:3,err:3,pyalpm:0,work:2,subel:3,can:2,purpos:0,root:3,process:2,accept:2,tarbal:3,occur:3,instead:2,updat:[3,2],product:0,after:3,befor:3,date:[0,3,2],data:0,man:0,github:2,incorrectli:3,element:3,issu:[3,2],inform:[1,3],bulit:3,juan:3,oper:2,help:3,softwar:0,consent:0,through:3,paramet:[0,2],conjunct:2,group:2,fit:0,makepkg:[3,2],tort:0,mail:2,non:3,good:0,"return":3,thei:2,python:[0,1,2,3],interrupt:0,now:[0,2],nor:[0,3],name:[0,2],auto_build:3,refresh:2,each:3,debug:3,found:[3,2],mean:3,domain:2,vote:2,redistribut:0,happen:3,extract:3,event:0,special:[0,2],out:[0,3,2],shown:3,profit:0,categori:[1,2,3],cwd:2,reason:3,theori:0,ask:3,"byte":3,place:2,retain:0,first:[3,2],origin:[0,2],endors:0,arrai:3,number:[1,3],predepcheck:3,mai:0,instruct:3,wrapper:[0,2],wasn:3,owner:[0,2],stabl:0,script:[3,2],licens:2,system:3,messag:[1,3],too:3,illeg:3,option:2,copi:0,sync:2,"short":3,holder:0,than:3,target:2,provid:[0,3,2],charact:3,posit:3,sai:2,ani:0,packag:[0,3,2],substitut:0,need:[0,3],caus:0,built:2,note:0,also:[3,2],exampl:[3,2],build:[0,3,2],which:[3,2],noth:3,even:0,distribut:0,shall:[0,2],multipli:3,letter:3,phase:2,"class":3,url:2,doc:0,request:3,doe:3,syntax:2,find:3,copyright:[0,2],explain:3,busi:0,meant:3,hit:3,variou:2,get:3,express:0,pypi:0,repo:2,cannot:3,report:2,liabl:0,requir:3,bad:3,see:2,result:3,reserv:0,correctli:3,someth:3,written:0,pkgbuilder:[0,1,2,3],neither:0,incident:0,last:2,howev:[0,3],contract:0,mani:0,com:2,comment:3,kwpolska:[0,3,2],color:2,exemplari:0,damag:0,liabil:0,addition:2,three:3,been:2,compon:3,much:2,consequenti:0,piconv:3,togeth:3,plain:3,servic:0,"while":3,abov:[0,3],error:[1,3],helper:[0,1,2],readm:[0,1],them:2,synopsi:2,author:[0,3,2],perform:3,make:2,shorter:3,binari:0,html:0,decod:3,document:[0,1,2,3],http:2,depcheck:3,user:2,syu:2,techniqu:2,without:0,thi:[0,3,2],usual:3,identifi:3,yet:3,add:[0,3],other:[0,3,2],input:3,match:3,bin:0,applic:2,advis:0,format:2,read:3,big:0,password:3,python3:0,loss:0,specif:0,makedepend:3,manual:2,nocolor:2,output:3,page:[0,2],right:[0,3],indirect:0,librari:[0,1,2],tmp:2,leap:0,exit:3,condit:0,reproduc:0,thhe:2,refer:[0,3],usag:3,broken:3,promot:0,repositori:3,about:[3,2],materi:0,submitt:3,encod:3,automat:[3,2],warranti:0,contributor:0,your:3,git:2,wai:0,submit:2,avail:0,strict:0,includ:[0,3],forward:0,properli:3,form:0,offer:2,forc:2,bug:2,info:[0,3,2],utf:3,possibl:[0,3,2],whether:0,pacman:[0,3,2],displai:[3,2],limit:0,otherwis:0,problem:3,featur:0,uid:2,dure:3,exist:3,file:[0,3],inf:3,check:[3,2],when:3,field:3,valid:[3,2],sysupgrad:2,you:[0,3,2],novalid:2,sequenc:3,ansi:2,dropbox:2,outdat:3,directori:2,descript:2,ignor:[3,2],time:3,unicodedecodeerror:3},objtypes:{},titles:["README for PKGBUILDer","PKGBUILDer 2.1.1.1 documentation","PKGBUILDer","Appendix B. PKGBUILDer message numbers list"],objnames:{},filenames:["README","index","pkgbuilder","messagecodes"]}) \ No newline at end of file +Search.setIndex({objects:{},terms:{all:0,code:[0,3,2],queri:2,four:3,follow:[0,2],categori:[1,2,3],iconv:3,procur:0,depend:3,friendli:2,send:2,aur:[0,1,2,3],skip:2,aris:0,neglig:0,introduc:0,merchant:0,digit:3,sourc:0,string:3,util:3,exact:3,err:3,list:[0,1,3],pleas:3,impli:0,direct:0,maintain:[3,2],download:3,compat:[0,2],sub:3,section:2,calcul:3,current:2,version:[0,3,2],"new":0,order:3,"public":2,deriv:0,disclaim:0,met:0,modif:0,sinc:2,search:[3,2],prior:0,permit:0,extra:0,modul:[3,2],api:3,instal:[0,3,2],from:[0,3,2],proceed:3,visit:2,perl:0,usr:0,tell:3,more:[0,3,2],desir:3,notic:0,warn:[1,3],appendix:[1,3],particular:0,must:0,none:3,pkgbuild:3,pyalpm:0,work:2,subel:3,can:2,purpos:0,root:3,process:2,accept:2,tarbal:3,occur:3,instead:2,updat:[3,2],product:0,after:3,befor:3,mai:0,data:0,man:0,"short":3,author:[0,3,2],element:3,caus:0,inform:[1,3],bulit:3,juan:3,oper:2,help:3,softwar:0,consent:0,through:3,paramet:[0,2],conjunct:2,group:2,fit:0,makepkg:[3,2],tort:0,mail:2,non:3,good:0,"return":3,thei:2,python:[0,1,2,3],interrupt:0,now:[0,2],nor:[0,3],name:[0,2],auto_build:3,refresh:2,each:3,debug:3,found:[3,2],mean:3,domain:2,vote:2,redistribut:0,happen:3,extract:3,event:0,special:[0,2],out:[0,3,2],shown:3,profit:0,content:1,cwd:2,reason:3,theori:0,ask:3,"byte":3,place:2,retain:0,first:[3,2],origin:[0,2],endors:0,arrai:3,number:[1,3],predepcheck:3,date:[0,3,2],instruct:3,wrapper:[0,2],wasn:3,owner:[0,2],stabl:0,script:[3,2],licens:2,system:3,messag:[1,3],too:3,illeg:3,option:2,copi:0,sync:2,github:2,holder:0,than:3,target:2,provid:[0,3,2],charact:3,posit:3,sai:2,ani:0,packag:[0,3,2],substitut:0,need:[0,3],issu:[3,2],built:2,note:0,also:[3,2],without:0,build:[0,3,2],which:[3,2],noth:3,even:0,distribut:0,shall:[0,2],multipli:3,letter:3,phase:2,"class":3,url:2,doc:0,request:3,doe:3,syntax:2,find:3,copyright:[0,2],explain:3,busi:0,meant:3,hit:3,variou:2,get:3,express:0,pypi:0,repo:2,cannot:3,report:2,liabl:0,requir:3,bad:3,see:2,result:3,reserv:0,correctli:3,someth:3,written:0,pkgbuilder:[0,1,2,3],neither:0,incident:0,last:2,howev:[0,3],contract:0,mani:0,com:2,comment:3,kwpolska:[0,3,2],color:2,exemplari:0,damag:0,liabil:0,addition:2,three:3,been:2,compon:3,much:2,consequenti:0,piconv:3,togeth:3,plain:3,servic:0,"while":3,abov:[0,3],error:[1,3],helper:[0,1,2],readm:[0,1],them:2,synopsi:2,incorrectli:3,perform:3,make:2,shorter:3,binari:0,html:0,decod:3,document:[0,1,2,3],http:2,depcheck:3,user:2,syu:2,techniqu:2,exampl:[3,2],thi:[0,3,2],usual:3,identifi:3,yet:3,add:[0,3],valid:[3,2],input:3,match:3,bin:0,applic:2,advis:0,format:2,read:3,big:0,password:3,python3:0,loss:0,specif:0,makedepend:3,manual:2,nocolor:2,output:3,page:[0,2],right:[0,3],indirect:0,librari:[0,1,2],tmp:2,leap:0,exit:3,condit:0,reproduc:0,thhe:2,refer:[0,3],usag:3,broken:3,promot:0,repositori:3,about:[3,2],materi:0,submitt:3,encod:3,automat:[3,2],warranti:0,contributor:0,your:3,git:2,wai:0,submit:2,avail:0,strict:0,includ:[0,3],forward:0,properli:3,form:0,offer:2,forc:2,bug:2,info:[0,3,2],utf:3,possibl:[0,3,2],whether:0,pacman:[0,3,2],displai:[3,2],limit:0,otherwis:0,problem:3,featur:0,uid:2,dure:3,exist:3,file:[0,3],inf:3,check:[3,2],when:3,field:3,other:[0,3,2],sysupgrad:2,you:[0,3,2],novalid:2,sequenc:3,ansi:2,dropbox:2,outdat:3,directori:2,descript:2,ignor:[3,2],time:3,unicodedecodeerror:3},objtypes:{},titles:["README for PKGBUILDer","PKGBUILDer 2.1.1.3 documentation","PKGBUILDer","Appendix B. PKGBUILDer message numbers list"],objnames:{},filenames:["README","index","pkgbuilder","messagecodes"]}) \ No newline at end of file diff --git a/docs/index.rst b/docs/index.rst index a723f10..2442e2a 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -3,7 +3,7 @@ You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. -PKGBUILDer 2.1.1.1 documentation +PKGBUILDer 2.1.1.3 documentation ================================ Contents: diff --git a/docs/messagecodes.rst b/docs/messagecodes.rst index 80a2252..b2fda91 100644 --- a/docs/messagecodes.rst +++ b/docs/messagecodes.rst @@ -3,8 +3,8 @@ Appendix B. PKGBUILDer message numbers list =========================================== :Info: This is an appendix to the PKGBUILDer documentation. :Author: Kwpolska -:Date: 2011-09-24 -:Version: 2.1.1.2 +:Date: 2011-10-04 +:Version: 2.1.1.3 In order to help debugging, messages are numbered. Each message number has four digits: the first one is the diff --git a/docs/pkgbuilder.8.gz b/docs/pkgbuilder.8.gz index dbec113..e288ddf 100644 Binary files a/docs/pkgbuilder.8.gz and b/docs/pkgbuilder.8.gz differ diff --git a/docs/pkgbuilder.rst b/docs/pkgbuilder.rst index 6c50ad3..16da256 100644 --- a/docs/pkgbuilder.rst +++ b/docs/pkgbuilder.rst @@ -8,8 +8,8 @@ a Python AUR helper/library :Author: Kwpolska :Copyright: This document has been placed in the public domain. -:Date: 2011-09-24 -:Version: 2.1.1.2 +:Date: 2011-10-04 +:Version: 2.1.1.3 :Manual section: 8 :Manual group: PKGBUILDer manual diff --git a/pkgbuilder.py b/pkgbuilder.py index cdc397b..707e879 100755 --- a/pkgbuilder.py +++ b/pkgbuilder.py @@ -1,5 +1,5 @@ #!/usr/bin/python3 -# PKGBUILDer Version 2.1.1.1 +# PKGBUILDer Version 2.1.1.3 # A Python AUR helper/library. # Copyright Kwpolska 2011. Licensed under GPLv3. # USAGE: ./build.py pkg1 [pkg2] [pkg3] (and more) @@ -18,7 +18,7 @@ import subprocess import datetime -VERSION = '2.1.1.1' +VERSION = '2.1.1.3' ### PBDS PB global data storage ### class PBDS: @@ -253,7 +253,7 @@ def auto_build(self, package, validate): """ build_result = self.build_runner(package) try: - if build_result == 0: + if build_result[0] == 0: fancy_msg("The build function reported a proper build.") os.chdir('../') if validate == True: @@ -273,12 +273,12 @@ def auto_build(self, package, validate): fancy_msg2("[INF3450] validation: installed "+ pkg.version) pyalpm.release() - elif build_result == 1: + elif build_result[0] == 1: os.chdir('../') raise PBError("[ERR3301] makepkg returned 1.") # I think that only makepkg can do that. Others would # raise an exception. - else: + elif build_result[0] == 2: os.chdir('../') fancy_warning("[ERR3401] Building more AUR packages is \ required.") @@ -358,7 +358,7 @@ def depcheck(self, bothdepends): Returns: a dict: key : package name - value: 0, 1 or 2 (in system, repos, AUR) + value: -1, 0, 1 or 2 (nowhere, in system, repos, AUR) Possible exceptions: PBError Suggested way of handling: types = ['system', 'repos', 'aur'] @@ -366,6 +366,9 @@ def depcheck(self, bothdepends): print("{0}: found in {1}".format(pkg, types[pkgtype]) if pkgtype == 2: #AUR #build pkg here + + Former data: + 2.0 Returns: no -1 """ if bothdepends == []: # THANK YOU, MAINTAINER, FOR HAVING NO DEPS AND DESTROYING ME! @@ -373,22 +376,27 @@ def depcheck(self, bothdepends): else: parseddeps = {} pycman.config.init_with_config('/etc/pacman.conf') - localdb = pyalpm.get_localdb() + localpkgs = pyalpm.get_localdb().pkgcache + syncpkgs = [] + for j in [ i.pkgcache for i in pyalpm.get_syncdbs() ]: + syncpkgs.append(j) for dep in bothdepends: if re.search('[<=>]', dep): vpat = '>=<|><=|=><|=<>|<>=|<=>|>=|=>|><|<>|=<|\ <=|>|=|<' ver_base = re.split(vpat, dep) dep = ver_base[0] - pkg = localdb.get_pkg(dep) - repos = dict((db.name, db) for db in pyalpm.get_syncdbs()) - if pkg != None: + #pkg = localdb.get_pkg(dep) + #repos = dict((db.name, db) for db in pyalpm.get_syncdbs()) + if pyalpm.find_satisfier(localpkgs, dep): #pkg != None: parseddeps[dep] = 0 - elif pycman.action_sync.find_sync_package(dep, repos)[0]: + elif pyalpm.find_satisfier(syncpkgs, dep): + #pycman.action_sync.find_sync_package(dep, repos)[0]: parseddeps[dep] = 1 elif self.utils.info(dep): parseddeps[dep] = 2 else: + parseddeps[dep] = -1 raise PBError("[ERR3201] depcheck: cannot find {0} \ anywhere".format(dep)) pyalpm.release() @@ -429,7 +437,7 @@ def build_runner(self, package): fancy_msg('Checking dependencies...') try: bothdepends = self.prepare_deps(open('./PKGBUILD', - 'r').read()) + 'rb').read().decode('utf8', 'ignore')) deps = self.depcheck(bothdepends) pkgtypes = ['system', 'repos', 'the AUR'] aurbuild = [] @@ -437,12 +445,16 @@ def build_runner(self, package): fancy_msg2('none found') for pkg, pkgtype in deps.items(): - fancy_msg2("{0}: found in {1}".format(pkg, - pkgtypes[pkgtype])) + if pkgtype == -1: + raise PBError("[ERR3201] depcheck: cannot find \ +{0} anywhere".format(dep)) if pkgtype == 2: aurbuild.append(pkg) + + fancy_msg2("{0}: found in {1}".format(pkg, + pkgtypes[pkgtype])) if aurbuild != []: - return aurbuild + return [2, aurbuild] except UnicodeDecodeError as inst: fancy_error2('[ERR3202] depcheck: UnicodeDecodeError. \ The PKGBUILD cannot be read. There are invalid UTF-8 characters (eg. \ @@ -451,19 +463,23 @@ def build_runner(self, package): asroot = '' if os.geteuid() == 0: asroot = ' --asroot' - return subprocess.call('/usr/bin/makepkg -si'+asroot, - shell=True) + return [subprocess.call('/usr/bin/makepkg -si'+asroot, + shell=True), 'makepkg'] # In version 2.0, this comment couldn't believe that # the main function takes only one line. But, right now, # it doesn't think so. Others look like it, too. except PBError as inst: fancy_error(str(inst)) + return [3] except urllib.error.URLError as inst: fancy_error(str(inst)) + return [3] except urllib.error.HTTPError as inst: fancy_error(str(inst)) + return [3] except IOError as inst: fancy_error(str(inst)) + return [3] ### Upgrade upgrade AUR packages ### class Upgrade: @@ -603,7 +619,7 @@ def main_routine(): print("""Category : {0} Name : {1} -Version : {2} +Version 2.1.1.3 URL : {3} Licenses : {4} Votes : {5} diff --git a/setup.py b/setup.py index 8a90fc2..dd88aa9 100755 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from distutils.core import setup setup(name='pkgbuilder', - version='2.1.1.2', + version='2.1.1.3', description='An AUR helper (and library) in python3', author='Kwpolska', author_email='kwpolska@kwpolska.tk',