Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 701382 - app-admin/eselect: broken output of rc-config show / eselect rc show
Summary: app-admin/eselect: broken output of rc-config show / eselect rc show
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: eselect (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo eselect Team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2019-11-28 10:49 UTC by Michael
Modified: 2019-11-28 19:40 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (emerge--info1.txt,21.84 KB, text/plain)
2019-11-28 15:28 UTC, Michael
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael 2019-11-28 10:49:28 UTC
in bash:



$ rc-config show
Status of init scripts in runlevel "gui"
  acpid                     a e
  apache2                   a e
  apcupsd                   a e
  ....  

$ ls -d [started]
a e



Square brackets works ok if there are no one-letter-named files.
Otherwise bash expansion lead to in code: "write_kv_list_entry ${script} [${x}] "
makes "started" -> "a e" in my case with files a, e in current directory.
(I can't understand the role of square brackets here.)

/usr/share/eselect/modules/rc.eselect :
-----------
show_script_status() {
	local script=$1 status=unknown x
	local PATH=/lib/rc/bin:/lib64/rc/bin:${PATH} # path to service_* commands

	for x in stopping starting inactive started stopped; do
		if service_${x} ${script}; then
			status=${x}
			break
		fi
	done
	case ${status} in
		stopped)
			write_kv_list_entry ${script} [${x}]
			;;
		started)
			write_kv_list_entry ${script} "$(highlight [${x}])"
			;;
		*)
			write_kv_list_entry ${script} "$(highlight_warning [${x}])"
			;;
	esac
}
-----------
Comment 1 Ulrich Müller gentoo-dev 2019-11-28 12:16:20 UTC
Please attach the output of "emerge --info".
Comment 2 Ulrich Müller gentoo-dev 2019-11-28 12:19:26 UTC
(In reply to Ulrich Müller from comment #1)
> Please attach the output of "emerge --info".

Nvm, I can reproduce the problem.
Comment 3 Larry the Git Cow gentoo-dev 2019-11-28 13:16:30 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/eselect.git/commit/?id=4201251a4b29d50f90616f6d40b1112fd3620749

commit 4201251a4b29d50f90616f6d40b1112fd3620749
Author:     Ulrich Müller <ulm@gentoo.org>
AuthorDate: 2019-11-28 13:16:05 +0000
Commit:     Ulrich Müller <ulm@gentoo.org>
CommitDate: 2019-11-28 13:16:05 +0000

    rc.eselect: Add missing quotes.
    
    * modules/rc.eselect (show_script_status): Quote strings to
    prevent globbing, bug 701382.
    
    Bug: https://bugs.gentoo.org/701382
    Signed-off-by: Ulrich Müller <ulm@gentoo.org>

 ChangeLog          | 5 +++++
 modules/rc.eselect | 6 +++---
 2 files changed, 8 insertions(+), 3 deletions(-)
Comment 4 Michael 2019-11-28 15:28:29 UTC
Created attachment 597670 [details]
emerge --info
Comment 5 Larry the Git Cow gentoo-dev 2019-11-28 19:39:46 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=95a6a9d60dcddb0a3a8335c5fd8f8924a8ece766

commit 95a6a9d60dcddb0a3a8335c5fd8f8924a8ece766
Author:     Ulrich Müller <ulm@gentoo.org>
AuthorDate: 2019-11-28 19:37:24 +0000
Commit:     Ulrich Müller <ulm@gentoo.org>
CommitDate: 2019-11-28 19:39:30 +0000

    app-admin/eselect: Version bump to 1.4.16.
    
    Closes: https://bugs.gentoo.org/701382
    Package-Manager: Portage-2.3.80, Repoman-2.3.19
    Signed-off-by: Ulrich Müller <ulm@gentoo.org>

 app-admin/eselect/Manifest              |  1 +
 app-admin/eselect/eselect-1.4.16.ebuild | 61 +++++++++++++++++++++++++++++++++
 2 files changed, 62 insertions(+)
Comment 6 Ulrich Müller gentoo-dev 2019-11-28 19:40:50 UTC
Thanks for reporting!