Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

mod_range workin'

  • Loading branch information...
commit 4b69b01d0425cf4e0ed91b4ea95bce66445374b7 1 parent 48e9267
@erikwb erikwb authored
View
4 libcrange/index.yaml
@@ -2,6 +2,6 @@ default:
name: libcrange
summary: C version of librange
version: '1.0.1'
- requires:
- - cpan-yaml-syck
+# requires:
+# - cpan-yaml-syck
View
10 mod_range/root/etc/httpd/conf.d/mod_range.conf
@@ -8,8 +8,8 @@ RangeLogRequests On
RangeTimeToLive 3600
RangeRequestsToServe 500
-RangeLogLwes On
-RangeLwesAddr "239.11.50.2"
-RangeLwesPort 2011
-RangeLwesTimeToLive 16
-RangeLwesHostHeader "NS-Client-IP"
+#RangeLogLwes On
+#RangeLwesAddr "239.11.50.2"
+#RangeLwesPort 2011
+#RangeLwesTimeToLive 16
+#RangeLwesHostHeader "NS-Client-IP"
View
3  mod_range/scripts/build
@@ -12,6 +12,7 @@ else
fi
mkdir -p $DESTDIR/$dir
-install -o root -g root -m 0755 .libs/mod_range.so $DESTDIR/$dir
+#install -o root -g root -m 0755 .libs/mod_range.so $DESTDIR/$dir
+install -m 0755 .libs/mod_range.so $DESTDIR/$dir
View
11 perl_seco_data_range/index.yaml
@@ -2,13 +2,4 @@ default:
name: perl-seco-data-range
summary: "Perl interface to libcrange"
arch: noarch
- version: '1.1'
- requires:
- - perl-seco-getopt
-yinst:
- name: perl_seco_data_range
- summary: "Perl interface to libcrange"
- arch: noarch
- version: 0.0.4
- requires:
- - perl_seco_getopt
+ version: '1.2'
View
48 perl_seco_data_range/root/usr/bin/er
@@ -1,33 +1,36 @@
-#!/usr/local/bin/perl -w
+#!/usr/bin/perl -w
use strict;
use warnings 'all';
use Seco::Data::Range;
-use Seco::Getopt;
+use Getopt::Long;
-my $opt = Seco::Getopt->new(
- options => {
- 'e|expand' => 'Print one node per line',
- 'c|count' => 'Print the count, not the expansion',
- 'v|vip=s' => 'Use this vip',
- 'p|port=i' => 'Port to use when connecting',
- 't|timeout=i' => 'Timeout value for queries',
- },
- description => "\nUsage: $0 [options] <range>\n" .
- "If <range> is '-' then it will read the range(s)" .
- " from standard input",
-);
+my %opt = (
+ 'e|expand' => 'Print one node per line',
+ 'c|count' => 'Print the count, not the expansion',
+ 'v|vip=s' => 'Use this vip',
+ 'p|port=i' => 'Port to use when connecting',
+ 't|timeout=i' => 'Timeout value for queries',
+ 'h|help' => 'Print this help',
+ );
+my %o;
my %opts;
-$opts{server} = $opt->get('v') if ($opt->get('v'));
-$opts{timeout} = $opt->get('t') if ($opt->get('t'));
-$opts{port} = $opt->get('p') if ($opt->get('p'));
+
+usage() unless GetOptions(\%o, keys %opt);
+usage() if($o{h});
+usage() unless(scalar @ARGV);
+
+$opts{server} = $o{v} if $o{v};
+$opts{timeout} = $o{t} if $o{t};
+$opts{port} = $o{p} if $o{p};
$opts{list} = 1;
my $range = Seco::Data::Range->new ( %opts );
my $r = join(',', @ARGV);
+
my @nodes;
if ($r eq '') {
warn "WARN: No range given!\n";
@@ -45,12 +48,12 @@ else {
# capture the error from the initial expansion
my $expansion_err = $range->last_err;
-if ($opt->get('c')) {
+if ($opt{c}) {
print scalar @nodes, "\n";
}
else {
if (@nodes) {
- if ($opt->get('e')) {
+ if ($o{e}) {
print join( "\n", @nodes ), "\n";
}
else {
@@ -67,3 +70,10 @@ else {
}
exit 0;
+
+sub usage {
+ foreach my $key (keys %opt) {
+ print "$key: $opt{$key}\n";
+ }
+ die "\n"
+}
Please sign in to comment.
Something went wrong with that request. Please try again.