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 1485, Tue May 11 16:36:07 2004 UTC revision 1923, Thu Apr 20 15:28:53 2006 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          echo "$this: !!! Unable to unpack $1 archive."          echo "$this: !!! Unable to unpack $1 archive."
212          exit 1          exit 1
213      fi      fi
# Line 219  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        compiler)        compiler)
230          unpack compiler $ROOT/src compiler compiler          unpack compiler "$ROOT"/src compiler compiler
231          ;;          ;;
232        cm)        cm)
233          unpack compiler $ROOT/src cm cm          unpack compiler "$ROOT"/src cm cm
234          ;;          ;;
235        system)        system)
236          unpack compiler $ROOT/src system system          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          lexgen)
245            unpack LexGen "$ROOT"/src lexgen lexgen
246          ;;          ;;
247        ml-burg)        ml-burg)
248          unpack ML-Burg $ROOT/src ml-burg ml-burg          unpack ML-Burg "$ROOT"/src ml-burg ml-burg
249          ;;          ;;
250        ml-nlffigen)        ml-nlffigen)
251          unpack ML-NLFFI-Gen $ROOT/src ml-nlffigen ml-nlffigen          unpack ML-NLFFI-Gen "$ROOT"/src ml-nlffigen ml-nlffigen
252          ;;          ;;
253        nowhere)        nowhere)
254          unpack "MLRISC Tools Library" $SRCDIR MLRISC MLRISC          unpack "MLRISC Tools Library" "$SRCDIR" MLRISC MLRISC
255          ;;          ;;
256        smlnj-lib)        smlnj-lib)
257          unpack "SML/NJ Library" $SRCDIR smlnj-lib smlnj-lib          unpack "SML/NJ Library" "$SRCDIR" smlnj-lib smlnj-lib
258          ;;          ;;
259        cml)        cml)
260          unpack CML $SRCDIR cml cml          unpack CML "$SRCDIR" cml cml
261          ;;          ;;
262        cml-lib)        cml-lib)
263          unpack CML $SRCDIR cml cml          unpack CML "$SRCDIR" cml cml
264          ;;          ;;
265        eXene)        eXene)
266          unpack EXene $SRCDIR eXene eXene          unpack EXene "$SRCDIR" eXene eXene
267          ;;          ;;
268        ckit)        ckit)
269          unpack "C-Kit" $ROOT ckit ckit          unpack "C-Kit" "$ROOT" ckit ckit
270          ;;          ;;
271        ml-nlffi-lib)        ml-nlffi-lib)
272          unpack "NLFFI Library" $SRCDIR ml-nlffi-lib ml-nlffi-lib          unpack "NLFFI Library" "$SRCDIR" ml-nlffi-lib ml-nlffi-lib
273          ;;          ;;
274        pgraph-util)        pgraph-util)
275          unpack "CM source code" $SRCDIR cm cm          unpack "CM source code" "$SRCDIR" cm cm
276          ;;          ;;
277        mlrisc)        mlrisc)
278          unpack "MLRISC Library" $SRCDIR MLRISC MLRISC          unpack "MLRISC Library" "$SRCDIR" MLRISC MLRISC
279          ;;          ;;
280        mlrisc-tools)        mlrisc-tools)
281          unpack "MLRISC Tools Library" $SRCDIR MLRISC MLRISC          unpack "MLRISC Tools Library" "$SRCDIR" MLRISC MLRISC
282          ;;          ;;
283        smlnj-c)        smlnj-c)
284          unpack "SML/NJ-C FFI" $SRCDIR smlnj-c smlnj-c          unpack "SML/NJ-C FFI" "$SRCDIR" smlnj-c smlnj-c
285            ;;
286          heap2asm)
287            unpack "Heap->ASM tool" "$SRCDIR" heap2asm heap2asm
288            ;;
289          tools)
290            unpack "debugging tools" "$SRCDIR" tools tools
291          ;;          ;;
292        doc)        doc)
293          echo Package doc is currently unavailable.          echo Package doc is currently unavailable.

Legend:
Removed from v.1485  
changed lines
  Added in v.1923

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