Bug 52180 - Code duplication script/preup.sh and checks/pre-update-checks-5.0
Code duplication script/preup.sh and checks/pre-update-checks-5.0
Status: VERIFIED WORKSFORME
Product: UCS
Classification: Unclassified
Component: Update - univention-updater
UCS 5.0
Other Linux
: P5 normal (vote)
: ---
Assigned To: Philipp Hahn
UCS maintainers
:
Depends on: 51655
Blocks:
  Show dependency treegraph
 
Reported: 2020-10-03 18:01 CEST by Philipp Hahn
Modified: 2021-09-07 09:16 CEST (History)
1 user (show)

See Also:
What kind of report is it?: Development Internal
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philipp Hahn univentionstaff 2020-10-03 18:01:54 CEST
Both script should perform the same nearly the same checks, but are not kept in-sync.
The common code should be extracted to a shared file, which is then merged at package build time into the version installed in the package respectively copied to the public repository for pre-download.

The preup.sh script also has the draw-back, that it checks one condition at a time, which forces the admin to start the update many times until the update is finally performed.
Similar to the pre-update-checks-5.0 script all checks should be performed and should print out their verdict - if any check fails the script should abort only at the end to prevent the update,.
Comment 1 Philipp Hahn univentionstaff 2021-09-07 09:06:48 CEST
(In reply to Philipp Hahn from comment #0)
> Both script should perform the same nearly the same checks, but are not kept
> in-sync.
> The common code should be extracted to a shared file, which is then merged
> at package build time into the version installed in the package respectively
> copied to the public repository for pre-download.

This has already been done by git:ad2d88025fc24aded2181eae98db21b2adec21ba for UCS 5.0-0 as part of Bug #51655:

The 'preup.sh' scripts is build by 'debian/rules:dh_install' during package built time by including 'script/check.sh' into the wrapper 'script/preup.sh'.

> The preup.sh script also has the draw-back, that it checks one condition at
> a time, which forces the admin to start the update many times until the
> update is finally performed.
> Similar to the pre-update-checks-5.0 script all checks should be performed
> and should print out their verdict - if any check fails the script should
> abort only at the end to prevent the update,.

This also has been fixed an `check.sh` now executes all tests and no longer aborts on the first failing test.
Comment 2 Florian Best univentionstaff 2021-09-07 09:16:19 CEST
very nice!