                                         NSLocalizedString("error extracting bundle: " + "\(e)", comment: ""))
                                 }
                             } else { // don't have the most recent version, download diff
+                                self.log("Fetching most recent version of bundle \(bundleName)")
                                 let req = NSURLRequest(URL:
                                     self.url("/assets/bundles/\(bundleName)/diff/\(curBundleSha)"))
                                 self.dataTaskWithRequest(req, handler: { (diffDat, diffResp, diffErr) -> Void in

            }
            return y
        }
        guard let patchFilePathData = patchFilePath.dataUsingEncoding(NSUTF8StringEncoding) else {
            log("unable to convert patch file path into data")
            throw BRBSPatchError.Unknown
        }
        let patchFilePathBytes = UnsafePointer<Int8>(patchFilePathData.bytes)
        let r = UnsafePointer<Int8>("r".dataUsingEncoding(NSASCIIStringEncoding)!.bytes)
        
        // open patch file
        guard let f = NSFileHandle(forReadingAtPath: patchFilePath) else {

        
        let cpf = fopen(patchFilePathBytes, r)
        if cpf == nil {
            let s = String.fromCString(strerror(errno))
            let ff = String.fromCString(patchFilePathBytes)
            log("unable to open patch file c: \(s) \(ff)")
            throw BRBSPatchError.Unknown
        }
        let cpfseek = fseeko(cpf, 32, SEEK_SET)
