Skip to content

Fixed warnings about not removable non-empty folders in apt_clean()#16

Merged
domcleal merged 1 commit intofreight-team:masterfrom
Yrrsinn:master
Mar 10, 2016
Merged

Fixed warnings about not removable non-empty folders in apt_clean()#16
domcleal merged 1 commit intofreight-team:masterfrom
Yrrsinn:master

Conversation

@Yrrsinn
Copy link
Copy Markdown

@Yrrsinn Yrrsinn commented Mar 9, 2016

freight-cache produces multiple lines warnings (proportional to the size of cache):
find: cannot delete [...]/cache/pool/[...]: Directory not empty

The behavior is correct. This directories should only be removed, when they are empty after removing old packages. Thus the warnings are erroneous.

apt_clean() {
find "$VARCACHE/pool" -links 1 -delete || true
find "$VARCACHE/pool" -links 1 -type f -delete
find "$VARCACHE/pool" -links 1 -type d -empty -delete
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

-links 1 should probably be removed from this search, I don't think it's too applicable for a dir.

@domcleal
Copy link
Copy Markdown

domcleal commented Mar 9, 2016

👍 looks good otherwise.

@mmoll you mentioned about Linux/GNUisms the other day, is -empty one and should we be bothered about it at this stage (i.e. are there others)?

@mmoll
Copy link
Copy Markdown

mmoll commented Mar 9, 2016

@domcleal this is perfectly fine, as there are already a whole lot of these and the only way at the moment is to install findutils and coreutils as packages and use the respective binaries with g/gnu prefix (which is also perfectly normal to do for an FreeBSD package to patch these prefixes in).

@Yrrsinn could you squash the commits together into one and force-push?

@mmoll
Copy link
Copy Markdown

mmoll commented Mar 9, 2016

👍

@Yrrsinn
Copy link
Copy Markdown
Author

Yrrsinn commented Mar 10, 2016

@mmoll squashed and rebased ~ ready on my side

@mattock
Copy link
Copy Markdown
Member

mattock commented Mar 10, 2016

👍

domcleal added a commit that referenced this pull request Mar 10, 2016
Fixed warnings about not removable non-empty folders in apt_clean()
@domcleal domcleal merged commit 9b2cec7 into freight-team:master Mar 10, 2016
@domcleal
Copy link
Copy Markdown

Thanks @Yrrsinn!

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.

4 participants