From fdcc87a14da1094d8c83952161727116748b1949 Mon Sep 17 00:00:00 2001 From: Eli Barzilay Date: Tue, 13 Jul 2010 16:18:16 -0400 Subject: [PATCH] pre pages should be working now. * Remove all uses iplt from svn, replaced with a new iplt repository in git. * The previous approach to patching pre html files wasn't robust enough, in case of a problem in the web page build things could be left with the raw html pages. Replace that with a better solution, which generates the web pages earlier and then uses them to patch the html files. * Add the drracket.org redirection page to the distribution list. * Fix a small bug in the git intro page css. --- collects/meta/build/build | 217 +++++++++----------- collects/meta/build/patch-html | 93 --------- collects/meta/web/config.rkt | 4 +- collects/meta/web/stubs/git.rkt | 2 +- collects/meta/web/stubs/pre.rkt | 350 ++++++++++++++++---------------- 5 files changed, 280 insertions(+), 386 deletions(-) delete mode 100755 collects/meta/build/patch-html diff --git a/collects/meta/build/build b/collects/meta/build/build index 233252947d..d154699582 100755 --- a/collects/meta/build/build +++ b/collects/meta/build/build @@ -18,7 +18,7 @@ verbose="yes" scriptlog="yes" # should we make binaries? make_bins="ask_or_yes" -# should we do a repository update (and start with an empty iplt dir)? +# should we do a repository update? make_repo="ask_or_yes" # should we make the pdf docs directory? make_pdf_docs="ask_or_yes" @@ -28,9 +28,11 @@ make_builddirs="ask_or_yes" make_bundles="ask_or_yes" # should we make platform-specific installers? make_installers="ask_or_yes" -# should we make stuff available on the web page? -# (for major distributions, it will be in html/NNN instead of html/) +# should we build all web pages (and distribute unless it's a release) make_web="ask_or_yes" +# should we make prebuilt stuff available on the web page? +# (for major distributions, it will be in html/NNN instead of html/) +make_pre_web="ask_or_yes" # should we run all test options? (multiple configurations) run_all_tests="no" @@ -41,7 +43,7 @@ buildnotifyemail="" init_repo_vars() { # use this function to initialize these on remote builds too gitbranch="${RKTBRANCH:-master}" - svnipath="${RKTSVNIPATH:-trunk}" + gitibranch="${RKTIBRANCH:-master}" } init_repo_vars @@ -55,7 +57,7 @@ dmgmachine="kauai" nsismachine="pitcairn" # list of environment variables that should be carried over to ssh jobs -ssh_vars=(RKTBRANCH RKTSVNIPATH) +ssh_vars=(RKTBRANCH RKTIBRANCH) # Add stuff to be msetted later (when we have the `mset' function) declare -a initial_msets machines @@ -113,7 +115,7 @@ hostname="`hostname`" hostname="${hostname%%.*}" # web directory for pre-prelease stuff on $workmachine (relative to $maindir) -prewebdir="html" +prewebdir_default="html" # directory for installation (relative to $maindir) installdir="racket" # directory in racket for build-related scripts (includes this script) @@ -122,7 +124,6 @@ scriptdir="collects/meta/build" internaldir="iplt" # directories for clean repository checkouts (relative to $maindir) cleandir="checkout" -cleaninternaldir="icheckout" # directory for binaries (relative to $maindir) bindir="binaries" # directory for pre-installers (relative to $maindir) @@ -135,6 +136,8 @@ instdir="installers" docdir="docs" # directory for web content (relative to $maindir) webdir="web" +# where inside webdir do we find the pre pages template files +pretemplatedir="stubs/pre" # script for patching files with current version info versionpatcher="$scriptdir/versionpatch" # DrScheme test script @@ -142,9 +145,7 @@ drtestscript="$scriptdir/test-drracket.rkt" # bundling script bundlescript="$scriptdir/bundle" # web build script -webscript="$maindir/$internaldir/web/build.ss" -# html patching script -htmlpatchscript="$scriptdir/patch-html" +webscript="collects/meta/web/build.rkt" # sitemap materials sitemapdir="$scriptdir/sitemap" @@ -667,27 +668,6 @@ git_get() { # inputs: git repository, git branch, path in $maindir _cd "$maindir" } -svn_get() { # inputs: svn repository, svn path, path in $maindir - local repo="$1" path="$2" dir="$3"; shift 3 - show "Getting $repo/$path to $maindir/$dir" - _cd "$maindir" - if [[ ! -d "$dir" ]]; then - _run svn checkout --depth immediates \ - "http://svn.racket-lang.org/$repo" "$dir" - fi - _cd "$dir" - _run svn update --set-depth infinity "$path" - svn status "$path" > "$tmpdir/svn-st" \ - || exit_error "problems running svn status" - if [[ -s "$tmpdir/svn-st" ]]; then - cat "$tmpdir/svn-st" 1>&2 - rm -f "$tmpdir/svn-st" - exit_error "The clean directory is not clean (see above)" - fi - rm -f "$tmpdir/svn-st" - _cd "$maindir" -} - append_dots() { # inputs: width, string local line="............................................................" echo "${2}${line:0:$(( ${1} - ${#2} ))}" @@ -876,34 +856,18 @@ version_init() { # input: plthome # html functions -- all write to $htmloutput # ($htmloutput is usually $index; also, assume that $htmloutput is in the # current directory -- be careful when cd-ing!) -# stuff before html_content_begin and after html_content_end is temporary, -# later on, patch-html will combine the contents with the skeleton files. html_begin() { # inputs: title [output-name] local htmltitle="$1"; shift htmloutput="$index" if [[ "$1" != "" ]]; then htmloutput="$1"; shift; fi show "Creating \"`pwd`/$htmloutput\" for \"$htmltitle\"" - _rm "$htmloutput" - { echo "" - echo "$htmltitle" - echo "" - echo "" - echo " " - echo " " - echo "
" - echo " " - echo " " - echo "
" - echo " $htmltitle

