Accept 'ISO' or 'boot' in file *.iso command output

Fixes #372
This commit is contained in:
Bob Lantz
2014-09-04 06:50:54 -07:00
parent b85943dc0a
commit f2458d1dcf
+4 -1
View File
@@ -192,7 +192,10 @@ def findiso( flavor ):
if not path.exists( iso ) or ( stat( iso )[ ST_MODE ] & 0777 != 0444 ): if not path.exists( iso ) or ( stat( iso )[ ST_MODE ] & 0777 != 0444 ):
log( '* Retrieving', url ) log( '* Retrieving', url )
run( 'curl -C - -o %s %s' % ( iso, url ) ) run( 'curl -C - -o %s %s' % ( iso, url ) )
if 'ISO' not in run( 'file ' + iso ): # Make sure the file header/type is something reasonable like
# 'ISO' or 'x86 boot sector', and not random html or text
result = run( 'file ' + iso )
if 'ISO' not in result and 'boot' not in result:
os.remove( iso ) os.remove( iso )
raise Exception( 'findiso: could not download iso from ' + url ) raise Exception( 'findiso: could not download iso from ' + url )
# Write-protect iso, signaling it is complete # Write-protect iso, signaling it is complete