Skip to content

Instantly share code, notes, and snippets.

@z3ntu
Created February 21, 2016 18:46
Show Gist options
  • Save z3ntu/f031284b618ae448ef5a to your computer and use it in GitHub Desktop.
Save z3ntu/f031284b618ae448ef5a to your computer and use it in GitHub Desktop.
pyPKGBUILD from the Arch Linux forum
#!/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
#!/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