4 SFUSER
=${SFUSER:-$USER}
17 This script performs a number of sanity checks on the current repository, and creates
18 a lightweight tag for the revision in \$PWD/release.sbcl (or does it?).
22 SFUSER: Sourceforge username. Defaults to \$USER
23 SBCL_RELEASE_DIR: Absolute path to directory containing all the build
24 artifacts. If not defined, a new build directory is created in \$PWD.
25 CCL: Path to Clozure Common Lisp, suitable as an argument to make.sh
26 CLISP: Path to CLISP, suitable as an argument to make.sh
33 usage
"No version number."
35 VERSION
="$1-rc"; shift
36 echo $VERSION | perl
-pe 'die "Invalid version number: $_\n" if !/^\d+\.\d+\.\d+-rc$/'
41 usage
"Extra command-line arguments: $@"
46 usage
"CLISP environment variable not set"
49 SBCL_RELEASE_DIR
=${SBCL_RELEASE_DIR:-$(mktemp -d $PWD/sbcl-release-dir-$(date +%Y%m%d)-XXXXXXXXX)}
50 SBCL_DIR
=$SBCL_RELEASE_DIR/sbcl-
$VERSION
51 GIT_DIR
=$PWD/release.sbcl
52 LOGFILE
=$SBCL_RELEASE_DIR/log.txt
54 if [ ! -d $SBCL_DIR ]; then
55 sbcl_directory
="$(cd "$
(dirname $0)"; pwd)"
58 echo "Checking that the tree is clean."
59 if ! [ $
(git status
--porcelain |
wc -l) = 0 ]
61 echo "There are uncommitted / unpushed changes in this checkout!"
66 ## Find the current version using git describe
67 git_describe_version
="$(git describe | grep -E '^sbcl-[0-9]\.[0-9]+\.[0-9]+' | sed -E 's/^sbcl-([0-9]\.[0-9]+\.[0-9]+)-.*$/\1/')"
71 if ! grep "^changes relative to sbcl-$git_describe_version:" NEWS
> /dev
/null
73 echo "NEWS not in correct format!"
77 ## Make draft release notes
79 if [ ! -f $SBCL_RELEASE_DIR/sbcl-
$VERSION-release-notes.txt
]; then
80 awk "BEGIN { state = 0 }
81 /^changes relative to sbcl-/ { state = 1 }
82 /^changes in sbcl-/ { state = 0 }
83 { if(state == 1) print \$0 }" < $GIT_DIR/NEWS
> $SBCL_RELEASE_DIR/sbcl-
$VERSION-release-notes.txt
88 # I'd like to use the same tag each time, but I can't convince
89 # myself that that will do the right thing when pushed, and I don't
90 # want to break all our mirrors for this.
92 # echo "Tagging as release_candidate"
93 # git tag release_candidate
95 git clone
$GIT_DIR $SBCL_DIR
98 # check self-build (without float oracle)
100 ## Build x86-64 binary for bootstrap.
102 if [ ! -d $SBCL_RELEASE_DIR/bin
]; then
103 echo "Building bootstrap x86-64 binary"
105 nice
-20 .
/make.sh
>$LOGFILE 2>&1
108 nice
-20 sh .
/run-tests.sh
>>$LOGFILE 2>&1
109 mkdir
-p $SBCL_RELEASE_DIR/bin
110 cp $SBCL_DIR/src
/runtime
/sbcl
$SBCL_RELEASE_DIR/bin
/sbcl
111 cp $SBCL_DIR/output
/sbcl.core
$SBCL_RELEASE_DIR/bin
/sbcl.core
114 ## Build x86-64 release candidate binary.
116 if [ ! -d $SBCL_RELEASE_DIR/sbcl-
$VERSION-x86-64-linux ]; then
117 echo "Building release candidate x86-64 binary"
120 nice
-20 .
/make.sh
"$SBCL_RELEASE_DIR/bin/sbcl --core $SBCL_RELEASE_DIR/bin/sbcl.core --no-userinit" >> $LOGFILE 2>&1
121 cd doc
&& sh .
/make-doc.sh
124 ln -s $SBCL_DIR $SBCL_RELEASE_DIR/sbcl-
$VERSION-x86-64-linux
125 sh
$SBCL_DIR/binary-distribution.sh sbcl-
$VERSION-x86-64-linux
126 bzip2 sbcl-
$VERSION-x86-64-linux-binary.
tar
127 sh
$SBCL_DIR/html-distribution.sh sbcl-
$VERSION
128 bzip2 sbcl-
$VERSION-documentation-html.
tar
130 mv $SBCL_DIR/obj
/from-xc obj_from-xc_sbcl
133 # check build from ccl
135 if [ -n "$CCL" ]; then
136 if [ ! -d $SBCL_RELEASE_DIR/obj_from-xc_ccl
]; then
139 nice
-20 .
/make.sh
"$CCL" >> $LOGFILE 2>&1
142 mv $SBCL_DIR/obj
/from-xc obj_from-xc_ccl
146 if [ ! -d $SBCL_RELEASE_DIR/obj_from-xc_clisp
]; then
149 nice
-20 .
/make.sh
"$CLISP" >> $LOGFILE 2>&1
152 mv $SBCL_DIR/obj
/from-xc obj_from-xc_clisp
155 # TODO: check binary-equality between ccl, clisp, sbcl objs
157 # TODO: check build from abcl, ecl
161 if [ ! -f $SBCL_RELEASE_DIR/uploaded
]; then
163 read -n 1 -p "Ok to upload? " A
; echo
164 if [ $A \
!= "y" ]; then
169 cat > $SBCL_RELEASE_DIR/sftp-batch
<<EOF
170 cd /home/frs/project/s/sb/sbcl/sbcl-rc
171 put sbcl-$VERSION-x86-64-linux-binary.tar.bz2
172 put sbcl-$VERSION-documentation-html.tar.bz2
173 put sbcl-$VERSION-release-notes.txt
175 sftp
-b $SBCL_RELEASE_DIR/sftp-batch
$SFUSER,sbcl@frs.sourceforge.net
179 # TODO: check self-crossbuild on x86, arm, ppc
182 # TODO: find Fix Committed lp bugs for NEWS frobbery