(self, tarf, destdir)
return
The layered filesystem of docker uses whiteout files
        to identify files or directories to be removed.
        The format is .wh.<filename>
The layered filesystem of docker uses whiteout files
        to identify files or directories to be removed.
        The format is .wh.<filename>
The layered filesystem of docker uses whiteout files to identify files or directories to be removed . The format is . wh . <filename >
def _apply_whiteouts(self, tarf, destdir):
        """The layered filesystem of docker uses whiteout files
        to identify files or directories to be removed.
        The format is .wh.<filename>
        """
        verbose = ""
        if Msg.level >= Msg.VER:
            verbose = 'v'
            Msg().out("Info: applying whiteouts:", tarf, l=Msg.INF)
        wildcards = ["--wildcards", ]
        if not HostInfo().cmd_has_option("tar", wildcards[0]):
            wildcards = []
        cmd = ["tar", "t" + verbose] + wildcards + ["-f", tarf, r"*/.wh.*"]
        whiteouts = Uprocess().get_output(cmd, True)
        if not whiteouts:
            return
        for wh_filename in whiteouts.split('\n'):
            if wh_filename:
                wh_basename = os.path.basename(wh_filename.strip())
                wh_dirname = os.path.dirname(wh_filename)
                if wh_basename == ".wh..wh..opq":
                    if not os.path.isdir(destdir + '/' + wh_dirname):
                        continue
                    for f_name in os.listdir(destdir + '/' + wh_dirname):
                        rm_filename = destdir + '/' \
                            + wh_dirname + '/' + f_name
                        FileUtil(rm_filename).remove(recursive=True)
                elif wh_basename.startswith(".wh."):
                    rm_filename = destdir + '/' \
                        + wh_dirname + '/' \
                        + wh_basename.replace(".wh.", "", 1)
                    FileUtil(rm_filename).remove(recursive=True)
        return
def _apply_whiteouts ( self , tarf , destdir ) : verbose = "" if Msg . level >= Msg . VER : verbose = 'v' Msg ( ) . out ( "Info: applying whiteouts:" , tarf , l = Msg . INF ) wildcards = [ "--wildcards" , ] if not HostInfo ( ) . cmd_has_option ( "tar" , wildcards [ 0 ] ) : wildcards = [ ] cmd = [ "tar" , "t" + verbose ] + wildcards + [ "-f" , tarf , r"*/.wh.*" ] whiteouts = Uprocess ( ) . get_output ( cmd , True ) if not whiteouts : return for wh_filename in whiteouts . split ( '\n' ) : if wh_filename : wh_basename = os . path . basename ( wh_filename . strip ( ) ) wh_dirname = os . path . dirname ( wh_filename ) if wh_basename == ".wh..wh..opq" : if not os . path . isdir ( destdir + '/' + wh_dirname ) : continue for f_name in os . listdir ( destdir + '/' + wh_dirname ) : rm_filename = destdir + '/' + wh_dirname + '/' + f_name FileUtil ( rm_filename ) . remove ( recursive = True ) elif wh_basename . startswith ( ".wh." ) : rm_filename = destdir + '/' + wh_dirname + '/' + wh_basename . replace ( ".wh." , "" , 1 ) FileUtil ( rm_filename ) . remove ( recursive = True ) return