Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #12 from tech2077/master

Fix DD Arguments and OS X name chopping - tech2077
  • Loading branch information...
commit 413db87d444866048bc02a9d0f2d77780a7dff69 2 parents d3f95d1 + f406d65
@exaviorn authored
Showing with 10 additions and 2 deletions.
  1. +10 −2 raspiwrite.py
View
12 raspiwrite.py
@@ -172,7 +172,10 @@ class transferInBackground (threading.Thread): #Runs the dd command in a thread
def run ( self ):
global SDsnip
global path
- copyString = 'dd bs=1M if=%s of=%s' % (path,SDsnip)
+ if OS[0] != 'Darwin':
+ copyString = 'dd bs=1M if=%s of=%s' % (path,SDsnip)
+ else
+ copyString = 'dd bs=1m if=%s of=%s' % (path,SDsnip)
print 'Running ' + copyString + '...'
print getoutput(copyString)
@@ -268,7 +271,12 @@ def transfer(file,archiveType,obtain,SD,URL): #unzips the disk image
if (SD.find("/dev/mmcblk") + 1):
SDsnip = "/dev/mmcblk" + SD[11]
else:
- SDsnip = SD.replace(' ', '')[:-1]
+ if OS[0] != 'Darwin':
+ SDsnip = SD.replace(' ', '')[:-1]
+ else:
+ # remove weird partition notation in OS X partition names
+ SDsnip = SD.replace(' ', '')[:-2]
+
print path
print '\n\n###################################################################'
print 'About to start the transfer procedure, here is your setup:'

7 comments on commit 413db87

@kellym

This merge broke the script due to different characters for indentation.

@8026787

same problem, same fixes

@Bouncner

Forgetting ":" really hurts ...

@minshallj

also on 177 there's no : after the else, and yah for 275 and 278 aren't properly indented on my macbook, as well as the link to raspiwrite.py from the github page, though here they look fine, probably a case of using tab with a different editor than the rest of the code. Lastly idk if it's from this commit or not, but after it unzips the package, it looks for it a folder named just like the zip, with the .img in it, but it seems mountain lion might not make the folder anymore if there's just one file being extracted. I just made the folder and before even unzipping it saw that there was the old unzipped file now in the correct place.

@minshallj

just to give example ~/Downloads/theFile.zip looks for ~/Downloads/theFile/theFile.img though the img is still in the ~/Downloads/ folder

@iennae

So anyone who downloads this and isn't sure how to fix it here are some explicit directions:
on line 177 there is a missing :, add : at the end of the else.
on line 275 add 3 spaces (line that has SDsnip = SD.replace(' ', '')[:-1])
on line 278 add 3 spaces (line that has SDsnip = SD.replace(' ', '')[:-2])

This is version 1.15 as of December 23.

@matth

Hey, thanks for comments on fix. Its a real shame the broken code still exists in master, this project is linked to from around the web and needs patching to work!

Please sign in to comment.
Something went wrong with that request. Please try again.