pkgsrc-wip/drweb/patches/patch-aa
Mike M. Volokhov 4d857cd924 Remake of installation procedure. Most major changes are:
- Support of FreeBSD, NetBSD, and Linux (glibc 2.3)
- New multiplatform RCD_SCRIPTS installation (see wip/oshavercd.mk)
- Various minor fixes in runtime config (cfg files, updater) and cleanups
- More friendly to use by other software (in future)
- Bump pkg revision number to 1
2003-09-11 15:20:28 +00:00

52 lines
1.6 KiB
Text

$NetBSD: patch-aa,v 1.2 2003/09/11 15:20:28 bubuchka Exp $
--- install/opt/drweb/update/update.pl.orig 2003-01-06 20:03:01.000000000 +0200
+++ install/opt/drweb/update/update.pl
@@ -1,4 +1,4 @@
-#! /usr/bin/perl
+#!@PERL5@ -w
#------------------------------------------------------------------------------
# drwebd update script, version 1.01
#------------------------------------------------------------------------------
@@ -18,7 +18,7 @@ my $TEMP = "/tmp";
my $system = '';
$system = "linux" if( $^O =~ /Linux/i );
-$system = "freebsd4" if( $^O =~ /FreeBSD/i );
+$system = "freebsd4" if( $^O =~ /FreeBSD|NetBSD/i );
$system = "solaris" if( $^O =~ /Solaris/i );
die "Unsupported OS!\n" unless $system;
@@ -33,9 +33,9 @@ my @urls =
);
my $ini = $ARGV[0];
-if( $ini eq '' )
+unless (defined($ini))
{
- $ini = "/etc/drweb/drweb32.ini";
+ $ini = "@PKG_SYSCONFDIR@/drweb32.ini";
}
my $fetch = `which fetch 2>&1`;
@@ -72,7 +72,7 @@ my $pidFile = '';
die "Bases path is not defined!" unless $bases;
die "Update path is not defined!" unless $update;
- $pidFile = "/var/drweb/run/drwebd.pid" if( $pidFile eq '' );
+ $pidFile = "@DRW_PIDFILE@" if( $pidFile eq '' );
my $version = readVersion( $engine );
die "Engine version error (invalid engine?)" unless $version;
@@ -157,8 +157,10 @@ my %Paths;
$updated++;
}
- if( $updated > 0 )
+ if( $updated > 0 && -f "$pidFile" )
{
+ # There is no error, if pid isn't existent - in this case
+ # daemon isn't running, but scanner may be updated as well.
open( FH, "$pidFile" ) || die "Can not open $pidFile: $!\n";
my $pid = <FH>;
close( FH );