quilt/setup-fix-tar-with-long-options.patch
Jean Delvare 4f00bbc36f - setup-skip-version-check.patch: setup: Skip version check.
- setup-fix-tar-with-long-options.patch: inspect: Handle long
  options passed to tar.

OBS-URL: https://build.opensuse.org/package/show/devel:tools:scm/quilt?expand=0&rev=85
2014-07-31 16:49:15 +00:00

65 lines
1.3 KiB
Diff

From: Jean Delvare <jdelvare@suse.de>
Subject: inspect: Handle long options passed to tar
Upstream: Submitted
The command line interface to tar is complex and sometimes confusing,
but we should still do our best to figure where the file name is on
that command line.
Add support for the --file FILE and --file=FILE options. Other long
options must be explicitly skipped, as well as short options not
containing the letter "f".
With this we should be good to go in most real-world cases, but
there are still a few corner cases we may not handle properly. These
can be addressed later when reported.
Reported by Petr Tesarik.
---
quilt/scripts/inspect.in | 34 ++++++++++++++++++++++++++--------
1 file changed, 26 insertions(+), 8 deletions(-)
--- a/quilt/scripts/inspect.in
+++ b/quilt/scripts/inspect.in
@@ -257,14 +257,32 @@ cat <<-'EOF' > $tmpdir/bin/wrapper
tar_input_file()
{
- case "$1" in
- *C*f*)
- echo "$3"
- ;;
- *f*)
- echo "$2"
- ;;
- esac
+ while [ $# -gt 0 ]; do
+ case "$1" in
+ --file)
+ echo "$2"
+ return
+ ;;
+ --file=*)
+ echo "${1#--file=}"
+ return
+ ;;
+ --*)
+ shift
+ ;;
+ *C*f*)
+ echo "$3"
+ return
+ ;;
+ *f*)
+ echo "$2"
+ return
+ ;;
+ -*)
+ shift
+ ;;
+ esac
+ done
}
unzip_input_file()