source: project/wiki/eggref/4/pseudo-meta-egg-info @ 36694

Last change on this file since 36694 was 36694, checked in by mario, 9 months ago

eggref/4/pseudo-meta-egg-info: file-list expects egg' in the query parameter, not egg-name'

File size: 3.7 KB
Line 
1[[tags: egg]]
2
3== Pseudo-meta-egg-info
4
5=== Description
6
7Serve automatically generated release-info and meta-files via [[spiffy]]
8for [[henrietta-cache]] from Subversion.
9
10See also [[svn-egg-author]] for another way to simplify release-info
11and meta-file management with Subversion.  If you are using another
12VCS, see the [[/releasing-your-egg|"releasing your egg"]] document.
13
14=== Requirements
15
16* [[spiffy]]
17* [[svn-client]]
18* [[intarweb]]
19* [[uri-common]]
20
21=== Documentation
22
23This is a really hacky plugin for spiffy that allows you to serve
24automatically-generated release-info files and files-list files
25(the latter of which serves as the files section of a meta-file)
26for an SVN repository.
27
28It assumes the svn repository location contains a toplevel directory
29named after the major CHICKEN release, with subdirectories matching
30the names of eggs.  Those egg directories contain a "tags" directory
31for each revision, with the revision number as its name:
32
33 /4
34   /MY-EGG
35     /tags
36       /1.0
37       /1.1
38   /ANOTHER-EGG
39     /tags
40       /0.1
41       /0.2
42       /1.0
43 /5
44   /MY-EGG
45     /tags
46       /2.0
47       /2.1
48   /SOME-NEWER-EGG
49     /tags
50       /0.1
51
52You can use it like this (assuming you have [[spiffy-uri-match]]
53installed, too):
54
55<enscript highlight="scheme">
56(use spiffy spiffy-uri-match pseudo-meta-egg-info)
57
58;; Trailing slash is mandatory here!
59;; By default this uses the Chicken repo
60(egg-repo "http://example.com/your-egg-repo/eggs/release/4/")
61
62(vhost-map `((".*"
63              . ,(uri-match/spiffy
64                  `(((/ "release-info") (GET ,release-info))
65                    ((/ "files-list")   (GET ,files-list)))))))
66(start-server)
67</enscript>
68
69This makes the release-info for the CHICKEN 4 version of egg MY-EGG, available under
70{{http://localhost:8080/release-info?egg=MY-EGG;release=4}}
71
72and the files-list for release 1.0 for the CHICKEN 5 version of MY-EGG under
73{{http://localhost:8080/files-list?egg=MY-EGG;release=1.0;release=5}}
74
75<parameter>(egg-repo [URI-STRING])</parameter>
76
77{{URI-STRING}} is a string representing the repository URI holding the
78Subversion files.  The placeholder {{{chicken-release}}} will get
79replaced with the requested major CHICKEN release.  If none was
80supplied, "4" is assumed.
81
82<procedure>(release-info CONTINUE)</procedure>
83
84This serves up the release-info file.  It assumes that
85{{current-request}} contains a request URI which contains a
86{{egg-name}} query parameter that indicates the name of the egg, and
87possibly a {{release}} query parameter that indicates the major
88release of CHICKEN for which to get the release info.
89
90<procedure>(files-list CONTINUE)</procedure>
91
92This serves up the file-list file.  It assumes that
93{{current-request}} contains a request URI which contains a
94{{chicken-release}} query parameter that indicates the major CHICKEN
95version, an {{egg}} query parameter that indicates the name of
96the egg, and an {{egg-release}} query parameter that indicates the
97release version of the egg.
98
99
100=== Changelog
101
102* 1.1 - Port to CHICKEN 5.
103* 1.0 - Add support for multiple major CHICKEN releases.
104* 0.2 - Add extra validation so that empty egg names/release numbers are caught and a nice 400/404 is returned rather than triggering a hard assertion in libsvn and crashing the entire server.  Thanks, Subversion team! :S
105* 0.1.1 - Improved error messages.
106* 0.1 - Initial release
107
108=== Author
109
110[[/users/peter-bex|Peter Bex]]
111
112=== Repository
113
114[[http://code.more-magic.net/pseudo-meta-egg-info]]
115
116=== License
117
118  All code in this egg is explicitly placed in the public domain. You may do whatever you want with it.
119
120This code can be used as a basis for generating any kind of
121pseudo-meta-egg-info stuff, for example the svn backend could be
122easily modified to read files from a directory or from any other VCS.
Note: See TracBrowser for help on using the repository browser.