Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
aiuto committed Jul 15, 2021
1 parent 830bb6b commit f99b65f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 0 additions & 2 deletions pkg/pkg.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,6 @@ def _pkg_tar_impl(ctx):
"--owner_names=%s=%s" % (_quote(key), ctx.attr.ownernames[key])
for key in ctx.attr.ownernames
]
#XX if ctx.attr.empty_files:
#XX args += ["--empty_file=%s" % empty_file for empty_file in ctx.attr.empty_files]
for empty_file in ctx.attr.empty_files:
add_empty_file(content_map, empty_file, ctx.label)
for empty_dir in ctx.attr.empty_dirs or []:
Expand Down
2 changes: 2 additions & 0 deletions pkg/private/build_tar.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,8 @@ def add_manifest_entry(self, entry_list, file_attributes):
self.add_empty_dir(entry.dest, **attrs)
elif entry.entry_type == manifest.ENTRY_IS_TREE:
self.add_tree(entry.src, entry.dest, **attrs)
elif entry.entry_type == manifest.ENTRY_IS_EMPTY_FILE:
self.add_empty_file(entry.dest, **attrs)
else:
self.add_file(entry.src, entry.dest, **attrs)

Expand Down
3 changes: 3 additions & 0 deletions pkg/private/manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
ENTRY_IS_LINK = 1 # Entry is a symlink: dest -> <src>
ENTRY_IS_DIR = 2 # Entry is an owned dir, possibly empty
ENTRY_IS_TREE = 3 # Entry is a tree artifact: take tree from <src>
ENTRY_IS_EMPTY_FILE = 4 # Entry is a an empty file

ManifestEntry = collections.namedtuple("ManifestEntry",
['entry_type', 'dest', 'src', 'mode', 'user', 'group'])
Expand All @@ -37,5 +38,7 @@ def entry_type_to_string(et):
return "directory"
elif et == ENTRY_IS_TREE:
return "tree"
elif et == ENTRY_IS_EMPTY_FILE:
return "empty_file"
else:
raise ValueError("Invalid entry id {}".format(et))

0 comments on commit f99b65f

Please sign in to comment.