From 91632a574de92c4b41d34f5bca8141276882043f Mon Sep 17 00:00:00 2001 From: John McQuah Date: Thu, 24 Aug 2023 10:34:02 -0400 Subject: [PATCH] prune unreachable code paths revise man-page discussion of --install-root --- doc/prt-get.8 | 29 +++++++++++++++++++++++------ src/installtransaction.h | 2 -- src/prtget.cpp | 9 --------- 3 files changed, 23 insertions(+), 17 deletions(-) diff --git a/doc/prt-get.8 b/doc/prt-get.8 index 0d0f6ae..1193b6f 100644 --- a/doc/prt-get.8 +++ b/doc/prt-get.8 @@ -565,9 +565,18 @@ reading/writing (so /var/lib/pkg/db must exist), and where the pkg.tar.?z archives get unpacked, but the relevant prt-get.conf and ports tree are those on the parent filesystem. Therefore it is not necessary for to contain its own copy of the ports tree (unless 'runscripts yes' is desired, as -explained above). However, if /etc/pkgadd.conf exists and is different -from /etc/pkgadd.conf, then install or update commands might behave -unexpectedly. In order to preserve the \fBpkgadd.conf(5)\fP settings from the +explained above). But each \fBpkgmk(8)\fP process will take place on the parent +filesystem, inspecting \fIthe parent filesystem\fP's environment for +information about installed ports and available shared libraries. The +\fBpkgmk(8)\fP process might therefore draw the wrong conclusions about what +functionality should be enabled for an installation to . If the parent +filesystem is more richly populated than , with respect to installed +packages, then the built package might exhibit breakage when \fBpkgadd\fP +unpacks it into . + +When setting --install-root=, install or update commands might behave +unexpectedly if /etc/pkgadd.conf exists and is different from +/etc/pkgadd.conf . In order to preserve the \fBpkgadd.conf(5)\fP settings from host system, append the option --aargs='-c /etc/pkgadd.conf' to your \fBprt\-get install\fP command, or just copy the desired directives into /etc/pkgadd.conf . @@ -730,15 +739,23 @@ currently-installed ports, but are needed now by the newer versions of these ports. The output of this command is sorted by dependencies, therefore suitable for piping to \fBxargs prt\-get install\fP. +.TP +.B prt\-get isinst $(prt\-get quickdep i3) | awk '/not installed/ { print $2 }' | xargs prt\-get depinst \-\-softdeps \-\-test +(inspired by a troubleshooting session with hestia) Assemble a set of install +targets needed to build the i3 window manager; sort the list, respecting both +hard and soft dependencies; then print how the installation would proceed. The +awk filter in the middle is needed to prevent the command from failing with the +error message "already installed". + .TP .B prt\-get printf \(dq%p\et%u\en\(dq | grep myrepo | cut -f 2 Print the upstream URL for each port in the collection \(dqmyrepo\(dq, perhaps as the first step in keeping your personal overlay up to date. .TP -.B prt\-get printf \(dq%M\et%n\en\(dq | grep ^Tim | wc -l -Count how many ports our most-overworked core team member claims -responsibility for. +.B prt\-get printf \(dq%M\et%n\en\(dq | grep -c -i ^unmaintained +Count how many ports are marked unmaintained (and hence at risk of being dropped +from the repos by the time you next run 'ports -u'). .TP .B comm -13 <(prt\-get depends firefox-bin |tail -n +2 |sort) <(prt\-get depends firefox |tail -n +2 |sort) diff --git a/src/installtransaction.h b/src/installtransaction.h index c653b3d..44de730 100644 --- a/src/installtransaction.h +++ b/src/installtransaction.h @@ -52,9 +52,7 @@ public: SUCCESS, /*!< yeah, success */ NO_PACKAGE_GIVEN, /*!< no package given to install */ PACKAGE_NOT_FOUND, /*!< package not found */ - PKGMK_EXEC_ERROR, /*!< can't execute pkgmk */ PKGMK_FAILURE, /*!< error while pkgmk */ - PKGADD_EXEC_ERROR, /*!< can't execute pkgadd */ PKGDEST_ERROR, /*!< can't change to PKGDEST */ PKGADD_FAILURE, /*!< error while pkgadd */ CYCLIC_DEPEND, /*!< cyclic dependencies found */ diff --git a/src/prtget.cpp b/src/prtget.cpp index 0a24007..031671f 100644 --- a/src/prtget.cpp +++ b/src/prtget.cpp @@ -595,21 +595,12 @@ void PrtGet::executeTransaction( InstallTransaction& transaction ) { case InstallTransaction::PACKAGE_NOT_FOUND: cout << m_appName << ": package(s) not found" << endl; break; - case InstallTransaction::PKGMK_EXEC_ERROR: - cout << m_appName << " couldn't excecute pkgmk " - << "(or alternative command). " - << "Make sure it's installed properly" << endl; - break; case InstallTransaction::PKGMK_FAILURE: cout << m_appName << ": error while building " << endl; break; case InstallTransaction::NO_PACKAGE_GIVEN: cout << m_appName << ": no package specified " << endl; break; - case InstallTransaction::PKGADD_EXEC_ERROR: - cout << m_appName << " couldn't excecute pkgadd. " - << "Make sure it's installed properly" << endl; - break; case InstallTransaction::PKGDEST_ERROR: cout << m_appName << ": error changing to PKGDEST directory " << m_config->packageDir() << endl;