From f94c84b241fc86b25babb12fabb98fe0e483ba27 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 27 Oct 2010 23:51:08 +0000 Subject: When run with no arguments, build default system include trees (/usr/include/lv2 and /usr/local/include/lv2). --- lv2include/lv2include.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'lv2include') diff --git a/lv2include/lv2include.py b/lv2include/lv2include.py index ae0e0af..0e4b00f 100755 --- a/lv2include/lv2include.py +++ b/lv2include/lv2include.py @@ -123,6 +123,10 @@ def build_tree(search_path, outdir): """Build a directory tree under outdir containing symlinks to all LV2 extensions found in search_path, such that the symlink paths correspond to the extension URIs.""" + print "Building LV2 include tree at", outdir, "for", search_path + if os.access(outdir, os.F_OK) and not os.access(outdir, os.W_OK): + print >> sys.stderr, "lv2include.py: cannot build `%s': Permission denied" % outdir + sys.exit(1) for bundle in __bundles(search_path): # Load manifest into model manifest = rdf_load('file://' + os.path.join(bundle, 'manifest.ttl')) @@ -150,11 +154,15 @@ def build_tree(search_path, outdir): if __name__ == "__main__": args = sys.argv[1:] - if len(args) != 1: + + if len(args) == 0: + build_tree('/usr/local/lib/lv2', '/usr/local/include/lv2') + build_tree('/usr/lib/lv2', '/usr/include/lv2') + sys.exit(0) + + elif len(args) != 1: __usage() sys.exit(1) - outdir = args[0] - print "Building LV2 include tree at", outdir - - build_tree(lv2_path(), outdir) + else: + build_tree(lv2_path(), args[1]) -- cgit v1.2.1