From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 97F33138334 for ; Thu, 5 Dec 2019 16:51:30 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id DC49EE086F; Thu, 5 Dec 2019 16:51:29 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id C45CCE086F for ; Thu, 5 Dec 2019 16:51:29 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 9CF6634D78A for ; Thu, 5 Dec 2019 16:51:28 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 00DB48CB for ; Thu, 5 Dec 2019 16:51:27 +0000 (UTC) From: "Matt Turner" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Matt Turner" Message-ID: <1575512600.3f25e307ba5116892beb48fec2809500882dcf4f.mattst88@gentoo> Subject: [gentoo-commits] proj/gentoolkit:master commit in: pym/gentoolkit/eclean/ X-VCS-Repository: proj/gentoolkit X-VCS-Files: pym/gentoolkit/eclean/clean.py X-VCS-Directories: pym/gentoolkit/eclean/ X-VCS-Committer: mattst88 X-VCS-Committer-Name: Matt Turner X-VCS-Revision: 3f25e307ba5116892beb48fec2809500882dcf4f X-VCS-Branch: master Date: Thu, 5 Dec 2019 16:51:27 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 0b5d131d-a4f2-43cc-a290-abe335f16071 X-Archives-Hash: 8340ec66d2fa75280f86b52eb6273183 commit: 3f25e307ba5116892beb48fec2809500882dcf4f Author: Matt Turner gentoo org> AuthorDate: Mon Dec 2 22:15:14 2019 +0000 Commit: Matt Turner gentoo org> CommitDate: Thu Dec 5 02:23:20 2019 +0000 URL: https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=3f25e307 eclean: Delete empty directories Closes: https://bugs.gentoo.org/671592 Signed-off-by: Matt Turner gentoo.org> pym/gentoolkit/eclean/clean.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pym/gentoolkit/eclean/clean.py b/pym/gentoolkit/eclean/clean.py index e00bcc0..c62abb9 100644 --- a/pym/gentoolkit/eclean/clean.py +++ b/pym/gentoolkit/eclean/clean.py @@ -139,6 +139,10 @@ class CleanUp(object): # only count size if successfully deleted and not a link if statinfo.st_nlink == 1: clean_size += statinfo.st_size + try: + os.rmdir(os.path.dirname(file_)) + except OSError: + pass except EnvironmentError as er: print( pp.error("Could not delete "+file_), file=sys.stderr) print( pp.error("Error: %s" %str(er)), file=sys.stderr)