From 7e283c367c60cf3da5e3bb7757ad06877298f437 Mon Sep 17 00:00:00 2001 From: Nils Freydank Date: Tue, 21 Nov 2017 23:50:44 +0100 Subject: [PATCH 1/2] Rely on portageq to find the portage tree. --- packageneedsme.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packageneedsme.sh b/packageneedsme.sh index fb8869c..5be013f 100755 --- a/packageneedsme.sh +++ b/packageneedsme.sh @@ -1,18 +1,21 @@ #!/bin/bash # This script will list all installed packages on a gentoo system # without maintainer or old EAPI. -# depends on eix +# depends on eix (and portage) # License: GPL-2 -# Author: Jonas Stein +# Author: Jonas Stein (main script), Nils Freydank (tree path detection) # Repository: https://github.com/jonasstein/packageneedsme # + +portagetree="$(portageq get_repo_path / gentoo)" + declare -a INSTALLED # declare an array INSTALLED=( $(qlist -RIC|grep gentoo| cut -f 1 -d":") ) echo "These installed packages have no maintainer. The package is waiting for you:" for catpkg in "${INSTALLED[@]}" do - grep -q "" /usr/portage/$catpkg/metadata.xml && echo $catpkg + grep -q "" "${portagetree}"/$catpkg/metadata.xml && echo $catpkg done echo From 10e8f5beed1c28781b67f5a30eb250f9ad22e0ce Mon Sep 17 00:00:00 2001 From: Jonas Stein Date: Wed, 22 Nov 2017 12:33:40 +0100 Subject: [PATCH 2/2] use bash typical uppercase, add changelog --- packageneedsme.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packageneedsme.sh b/packageneedsme.sh index 5be013f..6130c84 100755 --- a/packageneedsme.sh +++ b/packageneedsme.sh @@ -3,11 +3,14 @@ # without maintainer or old EAPI. # depends on eix (and portage) # License: GPL-2 -# Author: Jonas Stein (main script), Nils Freydank (tree path detection) +# Maintainer: Jonas Stein # Repository: https://github.com/jonasstein/packageneedsme # +# Changelog and authors: +# 2017-11-22 add tree path detection (Nils Freydank) +# 2017-11-17 initial script (Jonas Stein) -portagetree="$(portageq get_repo_path / gentoo)" +MYPORTDIR="$(portageq get_repo_path / gentoo)" declare -a INSTALLED # declare an array INSTALLED=( $(qlist -RIC|grep gentoo| cut -f 1 -d":") ) @@ -15,7 +18,7 @@ INSTALLED=( $(qlist -RIC|grep gentoo| cut -f 1 -d":") ) echo "These installed packages have no maintainer. The package is waiting for you:" for catpkg in "${INSTALLED[@]}" do - grep -q "" "${portagetree}"/$catpkg/metadata.xml && echo $catpkg + grep -q "" "${MYPORTDIR}"/$catpkg/metadata.xml && echo $catpkg done echo @@ -40,4 +43,3 @@ for catpkg in "${INSTALLED[@]}" do echo "EAPI="3" $catpkg" done -