Ticket #21082: symlinkbug.sh

File symlinkbug.sh, 1.8 KB (added by ryandesign (Ryan Carsten Schmidt), 15 years ago)
Line 
1#!/bin/bash
2
3BASE=/tmp
4PREFIX=$BASE/mpone
5ALT_PREFIX=$BASE/mptwo
6DISTFILES_DIR=$BASE/mpdistfiles
7PORTFILES_DIR=$BASE/mpdports
8SOURCE_DIR=$BASE/mpbase
9
10if [ -z "$1" ]; then
11        REV="HEAD"
12else
13        REV="$1"
14fi
15
16ZLIB_REV=53368
17
18if [ ! -d $SOURCE_DIR ]; then
19        mkdir -p $SOURCE_DIR
20        svn co -r $REV http://svn.macosforge.org/repository/macports/trunk/base $SOURCE_DIR || exit $?
21else
22        svn up -r $REV $SOURCE_DIR || exit $?
23fi
24if [ ! -d $PORTFILES_DIR ]; then
25        mkdir -p $PORTFILES_DIR
26        svn co -r $ZLIB_REV -N http://svn.macosforge.org/repository/macports/trunk/dports $PORTFILES_DIR || exit $?
27        svn up -r $ZLIB_REV -N $PORTFILES_DIR/archivers || exit $?
28        svn up -r $ZLIB_REV $PORTFILES_DIR/archivers/zlib || exit $?
29fi
30if [ ! -d $PREFIX/var/macports/distfiles ]; then
31        mkdir -p $DISTFILES_DIR $PREFIX/var/macports
32        ln -s $DISTFILES_DIR $PREFIX/var/macports/distfiles || exit $?
33fi
34
35export PATH="/bin:/sbin:/usr/bin:/usr/sbin"
36
37export GREP_OPTIONS=""
38
39cd $SOURCE_DIR
40
41./configure \
42--prefix=$PREFIX \
43--with-tclpackage=$PREFIX/Library/Tcl \
44--with-applications-dir=$PREFIX/Applications \
45--with-frameworks-dir=$PREFIX/Library/Frameworks \
46--enable-readline || exit $?
47
48make || exit $?
49
50make install || exit $?
51
52make distclean || exit $?
53
54sed s%^rsync://rsync.macports.org/release/ports/%file://$PORTFILES_DIR% < "$PREFIX/etc/macports/sources.conf" > "$PREFIX/etc/macports/sources.conf.tmp"
55mv "$PREFIX/etc/macports/sources.conf.tmp" "$PREFIX/etc/macports/sources.conf"
56
57mv "$PREFIX" "$ALT_PREFIX" || exit $?
58ln -s "$ALT_PREFIX" "$PREFIX" || exit $?
59
60"$PREFIX/bin/port" install zlib
61"$PREFIX/bin/port" -d deactivate zlib
62
63EXIT=0
64if [ -d "$PREFIX" ]; then
65        echo "Bug absent in base rev $REV: $PREFIX exists"
66else
67        echo "Bug present in base rev $REV: $PREFIX is gone"
68        EXIT=1
69fi
70
71rm -rf "$PREFIX" "$ALT_PREFIX"
72
73exit $EXIT
74