Update of /cvsroot/curl/curl-www/dl
In directory labb:/tmp/cvs-serv21256
Modified Files:
mktable.pl
Log Message:
Add type attribute to links for locally-served files
Index: mktable.pl
===================================================================
RCS file: /cvsroot/curl/curl-www/dl/mktable.pl,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- mktable.pl 25 Mar 2008 18:14:16 -0000 1.16
+++ mktable.pl 7 Apr 2008 17:55:56 -0000 1.17
@@ -121,6 +121,18 @@
'source' => 'source',
'lib', => 'libcurl');
+my %formats=( 'RPM' => 'application/x-rpm',
+ 'deb' => 'application/x-debian-package',
+ 'ipk' => 'application/octet-stream',
+ 'iso' => 'application/octet-stream',
+ 'lha' => 'application/octet-stream',
+ 'pkg' => 'application/octet-stream',
+ 'tar' => 'application/x-tar',
+ 'tar+Z' => 'application/x-compress',
+ 'tar+bz2' => 'application/x-bzip2',
+ 'tar+gz' => 'application/x-gzip',
+ 'zip' => 'application/zip');
+
my $numcpu; # for this particular OS
my $numpack; # for this particular OS
my $numflav; # for this particular OS
@@ -243,8 +255,18 @@
$fi = CGI::escapeHTML($fi);
}
}
- printf("<td class=\"col2\"><a href=\"%s\">%s</a></td>\n",
- $fi, $$per{'curl'});
+
+ my $contenttype;
+ if ($mirror) {
+ # If the file is served locally, include its content type in the link
+ $contenttype=$formats{$$per{'pack'}};
+ if ($contenttype) {
+ $contenttype = " type=\"$contenttype\"";
+ }
+ }
+
+ printf("<td class=\"col2\"><a href=\"%s\"%s>%s</a></td>\n",
+ $fi, $contenttype, $$per{'curl'});
printf("<td class=\"col3\">%s</td>\n",
show($typelong{$$per{'type'}}));
printf("<td class=\"col4\">%s</td>\n",
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.