Permalink
Browse files

Merge pull request #6 from alecthegeek/master

Unpacked .img file addition - alecthegeek
  • Loading branch information...
2 parents 6fe0df6 + 1312dc6 commit f6c034de1ccd500206e8b5b3b416115a68f03f18 @exaviorn committed Jun 14, 2012
Showing with 10 additions and 1 deletion.
  1. +10 −1 raspiwrite.py
View
@@ -178,6 +178,11 @@ def transfer(file,archiveType,obtain,SD,URL): #unzips the disk image
#path = file.replace(".zip", "") + '/' + file.replace(".zip", ".img") <- my old code
path = file.replace(".zip", "") + '/' + os.path.basename(file).replace(".zip", ".img") #Thanks to Lewis Boon
extractCMD = 'unzip ' + file
+
+ if archiveType == 'img':
+ path = file;
+ extractCMD = 'echo No extracttion required for ' + file
+
if archiveType == 'gz':
path = file.replace(".gz", "") #<-- verify
extractCMD = 'gunzip ' + file
@@ -338,7 +343,11 @@ def getImage(SD): #gives the user a bunch of options to download an image, or se
matchZip = re.match('^.*\.zip$',userLocate)
matchGzip = re.match('^.*\.img.gz$',userLocate)
matchBzip = re.match('^.*\.tar.bz2$',userLocate)
+ matchImg = re.match('^.*\.img$',userLocate)
+ if matchImg is not None:
+ print 'Found Image file'
+ transfer(userLocate,'img','usr',SD,'none')
if matchZip is not None:
print 'Found Zip'
transfer(userLocate,'zip','usr',SD,'none')
@@ -426,4 +435,4 @@ def driveTest(SD):
driveTest(manualID)
else: #otherwise...
SD = matchSD(volumes).group(1) #selects the first SD/USB drive located
- driveTest(SD) #action gets delegated to driveTest, which then leads on to the next step, I found this to be the easiest way
+ driveTest(SD) #action gets delegated to driveTest, which then leads on to the next step, I found this to be the easiest way

0 comments on commit f6c034d

Please sign in to comment.