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

handle save_y2logs when content modified when creating tarball #1145

Merged
merged 4 commits into from
Mar 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions package/yast2.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Mon Mar 8 16:41:27 UTC 2021 - Josef Reidinger <jreidinger@suse.com>

- save_y2logs: Make modified content of log files just warning
instead of fatal (bsc#1182710 see comment 2)
- 4.3.58

-------------------------------------------------------------------
Mon Mar 8 09:19:37 UTC 2021 - David Diaz <dgonzalez@suse.com>

Expand Down
2 changes: 1 addition & 1 deletion package/yast2.spec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


Name: yast2
Version: 4.3.57
Version: 4.3.58
Release: 0
Summary: YaST2 Main Package
License: GPL-2.0-only
Expand Down
5 changes: 4 additions & 1 deletion scripts/save_y2logs
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,14 @@ echo "Saving YaST logs to $TARGET" >&2

[ -n "$COMPRESSION" ] && COMPRESSION="--$COMPRESSION"

tar cf "$TARGET" $COMPRESSION --dereference -C / $LIST -C /var/log $LIST_VAR -C $TMPDIR $LIST_TMP
tar cf "$TARGET" --warning=no-file-changed $COMPRESSION --dereference -C / $LIST -C /var/log $LIST_VAR -C $TMPDIR $LIST_TMP
err=$?

rm -rf $TMPDIR

# tar returns 1 when content of tarball is older than the current system. Happen when something still writting to logs or memsampler (bsc#1182710#c2)
[ $err == 1 ] && echo "Warning: logs modified during save. Yast is probably running. Content of tarball can be older than current content." >&2 && err=0

[ $err != 0 ] && echo "FATAL: Error creating archive $TARGET" >&2

exit $err