1 |
darkside 09/10/29 02:26:39 |
2 |
|
3 |
Added: 0001-Add-rsync-monitoring-support-to-mirmon.patch |
4 |
0002-Add-ipv6-monitor-support-to-mirmon.patch |
5 |
Log: |
6 |
Revbump to add patches for rsync and ipv6 support, Gentoo bug 289942 & 289943 |
7 |
(Portage version: 2.1.6.13/cvs/Linux x86_64) |
8 |
|
9 |
Revision Changes Path |
10 |
1.1 net-analyzer/mirmon/files/0001-Add-rsync-monitoring-support-to-mirmon.patch |
11 |
|
12 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-analyzer/mirmon/files/0001-Add-rsync-monitoring-support-to-mirmon.patch?rev=1.1&view=markup |
13 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-analyzer/mirmon/files/0001-Add-rsync-monitoring-support-to-mirmon.patch?rev=1.1&content-type=text/plain |
14 |
|
15 |
Index: 0001-Add-rsync-monitoring-support-to-mirmon.patch |
16 |
=================================================================== |
17 |
https://bugs.gentoo.org/show_bug.cgi?id=289942 |
18 |
|
19 |
From d91f1f17be33dfc5ed771829639791b5463417a2 Mon Sep 17 00:00:00 2001 |
20 |
From: Jeremy Olexa <darkside@g.o> |
21 |
Date: Wed, 28 Oct 2009 20:58:45 -0500 |
22 |
Subject: [PATCH 1/2] Add rsync monitoring support to mirmon. |
23 |
|
24 |
You will also need to modify mirmon.conf to use probe-mirmon instead |
25 |
Original patch located at: http://www.tug.org/texlive/mirmon/probe-mirmon |
26 |
--- |
27 |
mirmon | 2 +- |
28 |
probe-mirmon | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ |
29 |
2 files changed, 51 insertions(+), 1 deletions(-) |
30 |
create mode 100644 probe-mirmon |
31 |
|
32 |
diff --git a/mirmon b/mirmon |
33 |
index a1261f5..6c0aaa8 100755 |
34 |
--- a/mirmon |
35 |
+++ b/mirmon |
36 |
@@ -384,7 +384,7 @@ sub get_ccs |
37 |
sub type_site |
38 |
{ my $url = shift ; |
39 |
my ( $type, $site, $home ) ; |
40 |
- if ( $url =~ m!^(ftp|http)://([^/:]+)(:\d+)?/! ) |
41 |
+ if ( $url =~ m!^(ftp|https?|rsync)://([^/:]+)(:\d+)?/! ) |
42 |
{ $type = $1 ; $site = $2 ; $home = $& ; } |
43 |
return $type, $site, $home ; |
44 |
} |
45 |
diff --git a/probe-mirmon b/probe-mirmon |
46 |
new file mode 100644 |
47 |
index 0000000..a7fe513 |
48 |
--- /dev/null |
49 |
+++ b/probe-mirmon |
50 |
@@ -0,0 +1,50 @@ |
51 |
+#!/usr/bin/env perl |
52 |
+# $Id: 0001-Add-rsync-monitoring-support-to-mirmon.patch,v 1.1 2009/10/29 02:26:38 darkside Exp $ |
53 |
+# public domain. Originally written by Karl Berry, 2009. |
54 |
+# |
55 |
+# Probe rsync url's for mirmon; use wget for anything else. |
56 |
+# From description at http://people.cs.uu.nl/henkp/mirmon. |
57 |
+# |
58 |
+# Also requires a patch to mirmon itself to accept rsync urls |
59 |
+# (and I wanted https too): |
60 |
+# --- /usr/local/share/mirmon/ORIG/mirmon 2007-08-18 18:05:47.000000000 +0200 |
61 |
+# +++ /usr/local/share/mirmon/mirmon 2009-07-03 22:38:00.000000000 +0200 |
62 |
+# @@ -386,3 +386,3 @@ |
63 |
+# my ( $type, $site, $home ) ; |
64 |
+# - if ( $url =~ m!^(ftp|http)://([^/:]+)(:\d+)?/! ) |
65 |
+# + if ( $url =~ m!^(ftp|https?|rsync)://([^/:]+)(:\d+)?/! ) |
66 |
+# { $type = $1 ; $site = $2 ; $home = $& ; } |
67 |
+ |
68 |
+exit (&main ()); |
69 |
+ |
70 |
+sub main |
71 |
+{ |
72 |
+ my ($timeout,$url) = @ARGV; |
73 |
+ my $ret; |
74 |
+ |
75 |
+ if ($url =~ m,^rsync://,) { |
76 |
+ $ret = &handle_rsync ($timeout, $url); |
77 |
+ } else { |
78 |
+ $ret = system qq(wget -q -O - -t 1 -T $timeout $url); |
79 |
+ } |
80 |
+ return $ret; |
81 |
+} |
82 |
+ |
83 |
+ |
84 |
+sub handle_rsync |
85 |
+{ |
86 |
+ my ($timeout,$url) = @_; |
87 |
+ |
88 |
+ my $tmpdir = "rsync-tmp"; |
89 |
+ -d $tmpdir || mkdir ($tmpdir, 0700); |
90 |
+ |
91 |
+ (my $file = $url) =~ s/\W/_/g; # translate all non-letters to _ |
92 |
+ my $local = "$tmpdir/$file"; |
93 |
+ my $ret = system |
94 |
+ qq(/usr/local/bin/rsync --no-motd --timeout $timeout $url $local); |
95 |
+ |
96 |
+ @ARGV = ($local); # don't care about our args any more. |
97 |
+ print <>; # let perl autoprint |
98 |
+ |
99 |
+ return $ret; |
100 |
+} |
101 |
-- |
102 |
1.6.4.4 |
103 |
|
104 |
|
105 |
|
106 |
|
107 |
1.1 net-analyzer/mirmon/files/0002-Add-ipv6-monitor-support-to-mirmon.patch |
108 |
|
109 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-analyzer/mirmon/files/0002-Add-ipv6-monitor-support-to-mirmon.patch?rev=1.1&view=markup |
110 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-analyzer/mirmon/files/0002-Add-ipv6-monitor-support-to-mirmon.patch?rev=1.1&content-type=text/plain |
111 |
|
112 |
Index: 0002-Add-ipv6-monitor-support-to-mirmon.patch |
113 |
=================================================================== |
114 |
https://bugs.gentoo.org/show_bug.cgi?id=289943 |
115 |
|
116 |
From ab302148275a973c3fccd164fa1ae4b4c4409d21 Mon Sep 17 00:00:00 2001 |
117 |
From: Jeremy Olexa <darkside@g.o> |
118 |
Date: Wed, 28 Oct 2009 21:04:39 -0500 |
119 |
Subject: [PATCH 2/2] Add ipv6 monitor support to mirmon |
120 |
|
121 |
This patch will overload the gethost() function provided by perl in such a way |
122 |
that it uses gethostbyname2() from Socket6, which is a new dependency. |
123 |
|
124 |
Original patch by: Kent Fredric |
125 |
--- |
126 |
mirmon | 12 +++++++++++- |
127 |
1 files changed, 11 insertions(+), 1 deletions(-) |
128 |
|
129 |
diff --git a/mirmon b/mirmon |
130 |
index 6c0aaa8..50d40ca 100755 |
131 |
--- a/mirmon |
132 |
+++ b/mirmon |
133 |
@@ -30,7 +30,17 @@ my $VER = '$Id: 0002-Add-ipv6-monitor-support-to-mirmon.patch,v 1.1 2009/10/29 02:26:38 darkside Exp $' ; |
134 |
use strict ; |
135 |
use IO::Pipe ; |
136 |
use IO::Select ; |
137 |
-use Net::hostent ; |
138 |
+ |
139 |
+use Socket; |
140 |
+use Socket6; |
141 |
+use Data::Dumper qw( Dumper ); |
142 |
+ |
143 |
+sub gethost($){ |
144 |
+ my $url = shift; |
145 |
+ return 1 if gethostbyname2 $url, AF_INET; |
146 |
+ return 1 if gethostbyname2 $url, AF_INET6; |
147 |
+ return 0; |
148 |
+} |
149 |
|
150 |
my $DEF_CNF = "/etc/$PRG.conf" ; |
151 |
|
152 |
-- |
153 |
1.6.4.4 |