Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/cygwin-apps/calm.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Turney <jon.turney@dronecode.org.uk>2019-05-25 19:19:48 +0300
committerJon Turney <jon.turney@dronecode.org.uk>2019-05-27 18:20:36 +0300
commit173955712e37afba9792cf0e4c14441935410539 (patch)
tree607a5486aec2caa5ff054df3547fad891f00cf5f /calm/pkg2html.py
parent734bf4ab5db8f962e73427d422f1f2ff6814e27f (diff)
Redirect directory index of package file lists to package summary page
This needs to use RedirectMatch with an exact match, as we don't want to redirect other URLs which have this directory URL as a prefix. Also use 'ForceType' rather than 'AddType' for an incomplete list of extensions.
Diffstat (limited to 'calm/pkg2html.py')
-rwxr-xr-xcalm/pkg2html.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/calm/pkg2html.py b/calm/pkg2html.py
index e753b3a..65f3d22 100755
--- a/calm/pkg2html.py
+++ b/calm/pkg2html.py
@@ -306,15 +306,16 @@ def write_arch_listing(args, packages, arch):
logging.debug('writing %s' % htaccess)
if not args.dryrun or args.force:
with open(htaccess, 'w') as f:
-
- print(textwrap.dedent('''\
- Options Indexes
- IndexOptions -FancyIndexing
- AddType text/html 1 2 3 4 5 6 7 8 9'''),
+ # We used to allow access to the directory listing as a
+ # crude way of listing the versions of the package available
+ # for which file lists were available. Redirect that index
+ # page to the summary page, which now has that information
+ # (and more).
+ print('RedirectMatch temp /packages/%s/%s/$ /packages/summary/%s.html' % (arch, p, p),
file=f)
- # XXX: omitting 0 here doesn't make much sense. and this
- # doesn't help for src packages, so is it actually having
- # any effect?
+
+ # listing files don't have the extension, but are html
+ print('ForceType text/html', file=f)
# this file should exist, so remove from the toremove list
if htaccess in toremove: