X-Git-Url: http://matita.cs.unibo.it/gitweb/?p=helm.git;a=blobdiff_plain;f=helm%2Fcgi%2Fmkindexcic.pl;fp=helm%2Fcgi%2Fmkindexcic.pl;h=0000000000000000000000000000000000000000;hp=a31f5ecfb08d2316e919fd37df760e0016c99950;hb=3ef089a4c58fbe429dd539af6215991ecbe11ee2;hpb=1c7fb836e2af4f2f3d18afd0396701f2094265ff diff --git a/helm/cgi/mkindexcic.pl b/helm/cgi/mkindexcic.pl deleted file mode 100755 index a31f5ecfb..000000000 --- a/helm/cgi/mkindexcic.pl +++ /dev/null @@ -1,113 +0,0 @@ -#!/usr/bin/perl - -# First of all, let's load HELM configuration -use Env; -my $HELM_LIB_DIR = $ENV{"HELM_LIB_DIR"}; -# this should be the only fixed constant -my $DEFAULT_HELM_LIB_DIR = "/projects/helm/on-line/local/lib/helm"; -if (defined ($HELM_LIB_DIR)) { - $HELM_LIB_PATH = $HELM_LIB_DIR."/configuration.pl"; -} else { - $HELM_LIB_PATH = $DEFAULT_HELM_LIB_DIR."/configuration.pl"; -} - -# next require defines: $helm_dir, $html_link, $dtd_dir, $uris_dbm -require $HELM_LIB_PATH; - -use URI::Escape; -use LWP::UserAgent; -use CGI; - -my $cgi = new CGI($ENV{"REQUEST_URL"}); -$uri = $cgi->param('cicuri'); -$getterURL = $cgi->param('getterURL'); -$uri =~ s/(.*)\/$/$1/; # Remove a final slash if present -$uri .= "/"; # Put a final slash -$myurl = $cgi->url(); - -$cont = ""; # modified by side-effect by &callback -my $ua = LWP::UserAgent->new; -my $request = HTTP::Request->new(GET => $getterURL."ls?format=txt&baseuri=".$uri); -my $response = $ua->request($request, \&callback); - -@filenames = split(/\n/, $cont); - -my $uridotdot = $uri; -$uridotdot =~ s/(.*)\/.+/$1/; -if ($uri ne "cic:/") { - # Let's print the link to the parent directory - $output = < -[BACK] -Parent Directory - -EOT -} - -foreach $i (@filenames) { - my ($type,$name,$flags) = split(/, /, $i); - my ($flagscic, $flagstypes) = split(/,/, $flags); - $flagscic =~ s/^<(.*)/$1/; - $flagstypes =~ s/(.*)>$/$1/; - if ($type eq "dir") { - $output .= < -[DIR] -$name - - -EOT - } elsif ($type eq "object") { - if ($name =~ /\.(con|var|ind)$/) { - # cic file - $output .= < -[DIR] -$name - -EOT - } else { - $output .= < -[DIR] -$name - -EOT - } - } else { - $output .= < -[DIR] -$name - -EOT - } -} - -print < - - -Index of $uri - - - - -$output -
-
- - -EOT - -#================================ - -sub callback -{ - my ($data) = @_; - $cont .= $data; -}