From d27300f75ecbec289630cca8703dbc56434b083d Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Tue, 11 Feb 2014 07:05:09 -0700 Subject: [PATCH] make "pre" page just point to snapshot sites --- .../meta/new-web/download/download-pages.rkt | 9 +- .../meta/new-web/minis/all.rkt | 2 +- .../meta/new-web/minis/pre.rkt | 19 ++ .../meta/new-web/stubs/all.rkt | 2 +- .../meta/new-web/stubs/pre.rkt | 308 ------------------ .../meta/new-web/www/community.rkt | 4 +- 6 files changed, 28 insertions(+), 316 deletions(-) create mode 100644 new-racket-web/new-plt-services/meta/new-web/minis/pre.rkt delete mode 100644 new-racket-web/new-plt-services/meta/new-web/stubs/pre.rkt diff --git a/new-racket-web/new-plt-services/meta/new-web/download/download-pages.rkt b/new-racket-web/new-plt-services/meta/new-web/download/download-pages.rkt index b48328e1ff..66857d44a0 100644 --- a/new-racket-web/new-plt-services/meta/new-web/download/download-pages.rkt +++ b/new-racket-web/new-plt-services/meta/new-web/download/download-pages.rkt @@ -1,7 +1,7 @@ #lang plt-web (require "resources.rkt" "data.rkt" "installer-pages.rkt" "symlinks.rkt" plt-web/style - (prefix-in pre: "../stubs/pre.rkt")) + (prefix-in pre: "../minis/pre.rkt")) (provide render-download-page) (define (render-download-page [release current-release] [package 'racket]) @@ -35,7 +35,7 @@ @a[href: @docs]{Documentation}]} @row{@links[@license{License} all-version-pages - @pre:installers{Nightly Installers}]}))} + @pre:installers{Snapshot Builds}]}))} @columns[4 #:center? #t #:center-text? #t #:row? #t]{ @div[id: "linux_explain" style: '("font-size: 75%; display: none;" " margin-top: 1ex;")]{ @@ -142,8 +142,9 @@ @tfoot{ @tr[class: 'version-row]{ @td[align: 'center colspan: 3]{@pre:installers} - @td{@nbsp @pre:docs[#:sub 'html]{[HTML]} @; - @nbsp @pre:docs[#:sub 'pdf]{[PDF]} @nbsp}}}}}})) + @td{@; @nbsp @pre:docs[#:sub 'html]{[HTML]} @; + @; @nbsp @pre:docs[#:sub 'pdf]{[PDF]} + @nbsp}}}}}})) (define license @page[#:site download-site diff --git a/new-racket-web/new-plt-services/meta/new-web/minis/all.rkt b/new-racket-web/new-plt-services/meta/new-web/minis/all.rkt index f5c71bb862..f0f90f0257 100644 --- a/new-racket-web/new-plt-services/meta/new-web/minis/all.rkt +++ b/new-racket-web/new-plt-services/meta/new-web/minis/all.rkt @@ -1,3 +1,3 @@ #lang racket/base -(require "lists.rkt" "bugs.rkt" "drracket.rkt") +(require "lists.rkt" "bugs.rkt" "drracket.rkt" "pre.rkt") diff --git a/new-racket-web/new-plt-services/meta/new-web/minis/pre.rkt b/new-racket-web/new-plt-services/meta/new-web/minis/pre.rkt new file mode 100644 index 0000000000..a451984c6c --- /dev/null +++ b/new-racket-web/new-plt-services/meta/new-web/minis/pre.rkt @@ -0,0 +1,19 @@ +#lang plt-web +(require "../www/resources.rkt" + plt-web/style) + +(provide installers) + +(define pre-site (site "pre" + #:url "http://pre.racket-lang.org/" + #:share-from www-site)) + +(define installers + @page[#:site pre-site #:width 'full]{ + @columns[10 #:center? #t #:row? #t #:center-text? #t]{ + Recent builds for various platforms are available from the + following sites: + @ul{@li{@a[href: "http://www.cs.utah.edu/plt/snapshots/"]{ + University of Utah}} + @li{@a[href: "http://plt.eecs.northwestern.edu/snapshots/"]{ + Northwestern University}}}}}) diff --git a/new-racket-web/new-plt-services/meta/new-web/stubs/all.rkt b/new-racket-web/new-plt-services/meta/new-web/stubs/all.rkt index 031033c1af..1fc95fffc1 100644 --- a/new-racket-web/new-plt-services/meta/new-web/stubs/all.rkt +++ b/new-racket-web/new-plt-services/meta/new-web/stubs/all.rkt @@ -4,7 +4,7 @@ (require "docs.rkt" ; for the doc tweaking script "planet.rkt" "blog.rkt" ; these need to be copied to the service - "pre.rkt" "git.rkt" ; / these are used on the + "git.rkt" ; / these are used on the "mailman.rkt" "dirlist.rkt" ; \ server directly "wiki.rkt" "pkgs.rkt") diff --git a/new-racket-web/new-plt-services/meta/new-web/stubs/pre.rkt b/new-racket-web/new-plt-services/meta/new-web/stubs/pre.rkt deleted file mode 100644 index 0a7b4f2ba6..0000000000 --- a/new-racket-web/new-plt-services/meta/new-web/stubs/pre.rkt +++ /dev/null @@ -1,308 +0,0 @@ -#lang plt-web - -(require "git.rkt") - -(define pre-site (site "stubs/pre" - #:url "http://pre.racket-lang.org/" - #:always-abs-url? #t)) - -(define temporary-outdated-warning - @div[style: "border: 1px dotted red; padding: 0ex 1ex"]{ - @p*{ - This page is not currently updating with new nightly builds, but it will - resume soon. - @~ - Meanwhile, recent builds for various platforms are available from the - following sites: - @ul*{@~ @a[href: "http://www.cs.utah.edu/plt/snapshots/"]{ - University of Utah} - @~ @a[href: "http://plt.eecs.northwestern.edu/snapshots/"]{ - Northwestern University}}}}) - -(define (hole tag) - @list{@|| - {{{@tag}}} - @||}) - -(define title-hole (list "Prebuilt:" (hole "TITLE"))) -(define content-hole (hole "CONTENT")) -(define version-hole - (div style: "text-align: right; font-size: small; font-style: italic;" - (hole "VERSION"))) - -(define template - ;; generic skeleton for all files that don't have a specific template below. - @page[#:site pre-site - #:window-title title-hole]{ - @temporary-outdated-warning - @content-hole - @hr - @version-hole}) - -(provide index) -(define index - @page[#:site pre-site - #:file "" #:window-title "Prebuilt materials"]{ - @temporary-outdated-warning - @p{This directory contains Racket materials that are built daily from the - development repository. See below for instructions.} - @hr - @content-hole - @hr - @p*{ - The nightly-builds page is being built every night from the current @git, - which lets you use the latest material with close to zero hassle that is - normally associated with checking out the development tree. You can - choose whether you want to use the full source tree, which means that you - will get a lot more than you get with a standard distribution, or the - installers that contain the same material as a standard distribution. - @~ - For the easiest way of getting a build, choose an installer for your - platform from the @a[href: "installers/"]{@tt{installers}} directory. - @~ - For an approach that is more suitable for scripting, you should: - @ol*{@~ start at the @a[href: "binaries/"]{@tt{binaries}} subdirectory - for your platform, - @~ download the @tt{racket-...-full.tgz} file, - @~ unpack it with GNU Tar (or something compatible to it), for - example: "@tt{tar xzf racket-...-full.tgz}".} - Note that there are many other @tt{tgz} files that contain various - subsets of the tree, for example, you can get just the documentation - part, the clean @tt{plt/src} part, the full tree before any compilation, - documentation @tt{.plt} files, or for each platform a @tt{tgz} file that - contains just native-code binary files. - @~ - It is also easy to setup a script that will automate the process of - retrieving the @tt{tgz} file, unpacking and installing it. This is - explained in more details in @script{scripts}. In addition to being - convenient for updating your tree, it can be used by an automatic job - scheduler (for example, a cron job on Unix) to make tree that is always - updated.} - @hr - @version-hole}) - -(define pre-installers - @page[#:site pre-site - #:file "pre-installers/" #:title "Nightly build pre-installers"]{ - @temporary-outdated-warning - @p{This directory contains distribution packages in tgz format. They are - later converted to the actual platform-specific - @a[href: "../installers/"]{installers}.} - @hr - @content-hole - @hr - @version-hole}) - -(provide installers) -(define installers - @page[#:site pre-site - #:file "installers/" #:title "Nightly build installers"]{ - @temporary-outdated-warning - @p{Pre-release software is built using actively developed sources. - Binaries are built nightly, and minute-by-minute changes are available - through @|git|.} - @; ---------------------------------------- - @h2{Option 1: Installer} - @content-hole - @version-hole - @table[width: "80%" align: 'center]{ - @tr{@td[valign: 'top]{Installers:} - @td{@nbsp} - @td{@dl*{@~ @b{Racket} - @~ Same as the normal distribution, containing the basic - systems and DrRacket. - @~ @b{Racket Textual} - @~ A small distribution that contains only Racket and - console applications based on it, including the Racket - web server. No docs and no GUI applications. - @~ @b{Racket Full} - @~ Contains the @i{complete} Racket tree from the - @git{repository}, including full documentation, full - source tree, libraries that are not completely stable, - and esoteric material.}}} - @tr{@td[colspan: 3]{ - Note: the default installation directory contains the version - number to avoid clobbering a normal installation. - @small{(Under Windows, registry names are different, too.)}}}} - @; ---------------------------------------- - @h2{Option 2: git Repository} - @p{Full source is available from the @git{repository}.} - @; ---------------------------------------- - @h2{Option 3: Other} - @p{Want Racket sources from @git but don't want to build binaries? - Want to browse a @git checkout? The - @a[href: "../"]{nightly build page} has everything you - could want.}}) - -(provide (rename-out [docs* docs])) -(define (docs* #:sub [sub #f] . text) - (if sub - (apply a href: (list (url-of docs) sub "/") (if (null? text) sub text)) - (apply docs text))) -(define docs - @page[#:site pre-site - #:file "docs/" #:title "Prebuilt documentation"]{ - @temporary-outdated-warning - @p{This directory contains documentation files in all forms, compiled from - the current sources.} - @hr - @content-hole - @hr - @version-hole}) - -(define binaries - @page[#:site pre-site - #:file "binaries/" #:title "Prebuilt binaries"]{ - @temporary-outdated-warning - @p{This directory contains a subdirectory for each supported platform.} - @hr - @content-hole - @hr - @version-hole}) - -(define script - @page[#:site pre-site - #:file "script.html" #:title "Using the nightly Racket builds"]{ - @temporary-outdated-warning - @(define (url . s) @list{http://pre.racket-lang.org/@s}) - @(define (pre* . text) (apply pre style: "margin-left: 2em;" text)) - @p*{ - Using the nightly builds to get the latest version is very simple, and - does not require git. If you use the @a[href: "installers"]{installers} - directory, then things are as simple as they are with a normal Racket - distribution – the only slight difference is that by default the - directory name contains the version number, so it does not clobber an - official installation (this also works on Windows, where the registry - keys are separate for each nightly version). - @~ - But there is a lot of material in here that might fit better a script - that updates a Racket tree automatically. For this, the only tools you - will need are GNU tar, a utility to fetch files from the web, and some - scripting facility. For example, assuming that your @tt{racket} - directory is in "@tt{$BASE}", retrieving the latest source tree is as - simple as: - @pre*{ - cd $BASE - wget @url{racket-src.tgz} -O - | tar xzf -} - or with @tt{curl}: - @pre*{ - cd $BASE - curl @url{racket-src.tgz} | tar xzf -} - @~ - This will fetch and unpack the full @tt{racket} source tree at the - current directory, on top of any @tt{racket} directory that might happen - to be there. Since it probably doesn't make sense to have older binaries - and newer source files, it is a good idea to remove any previous tree (if - any): - @pre*{ - cd $BASE - rm -rf racket - curl @url{racket-clean-tree.tgz} | tar xzf -} - @~ - This is possible with any of the subsets that are packed as tgz files. - For example, to update just the binaries for OS X (over an existing - @tt{racket} tree): - @pre*{ - cd $BASE - wget @url{binaries/i386-osx-mac/racket-i386-osx-mac-binaries.tgz} -O - \ - || tar xzf -} - To get a fully built tree for Windows: - @pre*{ - cd $BASE - rm -rf racket - wget @url{binaries/i386-win32/racket-i386-win32-full.tgz} -O - \ - || tar xzf - - cd racket} - Note that there is no “install” step: the archive contains a ready-to-run - tree. - @~ - Finally, there is a @tt{stamp} file in the nightly build directory that - can be used for scripts that periodically poll for new builds. This file - is updated last in the build process, so if a build fails it will stay - the same and not fool you into getting the same build. To demonstrate - using this, here is an @tt{sh} script that compares a local copy of the - @tt{stamp} file to the one on the web, and if there is any difference, - retrieves and installs the new full Windows build (assuming it is in my - home directory): - @pre*{ - #!/bin/sh - cd - URL="@url{}" - touch stamp # make sure that it is there - if ! curl -s $URL/stamp | diff -q stamp - >/dev/null 2>&1; then - curl -s $URL/stamp > stamp # remember the new stamp - #---------- - rm -rf racket - wget $URL/binaries/i386-win32/racket-i386-win32-full.tgz -O - @; - | tar xzf - - #---------- - fi} - The marked part of this script can be replaced by any of the options - mentioned above, for other platforms or something other than retrieving a - full build. - @~ - This script will retrieve and install a new build only when one is ready. - It is suitable for running periodically via a crontab entry. For - example, save it in @tt{~/bin/update-full-racket}, run @tt{crontab -e} to - edit your @tt{crontab} entries, and add a line that looks like this: - @pre*{13 */6 * * * ~/bin/update-full-racket} - This will run the script on the 13th minute of every sixth hour. It is - harmless to run it every hour, but there's no real need for it. - Currently, the nightly build process starts at 3:50am (EDT) and lasts for - about two hours, but every once in a while there would be additional - builds (eg, after a minor version change).} - @h3{A note about defensive scripting:} - @p{Writing scripts that work for you is easy. Making them robust enough to - be usable by others or by site-wide setups can be a delicate job — you - have to plan for bad @tt{PATH} setting (for example, a cron job is - started in a pretty much bare environment), errors that happen in one - command etc. The following is just like the above script, modified to - be more robust in the following way: - @ol*{@~ The @tt{PATH} environment variable is explicitly set. - @~ Use variable definitions to make customization easy. - @~ Usages of @tt{$URL} and others are quoted in case they will ever - contain spaces. - @~ If we fail to retrieve a file, we quit the script. - @~ Use a temporary directory to retrieve the tree, and then move it - to its real place (so if it fails we don't end up with no - @tt{racket}) through renaming (if we delete @tt{racket} and then - rename the new one, we might fail halfway into the deletion). - @~ Also, there might be some binary process running from an old - file which might prevent removing the directory, so failure to - remove the old tree does not abort the script. - @~ The new stamp is remembered only if everything succeeded.}} - @hr - @pre*{ - #!/bin/sh - PATH="/bin:/usr/bin" - # where is our racket tree placed? - MAINDIR="$HOME" - # where should the local stamp file copy be stored? - STAMP="$MAINDIR/stamp" - # where is the online stuff? - URL="@url{}" - cd "$MAINDIR" - touch "$STAMP" # make sure that it is there - curl -s "$URL/stamp" > "$STAMP-new" - if diff -q "$STAMP" "$STAMP-new" >/dev/null 2>&1; then - # nothing changed - rm "$STAMP-new" - else - #---------- - mkdir "$MAINDIR/racket-temp-$$" - cd "$MAINDIR/racket-temp-$$" - wget "$URL/binaries/i386-win32/racket-i386-win32-full.tgz" -O - \ - | tar xzf - \ - || exit 1 - cd "$MAINDIR" - if [ -e "racket" ]; then mv "racket" "racket-temp-$$/racket-old"; fi \ - && mv "racket-temp-$$/racket" . \ - || exit 1 - rm -rf "racket-temp-$$" - #---------- - cd "$MAINDIR" - rm "$STAMP" # remember the new stamp only if no failure so far - mv "$STAMP-new" "$STAMP" - fi - } - @hr}) diff --git a/new-racket-web/new-plt-services/meta/new-web/www/community.rkt b/new-racket-web/new-plt-services/meta/new-web/www/community.rkt index 94b5a88fb1..e7b37ceb08 100644 --- a/new-racket-web/new-plt-services/meta/new-web/www/community.rkt +++ b/new-racket-web/new-plt-services/meta/new-web/www/community.rkt @@ -4,7 +4,7 @@ "resources.rkt" "people.rkt" "irc.rkt" "../minis/lists.rkt" "../minis/bugs.rkt" "../stubs/blog.rkt" "../stubs/git.rkt" - (prefix-in pre: "../stubs/pre.rkt")) + (prefix-in pre: "../minis/pre.rkt")) (provide community) (define community @@ -31,7 +31,7 @@ @parlist[@strong{Development} @text{@git (also available on @a[href: "http://github.com/plt/racket/"]{GitHub}).} - @text{@pre:installers and @pre:index{more}.} + @text{@pre:installers{Snapshot} — daily builds.} @text{@bug-reports — create and query existing reports.}] @parlist[@strong{Support} @text{