#!/usr/bin/perl -w # Move this script to a package later, so we do not # have multiple copies of it. use strict; my $line; my $package; my $jars; my @jars; my $jar; my $jarfile; my $directory = '/usr/share/java'; my $classpath; while ($line = <>) { chomp $line; next if ($line =~ /^\s*\#/); next if ($line =~ /^\s*$/); ($package, $jars) = $line =~ /^([^\s]+)\s+(.*)/; @jars = split(/\s+/, $jars); foreach $jar (@jars) { $jarfile = "$directory/$jar"; if (! -e $jarfile) { print STDERR "WARNING: file $jarfile not found\n"; } $classpath .= ":$jarfile" } } $classpath =~ s/^://; print "$classpath\n"; exit