Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:13.2
quilt
setup-fix-tar-with-long-options.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File setup-fix-tar-with-long-options.patch of Package quilt
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 out 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. Let's just hope we never hit them. Reported by Petr Tesarik. --- Changes since v1: * Fix an endless loop when trying to parse options "x --file file". * On "-xC software -f file", the previous code would extract "-f" as the file name, instead of "file". quilt/scripts/inspect.in | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) --- a/quilt/scripts/inspect.in +++ b/quilt/scripts/inspect.in @@ -258,13 +258,58 @@ cat <<-'EOF' > $tmpdir/bin/wrapper tar_input_file() { case "$1" in + # Modern option format + -*) + while [ $# -gt 0 ]; do + case "$1" in + # Extract the file name (long option) + --file) + echo "$2" + return + ;; + --file=*) + echo "${1#--file=}" + return + ;; + # Skip other long options + --*) + shift + ;; + # Extract the file name (short option) + -*f) + echo "$2" + return + ;; + -f*) + echo "${1#-f}" + return + ;; + # Skip other short options and parameters + *) + shift + ;; + esac + done + ;; + # Legacy option format (must always come first) *C*f*) echo "$3" + return ;; *f*) echo "$2" + return + ;; + ?*) + # Eat legacy options and try again + until [ $# -eq 0 -o "${1:0:1}" = "-" ]; do + shift + done + tar_input_file "$@" + return ;; esac + return 1 } unzip_input_file()
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor