Skip to content
Snippets Groups Projects
Commit f2458d1d authored by Bob Lantz's avatar Bob Lantz
Browse files

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

Fixes #372
parent b85943dc
No related branches found
No related tags found
No related merge requests found
...@@ -192,7 +192,10 @@ def findiso( flavor ): ...@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment