<s> import aurinfo <EOL> import subprocess <EOL> import tempfile <EOL> def OutputOf ( * argv ) : <EOL> return subprocess . check_output ( <EOL> argv , stderr = subprocess . DEVNULL ) . decode ( ) . rstrip ( ) . split ( '<STR_LIT:\n>' ) <EOL> def parse_pkgbuild ( pkgbuild_text ) : <EOL> with tempfile . NamedTemporaryFile ( ) as pkgbuild_file : <EOL> pkgbuild_file . write ( pkgbuild_text . encode ( ) ) <EOL> pkgbuild_file . flush ( ) <EOL> srcinfo_text = OutputOf ( '<STR_LIT>' , pkgbuild_file . name ) <EOL> srcinfo = aurinfo . ParseAurinfoFromIterable ( srcinfo_text ) <EOL> pkgnames = srcinfo . GetPackageNames ( ) <EOL> pkgs = map ( lambda n : srcinfo . GetMergedPackage ( n ) , pkgnames ) <EOL> return dict ( zip ( pkgnames , pkgs ) ) </s>
