Skip to content
This repository has been archived by the owner on Jan 28, 2025. It is now read-only.

Commit

Permalink
Add message if rm fails to remove some files
Browse files Browse the repository at this point in the history
dnf install requires root and some of the temporary directories
are owned by root. Not all tests are executed as root though.

Instead of using sudo and delete everything (possibly breaking
the file system in the process) we just issue a message for the
user. This also has the nice side effect of returning an exit code
of 0 so that make doesn't exit and CI does not report failures.

If temporary files are left around this is mostly problem for local
development since in CI the worker nodes are destroyed once testing
is completed.
  • Loading branch information
atodorov committed Mar 1, 2018
1 parent 64c24f0 commit eb718d9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/bin/import-metadata
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,5 @@ for F in $DNF_DOWNLOAD/*.rpm; do
done

# cleanup temporary directories and files
rm -rf $DNF_ROOT $DNF_DOWNLOAD $IMPORT $SCHEMA
[ "$REMOVE_IMPORT_REPO" == 1 ] && rm -rf $IMPORT_REPO
rm -rf $DNF_ROOT $DNF_DOWNLOAD $IMPORT $SCHEMA || echo "Can't remove some files"
[ "$REMOVE_IMPORT_REPO" == 1 ] && rm -rf $IMPORT_REPO || echo "Can't remove some files"

0 comments on commit eb718d9

Please sign in to comment.