Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /config/trunk/unpack
ViewVC logotype

Diff of /config/trunk/unpack

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1385, Fri Sep 19 20:55:21 2003 UTC revision 1747, Fri Jan 14 23:53:21 2005 UTC
# Line 17  Line 17 
17  CONFIGDIR=$ROOT/config  CONFIGDIR=$ROOT/config
18  SRCDIR=$ROOT/src  SRCDIR=$ROOT/src
19    
20  VERSION=`cat $CONFIGDIR/version`  VERSION=`cat "$CONFIGDIR"/version`
21  SRCARCHIVEURL=`cat $CONFIGDIR/srcarchiveurl`  . "$CONFIGDIR"/srcarchiveurl
22    
23  vsay() {  vsay() {
24      if [ x${INSTALL_DEBUG} = xtrue ] ; then      if [ x${INSTALL_DEBUG} = xtrue ] ; then
# Line 59  Line 59 
59          for ext in tgz tar.gz tar.Z tz tar tar.bz2 ; do          for ext in tgz tar.gz tar.Z tz tar tar.bz2 ; do
60              try=$base.$ext              try=$base.$ext
61              vsay $this: Trying $try ...              vsay $this: Trying $try ...
62              if $getter $3/$try $ROOT/$try ; then              if "$getter" "$3"/"$try" "$ROOT"/"$try" ; then
63                  fetched=yes                  fetched=yes
64                  vsay $this: Fetching $try was a success.                  vsay $this: Fetching $try was a success.
65                  break 2         # get out of both for-loops                  break 2         # get out of both for-loops
66              else              else
67                  rm -f $ROOT/$try                  rm -f "$ROOT"/"$try"
68              fi              fi
69          done          done
70      done      done
# Line 77  Line 77 
77    
78  # wrapper for wget  # wrapper for wget
79  usewget() {  usewget() {
80      wget -nv -O $2 $1      wget -nv -O "$2" "$1"
81  }  }
82    
83  # wrapper for lynx  # wrapper for lynx
84  uselynx() {  uselynx() {
85      lynx -source $1 >$2      lynx -source "$1" >"$2"
86  }  }
87    
88  # wrapper for curl  # wrapper for curl
89  usecurl() {  usecurl() {
90      curl -s $1 >$2      curl -s "$1" >"$2"
91  }  }
92    
93  testurlgetter() {  testurlgetter() {
# Line 133  Line 133 
133  # wrapper for tar  # wrapper for tar
134  un_tar() {  un_tar() {
135      vsay "$this: Un-TAR-ing $1 archive."      vsay "$this: Un-TAR-ing $1 archive."
136      tar -xf $2      tar -xf "$2"
137  }  }
138    
139  # wrapper for zcat followed by tar  # wrapper for zcat followed by tar
140  un_tar_Z() {  un_tar_Z() {
141      vsay "$this: Un-COMPRESS-ing and un-TAR-ing $1 archive."      vsay "$this: Un-COMPRESS-ing and un-TAR-ing $1 archive."
142      zcat $2 | tar -xf -      zcat "$2" | tar -xf -
143  }  }
144    
145  # wrapper for gunzip followed by tar  # wrapper for gunzip followed by tar
146  un_tar_gz() {  un_tar_gz() {
147      vsay "$this: Un-GZIP-ing and un-TAR-ing $1 archive."      vsay "$this: Un-GZIP-ing and un-TAR-ing $1 archive."
148      gunzip -c $2 | tar -xf -      gunzip -c "$2" | tar -xf -
149  }  }
150    
151  # wrapper for bunzip2 followed by tar  # wrapper for bunzip2 followed by tar
152  un_tar_bz2() {  un_tar_bz2() {
153      vsay "$this: Un-BZIP2-ing and un-TAR-ing $1 archive."      vsay "$this: Un-BZIP2-ing and un-TAR-ing $1 archive."
154      bunzip2 -c $2 | tar -xf -      bunzip2 -c "$2" | tar -xf -
155  }  }
156    
157  # unarchive archive without and with version number attached  # unarchive archive without and with version number attached
158  unarchive() {  unarchive() {
159      # $1: descriptive string, $2: archive, $3: unpacker      # $1: descriptive string, $2: archive, $3: unpacker
160      if [ -r $ROOT/$2 ] ; then      if [ -r "$ROOT"/"$2" ] ; then
161          $3 "$1" $ROOT/$2          "$3" "$1" "$ROOT"/"$2"
162      elif [ -r $ROOT/$VERSION-$2 ]; then      elif [ -r "$ROOT"/"$VERSION"-"$2" ]; then
163          $3 "$1" $ROOT/$VERSION-$2          $3 "$1" "$ROOT"/"$VERSION"-"$2"
164      else      else
165          return 1          return 1
166      fi      fi
# Line 180  Line 180 
180  # no archive is found locally, it invokes $URLGETTER and tries again.  # no archive is found locally, it invokes $URLGETTER and tries again.
181  # The variable $tryfetch is used to make sure this happens only once.  # The variable $tryfetch is used to make sure this happens only once.
182  fetch_n_unpack() {  fetch_n_unpack() {
183      cd $2      cd "$2"
184      if unarchive "$1" $4.tgz un_tar_gz ||      if unarchive "$1" "$4".tgz un_tar_gz ||
185         unarchive "$1" $4.tar.gz un_tar_gz ||         unarchive "$1" "$4".tar.gz un_tar_gz ||
186         unarchive "$1" $4.tar.Z un_tar_Z ||         unarchive "$1" "$4".tar.Z un_tar_Z ||
187         unarchive "$1" $4.tar un_tar ||         unarchive "$1" "$4".tar un_tar ||
188         unarchive "$1" $4.tar.bz2 un_tar_bz2 ||         unarchive "$1" "$4".tar.bz2 un_tar_bz2 ||
189         unarchive "$1" $4.tz un_tar_Z         unarchive "$1" "$4".tz un_tar_Z
190      then      then
191          : we are done          : we are done
192      elif [ $tryfetch = yes ] ; then      elif [ $tryfetch = yes ] ; then
193          urlgetter          urlgetter
194          $URLGETTER "$1" $4 $SRCARCHIVEURL          $URLGETTER "$1" "$4" "$SRCARCHIVEURL"
195          tryfetch=no          tryfetch=no
196          fetch_n_unpack "$1" "$2" "$3" "$4"          fetch_n_unpack "$1" "$2" "$3" "$4"
197      fi      fi
# Line 202  Line 202 
202  #  #
203  unpack() {  unpack() {
204      tryfetch=yes      tryfetch=yes
205      if [ -d $2/$3 ]; then      if [ -d "$2"/"$3" ]; then
206          vsay "$this: The $1 tree already exists."          vsay "$this: The $1 tree already exists."
207      else      else
208          fetch_n_unpack "$1" "$2" "$3" "$4"          fetch_n_unpack "$1" "$2" "$3" "$4"
209      fi      fi
210      if [ ! -d $2/$3 ]; then      if [ ! -d "$2"/"$3" ]; then
211          complain "$this: !!! Unable to unpack $1 archive."          echo "$this: !!! Unable to unpack $1 archive."
212            exit 1
213      fi      fi
214  }  }
215    
# Line 218  Line 219 
219    
220  for i  for i
221  do  do
222      case $i in      case "$i" in
223        runtime)        runtime)
224          unpack run-time $ROOT/src runtime runtime          unpack run-time "$ROOT"/src runtime runtime
225          ;;          ;;
226        boot.*)        boot.*)
227          unpack bootfiles $ROOT sml.$i $i          unpack bootfiles "$ROOT" sml.$i $i
228          ;;          ;;
229        src-smlnj)        compiler)
230          for src in compiler cm MLRISC smlnj-lib ml-yacc system          unpack compiler "$ROOT"/src compiler compiler
231          do          ;;
232              unpack $src $ROOT/src $src $src        cm)
233          done          unpack compiler "$ROOT"/src cm cm
234            ;;
235          system)
236            unpack compiler "$ROOT"/src system system
237          ;;          ;;
238        ml-yacc)        ml-yacc)
239          unpack ML-Yacc $ROOT/src ml-yacc ml-yacc          unpack ML-Yacc "$ROOT"/src ml-yacc ml-yacc
240          ;;          ;;
241        ml-lex)        ml-lex)
242          unpack ML-Lex $ROOT/src ml-lex ml-lex          unpack ML-Lex "$ROOT"/src ml-lex ml-lex
243          ;;          ;;
244        ml-burg)        ml-burg)
245          unpack ML-Burg $ROOT/src ml-burg ml-burg          unpack ML-Burg "$ROOT"/src ml-burg ml-burg
246          ;;          ;;
247        ml-nlffigen)        ml-nlffigen)
248          unpack ML-NLFFI-Gen $ROOT/src ml-nlffigen ml-nlffigen          unpack ML-NLFFI-Gen "$ROOT"/src ml-nlffigen ml-nlffigen
249          ;;          ;;
250        nowhere)        nowhere)
251          unpack "MLRISC Tools Library" $SRCDIR MLRISC MLRISC          unpack "MLRISC Tools Library" "$SRCDIR" MLRISC MLRISC
252          ;;          ;;
253        smlnj-lib)        smlnj-lib)
254          unpack "SML/NJ Library" $SRCDIR smlnj-lib smlnj-lib          unpack "SML/NJ Library" "$SRCDIR" smlnj-lib smlnj-lib
255          ;;          ;;
256        cml)        cml)
257          unpack CML $SRCDIR cml cml          unpack CML "$SRCDIR" cml cml
258          ;;          ;;
259        cml-lib)        cml-lib)
260          unpack CML $SRCDIR cml cml          unpack CML "$SRCDIR" cml cml
261          ;;          ;;
262        eXene)        eXene)
263          unpack EXene $SRCDIR eXene eXene          unpack EXene "$SRCDIR" eXene eXene
264          ;;          ;;
265        ckit)        ckit)
266          unpack "C-Kit" $ROOT ckit ckit          unpack "C-Kit" "$ROOT" ckit ckit
267          ;;          ;;
268        ml-nlffi-lib)        ml-nlffi-lib)
269          unpack "NLFFI Library" $SRCDIR ml-nlffi-lib ml-nlffi-lib          unpack "NLFFI Library" "$SRCDIR" ml-nlffi-lib ml-nlffi-lib
270          ;;          ;;
271        pgraph-util)        pgraph-util)
272          unpack "CM source code" $SRCDIR cm cm          unpack "CM source code" "$SRCDIR" cm cm
273          ;;          ;;
274        mlrisc)        mlrisc)
275          unpack "MLRISC Library" $SRCDIR MLRISC MLRISC          unpack "MLRISC Library" "$SRCDIR" MLRISC MLRISC
276          ;;          ;;
277        mlrisc-tools)        mlrisc-tools)
278          unpack "MLRISC Tools Library" $SRCDIR MLRISC MLRISC          unpack "MLRISC Tools Library" "$SRCDIR" MLRISC MLRISC
279            ;;
280          smlnj-c)
281            unpack "SML/NJ-C FFI" "$SRCDIR" smlnj-c smlnj-c
282            ;;
283          heap2asm)
284            unpack "Heap->ASM tool" "$SRCDIR" heap2asm heap2asm
285          ;;          ;;
286        doc)        doc)
287          echo Package doc is currently unavailable.          echo Package doc is currently unavailable.
# Line 280  Line 290 
290          # build $ROOT          # build $ROOT
291          ;;          ;;
292        *)        *)
293          complain Unknown package: ${i}.          echo Unknown package: ${i}.
294            exit 1
295          ;;          ;;
296      esac      esac
297  done  done

Legend:
Removed from v.1385  
changed lines
  Added in v.1747

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0