Ticket #7 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

Add explicit support for indexes hosted under a common base uri

Reported by: robin Assigned to: robin
Priority: major Component: pypicache
Version: Keywords:
Cc:

Description (Last modified by robin)

If the index is to be hosted under /some/path/ then, with v 0.1, its necessary to make some non-obvious manual tweaks to the re-write rules. Also the --download-path and --projects-path options are ill conceived.

From the package-index-api

  1. Individual project version pages' URLs must be of the form base/projectname/version, where base is the package index's base URL.
So lets:
  • Make -U, --index-url specify the exact url that should be used to access the index, including the base/ part of the project path.
  • Remove the --projects-path option and instead use the path part of index-url when generating base/project and base/project/version hrefs.
  • Require a trailing slash on the index-url option, log an error and exit if its missing.
  • Keep the --downloads-path option, and use it when generating the index local download links.
  • use posixpath.join semantics to join the download path to the project path component of the index url. So a --download-url that specifies an absolute path (startswith('/')) will produce download urls that are relative to the site root rather than the index root.
  • Don't support generation of links to other hosts. ie, --download-path is a path and can not be a url.
  • Ensure the appropriate RewriteBase directives are incorporated into the generated apache Directory and .htaccess configurations.

Attachments

Change History

04/14/07 15:13:24 changed by robin

  • status changed from new to assigned.

04/14/07 20:32:06 changed by robin

  • status changed from assigned to new.
  • description changed.

04/14/07 20:34:58 changed by robin

(In [571]) closes #5, re #7

04/15/07 05:35:09 changed by robin

  • description changed.

04/15/07 08:29:10 changed by robin

  • status changed from new to closed.
  • resolution set to fixed.

(In [572]) closes #7

Also, everything but actualy enabling the commandline option is done to support --downloads-server-url. This change set includes the default processing where by the downloads-server-url is infered from the **site** root implied by --index-url. This makes the relation ship between downloads-path and the path component of the index-url less intuitive: A relative downloads-path is relative to the **downloads site** root if downloads-server-url is explicitly set; and otherwise it is relative to the the projects-path implied by the index-url. And an absoloute downloads-path is allways relative to the site root irrespective of whether the index host and the downloads host are different.


Add/Change #7 (Add explicit support for indexes hosted under a common base uri)




Action