diff --git a/tools/build_defs/pkg/build_test.sh b/tools/build_defs/pkg/build_test.sh index f07b7292538862..ad1b8f4e860ccb 100755 --- a/tools/build_defs/pkg/build_test.sh +++ b/tools/build_defs/pkg/build_test.sh @@ -164,6 +164,10 @@ function test_tar() { drwxrwxrwx 0/0 0 2000-01-01 00:00 ./tmp/ drwxrwxrwx 0/0 0 2000-01-01 00:00 ./pmt/" \ "$(get_tar_verbose_listing test-tar-empty_dirs.tar)" + check_eq \ + "drwxr-xr-x 0/0 0 1999-12-31 23:59 ./ +-r-xr-xr-x 0/0 2 1999-12-31 23:59 ./nsswitch.conf" \ + "$(get_tar_verbose_listing test-tar-mtime.tar)" } function test_deb() { diff --git a/tools/build_defs/pkg/pkg.bzl b/tools/build_defs/pkg/pkg.bzl index 051061c82abc23..8ef8c1af6a01ce 100644 --- a/tools/build_defs/pkg/pkg.bzl +++ b/tools/build_defs/pkg/pkg.bzl @@ -50,7 +50,7 @@ def _pkg_tar_impl(ctx): if ctx.attr.mtime != -1: # Note: Must match default in rule def. if ctx.attr.portable_mtime: fail("You may not set both mtime and portable_mtime") - args.append("--mtime=" + ctx.attr.mtime) + args.append("--mtime=%d" % ctx.attr.mtime) if ctx.attr.portable_mtime: args.append("--mtime=portable")