" - while [[ "$#" -gt "0" ]]; do - if [[ "$1" = "-f" ]]; then shift; cat "$1"; else echo "$1"; fi - shift - done - } > "$htmloutput" + # the *.title. file marks this for later patching through the web templates, + # so it should be created even if it won't get used later. + _rm "$htmloutput" "$htmloutput.title." + echo "$htmltitle" > "$htmloutput.title." } -html_content_begin() { - echo '' >> "$htmloutput" +html_end() { + show "Finished \"`pwd`/$htmloutput\"" } html_table_begin() { # inputs: [rules-attr] local rules="rows" @@ -925,7 +889,8 @@ html_file_row() { # inputs: filename, explanation ... { echo_n "• " echo_n "$fname" if [[ -f "$fname" ]]; then - echo_n " (`get_first du -h \"$fname\"`)" + local size="`get_first du -h \"$fname\"`" + if [[ "$size" = *[MG] ]]; then echo_n " ($size)"; fi fi echo "" echo " $*" @@ -934,19 +899,6 @@ html_file_row() { # inputs: filename, explanation ... html_table_end() { echo "" >> "$htmloutput" } -html_content_end() { - echo '' >> "$htmloutput" -} -html_end() { - { echo "
" - echo '' - echo "(version $version, $htmltimestamp)" - echo '' - echo "
" - echo "" - } >> "$htmloutput" - show "Finished \"`pwd`/$htmloutput\"" -} run_part() { local exec=no @@ -1024,7 +976,7 @@ MAIN_BUILD() { if is_yes make_repo; then separator "Repository updates" git_get "plt" "$gitbranch" "$cleandir" - svn_get "iplt" "$svnipath" "$cleaninternaldir" + git_get "iplt" "$gitibranch" "$internaldir" else show "Skipping repository updates" fi @@ -1034,13 +986,8 @@ MAIN_BUILD() { DO_AUTO_UPDATES fi - if is_yes make_repo; then - _cd "$maindir" - _rm "$internaldir" - _cp -r "$cleaninternaldir/$svnipath" "$internaldir" - fi - if is_yes make_bins; then + _cd "$maindir" _rm "$repotgz" _cd "$maindir/$cleandir" show "Creating archive" @@ -1069,7 +1016,8 @@ MAIN_BUILD() { show "Skipping binaries" fi - # build pdfs while other machines continue doing their builds + # build web pages and pdfs while other machines continue doing their builds + BUILD_WEB BUILD_DOCS_AND_PDFS # and now wait for all builds @@ -1096,7 +1044,7 @@ MAIN_BUILD() { if is_yes make_installers; then BUILD_INSTALLERS else show "Skipping installers"; fi - if is_yes make_web; then BUILD_WEB; fi + if is_yes make_pre_web; then BUILD_PRE_WEB; fi _rm "$lockfile" @@ -1253,7 +1201,7 @@ DO_BUILD() { # inputs -- releasing flags="" if [[ "${_jit}" = "no" ]]; then flags="--no-jit $flags"; fi dont_exit _run env HOME="$testdir" DISPLAY="" \ - "$exe" $flags "$PLTHOME/collects/tests/run-automated-tests.ss" + "$exe" $flags "$PLTHOME/collects/tests/run-automated-tests.rkt" done done sleep 8 # time to flush stderr @@ -1341,7 +1289,7 @@ build_w32step() { # inputs: type, name, [args...] ;; ( "VSNET3M" ) _cd "$PLTHOME/src/worksp/$bname" _run "$VSNET" "$bname.sln" /build "Release|Win32" - _run "$PLTHOME/Racket.exe" "xform.ss" "$@" + _run "$PLTHOME/Racket.exe" "xform.rkt" "$@" _run "$VSNET" "$bname.sln" /build "3m|Win32" ;; ( * ) exit_error "Unknown type for build_w32step: \"$btype\"" ;; @@ -1387,7 +1335,7 @@ DO_WIN32_BUILD() { separator "win32: Full build" build_w32step VSNET "racket" build_w32step VSNET "gracket" - _cd "$PLTHOME/src/worksp/gc2"; build_w32step RKT "3M" make.ss + _cd "$PLTHOME/src/worksp/gc2"; build_w32step RKT "3M" make.rkt _cd "$PLTHOME" build_w32step VSNET "mzstart" @@ -1433,7 +1381,6 @@ BUILD_DOCS_AND_PDFS() { _rmcd "$maindir/$docdir" html_begin "Documentation" - html_content_begin html_table_begin { html_file_row "html" \ @@ -1454,7 +1401,6 @@ BUILD_DOCS_AND_PDFS() { show "Skipping pdf build" fi html_table_end - html_content_end html_end } @@ -1473,7 +1419,6 @@ COPY_AND_BUILD_BINARY_DIRS() { _rmcd "$maindir/$bindir" html_begin "Binaries" - html_content_begin html_show "Note that the binaries include the CGC versions." html_table_begin @@ -1491,7 +1436,6 @@ COPY_AND_BUILD_BINARY_DIRS() { _scp "${prfx}$fulltgz" "$ftgz" local extratext="`extra_description_of_platform \"$mplatform\"`" html_begin "$mplatformname binaries ($mplatform)" - html_content_begin html_show "These are the $mplatformname binary files." $extratext html_table_begin # The following two things do not exist until the bundle script runs @@ -1500,14 +1444,12 @@ COPY_AND_BUILD_BINARY_DIRS() { html_file_row "$ftgz" "An archive of the fully-built tree" \ "
(without the \"src\" tree)" html_table_end - html_content_end html_end _cd .. } done html_table_end - html_content_end html_end ## -------------------------------------------------------------------------- @@ -1887,7 +1829,6 @@ BUILD_INSTALLERS() { _rmd "$maindir/$instdir" _cd "$maindir/$preinstdir" html_begin "Pre-installers" - html_content_begin html_table_begin local tgz idx idx=0 @@ -1909,7 +1850,6 @@ BUILD_INSTALLERS() { _cd "$maindir/$preinstdir" done html_table_end - html_content_end html_end _cd "$maindir/$instdir" @@ -1918,18 +1858,14 @@ BUILD_INSTALLERS() { do_installers_page_body "$tmpdir/rkt-tmp-selector" "$tmpdir/rkt-tmp-table" # selector page html_begin "Installers" - html_content_begin html_show -f "$tmpdir/rkt-tmp-selector" - html_content_end html_end # static table page html_begin "Installers (static)" "table.html" - html_content_begin html_table_begin "all" html_show -f "$tmpdir/rkt-tmp-table" _rm "$tmpdir/rkt-tmp-selector" "$tmpdir/rkt-tmp-table" html_table_end - html_content_end html_end local f sorted1 sorted2 @@ -1973,22 +1909,46 @@ copy_from() { # input: directory file-name BUILD_WEB() { - local w="$prewebdir" + # prewebdir is set to the directory where the pre pages go (used by + # BUILD_PRE_WEB below) # cases for "hidden" results: building a major version, or a non-default path - if [[ "$reallyreleasing" = "yes" ]]; then w="$w/$version" - elif [[ "$gitbranch" != "master" ]]; then w="$w/$gitbranch" - elif [[ "$releasing" = "yes" ]]; then w="$w/$version" + prewebdir="$prewebdir_default" + if [[ "$reallyreleasing" = "yes" ]]; then prewebdir="$prewebdir/$version" + elif [[ "$gitbranch" != "master" ]]; then prewebdir="$prewebdir/$gitbranch" + elif [[ "$releasing" = "yes" ]]; then prewebdir="$prewebdir/$version" fi + # should always set prewebdir above, the rest is optional + if ! is_yes make_web; then return; fi + ## -------------------------------------------------------------------------- - if [[ "$w" = "$prewebdir" ]]; then separator "Making external web pages" - else separator "Making external web pages at $w" + _rmcd "$maindir/$webdir" + local webflags="" + webflags="$webflags -w -f -o $maindir/$webdir" + webflags="$webflags -e $maindir/$internaldir/web/main.rkt" + # distribute only if this is a normal build + if [[ "$prewebdir" = "$prewebdir_default" ]]; then + separator "Making and distributing web content" + _run "$PLTHOME/$webscript" $webflags --dist + else + separator "Making web content -- not distributing" + _run "$PLTHOME/$webscript" $webflags fi - _mcd "$maindir/$w" +} + +BUILD_PRE_WEB() { + + ## -------------------------------------------------------------------------- + if [[ "$prewebdir" = "$prewebdir_default" ]]; then + separator "Making external web pages" + else + separator "Making external web pages at $prewebdir" + fi + + _mcd "$maindir/$prewebdir" html_begin "Racket Nightly Builds" - html_content_begin html_table_begin #---- move_from_maindir "$installersdir" @@ -2030,30 +1990,55 @@ BUILD_WEB() { html_file_row "$scriptlogfile" "Full build log" #---- html_table_end - html_content_end html_end ## -------------------------------------------------------------------------- - separator "Making and installing web content" - _rmcd "$maindir/$webdir" - # distribute only if this is a normal build - if [[ "$w" = "$prewebdir" ]]; then - _run "$webscript" --dist - else - _run "$webscript" - fi + local F F2 + + # copy resources built by the web script for the pre pages + _cd "$maindir/$webdir/$pretemplatedir" + find . -type f -printf '%P\n' | \ + while read F; do + F2="$maindir/$prewebdir/$F" + if ! [[ "$F" -nt "$F2" ]]; then continue; fi + # skip files that will be patched below + if [[ -e "$F2.title." ]]; then continue; fi + _md "$maindir/$prewebdir/`dirname \"$F\"`" + _cp "$F" "$maindir/$prewebdir/$F" + done + + # patch generated html files with their templates (or the generic one) + _cd "$maindir/$prewebdir" + find . -type f -name "*.title." -printf '%P\n' | \ + while read F; do + F="${F%.title.}" + if [[ ! -e "$F" ]]; then continue; fi + show "Patching $F" + mv "$F" "$F.temp." + local htmltemplate="$maindir/$webdir/$pretemplatedir/$F" + if [[ ! -e "$htmltemplate" ]]; then + htmltemplate="$maindir/$webdir/$pretemplatedir/template.html" + fi + { if grep -q "TITLE" "$htmltemplate"; then + awk '/^{{{TITLE}}}$/{p=0};p;BEGIN{p=1}' "$htmltemplate" + cat "$F.title." + awk '/^{{{CONTENT}}}$/{p=0};p;/^{{{TITLE}}}$/{p=1}' "$htmltemplate" + else + awk '/^{{{CONTENT}}}$/{p=0};p;BEGIN{p=1}' "$htmltemplate" + fi + cat "$F.temp." + awk '/^{{{VERSION}}}$/{p=0};p;/^{{{CONTENT}}}$/{p=1}' "$htmltemplate" + echo "(version $version, $htmltimestamp)" + awk 'END{p=0};p;/^{{{VERSION}}}$/{p=1}' "$htmltemplate" + } > "$F" + rm "$F.title." "$F.temp." + done ## -------------------------------------------------------------------------- - separator "Patching up pre-release web content" - - _cd "$maindir/$w" - _run "$PLTHOME/$htmlpatchscript" "$maindir/$webdir/pre" - - ## -------------------------------------------------------------------------- - if [[ "$w" = "$prewebdir" ]]; then + if [[ "$prewebdir" = "$prewebdir_default" ]]; then separator "Creating a site-map" - _cd "$maindir/$w" + _cd "$maindir/$prewebdir" _run "$PLTHOME/$sitemapdir/sitemap_gen.py" \ --config="$PLTHOME/$sitemapdir/plt-pre.xml" \ > /dev/null diff --git a/collects/meta/build/patch-html b/collects/meta/build/patch-html deleted file mode 100755 index 2e66f63da7..0000000000 --- a/collects/meta/build/patch-html +++ /dev/null @@ -1,93 +0,0 @@ -#!/bin/sh -#| -*- mode: scheme -*- -if [ -x "$PLTHOME/bin/mzscheme" ]; then - exec "$PLTHOME/bin/mzscheme" -rm "$0" "$@" -else - exec "mzscheme" -rm "$0" "$@" -fi -|# - -(define begin-pattern #"\n") -(define end-pattern #"\n") - -(define begin-re (regexp-replace #"XXX" begin-pattern #"([^<> ]+)")) -(define end-re (regexp-replace #"XXX" end-pattern #"([^<> ]+)")) - -(define (regexp-match1 rx inp . disp?) - (cond [(if (and (pair? disp?) (car disp?)) - (regexp-match rx inp 0 #f (current-output-port)) - (regexp-match rx inp)) - => cadr] - [else #f])) - -(define (eprintf fmt . args) - (apply fprintf (current-error-port) fmt args)) - -(define (patch-file skeleton html) - (let ([skeleton (open-input-file skeleton)] - [html (open-input-file html)]) - (let loop () - (let ([begin-tag (regexp-match1 begin-re skeleton #t)]) - ;; (eprintf ">>> skeleton: ~a begin\n" begin-tag) - (if begin-tag - (let ([begin-tag* (regexp-match1 begin-re html)]) - ;; (eprintf ">>> html: ~a begin\n" begin-tag*) - (unless (equal? begin-tag begin-tag*) - (error 'patch-html - "mismatched input begin-tags, expecting ~a got ~a" - begin-tag begin-tag*)) - ;; leave tags in, so it is possible to run this script again - (display (regexp-replace #"XXX" begin-pattern begin-tag)) - (let ([end-tag (regexp-match1 end-re html #t)]) - ;; (eprintf ">>> html: ~a end\n" end-tag) - (unless (equal? end-tag begin-tag) - (error 'patch-html "bad end tag (~a) for begin tag (~a)" - end-tag begin-tag)) - (let ([end-tag* (regexp-match1 end-re skeleton)]) - ;; (eprintf ">>> skeleton: ~a end\n" end-tag*) - (unless (equal? end-tag end-tag*) - (error 'patch-html - "mismatched input end-tags, expecting ~a got ~a" - end-tag end-tag*)) - ;; leave tags in, so it is possible to run this script again - (display (regexp-replace #"XXX" end-pattern end-tag)) - (loop)))) - (cond [(regexp-match1 begin-re html) => - (lambda (tag) - (error 'patch-html - "mismatched input tags, extraneous tag in target: ~a" - tag))])))) - (close-input-port skeleton) - (close-input-port html))) - -(define (patch-dir skeleton-dir) - (printf "patching directory: ~a\n" (current-directory)) - (for-each (lambda (p) - (if (cdr p) - (begin - (unless (directory-exists? (car p)) (make-directory (car p))) - (parameterize ([current-directory (car p)]) - (patch-dir (build-path skeleton-dir (car p))))) - (let ([skeleton (build-path skeleton-dir (car p))]) - (if (file-exists? (car p)) - (let ([tmp "/tmp/patch-html-file"]) - (printf "patching file: ~a\n" - (build-path (current-directory) (car p))) - (with-output-to-file tmp - (lambda () (patch-file skeleton (car p))) - #:exists 'truncate) - (delete-file (car p)) - (copy-file tmp (car p)) - (delete-file tmp)) - (begin (printf "copying file: ~a/~a\n" - (current-directory) (car p)) - (copy-file skeleton (car p))))))) - (parameterize ([current-directory skeleton-dir]) - (map (lambda (p) - (cons p (cond [(file-exists? p) #f] - [(directory-exists? p) #t] - [else (error "internal-error")]))) - (directory-list))))) - -(define (main arg) - (patch-dir (path->complete-path arg))) diff --git a/collects/meta/web/config.rkt b/collects/meta/web/config.rkt index d95c098b34..7a0b7e8935 100644 --- a/collects/meta/web/config.rkt +++ b/collects/meta/web/config.rkt @@ -4,8 +4,8 @@ (define sites '(("www" "http://racket-lang.org/") ("download" "http://download.racket-lang.org/") - ("lists" "http://lists.racket-lang.org/") ("bugs" "http://bugs.racket-lang.org/") + ("lists" "http://lists.racket-lang.org/") ("drracket" "http://drracket.org/") ;; stubs usually use absolute paths for resources, since they're ;; templates that often get used in sub-dir pages too @@ -22,4 +22,4 @@ ;; Each is a "hostname:dest-path", and then a list of directories to ;; put in that path. (Warning: "dest" should not be a top-level ;; directory that already exists.) - '(["champlain:/www" "www" "download" "bugs" "lists" "stubs"]))) + '(["champlain:/www" "www" "download" "bugs" "lists" "drracket" "stubs"]))) diff --git a/collects/meta/web/stubs/git.rkt b/collects/meta/web/stubs/git.rkt index d50ed5c16c..f543d2256f 100644 --- a/collects/meta/web/stubs/git.rkt +++ b/collects/meta/web/stubs/git.rkt @@ -118,7 +118,7 @@ } .the_text pre { margin-left: 2em; - padding-left: 0.6em 0 0.6em 0.6em; + padding: 0.6em 0 0.6em 0.6em; } .the_text ul, .the_text ol, .the_text dl, .the_text li, .the_text dt, .the_text dd { diff --git a/collects/meta/web/stubs/pre.rkt b/collects/meta/web/stubs/pre.rkt index f551d071fe..213f45cebb 100644 --- a/collects/meta/web/stubs/pre.rkt +++ b/collects/meta/web/stubs/pre.rkt @@ -5,70 +5,72 @@ (define-context "stubs/pre") (define (hole tag) - @literal{ - - - @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 version-hole @div[align: 'right]{@small{@i{@(hole "VERSION")}}}) +(define template + ;; generic skeleton for all files that don't have a specific template below. + @page[#:window-title title-hole]{ + @content-hole + @hr + @version-hole}) (provide index) (define index - @page[#:file "" #:title "Prebuilt materials"]{ + @page[#:file "" #:window-title "Prebuilt materials"]{ @p{This directory contains Racket material that is 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.} - @p{For the easiest way of getting a build, choose an installer for your - platform from the @a[href: "installers/"]{@tt{installers}} - directory.} - @p{For an approach that is more suitable for scripting, you should: - @ol{@li{start at the @a[href: "binaries/"]{@tt{binaries}} - subdirectory for your platform,} - @li{download the @tt{racket-...-full.tgz} file,} - @li{unpack it with GNU Tar (or something compatible to it), for - example: "@tt{tar xzf plt-...-full.tgz}"} - @li{Mac OSX users need to get the - @tt{racket-ppc-osx-mac-frameworks.tgz} (or @tt{racket-i386-osx-}...) - and unpack it on top of the @tt{racket-...-full.tgz} file.} - @li{run "@tt{./install -i}" (or "@tt{install.bat}" on Windows).}} - 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.} - @p{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 @a[href: "script.html"]{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}) + @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 plt-...-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 @a[href: "script.html"]{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}) -(provide pre-installers) (define pre-installers @page[#:file "pre-installers/" #:title "Nightly build pre-installers"]{ @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}) + @hr + @content-hole + @hr + @version-hole}) (provide installers) (define installers @@ -78,8 +80,8 @@ through @|git|.} @; ---------------------------------------- @h2{Option 1: Installer} - content-hole - version-hole + @content-hole + @version-hole extra @p{@table[width: "80%" align: 'center]{ @tr{@td[valign: 'top]{Installers:} @@ -92,7 +94,7 @@ console applications based on it, including the Racket web server. No docs and no GUI applications.} @dt{@b{Racket Full}} - @dd{Contains the @i{complete} Racket tree from @|git|, + @dd{Contains the @i{complete} Racket tree from @git, including full documentation, full source tree, libraries that are not completely stable, and esoteric material.}}}} @@ -105,124 +107,124 @@ @p{Full source is available from @|git|.} @; ---------------------------------------- @h2{Option 3: Other} - @p{Want Racket sources from @|git| but don't want to build binaries? - Want to browse a @|git| checkout? The + @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 pre-docs) (define pre-docs - @page[#:file "docs/" #:title "Pre-Release documentation"]{ + @page[#:file "docs/" #:title "Prebuilt documentation"]{ @p{This directory contains documentation files in all forms, compiled from the current sources.} - @hr{} - content-hole - @hr{} - version-hole}) + @hr + @content-hole + @hr + @version-hole}) - -(provide pre-binaries) (define pre-binaries - @page[#:file "binaries/" #:title "Pre-Release binaries"]{ + @page[#:file "binaries/" #:title "Prebuilt binaries"]{ @p{This directory contains a subdirectory for each supported platform.} - @hr{} - content-hole - @hr{} - version-hole}) + @hr + @content-hole + @hr + @version-hole}) -(define (url s) (string-append "http:///pre-racket-lang.org/" s)) - -(provide pre-scripts) (define pre-scripts @page[#:file "script.html" #:title "Using the nightly Racket builds"]{ - @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).} - @p{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: - @blockquote{@pre{ - cd $BASE - wget @(url "racket-src.tgz") -O - | tar xzf -}} - or with @tt{curl}: - @blockquote{@pre{ - cd $BASE - curl @(url "racket-src.tgz") | tar xzf -}}} - @p{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): - @blockquote{@pre{ - cd $BASE - rm -rf racket - curl @(url "racket-src.tgz") | tar xzf -}}} - @p{This is possible with any of the subsets that are packed as tgz files. - For example, to update just the documentation, do this: - @blockquote{@pre{ - cd $BASE - wget @(url "docs/racket-docs.tgz") -O - | tar xzf -}} - (Note that it is not necessary to remove the previous tree for this.)} - @p{To update the binaries for Linux (over an existing @tt{racket} tree): - @blockquote{@pre{ - cd $BASE - rm -rf racket - wget @(url "binaries/i386-linux/racket-i386-linux-binaries.tgz") @; - -O - \ - || tar xzf - - cd racket}} - To get a fully built tree for Solaris: - @blockquote{@pre{ - cd $BASE - rm -rf racket - wget @(url "binaries/sparc-solaris/racket-sparc-solaris-full.tgz") @; - -O - \ - || tar xzf - - cd racket}} - Note that there is no "install" step: the archive contains a - ready-to-run tree.} - @p{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 FreeBSD build - (assuming it is in my home directory): - @blockquote{@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-freebsd/racket-i386-freebsd-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.} - @p{This script will retreive 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: - @blockquote{@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).} + @(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-src.tgz} | tar xzf -} + @~ + This is possible with any of the subsets that are packed as tgz files. + For example, to update just the documentation, do this: + @pre*{ + cd $BASE + wget @url{docs/racket-docs.tgz} -O - | tar xzf -} + (Note that it is not necessary to remove the previous tree for this.) + @~ + To update the binaries for Linux (over an existing @tt{racket} tree): + @pre*{ + cd $BASE + rm -rf racket + wget @url{binaries/i386-linux/racket-i386-linux-binaries.tgz} -O - \ + || tar xzf - + cd racket} + To get a fully built tree for Solaris: + @pre*{ + cd $BASE + rm -rf racket + wget @url{binaries/sparc-solaris/racket-sparc-solaris-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 FreeBSD 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-freebsd/racket-i386-freebsd-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 retreive 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 @@ -230,21 +232,21 @@ 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{@li{The @tt{PATH} environment variable is explicitly set.} - @li{Use variable definitions to make customization easy.} - @li{Usages of @tt{$URL} and others are quoted in case they will - ever contain spaces.} - @li{If we fail to retreive a file, we quit the script.} - @li{Use a temporary directory to retreive the tree, and then move it + @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 retreive a file, we quit the script. + @~ Use a temporary directory to retreive 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).} - @li{Also, there might be some binary process running from an old + 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.} - @li{The new stamp is remembered only if everything succeeded.}}} - @hr{} - @blockquote{@pre{ + 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? @@ -252,7 +254,7 @@ # where should the local stamp file copy be stored? STAMP="$MAINDIR/stamp" # where is the online stuff? - URL="@(url "")" + URL="@url{}" cd "$MAINDIR" touch "$STAMP" # make sure that it is there curl -s "$URL/stamp" > "$STAMP-new" @@ -276,5 +278,5 @@ rm "$STAMP" # remember the new stamp only if no failure so far mv "$STAMP-new" "$STAMP" fi - }} - @hr{}}) + } + @hr})