diff options
author | pjmattal <pjmattal> | 2004-09-14 05:15:56 +0200 |
---|---|---|
committer | pjmattal <pjmattal> | 2004-09-14 05:15:56 +0200 |
commit | cd539facb844f3dff6df33dce6760550df4cafa3 (patch) | |
tree | 9295b858aba12f30a58f14751b14692607886b22 /tupkg/update/tupkgupdate | |
parent | 272d00879c880bed8f2ae1f51dedbf6b6929959d (diff) | |
download | aur-cd539facb844f3dff6df33dce6760550df4cafa3.tar.gz aur-cd539facb844f3dff6df33dce6760550df4cafa3.tar.xz |
added parsing of PKGBUILD by using bash
Diffstat (limited to 'tupkg/update/tupkgupdate')
-rwxr-xr-x | tupkg/update/tupkgupdate | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/tupkg/update/tupkgupdate b/tupkg/update/tupkgupdate index 3f2de3af..97b269c6 100755 --- a/tupkg/update/tupkgupdate +++ b/tupkg/update/tupkgupdate @@ -51,9 +51,32 @@ def areFilesIdentical(file_a, file_b): ############################################################ def infoFromPackageFile(filename): - pkgbuild = pacman.load(filename) - return pkgbuild.name, pkgbuild.version + "-" + pkgbuild.release + pkg = pacman.load(filename) + return pkg.name, pkg.version + "-" + pkg.release +def infoFromPkgbuildFile(filename): + # open and source the file + pf_stdin, pf_stdout = os.popen2("/bin/bash", 't', 0) + print >>pf_stdin, ". " + filename + + # get pkgname + print >>pf_stdin, 'echo $pkgname' + pkgname = pf_stdout.readline().strip() + + # get pkgver + print >>pf_stdin, 'echo $pkgver' + pkgver = pf_stdout.readline().strip() + + # get pkgrel + print >>pf_stdin, 'echo $pkgrel' + pkgrel = pf_stdout.readline().strip() + + # clean up + pf_stdin.close() + pf_stdout.close() + + return pkgname, pkgver + "-" + pkgrel + ############################################################ # Functions for doing the final steps of execution ############################################################ @@ -126,7 +149,7 @@ delete = list() a_files = pkgbuildsInTree(pkgbuild_dir) for a_file in a_files: - pkgname, ver = infoFromPackageFile(a_file) + pkgname, ver = infoFromPkgbuildFile(a_file) # Error (and skip) if we encounter any invalid PKGBUILD files if (pkgname == None or ver == None): |