Skip to content

ua_restore: change restore argument handling#1516

Merged
BareosBot merged 13 commits intobareos:masterfrom
sebsura:dev/ssura/master/change-restore-handling
Aug 23, 2023
Merged

ua_restore: change restore argument handling#1516
BareosBot merged 13 commits intobareos:masterfrom
sebsura:dev/ssura/master/change-restore-handling

Conversation

@sebsura
Copy link
Contributor

@sebsura sebsura commented Aug 3, 2023

Thank you for contributing to the Bareos Project!

restore does not parse its arguments correctly. It only considers a single file=/directory= keyword and only considers jobid=/current/before= if they are specified before their respective command.

This PR changes the argument parsing such that first all keywords are looked at and then the found commands are executed.

It also contains a fix for bextract not setting up decompression buffers when compression is on but autoxflate is not.

Please check

  • Short description and the purpose of this PR is present above this paragraph
  • Your name is present in the AUTHORS file (optional)

If you have any questions or problems, please give a comment in the PR.

Helpful documentation and best practices

Checklist for the reviewer of the PR (will be processed by the Bareos team)

Make sure you check/merge the PR using devtools/pr-tool to have some simple automated checks run and a proper changelog record added.

General
  • Is the PR title usable as CHANGELOG entry?
  • Purpose of the PR is understood
  • Commit descriptions are understandable and well formatted
  • Check backport line
Source code quality
  • Source code changes are understandable
  • Variable and function names are meaningful
  • Code comments are correct (logically and spelling)
Tests
  • Decision taken that a test is required (if not, then remove this paragraph)
  • The choice of the type of test (unit test or systemtest) is reasonable
  • Testname matches exactly what is being tested
  • On a fail, output of the test leads quickly to the origin of the fault

@sebsura sebsura force-pushed the dev/ssura/master/change-restore-handling branch from 276f141 to 456811d Compare August 8, 2023 09:54
@sebsura sebsura force-pushed the dev/ssura/master/change-restore-handling branch from 456811d to fad2229 Compare August 11, 2023 06:27
Copy link
Contributor

@alaaeddineelamri alaaeddineelamri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just realized the tests are not passing on jenkins

@alaaeddineelamri alaaeddineelamri dismissed their stale review August 16, 2023 08:22

just realized the tests are not passing on jenkins

@sebsura sebsura force-pushed the dev/ssura/master/change-restore-handling branch from 552e067 to 964821e Compare August 17, 2023 13:46
@sebsura sebsura force-pushed the dev/ssura/master/change-restore-handling branch 6 times, most recently from 96f38ad to f296081 Compare August 18, 2023 09:39
sebsura and others added 13 commits August 23, 2023 09:15
This change will make the order of arguments passed to the restore
command mostly irrelevant.  This means that

restore file=... jobid=...

and

restore select before=...

will work as one would naivly expect; without this change both
jobid=... and before=... would be silently ignored!
If autoxflate is enabled then autoxflate will set up these buffers.
If autoxflate is disabled then it will not.  As such we need to ensure
to set up the buffers when they are are not yet set up!
Instead of implicitly using ua->cmd, we instead pass the parameter
explicitly.
if "$rscripts/diff.pl" -s "${dest}" -d "${restorepath}"; then
     result=$?
fi
means: if diff.pl succeeds (i.e. return 0), then set result to 0.
This is not very useful.  Instead the script should signal an error
when diff.pl does _not_ succeed!
@BareosBot BareosBot force-pushed the dev/ssura/master/change-restore-handling branch from bd9244f to 62f1cb8 Compare August 23, 2023 09:15
@BareosBot BareosBot merged commit b75ea95 into bareos:master Aug 23, 2023
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

Successfully merging this pull request may close these issues.

3 participants