aboutsummaryrefslogtreecommitdiffstats
path: root/lv2include
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2010-10-27 23:51:08 +0000
committerDavid Robillard <d@drobilla.net>2010-10-27 23:51:08 +0000
commitf94c84b241fc86b25babb12fabb98fe0e483ba27 (patch)
tree1ce1347a9ea60adb04c2a0990854c042e86c1354 /lv2include
parentf9695523147e44333593ba52048bf22e1e417079 (diff)
downloadlv2-f94c84b241fc86b25babb12fabb98fe0e483ba27.tar.xz
When run with no arguments, build default system include trees (/usr/include/lv2 and /usr/local/include/lv2).
Diffstat (limited to 'lv2include')
-rwxr-xr-xlv2include/lv2include.py18
1 files changed, 13 insertions, 5 deletions
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])