1 --- avahi-0.8/service-type-database/build-db.orig 1970-01-01 01:00:00.000000000 +0100
2 +++ avahi-0.8/service-type-database/build-db 2020-02-26 21:30:46.708401608 +0100
6 +# This file is part of avahi.
8 +# avahi is free software; you can redistribute it and/or modify it
9 +# under the terms of the GNU Lesser General Public License as
10 +# published by the Free Software Foundation; either version 2 of the
11 +# License, or (at your option) any later version.
13 +# avahi is distributed in the hope that it will be useful, but WITHOUT
14 +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15 +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
16 +# License for more details.
18 +# You should have received a copy of the GNU Lesser General Public
19 +# License along with avahi; if not, write to the Free Software
20 +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
24 + import anydbm as dbm
30 +if len(sys.argv) > 1:
33 + infn = "service-types"
35 +if len(sys.argv) > 2:
38 + outfn = infn + ".db"
40 +db = dbm.open(outfn, "n")
42 +for ln in open(infn, "r"):
43 + ln = ln.strip(" \r\n\t")
45 + if ln == "" or ln.startswith("#"):
48 + t, n = ln.split(":", 1)
50 + db[t.strip()] = n.strip()