Created
February 21, 2016 18:46
-
-
Save z3ntu/f031284b618ae448ef5a to your computer and use it in GitHub Desktop.
pyPKGBUILD from the Arch Linux forum
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| if [ -f $1 ]; then | |
| . $1 | |
| VARIABLE="pkgname pkgver pkgrel pkgdesc license url md5sums install source arch group provides makedepends conflicts replaces backup depends" | |
| for VAR in $VARIABLE | |
| do | |
| eval "echo \"$VAR=\${$VAR[@]}\"" | |
| done | |
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| import os | |
| def parse(file): | |
| dict = {} | |
| for line in os.popen('%s/pkgbuild_reader.sh %s' % (os.getcwd(), file)): | |
| argv, value = line.split('=', 1) | |
| dict[argv] = value[:-1] | |
| return dict | |
| if __name__ == '__main__': | |
| import sys | |
| dict = parse(sys.argv[1]) | |
| for argv in dict.keys(): | |
| print(argv.rjust(14), ':', dict[argv]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment