X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=modulemanager;h=50a86a7f7cac40b993396f4e77a5dccd63160962;hb=66ecf04088b747c00e7fdf8380fbece7848018be;hp=d44ccbeb95df357049570dc61eaf665863af372a;hpb=5ac5440a44595a7d7073a311bc280274aaed449e;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/modulemanager b/modulemanager index d44ccbeb9..50a86a7f7 100755 --- a/modulemanager +++ b/modulemanager @@ -73,7 +73,7 @@ sub parse_url { } my $mod; - for (split /\n+/, $response->decoded_content) { + for (split /\n+/, $response->content) { s/^\s+//; # ignore whitespace at start next if /^#/; if (/^module (\S+) (\S+) (\S+)/) { @@ -97,7 +97,7 @@ sub parse_url { $mod->{description} = $1; } elsif (/^mask (.*)/) { $mod->{mask} = $1; - } elsif (m#^source (http://\S+)#) { + } elsif (/^source (\S+)/) { parse_url $1; } else { print "Unknown line in $src: $_\n"; @@ -254,7 +254,7 @@ sub resolve_deps { } command 'install', 'Install a third-party module', sub { - for my $mod (@ARGV) { + for my $mod (@_) { my $vers = $mod =~ s/=([-0-9.]+)// ? $1 : undef; $mod = lc $mod; unless ($modules{$mod}) { @@ -296,6 +296,7 @@ command 'list', 'List available third-party modules', sub { my $vers = join ' ', map { $_ eq $instver ? "\e[1m$_\e[m" : $_ } @vers; print "$mod ($vers) - $desc\n"; } + exit 0; }; execute_command @ARGV; @@ -333,7 +334,7 @@ for my $mod (sort keys %todo) { if ($response->is_success) { open(MF, ">src/modules/$mod.cpp") or die "\nFilesystem not writable: $!"; - print MF $response->decoded_content; + print MF $response->content; close(MF); print " - done\n"; } else {