summaryrefslogtreecommitdiff
path: root/net-mgmt/net-snmp/files/patch-local:snmpconf
blob: 3b9d20968d1d624c79551ce28aba8d3ea3767045 (plain) (blame)
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
--- local/snmpconf.orig	Thu May 29 05:30:19 2003
+++ local/snmpconf	Thu May 29 05:34:45 2003
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!%%PERL%% -w
 
 #
 # A simple configuration file builder based on questions listed in
@@ -16,7 +16,7 @@
 %arrayitems=qw(question 1 validanswer 1);
 
 #defaults
-$opts{'c'} = "/usr/local/share/snmp/snmpconf-data";
+$opts{'c'} = "%%PREFIX%%/share/snmp/snmpconf-data";
 
 # read the argument string
 getopts("qadhfc:piI:r:R:g:G", \%opts);
@@ -26,7 +26,7 @@
     print "$0 [options] [FILETOCREATE...]\n";
     print "options:\n";
     print "  -f           overwrite existing files without prompting\n";
-    print "  -i           install created files into /usr/local/share/snmp.\n";
+    print "  -i           install created files into %%PREFIX%%/share/snmp.\n";
     print "  -p           install created files into $ENV{HOME}/.snmp.\n";
     print "  -I DIR       install created files into DIR.\n";
     print "  -a           Don't ask any questions, just read in current\n";
@@ -62,7 +62,7 @@
 #
 # Find existing files to possibly read in.
 #
-my @searchpath = (qw(/usr/local/share/snmp /usr/local/etc/snmp .), "$ENV{HOME}/.snmp");
+my @searchpath = (qw(%%PREFIX%%/share/snmp %%PREFIX%%/etc/snmp .), "$ENV{HOME}/.snmp");
 push @searchpath, $opts{I} if ($opts{I});
 foreach my $i (@searchpath) {
     debug("searching $i\n");
@@ -159,7 +159,7 @@
 foreach my $i (@didfiles) {
     if ($didfile{$i} ne "1") {
 	if ($opts{'i'} || $opts{'I'}) {
-	    $opts{'I'} = "/usr/local/share/snmp" if (!$opts{'I'});
+	    $opts{'I'} = "%%PREFIX%%/share/snmp" if (!$opts{'I'});
 	    system("mv $opts{'I'}/$i $opts{'I'}/$i.bak") if (-f "$opts{'I'}/$i");
 	    system("mv $didfile{$i} $opts{'I'}");
 	    Print("  $didfile{$i} installed in $opts{'I'}\n");
@@ -180,7 +180,7 @@
 }
 
 if (!$opts{'p'} && !$opts{'i'} && !$opts{'I'}) {
-    Print("\nThese files should be moved to /usr/local/share/snmp/ if you
+    Print("\nThese files should be moved to %%PREFIX%%/share/snmp/ if you
 want them used by everyone on the system.  In the future, if you add 
 the -i option to the command line I'll copy them there automatically for you.