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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 6E2D4158042 for ; Sat, 26 Oct 2024 03:10:37 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 7B58EE09C2; Sat, 26 Oct 2024 03:10:29 +0000 (UTC) Received: from out.packetderm.com (out.packetderm.com [173.166.91.13]) (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 3E8FDE09AE for ; Sat, 26 Oct 2024 03:10:27 +0000 (UTC) Received: from localhost (out.packetderm.com[173.166.91.13]) by smtp (5.7.4/5.7.4) with ESMTPSA id 49Q3APi0084690 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Fri, 25 Oct 2024 23:10:26 -0400 (EDT) (envelope-from waltdnes@waltdnes.org) Date: Fri, 25 Oct 2024 23:10:29 -0400 From: Walter Dnes To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] --depclean and openrc [Was: Wayland! Beware of!] Message-ID: References: <65e5de50-e053-46ff-be61-52f472d95025@gentoo.org> <2c966cf9-9cc5-4f51-96a4-9c0e537d5f95@gentoo.org> <4219bce4-f14f-4c5d-a52a-a303dd583907@gentoo.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Archives-Salt: cb0a53ae-5155-46f2-ab16-5f8fd2d859f8 X-Archives-Hash: d997e459a5c4a4761c2475a995679d3c On Fri, Oct 25, 2024 at 07:22:01PM +0000, Alan Mackenzie wrote > > There doesn't appear to be anything better in emerge - I've looked but > not found an emerge action to unmerge specific packages only, apart from > --unmerge. Why is there not a version of --unmerge which does safety > checks first? I've cobbled together a script of my own to handle this. It's /root/bin/autodepclean : NOTE: it does *NOT* clean out anything. Rather, it generates a script "cleanscript" in the current directory. The idea is that you inspect it first before running ./cleanscript ########################################## #!/bin/bash # autodepclean script v 0.04 released under GPL v3 by Walter Dnes # 2023/02/18 Generates a file "cleanscript" in the current directory to # remove unused ebuilds, including buildtime-only dependancies. # # Warning; this script is beta. I recommend that you check the output # in cleanscript before running it. # # With the arrival of "virtual/editor", the script now suggests removing # app-editors/nano, which may not be what you want. If you want to keep # nano, put it into world. # # version 0.03 disables the removal of gentoo-sources. Your current kernel # is not always the most recent one in /usr/src. # # version 0.04 adds "--verbose" to the "emerge --depclean". This makes it # easier to track down circular dependancies. # # version 0.05 wipes cleanscript if no files to process. This guards # against the edge case of running a flat "emerge --depclean" if there # are no ebuilds to remove. echo "#!/bin/bash" > cleanscript echo "#" >> cleanscript echo "emerge --depclean \\" >> cleanscript emerge --pretend --depclean |\ grep -A1 "^ .*/" |\ grep -v "^ \*" |\ grep -v "^--" |\ sed ":/: { N s:\n:: s/ selected: /-/ s/^ / =/ s/$/ \\\/ }" | grep -v "=app-editors/nano" |\ grep -v "=sys-kernel/gentoo-sources" |\ grep -v "=sys-devel/gcc-" >> cleanscript echo ' ; echo ""' >> cleanscript echo "revdep-rebuild" >> cleanscript chmod 744 cleanscript if grep "=" cleanscript >> /dev/null 2>&1 ; then echo "OK to proceed." else echo "" > cleanscript echo "Nothing to process" fi ########################################## I last updated my system 32 days ago. When I ran "autodepclean" after updating world today, it generated the following "cleanscript" ########################################## #!/bin/bash # emerge --depclean \ =net-dns/bind-tools-9.18.0 \ =dev-python/pip-24.2-r1 \ =dev-build/autoconf-2.71-r7 \ =dev-python/typing-extensions-4.12.2 \ =dev-python/truststore-0.9.2 \ =dev-python/rich-13.7.1 \ =dev-python/resolvelib-1.0.1 \ =dev-python/pyproject-hooks-1.1.0 \ =dev-python/distro-1.9.0 \ =dev-python/distlib-0.3.8 \ =dev-python/cachecontrol-0.14.0 \ =dev-python/requests-2.32.3 \ =dev-python/poetry-core-1.9.0 \ =dev-python/msgpack-1.0.8 \ =dev-python/markdown-it-py-3.0.0 \ =dev-python/colorama-0.4.6 \ =dev-python/urllib3-2.2.2 \ =dev-python/mdurl-0.1.2 \ =dev-python/linkify-it-py-2.0.3 \ =dev-python/lark-1.2.2 \ =dev-python/idna-3.8 \ =dev-python/fastjsonschema-2.20.0 \ =dev-python/charset-normalizer-3.3.2 \ =dev-python/certifi-3024.7.22 \ =dev-python/uc-micro-py-1.0.3 \ =dev-python/PySocks-1.7.1-r2 \ ; echo "" revdep-rebuild ########################################## autodepclean takes out a lot of "virtual-perl" packages after a perl update, but doesn't cause problems. -- There are 2 types of people in this world 1) Those who can extrapolate from incomplete data