summaryrefslogtreecommitdiffstats
path: root/tupkg/update/tupkgupdate
diff options
context:
space:
mode:
authorLoui Chang <louipc.ist@gmail.com>2008-12-04 21:23:58 +0100
committerLoui Chang <louipc.ist@gmail.com>2008-12-04 21:23:58 +0100
commitcf2a97701a51b5644d5923a6f18af4dc263ea9b0 (patch)
tree099d7867fd860353863231d6685cbb480e1ad6d4 /tupkg/update/tupkgupdate
parentb87c8a4ba8aab577efdf7ff253392fe8c6f6f964 (diff)
downloadaur-cf2a97701a51b5644d5923a6f18af4dc263ea9b0.tar.gz
aur-cf2a97701a51b5644d5923a6f18af4dc263ea9b0.tar.xz
Replace deprecated os.popen2 with subprocess.Popen in tupkgupdate.
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
Diffstat (limited to 'tupkg/update/tupkgupdate')
-rwxr-xr-xtupkg/update/tupkgupdate40
1 files changed, 22 insertions, 18 deletions
diff --git a/tupkg/update/tupkgupdate b/tupkg/update/tupkgupdate
index 6003ff12..10108754 100755
--- a/tupkg/update/tupkgupdate
+++ b/tupkg/update/tupkgupdate
@@ -8,6 +8,7 @@ import getopt
import MySQLdb
import MySQLdb.connections
import ConfigParser
+from subprocess import Popen, PIPE
###########################################################
# Deal with configuration
@@ -244,46 +245,49 @@ def infoFromPkgbuildFile(filename):
category = "none"
# open and source the file
- pf_stdin, pf_stdout = os.popen2("/bin/bash", 't', 0)
- print >>pf_stdin, ". " + filename
+ pf = Popen("/bin/bash",
+ shell=True, bufsize=0, stdin=PIPE, stdout=PIPE, close_fds=True)
+
+ print >>pf.stdin, ". " + filename
#print "PKGBUILD: " + filename
# get pkgname
- print >>pf_stdin, 'echo $pkgname'
- pkgname = pf_stdout.readline().strip()
+ print >>pf.stdin, 'echo $pkgname'
+ pkgname = pf.stdout.readline().strip()
+ print pkgname
#print "PKGBUILD: pkgname: " + pkgname
# get pkgver
- print >>pf_stdin, 'echo $pkgver'
- pkgver = pf_stdout.readline().strip()
+ print >>pf.stdin, 'echo $pkgver'
+ pkgver = pf.stdout.readline().strip()
#print "PKGBUILD: pkgver: " + pkgver
# get pkgrel
- print >>pf_stdin, 'echo $pkgrel'
- pkgrel = pf_stdout.readline().strip()
+ print >>pf.stdin, 'echo $pkgrel'
+ pkgrel = pf.stdout.readline().strip()
#print "PKGBUILD: pkgrel: " + pkgrel
# get url
- print >>pf_stdin, 'echo $url'
- url = pf_stdout.readline().strip()
+ print >>pf.stdin, 'echo $url'
+ url = pf.stdout.readline().strip()
#print "PKGBUILD: url: " + url
# get desc
- print >>pf_stdin, 'echo $pkgdesc'
- pkgdesc = pf_stdout.readline().strip()
+ print >>pf.stdin, 'echo $pkgdesc'
+ pkgdesc = pf.stdout.readline().strip()
#print "PKGBUILD: pkgdesc: " + pkgdesc
# get source array
- print >>pf_stdin, 'echo ${source[*]}'
- source = (pf_stdout.readline().strip()).split(" ")
+ print >>pf.stdin, 'echo ${source[*]}'
+ source = (pf.stdout.readline().strip()).split(" ")
# get depends array
- print >>pf_stdin, 'echo ${depends[*]}'
- depends = (pf_stdout.readline().strip()).split(" ")
+ print >>pf.stdin, 'echo ${depends[*]}'
+ depends = (pf.stdout.readline().strip()).split(" ")
# clean up
- pf_stdin.close()
- pf_stdout.close()
+ pf.stdin.close()
+ pf.stdout.close()
return pkgname, pkgver + "-" + pkgrel, pkgdesc, url, depends, source, category