chmod +x $@
service-types.db: service-types
- $(PYTHON) build-db $<
+ $(PYTHON) build-db $(srcdir)/$< $@
CLEANFILES = service-types.db build-db
#!@PYTHON@
-
+# -*-python-*-
# $Id$
# This file is part of avahi.
import dbm, sys
if len(sys.argv) > 1:
- fn = sys.argv[1]
+ infn = sys.argv[1]
+else:
+ infn = "service-types"
+
+if len(sys.argv) > 2:
+ outfn = sys.argv[2]
else:
- fn = "service-types"
+ outfn = infn
+
+if outfn.endswith(".db"):
+ outfn = outfn[:-3]
-db = dbm.open(fn, "n")
+db = dbm.open(outfn, "n")
-for ln in file(fn, "r"):
+for ln in file(infn, "r"):
ln = ln.strip(" \r\n\t")
if ln == "" or ln.startswith("#"):