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/install.sh
ViewVC logotype

Diff of /config/trunk/install.sh

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

revision 1038, Mon Jan 28 00:18:03 2002 UTC revision 1047, Tue Jan 29 21:31:50 2002 UTC
# Line 69  Line 69 
69  LIBMOVESCRIPT=$ROOT/libmove     # a temporary script  LIBMOVESCRIPT=$ROOT/libmove     # a temporary script
70  LOCALPATHCONFIG=$INSTALLDIR/pathconfig # a temporary pathconfig file  LOCALPATHCONFIG=$INSTALLDIR/pathconfig # a temporary pathconfig file
71    
 URLGETTER=unknown  
   
72  #  #
73  # The path to the dir where ml-yacc, ml-burg, ml-lex, ml-build, and  # The path to the dir where ml-yacc, ml-burg, ml-lex, ml-build, and
74  # ml-makedepend live.  This path will be interpreted relative to $LIBDIR.  # ml-makedepend live.  This path will be interpreted relative to $LIBDIR.
# Line 167  Line 165 
165          for ext in tar.gz tgz tar.Z tz tar tar.bz2 ; do          for ext in tar.gz tgz tar.Z tz tar tar.bz2 ; do
166              try=$base.$ext              try=$base.$ext
167              echo $this: Trying $try ...              echo $this: Trying $try ...
168              if $getter $3 $try $ROOT/$try ; then              if $getter $3/$try $ROOT/$try ; then
169                  fetched=yes                  fetched=yes
170                  echo $this: Fetching $try was a success.                  echo $this: Fetching $try was a success.
171                  break 2         # get out of both for-loops                  break 2         # get out of both for-loops
# Line 183  Line 181 
181      fi      fi
182  }  }
183    
184    # wrapper for wget
185  usewget() {  usewget() {
186      wget -nv -O $3 $1/$2      wget -nv -O $2 $1
187  }  }
188    
189    # wrapper for lynx
190  uselynx() {  uselynx() {
191      lynx -source $1/$2 >$3      lynx -source $1 >$2
192  }  }
193    
194    # wrapper for curl
195  usecurl() {  usecurl() {
196      curl -s $1/$2 >$3      curl -s $1 >$2
197  }  }
198    
199  testurlgetter() {  testurlgetter() {
# Line 201  Line 202 
202    
203  #  #
204  # Function to check whether wget or lynx is available.  # Function to check whether wget or lynx is available.
205  # Set URLGETTER accordingly.  # Set URLGETTER accordingly.  URLGETTER can be set externally
206    # to either 'wget' or 'curl' or 'lynx' -- in which case the
207    # corresponding command will be used (properly wrapped).  Any
208    # other external setting will be passed directly to fetchurl (without
209    # wrapping -- meaning it must take precisely two argumets: source and
210    # destination, in that order).
211  #  #
212  urlgetter() {  urlgetter() {
213      if [ "$URLGETTER" = unknown ] ; then      case ${URLGETTER:-unknown} in
214            fetchurl*)
215                ;;
216            unknown)
217                # automatically figure out which wrapper to use
218          if testurlgetter wget --help ; then          if testurlgetter wget --help ; then
219              URLGETTER="fetchurl usewget"              URLGETTER="fetchurl usewget"
220          elif testurlgetter curl --help ; then              elif testurlgetter curl -s -O file:///dev/null -o /dev/null ; then
221              URLGETTER="fetchurl usecurl"              URLGETTER="fetchurl usecurl"
222          elif testurlgetter lynx -help ; then          elif testurlgetter lynx -help ; then
223              URLGETTER="fetchurl uselynx"              URLGETTER="fetchurl uselynx"
224          else          else
225              URLGETTER="askurl"              URLGETTER="askurl"
226          fi          fi
227      fi              ;;
228            wget|curl|lynx)
229                # special getters we know how to wrap
230                URLGETTER="fetchurl use${URLGETTER}"
231                ;;
232            *)
233                # other -- must be able to work without wrapper
234                URLGETTER="fetchurl ${URLGETTER}"
235                ;;
236        esac
237  }  }
238    
239    # wrapper for tar
240  un_tar() {  un_tar() {
241      echo "$this: Un-TAR-ing $1 archive."      echo "$this: Un-TAR-ing $1 archive."
242      tar -xf $2      tar -xf $2
243  }  }
244    
245    # wrapper for zcat followed by tar
246  un_tar_Z() {  un_tar_Z() {
247      echo "$this: Un-COMPRESS-ing and un-TAR-ing $1 archive."      echo "$this: Un-COMPRESS-ing and un-TAR-ing $1 archive."
248      zcat $2 | tar -xf -      zcat $2 | tar -xf -
249  }  }
250    
251    # wrapper for gunzip followed by tar
252  un_tar_gz() {  un_tar_gz() {
253      echo "$this: Un-GZIP-ing and un-TAR-ing $1 archive."      echo "$this: Un-GZIP-ing and un-TAR-ing $1 archive."
254      gunzip -c $2 | tar -xf -      gunzip -c $2 | tar -xf -
255  }  }
256    
257    # wrapper for bunzip2 followed by tar
258  un_tar_bz2() {  un_tar_bz2() {
259      echo "$this: Un-BZIP2-ing and un-TAR-ing $1 archive."      echo "$this: Un-BZIP2-ing and un-TAR-ing $1 archive."
260      bunzip2 -c $2 | tar -xf -      bunzip2 -c $2 | tar -xf -
261  }  }
262    
263    # unarchive archive without and with version number attached
264  unarchive() {  unarchive() {
265      # $1: descriptive string, $2: archive, $3: unpacker      # $1: descriptive string, $2: archive, $3: unpacker
266      if [ -r $ROOT/$2 ] ; then      if [ -r $ROOT/$2 ] ; then
# Line 682  Line 706 
706          reglib mlrisc-tools match-compiler.cm MLRISC/Tools          reglib mlrisc-tools match-compiler.cm MLRISC/Tools
707          ;;          ;;
708        nowhere)        nowhere)
709            unpack "MLRISC Tools Library" $SRCDIR MLRISC MLRISC
710          echo standalone nowhere NoWhere . MLRISC/Tools >>$LATESTANDALONES          echo standalone nowhere NoWhere . MLRISC/Tools >>$LATESTANDALONES
711          echo nowhere $TOOLDIR >>$CM_PATHCONFIG_DEFAULT          echo nowhere $TOOLDIR >>$CM_PATHCONFIG_DEFAULT
712          ;;          ;;

Legend:
Removed from v.1038  
changed lines
  Added in v.1047

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