File: perl_syntax.patch

package info (click to toggle)
mon-client 1.2.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 328 kB
  • sloc: perl: 2,381; makefile: 2
file content (64 lines) | stat: -rw-r--r-- 1,631 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
Author: Andreas Tille <tille@debian.org>
Last-Update: 2025-02-11
Description: Fix some Perl issues that make autopkgtest fail

--- a/Mon/Config.pm
+++ b/Mon/Config.pm
@@ -25,10 +25,13 @@ require Exporter;
 require 5.004;
 use strict;
 
-@ISA = qw(Exporter);
-@EXPORT_OK = qw($VERSION);
+my @ISA = qw(Exporter);
+my @EXPORT_OK = qw($VERSION);
 
-$VERSION = "1.0000";
+my $VERSION = "1.0000";
+
+use Cwd qw(getcwd);
+my $PWD = getcwd();
 
 sub new
 {
@@ -96,9 +99,10 @@ sub read
     
     else
     {
+	my $CF = $args{file};
 	if (!open (CFG, $CF))
 	{
-	    $self->{"error"} = "could not open $args{file}: $!"
+	    $self->{"error"} = "could not open $args{file}: $!";
 	    return $self->{"error"};
 	}
     }
@@ -107,7 +111,7 @@ sub read
     # buffers to hold the new un-committed config
     #
     my %new_alias = ();
-    my %new_CF = %CF;
+    my %new_CF = ();
     my %new_groups;
     my %new_watch;
 
@@ -356,7 +360,7 @@ sub read
 	    $hosts = $2;
 	    %disabled = ();
 
-	    foreach $h (grep (/^\*/, @{$groups{$curgroup}}))
+	    foreach my $h (grep (/^\*/, @{$groups{$curgroup}}))
 	    {
 		# We have to make $i = $h because $h is actually
 		# a pointer to %groups and will modify it.
--- a/Mon/Client.pm
+++ b/Mon/Client.pm
@@ -39,7 +39,7 @@ use vars grep { /^\W/ } @EXPORT_OK;
 
 $VERSION = "1.0000";
 
-my ($STAT_FAIL, $STAT_OK, $STAT_COLDSTART, $STAT_WARMSTART, $STAT_LINKDOWN,
+our ($STAT_FAIL, $STAT_OK, $STAT_COLDSTART, $STAT_WARMSTART, $STAT_LINKDOWN,
 $STAT_UNKNOWN, $STAT_TIMEOUT, $STAT_UNTESTED, $STAT_DEPEND, $STAT_WARN) = (0..9);
 
 my ($TRAP_COLDSTART, $TRAP_WARMSTART, $TRAP_LINKDOWN, $TRAP_LINKUP,