Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple custom options not recognized #50

Open
sabalinux opened this issue Oct 29, 2023 · 0 comments
Open

Multiple custom options not recognized #50

sabalinux opened this issue Oct 29, 2023 · 0 comments

Comments

@sabalinux
Copy link

sabalinux commented Oct 29, 2023

Hi

Multiple custom options error

Adding more than 1 custom option , tar command doesn't recognized them : (i.e.: adding --totals -v --strip-components=2) to the mkstage commnd options

I got under single quote a unique option that tar not recognized:

Running mkstage4 :
mkstage4 -t /mnt/bind-home test-home --totals -v --strip-components=2

mkstage4 output :
'[...] --exclude=/mnt/bind-home/usr/portage/*' '--totals -v --strip-components=2' -f /run/media/nykay/Backup-1/tar/test-home.tar.bz2 /mnt/bind-home/ tar: unrecognized option '--totals -v --strip-components=2' Try 'tar --help' or 'tar --usage' for more information.

'--totals -v --strip-components=2' line is interpreted just like unique option

I solved removing double quotes from mkstage4 script to the ${OPTIONS[@]} array
tar "${TAR_OPTIONS[@]}" "${INCLUDES[@]}" "${EXCLUDES[@]}" ${OPTIONS[@]} -f "$STAGE4_FILENAME" "${TARGET}"

and to the echo for the printed output
echo 'tar' "${TAR_OPTIONS[@]}" "${INCLUDES[@]}" "${EXCLUDES[@]}" ${OPTIONS[@]} -f "$STAGE4_FILENAME" "${TARGET}"

So TAR can recognized the single custom option now

edit :
or update "Shifts pointer to read custom tar options"


for custom_opts in $@ ; do OPTIONS+=("$custom_opts") ; done ((${#OPTIONS[@]} == 1)) && [ -z "${OPTIONS[0]}" ] && unset OPTIONS

Got this ok :
--exclude=/mnt/bind-home/usr/portage/* --totals -v --strip-components=2 -f /run/media/nykay/Backup-1/tar/test-home.tar.bz2 /mnt/bind-home/

hope to helpful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant