Imported Upstream version 3.0.2-20050705
Didier Raboud
13 years ago
0 | 0 | /COPYING/3.1/Tue Jan 28 23:01:10 2003//Tfoomatic-3_0-branch |
1 | /ChangeLog/3.99.2.24/Thu Feb 24 00:17:50 2005//Tfoomatic-3_0-branch | |
1 | /ChangeLog/3.99.2.26/Mon May 30 00:44:48 2005//Tfoomatic-3_0-branch | |
2 | 2 | /Foomatic-Devel-Ideas.txt/3.2/Tue Apr 22 23:19:52 2003//Tfoomatic-3_0-branch |
3 | 3 | /Makefile.in/3.16.2.3/Fri Jan 28 16:17:13 2005//Tfoomatic-3_0-branch |
4 | /README/3.26.2.5/Tue Sep 14 21:08:37 2004//Tfoomatic-3_0-branch | |
4 | /README/3.26.2.6/Wed May 11 17:58:56 2005//Tfoomatic-3_0-branch | |
5 | 5 | /README.build-foomatic-filters-ppds/3.3.2.1/Sun Mar 28 23:04:51 2004//Tfoomatic-3_0-branch |
6 | 6 | /TODO/3.1/Fri Nov 29 01:31:37 2002//Tfoomatic-3_0-branch |
7 | 7 | /USAGE/3.14.2.4/Tue Sep 14 21:08:37 2004//Tfoomatic-3_0-branch |
16 | 16 | /foomatic-compiledb.1.in/3.1/Thu Nov 28 02:42:26 2002//Tfoomatic-3_0-branch |
17 | 17 | /foomatic-compiledb.in/3.6.2.1/Tue Nov 30 14:29:43 2004//Tfoomatic-3_0-branch |
18 | 18 | /foomatic-configure.1.in/3.1/Thu Nov 28 02:42:26 2002//Tfoomatic-3_0-branch |
19 | /foomatic-configure.in/3.18.2.3/Thu Feb 24 00:17:50 2005//Tfoomatic-3_0-branch | |
19 | /foomatic-configure.in/3.18.2.4/Mon May 30 00:44:48 2005//Tfoomatic-3_0-branch | |
20 | 20 | /foomatic-filters-ppds-README/3.1/Sun Feb 23 07:14:18 2003//Tfoomatic-3_0-branch |
21 | 21 | /foomatic-filters-ppds-install/3.1/Sun Feb 23 07:14:18 2003//Tfoomatic-3_0-branch |
22 | 22 | /foomatic-fix-xml.in/3.0/Fri Oct 11 01:16:34 2002//Tfoomatic-3_0-branch |
0 | 2004-02-23 Till Kamppeter <till.kamppeter@gmx.net> | |
0 | 2005-05-29 Till Kamppeter <till.kamppeter@gmx.net> | |
1 | ||
2 | * foomatic-configure.in, lib/Foomatic/DB.pm: Added support for | |
3 | PPD file names with spaces (Mandriva bug #16172). | |
4 | ||
5 | 2005-05-11 Till Kamppeter <till.kamppeter@gmx.net> | |
6 | ||
7 | * README: Corrected character list in "<arg_allowedchars>" in the | |
8 | example string option XML file. Improved instructions for | |
9 | "<arg_allowedchars>". | |
10 | ||
11 | 2005-02-23 Till Kamppeter <till.kamppeter@gmx.net> | |
1 | 12 | |
2 | 13 | * foomatic-configure.in: Fixed bug of old non-Foomatic PPD not |
3 | 14 | overtaken when applying "foomatic-configure" to a queue without |
7 | 18 | options "0" or "1" was written into the PPD file and not |
8 | 19 | "False" or "True". |
9 | 20 | |
10 | 2004-01-28 Till Kamppeter <till.kamppeter@gmx.net> | |
21 | 2005-01-28 Till Kamppeter <till.kamppeter@gmx.net> | |
11 | 22 | |
12 | 23 | * makeDefaults.in, foomatic-cleanupdrivers.in: Allow use of an |
13 | 24 | alternative Foomatic database location specifying it with the |
19 | 30 | * foomatic-cleanupdrivers.in: Use default database location from |
20 | 31 | Defaults.pm. |
21 | 32 | |
22 | 2004-01-22 Till Kamppeter <till.kamppeter@gmx.net> | |
33 | 2005-01-22 Till Kamppeter <till.kamppeter@gmx.net> | |
23 | 34 | |
24 | 35 | * lib/Foomatic/DB.pm: Fixed Tim Waugh's fix. It made an |
25 | 36 | "@@IEEE1284@@" appear in the PPD file when for a printer |
2067 | 2067 | "/^[...]*$/" expression in the Perl scripts, so ranges with "-", a |
2068 | 2068 | list of forbidden characters with a leading "^", or special characters |
2069 | 2069 | as "\w", "\d", "\x07", ... are allowed. To allow a backslash, one has |
2070 | to escape it by using two backslashes ("\\"). | |
2070 | to escape it by using two backslashes ("\\"). To allow a "-" it must | |
2071 | be in the end of the list to not make it defining a range and for a | |
2072 | "^" must be placed at any other place than the beginning of the string | |
2073 | if it should be explicitly allowed. | |
2071 | 2074 | |
2072 | 2075 | "<arg_allowedregexp>" allows also to restrict the structure of the |
2073 | 2076 | string, as it defines an arbitrary Perl regular expression (see "man |
2119 | 2122 | <arg_proto>-G%s </arg_proto> |
2120 | 2123 | </arg_execution> |
2121 | 2124 | <arg_maxlength>127</arg_maxlength> |
2122 | <arg_allowedchars>A-Za-z0-9\._-/</arg_allowedchars> | |
2125 | <arg_allowedchars>A-Za-z0-9\._/-</arg_allowedchars> | |
2123 | 2126 | <arg_allowedregexp>(?<!\/)$</arg_allowedregexp> |
2124 | 2127 | <constraints> |
2125 | 2128 | <constraint sense="true"> |
312 | 312 | } |
313 | 313 | } elsif ($config->{'ppdfile'}) { |
314 | 314 | if (! -r $config->{'ppdfile'}) { |
315 | die "The PPD file $config->{'ppdfile'} does not exist or is " . | |
315 | die "The PPD file \'$config->{'ppdfile'}\' does not exist or is " . | |
316 | 316 | "readable.\n"; |
317 | 317 | } |
318 | 318 | # Load the data from the PPD file |
385 | 385 | my ($config, $ppdfile, $rawqueue, $newfoomaticdata) = @_; |
386 | 386 | |
387 | 387 | # Save old $ppdfile, if any |
388 | system("cp -f $ppdfile $ppdfile.old") | |
388 | system("cp -f \'$ppdfile\' \'$ppdfile.old\'") | |
389 | 389 | if (-f $ppdfile); |
390 | 390 | if ($rawqueue) { |
391 | 391 | # Raw queue with $postpipe, use a "PPD" only containing the |
394 | 394 | (($config->{'spooler'} eq 'lprng') || |
395 | 395 | ($config->{'spooler'} eq 'lpd'))) || |
396 | 396 | ($config->{'spooler'} eq 'direct')) { |
397 | open PPDFILE, "> $ppdfile" or die "Cannot write $ppdfile!\n"; | |
397 | open PPDFILE, "> $ppdfile" or die "Cannot write \'$ppdfile\'!\n"; | |
398 | 398 | print PPDFILE "*PPD-Adobe: \"4.3\"\n*%\n"; |
399 | 399 | print PPDFILE "*% This is a raw (driverless/unfiltered) " . |
400 | 400 | "queue, this PPD file only carries\n" . |
404 | 404 | chmod 0644, $ppdfile; |
405 | 405 | } else { |
406 | 406 | if (-f $ppdfile) { |
407 | unlink "$ppdfile" or die "Cannot delete $ppdfile!\n"; | |
407 | unlink "$ppdfile" or die "Cannot delete \'$ppdfile\'!\n"; | |
408 | 408 | } |
409 | 409 | } |
410 | 410 | } else { |
412 | 412 | # Copy in the PPD file specified on the command line |
413 | 413 | if ($config->{'ppdfile'} !~ /\.gz$/i) { |
414 | 414 | # Uncompressed PPD file |
415 | system("cp -f $config->{'ppdfile'} $ppdfile") and | |
416 | die "Cannot copy $config->{'ppdfile'} to $ppdfile!\n"; | |
415 | system("cp -f \'$config->{'ppdfile'}\' \'$ppdfile\'") and | |
416 | die "Cannot copy \'$config->{'ppdfile'}\' to \'$ppdfile\'!\n"; | |
417 | 417 | } else { |
418 | 418 | # Compressed PPD file |
419 | system("$sysdeps->{'gzip'} -dc $config->{'ppdfile'} > " . | |
420 | "$ppdfile") and | |
421 | die "Cannot copy $config->{'ppdfile'} to $ppdfile!\n"; | |
419 | system("$sysdeps->{'gzip'} -dc " . | |
420 | "\'$config->{'ppdfile'}\' > " . | |
421 | "\'$ppdfile\'") and | |
422 | die "Cannot copy \'$config->{'ppdfile'}\' to \'$ppdfile\'!\n"; | |
422 | 423 | } |
423 | 424 | # Set default option settings and $postpipe |
424 | 425 | $db->ppdsetdefaults($ppdfile); |
425 | 426 | } elsif ($newfoomaticdata) { |
426 | 427 | # Generate the PPD file from the Foomatic database |
427 | open PPDFILE, "> $ppdfile" or die "Cannot write $ppdfile!\n"; | |
428 | open PPDFILE, "> $ppdfile" or die "Cannot write \'$ppdfile\'!\n"; | |
428 | 429 | print PPDFILE $db->getppd($config->{'shortgui'}); |
429 | 430 | close PPDFILE; |
430 | 431 | } else { |
1157 | 1158 | |
1158 | 1159 | # PPD file argument for the printer |
1159 | 1160 | if (!$rawqueue) { |
1160 | $lpadminline .= " -P \"$ppdfile\""; | |
1161 | $lpadminline .= " -P \'$ppdfile\'"; | |
1161 | 1162 | } |
1162 | 1163 | |
1163 | 1164 | # All URIs ("-c" option) have the same syntax as URIs in CUPS |
1458 | 1459 | system("$sysdeps->{'foomatic-rip'} --genrawpdq $driverfile") and |
1459 | 1460 | die "Cannot create $driverfile!\n"; |
1460 | 1461 | } else { |
1461 | system("$sysdeps->{'foomatic-rip'} --ppd $ppdfile --genpdq " . | |
1462 | system("$sysdeps->{'foomatic-rip'} --ppd \'$ppdfile\' --genpdq " . | |
1462 | 1463 | "$driverfile") and |
1463 | 1464 | die "Cannot create $driverfile!\n"; |
1464 | 1465 | } |
4145 | 4146 | # From PPD file |
4146 | 4147 | my $dat = ppdtoperl($config->{'ppdfile'}); |
4147 | 4148 | if (!defined($dat)) { |
4148 | die ("Unable to open PPD file $config->{'ppdfile'}\n"); | |
4149 | die ("Unable to open PPD file \'$config->{'ppdfile'}\'\n"); | |
4149 | 4150 | } |
4150 | 4151 | $db->{'dat'} = $dat; |
4151 | 4152 | } else { |
0 | /DB.pm/3.56.2.12/Thu Feb 24 00:17:50 2005//Tfoomatic-3_0-branch | |
0 | /DB.pm/3.56.2.13/Mon May 30 00:44:49 2005//Tfoomatic-3_0-branch | |
1 | 1 | /PPD.pm/3.0/Fri Oct 11 01:16:34 2002//Tfoomatic-3_0-branch |
2 | 2 | /UIElem.pm/3.0/Fri Oct 11 01:16:34 2002//Tfoomatic-3_0-branch |
3 | 3 | D |
14 | 14 | use POSIX; # for rounding integers |
15 | 15 | use strict; |
16 | 16 | |
17 | my $ver = '$Revision: 3.56.2.12 $ '; | |
17 | my $ver = '$Revision: 3.56.2.13 $ '; | |
18 | 18 | |
19 | 19 | # constructor for Foomatic::DB |
20 | 20 | sub new { |
550 | 550 | my $dat = ppdtoperl($ppdfile); |
551 | 551 | |
552 | 552 | if (!defined($dat)) { |
553 | die ("Unable to open PPD file $ppdfile\n"); | |
553 | die ("Unable to open PPD file \'$ppdfile\'\n"); | |
554 | 554 | } |
555 | 555 | |
556 | 556 | $this->{'dat'} = $dat; |
569 | 569 | |
570 | 570 | # Load the PPD file and send it to the parser |
571 | 571 | open PPD, ($ppdfile !~ /\.gz$/i ? "< $ppdfile" : |
572 | "$sysdeps->{'gzip'} -cd $ppdfile |") or return undef; | |
572 | "$sysdeps->{'gzip'} -cd \'$ppdfile\' |") or return undef; | |
573 | 573 | my @ppd = <PPD>; |
574 | 574 | close PPD; |
575 | 575 | return ppdfromvartoperl(\@ppd); |
1236 | 1236 | |
1237 | 1237 | # Open the PPD file |
1238 | 1238 | open PPD, ($ppdfile !~ /\.gz$/i ? "< $ppdfile" : |
1239 | "$sysdeps->{'gzip'} -cd $ppdfile |") or | |
1240 | die ("Unable to open PPD file $ppdfile\n"); | |
1239 | "$sysdeps->{'gzip'} -cd \'$ppdfile\' |") or | |
1240 | die ("Unable to open PPD file \'$ppdfile\'\n"); | |
1241 | 1241 | |
1242 | 1242 | # We don't read the "COMDATA" lines of old Foomatic 2.0.x PPD files |
1243 | 1243 | # here, because the defaults in the main PPD structure have priority. |
1307 | 1307 | |
1308 | 1308 | # Load the complete PPD file into memory but remove the postpipe |
1309 | 1309 | open PPD, ($ppdfile !~ /\.gz$/i ? "< $ppdfile" : |
1310 | "$sysdeps->{'gzip'} -cd $ppdfile |") or | |
1311 | die ("Unable to open PPD file $ppdfile\n"); | |
1310 | "$sysdeps->{'gzip'} -cd \'$ppdfile\' |") or | |
1311 | die ("Unable to open PPD file \'$ppdfile\'\n"); | |
1312 | 1312 | while (my $line = <PPD>) { |
1313 | 1313 | if ($line =~ m!^\*FoomaticRIPPostPipe:\s*\"(.*)$!) { |
1314 | 1314 | # "*FoomaticRIPPostPipe: <code>" |
1458 | 1458 | |
1459 | 1459 | # Write back the modified PPD file |
1460 | 1460 | open PPD, ($ppdfile !~ /\.gz$/i ? "> $ppdfile" : |
1461 | "| $sysdeps->{'gzip'} > $ppdfile") or | |
1462 | die ("Unable to open PPD file $ppdfile for writing\n"); | |
1461 | "| $sysdeps->{'gzip'} > \'$ppdfile\'") or | |
1462 | die ("Unable to open PPD file \'$ppdfile\' for writing\n"); | |
1463 | 1463 | print PPD $ppd; |
1464 | 1464 | close PPD; |
1465 | 1465 |