Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 473420 - app-portage/layman - drop zsh-completion USE flag and install completion files unconditionally
Summary: app-portage/layman - drop zsh-completion USE flag and install completion file...
Status: RESOLVED WONTFIX
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Tools (show other bugs)
Hardware: All Linux
: Lowest enhancement (vote)
Assignee: Layman Overlay Manager project
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2013-06-15 22:11 UTC by Nado
Modified: 2016-10-03 15:24 UTC (History)
1 user (show)

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


Attachments
Modified layman ebuild to support zsh-completion (layman-2.0.0.ebuild,1.93 KB, text/plain)
2013-06-15 22:11 UTC, Nado
Details
_layman functions from app-shells/zsh-completion (_layman,2.21 KB, text/plain)
2013-06-16 08:47 UTC, Nado
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nado 2013-06-15 22:11:44 UTC
Created attachment 351060 [details]
Modified layman ebuild to support zsh-completion

Hi,

I wondered why there was so few ebuilds with zsh-completion USE flag.
The ebuild zsh-completion provides few functions for portage associated commands, it could be better to remove this ebuild, and add the zsh-completion functions by ebuild.

For example, the ebuild layman would have a USE flag zsh-completion which brings the functions needed. It’s a way to avoid useless functions and have something more adaptive.

Find an example of the layman ebuild modified attached.
Comment 1 Nado 2013-06-16 08:47:57 UTC
Created attachment 351088 [details]
_layman functions from app-shells/zsh-completion
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2013-06-18 12:45:29 UTC
Comment on attachment 351060 [details]
Modified layman ebuild to support zsh-completion

--- layman-2.0.0.ebuild 2013-06-18 14:43:44.539473456 +0200
+++ -   2013-06-18 14:45:18.617303670 +0200
@@ -1,13 +1,14 @@
 # Copyright 1999-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/app-portage/layman/layman-2.0.0.ebuild,v 1.13 2013/06/17 04:27:34 dolsen Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-portage/layman/layman-2.0.0.ebuild,v 1.11 2013/01/22 15:48:01 jer Exp $

-EAPI="5"
+EAPI="4"
+SUPPORT_PYTHON_ABIS="1"
+PYTHON_DEPEND="2:2.6"
+RESTRICT_PYTHON_ABIS="2.4 3.*"
+PYTHON_USE_WITH="xml(+)"

-PYTHON_COMPAT=( python{2_6,2_7} )
-PYTHON_REQ_USE="xml"
-
-inherit eutils distutils-r1 prefix
+inherit eutils distutils prefix
 
 DESCRIPTION="Tool to manage Gentoo overlays"
 HOMEPAGE="http://layman.sourceforge.net/"
@@ -16,11 +17,12 @@
 LICENSE="GPL-2"
 SLOT="0"
 KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 sparc x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
-IUSE="bazaar cvs darcs +git mercurial subversion test"
-
-DEPEND="test? ( dev-vcs/subversion )"
+IUSE="bazaar cvs darcs +git mercurial subversion test zsh-completion"

-RDEPEND="
+COMMON_DEPS="dev-lang/python"
+DEPEND="${COMMON_DEPS}
+       test? ( dev-vcs/subversion )"
+RDEPEND="${COMMON_DEPS}
        bazaar? ( dev-vcs/bzr )
        cvs? ( dev-vcs/cvs )
        darcs? ( dev-vcs/darcs )
@@ -32,36 +34,44 @@     
                        >=dev-vcs/subversion-1.5.4[webdav-serf]
                )
        )
-       virtual/python-argparse[${PYTHON_USEDEP}]
-       "
+       zsh-completion? ( app-shells/zsh )"

-python_prepare_all()  {
-       python_export_best
+src_prepare() {
        eprefixify etc/layman.cfg layman/config.py
        epatch "${FILESDIR}"/layman-2.0.0.doctest.patch
 }

-python_test() {
-       for suite in layman/tests/{dtest,external}.py ; do
-               PYTHONPATH="." "${PYTHON}" ${suite} \
-                               || die "test suite '${suite}' failed"
-       done
+src_test() {
+       testing() {
+               for suite in layman/tests/{dtest,external}.py ; do
+                       PYTHONPATH="." "$(PYTHON)" ${suite} \
+                                       || die "test suite '${suite}' failed"
+               done
+       }
+       python_execute_function testing
 }

-python_install_all() {
-       distutils-r1_python_install_all
+src_install() {
+       distutils_src_install

        insinto /etc/layman
-       doins etc/layman.cfg
+       doins etc/layman.cfg || die

        doman doc/layman.8
        dohtml doc/layman.8.html

        keepdir /var/lib/layman
        keepdir /etc/layman/overlays
+
+       if use zsh-completion ; then
+               insinto /usr/share/zsh/site-functions
+               doins _layman
+       fi
 }
 
 pkg_postinst() {
+       distutils_pkg_postinst
+       
        # now run layman's update utility
        einfo "Running layman-updater..."
        "${EROOT}"/usr/bin/layman-updater
Comment 3 Ben de Groot (RETIRED) gentoo-dev 2015-03-29 05:42:33 UTC
See the recent discussion on -dev ML. 

Small text files such as shell completion functions should be installed unconditionally and without dependency on the package which will use the completions.