1#!@PERL@
2#
3# hpijs-remover - Removes the foomatic XML files for HP's "hpijs"
4#                 inkjet printer driver (http://hpinkjet.sourceforge.net/)
5#
6# Copyright 2002 Till Kamppeter <till.kamppeter@gmx.net>
7#
8#   This program is free software; you can redistribute it and/or modify it
9#   under the terms of the GNU General Public License as published by the Free
10#   Software Foundation; either version 2 of the License, or (at your option)
11#   any later version.
12#
13#   This program is distributed in the hope that it will be useful, but
14#   WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15#   or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
16#   for more details.
17#
18#   You should have received a copy of the GNU General Public License
19#   along with this program; if not, write to the Free Software
20#   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21#
22
23# Was a path for the database given on the command line?
24
25my $libdir = "../..";
26if ($ARGV[0]) {
27    $libdir = $ARGV[0];
28}
29
30# Remove generated files from the database
31
32if ( -d "$libdir/db/source/driver/" ) {
33    print "Removing HPIJS Foomatic entries ...\n";
34    unlink("$libdir/db/source/driver/hpijs.xml") ||
35	die "Cannot remove $libdir/db/source/driver/hpijs.xml\n";
36    unlink("$libdir/db/source/opt/hpijs-Model.xml") ||
37	die "Cannot remove $libdir/db/source/opt/hpijs-Model.xml\n";
38    unlink("$libdir/db/source/opt/hpijs-PageSize.xml") ||
39	die "Cannot remove $libdir/db/source/opt/hpijs-PageSize.xml\n";
40    unlink("$libdir/db/source/opt/hpijs-Resolution.xml") ||
41	die "Cannot remove $libdir/db/source/opt/hpijs-Resolution.xml\n";
42    unlink("$libdir/db/source/opt/hpijs-Duplex.xml") ||
43	die "Cannot remove $libdir/db/source/opt/hpijs-Duplex.xml\n";
44    unlink("$libdir/db/source/opt/hpijs-InputSlot.xml") ||
45	die "Cannot remove $libdir/db/source/opt/hpijs-InputSlot.xml\n";
46}
47
48# Done
49
50print "\nDone,\n\n";
51exit 0;
52