Zain,
If you reformat the manifest as something you can
load, it's easy to work with it. That can't be quite one per line, but it can be close. I would do something like this (might not handle paths within the tar file too well without some more work):
manifest_foo.bzl:
contents = [
'file1',
'file2',
]
BUILD:
load(':manifest_foo.bzl', foo_contents = 'contents')
genrule(
name = 'extract_foo',
srcs = ['foo.tar'],
outs = foo_contents,
cmd = 'tar -C $(@D) -xf $(location foo.tar)',
)
If you're going to use this a lot, definitely write a
macro around it.
Feel free to ask if you have any questions about that,
Brian