[rb-general] [PATCH] Reorder tar arguments so --no-recursion takes effect
Anders Kaseorg
andersk at mit.edu
Thu Dec 8 03:49:25 CET 2016
The invocation ‘tar --null -T - --no-recursion -cf archive.tar’
doesn’t work, because --no-recursion only affects following arguments.
Signed-off-by: Anders Kaseorg <andersk at mit.edu>
---
_docs/archives.md | 2 +-
_docs/stable_inputs.md | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/_docs/archives.md b/_docs/archives.md
index 67520b7..e6e26c5 100644
--- a/_docs/archives.md
+++ b/_docs/archives.md
@@ -80,7 +80,7 @@ For older versions or other archive formats, it is possible to use
{% highlight sh %}
$ find build -print0 | LC_ALL=C sort -z |
- tar --null -T - --no-recursion -cf product.tar
+ tar --no-recursion --null -T - -cf product.tar
{% endhighlight %}
Care must be taken to ensure that `sort` is called in the context of the
diff --git a/_docs/stable_inputs.md b/_docs/stable_inputs.md
index 2c0bf69..55aa72e 100644
--- a/_docs/stable_inputs.md
+++ b/_docs/stable_inputs.md
@@ -71,7 +71,7 @@ have differences when run under different locales:
<div class="wrong">
{% highlight sh %}
$ find src -print0 | sort -z |
- tar --null -T - --no-recursion -cf archive.tar
+ tar --no-recursion --null -T - -cf archive.tar
{% endhighlight %}
</div>
@@ -80,7 +80,7 @@ The locale used to sort files must be specified to avoid any surprises:
<div class="correct">
{% highlight sh %}
$ find src -print0 | LC_ALL=C sort -z |
- tar --null -T - --no-recursion -cf archive.tar
+ tar --no-recursion --null -T - -cf archive.tar
{% endhighlight %}
</div>
--
2.11.0
More information about the rb-general
mailing list