def METHOD_NAME(self, ud, rootdir, d):
    """
    Unpacks a crate
    """
    thefile = ud.localpath
    # possible metadata we need to write out
    metadata = {}
    # change to the rootdir to unpack but save the old working dir
    save_cwd = os.getcwd()
    os.chdir(rootdir)
    pn = d.getVar('BPN')
    if pn == ud.parm.get('name'):
        cmd = "tar -xz --no-same-owner -f %s" % thefile
    else:
        cargo_bitbake = self._cargo_bitbake_path(rootdir)
        cmd = "tar -xz --no-same-owner -f %s -C %s" % (thefile, cargo_bitbake)
        # ensure we've got these paths made
        bb.utils.mkdirhier(cargo_bitbake)
        # generate metadata necessary
        with open(thefile, 'rb') as f:
            # get the SHA256 of the original tarball
            tarhash = hashlib.sha256(f.read()).hexdigest()
        metadata['files'] = {}
        metadata['package'] = tarhash
    # path it
    path = d.getVar('PATH')
    if path:
        cmd = "PATH=\"%s\" %s" % (path, cmd)
    bb.note("Unpacking %s to %s/" % (thefile, os.getcwd()))
    ret = subprocess.call(cmd, preexec_fn=subprocess_setup, shell=True)
    os.chdir(save_cwd)
    if ret != 0:
        raise UnpackError("Unpack command %s failed with return value %s" % (cmd, ret), ud.url)
    # if we have metadata to write out..
    if len(metadata) > 0:
        cratepath = os.path.splitext(os.path.basename(thefile))[0]
        bbpath = self._cargo_bitbake_path(rootdir)
        mdfile = '.cargo-checksum.json'
        mdpath = os.path.join(bbpath, cratepath, mdfile)
        with open(mdpath, "w") as f:
            json.dump(metadata, f)