Changeset 12881
- Timestamp:
- 08/02/12 17:45:23 (13 years ago)
- Location:
- issm/trunk-jpl
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/externalpackages/gsl/install-android.sh
r12846 r12881 10 10 11 11 #Download from ISSM server 12 $ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/gsl-1. 15.tar.gz' 'gsl-1.15.tar.gz'12 $ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/gsl-1.' 'gsl-1.15.tar.gz' 13 13 14 14 #Untar … … 28 28 ./configure \ 29 29 --build="i386-apple-darwin10.8.0" \ 30 --host=$host_triplet\ 31 --prefix="$ISSM_DIR/externalpackages/gsl/install/" 30 --host=$host_triplet \ 31 --prefix="$ISSM_DIR/externalpackages/gsl/install/" \ 32 --disable-static 32 33 fi 33 34 -
issm/trunk-jpl/externalpackages/libtool/install.sh
r12846 r12881 6 6 7 7 #Download from ISSM server 8 $ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/libtool' 'libtool '8 $ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/libtool' 'libtool.tar.gz' 9 9 10 10 #Untar -
issm/trunk-jpl/externalpackages/triangle/install-android.sh
r12738 r12881 1 1 #!/bin/bash 2 source $ANDROID_DIR/android_aux.sh3 2 4 # use matlab? 5 matlab=0 6 7 # Some cleanup 3 #Some cleanup 8 4 rm -rf install triangle 9 5 mkdir install 10 6 11 # 7 #Download from ISSM server 12 8 $ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/triangle.zip' 'triangle.zip' 13 9 14 # 10 #Untar 15 11 cd install 16 12 cp ../triangle.zip ./ 17 13 unzip triangle.zip 18 14 19 # 20 cp ../configs/ /android/configure.make ./15 #copy new makefile 16 cp ../configs/android/configure.make ./ 21 17 cp ../makefile ./ 22 18 23 # Patch triangle.c 24 if [[ $matlab == "1" ]];then 25 patch triangle.c ../triangle.c.patch.matlab 26 else 27 patch triangle.c ../triangle.c.patch.python 28 fi 19 #Patch triangle.c 20 patch triangle.c ../triangle.c.patch 29 21 30 # 31 make -j $j22 #Compile triangle 23 make 32 24 33 # 25 #Patch triangle.h 34 26 patch triangle.h ../triangle.h.patch -
issm/trunk-jpl/scripts/DownloadExternalPackage.py
r12846 r12881 1 1 #!/usr/bin/env python 2 2 # -*- coding: ISO-8859-1 -*- 3 # 4 # TODO: Improve upon extension recognition by checking for mismatches in found targets 5 # and specified local file. 6 # 3 7 4 8 import os,sys,re … … 21 25 # End class myHTMLParser 22 26 23 pivot = sys.argv[1].rfind("/") 24 url = (sys.argv[1])[:pivot] 25 localFile=sys.argv[2] 27 # Separates the URL into a directory and the file or pattern based on the 28 # last appearance of '/'. 29 if len(sys.argv) > 1: 30 pivot = sys.argv[1].rfind("/") 31 url = (sys.argv[1])[:pivot] 32 pivot += 1 33 find = (sys.argv[1])[pivot:] 34 else: 35 print "******************************************************************************************************************************" 36 print "* Invalid input! *" 37 print "* *" 38 print "* Try: 'DownloadExternalPackage.py url [localFile]' *" 39 print "* *" 40 print "* Where 'URL' is the URL with an explicit package name or the URL followed by the truncated package name. And 'localFile' is *" 41 print "* the file name (including extension) that you would like to save as. *" 42 print "* *" 43 print "* Examples: *" 44 print "* *" 45 print "* DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/petsc-2.3.2-p3.tar.gz' 'petsc-2.3.2-p3.tar.gz' *" 46 print "* *" 47 print "* This is the old style and the safest way to download a package. *" 48 print "* *" 49 print "* DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/libtool' 'libtool.tar.gz' *" 50 print "* *" 51 print "* This is the new style. For packages like 'Libtool', which we never expect to be using multiple versions, this will *" 52 print "* download the most recent version and save it as the generic 'libtool.tar.gz'. *" 53 print "* *" 54 print "* DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/gsl-1.' 'gsl-1.15.tar.gz' *" 55 print "* *" 56 print "* This is the new style. This is a demonstration of how this script can be used to disambiguate a package name if there *" 57 print "* are more than once package matching 'gsl-'. *" 58 print "* *" 59 print "* DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/libtool' *" 60 print "* *" 61 print "* This is the new style. This will download a package with 'libtool' as a prefix and save it as its canonical name. *" 62 print "* *" 63 print "* *" 64 print "******************************************************************************************************************************" 26 65 27 pivot += 1; 28 find = (sys.argv[1])[pivot:]; 66 if len(sys.argv) > 2: 67 localFile=sys.argv[2] 68 print "Downloaded file will saved as: " + localFile 69 else: 70 localFile = None 71 print "Downloaded file will saved with the same file name." 72 73 29 74 print "Looking for " + find 75 76 # As an extra precaution, if no extension is given for a particular package 77 # such as '.../libtool', then ensure that files found are of appropriate 78 # file extensions. 79 # 80 # WARNING: The external packages directory includes executable binaries with 81 # '.exe' extensions. As such, '.exe' is an acceptable suffix, but this is 82 # inherently dangerous since this script can be used to download from any 83 # valid website. Furthermore, if an individual attempts a "man-in-the-middle" 84 # attack, then the user would be capable of downloading executables from 85 # an untrusted source. 30 86 pattern = find + "[\w.-]*(\.tar\.gz|tar\.gz2|tgz|zip|exe)?" 31 87 parser = MyHTMLParser(pattern) 32 88 89 # Creates a 'FancyURL' which allows the script to fail gracefully by catching 90 # HTTP error codes 30X and several 40X(where 'X' is a natural number). 33 91 urlObject = FancyURLopener() 34 92 obj = urlObject.open(url) 35 93 parser.feed(obj.read()) 36 94 95 # If a file pattern was used to describe the file that should be downloaded, 96 # then there is the potential for multiple file matches. Currently, the script 97 # will detect this ambiguity and print out all the matches, while informing 98 # the user that he must refine his search. 99 # 100 # TODO: Prompt the user to select from a list his/her preferred target. 37 101 if len(parser.targets) > 1: 38 102 print "Could not resolve your download due to the number of hits." … … 42 106 43 107 elif len(parser.targets) == 1: 108 print "Found: " + parser.targets[0] 44 109 url += "/" + parser.targets[0] 45 if os.path.exists(localFile): 46 print "File "+ localFile +" already exists and will not be downloaded..." 47 elif parser.targets[0] == localFile: 48 urllib.urlretrieve(url, localFile) 49 print "Found: " + parser.targets[0] 50 elif parser.matcher.match(localFile) != "None": 51 urllib.urlretrieve(url,parser.targets[0]); 52 print "Found: " + parser.targets[0] 110 111 if localFile is None: 112 if os.path.exists(parser.targets[0]): 113 print "File " + parser.targets[0] + " already exists and will not be downloaded..." 114 else: 115 urllib.urlretrieve(url, parser.targets[0]) 116 print "File saved as: " + parser.targets[0] 53 117 else: 54 urllib.urlretrieve(url, parser.targets[0]); 55 print "WARNING: the file found \'" + parser.targets[0] + "\' does not match \'" + localFile + "\'" 56 print "Ensure the downloaded version is suitable." 118 if os.path.exists(localFile): 119 print "File "+ localFile +" already exists and will not be downloaded..." 120 else: 121 if parser.targets[0] == localFile: 122 print "File found and destination match." 123 elif parser.matcher.match(localFile) != "None": 124 print "File found matches destination pattern." 125 else: 126 print "WARNING: the file found \'" + parser.targets[0] + "\' does not match \'" + localFile + "\'" 127 print "Ensure the downloaded version is suitable." 128 129 urllib.urlretrieve(url, localFile) 130 print "File saved as: " + localFile 57 131 58 132 else:
Note:
See TracChangeset
for help on using the changeset viewer.