file with ls)
- change the installcgi method in Makefile, now no error if no cgi is
going to be installed
cp http_getter.pl $(INSTALL_DIR)/
installcgi:
cp http_getter.pl $(INSTALL_DIR)/
installcgi:
+ for f in *.cgi; do \
+ if [ -f $$f ]; then \
+ cp -f $$f $(CGI_DIR)/; \
+ fi; \
+ done
uninstallgetter:
rm $(INSTALL_DIR)/http_getter.pl
uninstallcgi:
uninstallgetter:
rm $(INSTALL_DIR)/http_getter.pl
uninstallcgi:
- for f in *.cgi; do rm -f $(CGI_DIR)/$$f; done
+ for f in *.cgi; do \
+ rm -f $(CGI_DIR)/$$f; \
+ done
my ($uri,$localpart,$basepart,$dirname,$suffix,$flags,$key);
my (@itemz,@already_pushed_dir);
my (%objects,%dirs); # map uris to suffixes' flags
my ($uri,$localpart,$basepart,$dirname,$suffix,$flags,$key);
my (@itemz,@already_pushed_dir);
my (%objects,%dirs); # map uris to suffixes' flags
+ #my $debug=1; # for debug
print "FINDURIS, uritype: $uritype, uripattern: $uripattern, ".
print "FINDURIS, uritype: $uritype, uripattern: $uripattern, ".
+ "format: $format\n\n" if defined($debug);
if (($uritype eq "cic") or ($uritype eq "theory")) {
# get info only of one type: cic or theory
foreach (keys(%map)) { # select matching uris
$uri = $_;
if (($uritype eq "cic") or ($uritype eq "theory")) {
# get info only of one type: cic or theory
foreach (keys(%map)) { # select matching uris
$uri = $_;
- if ($uri =~ /^$uritype:$uripattern\//) {
- $localpart = $uri;
- $localpart =~ s/^$uritype:$uripattern\/(.*)/$1/;
+ if ($uri =~ /^$uritype:$uripattern(\/|$|\.)/) {
+ if ($uri =~ /^$uritype:$uripattern\//) { # directory match
+ $localpart = $uri;
+ $localpart =~ s/^$uritype:$uripattern\/(.*)/$1/;
+ } elsif ($uri =~ /^$uritype:$uripattern($|\.)/) { # file match
+ $localpart = $uri;
+ $localpart =~ s/^.*\/([^\/]*)/$1/;
+ } else {
+ die "Internal error, seems that requested match is none of ".
+ "directory match or file match";
+ }
+ print "LOCALPART: $localpart\n" if defined($debug);
if ($localpart =~ /^[^\/]*$/) { # no slash, an OBJECT
$basepart = $localpart;
if ($localpart =~ /^[^\/]*$/) { # no slash, an OBJECT
$basepart = $localpart;
- $basepart =~ s/^([^.]*\.[^.]*)(\.types)?(\.ann)?/$1/; # remove exts .types or
+ $basepart =~ s/^([^.]*\.[^.]*)(\.types)?(\.ann)?/$1/;
+ # remove exts .types or
# .types.ann
$flags = $objects{$basepart}; # get old flags
if ($localpart =~ /\.ann$/) {
# .types.ann
$flags = $objects{$basepart}; # get old flags
if ($localpart =~ /\.ann$/) {