Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 533672 - net-misc/youtube-dl - add support for zsh completion
Summary: net-misc/youtube-dl - add support for zsh completion
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Jeroen Roovers (RETIRED)
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2014-12-27 11:19 UTC by Elias Probst
Modified: 2022-05-10 19:39 UTC (History)
4 users (show)

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


Attachments
Patch for youtube-dl-2014.12.17.2.ebuild adding zsh-completion support (youtube-dl-zsh-completion.patch,911 bytes, patch)
2014-12-27 11:19 UTC, Elias Probst
Details | Diff
Simplified patch as file (file_533672.txt,401 bytes, patch)
2016-04-17 21:12 UTC, gentoo_usr
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Elias Probst 2014-12-27 11:19:19 UTC
Created attachment 392500 [details, diff]
Patch for youtube-dl-2014.12.17.2.ebuild adding zsh-completion support

The attached patch adds support for zsh-completion in net-misc/youtube-dl.
THe diff is based on 'youtube-dl-2014.12.7.2.ebuild.
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2014-12-27 11:35:29 UTC
Why can't we just skip this:

+	if use zsh-completion; then

And unconditionally do this:

+		insinto /usr/share/zsh/site-functions
+		newins ${PN}.zsh _${PN}.zsh

Then we don't need a USE flag or a dependency and we install an additional 2.5K file.
Comment 2 Elias Probst 2014-12-27 11:57:23 UTC
(In reply to Jeroen Roovers from comment #1)
> Why can't we just skip this:
> 
> +	if use zsh-completion; then
> 
> And unconditionally do this:
> 
> +		insinto /usr/share/zsh/site-functions
> +		newins ${PN}.zsh _${PN}.zsh
> 
> Then we don't need a USE flag or a dependency and we install an additional
> 2.5K file.

Sure, would work just fine for me.
I just copied this way of handling it based on how most other ebuilds did it.
Comment 3 gentoo_usr 2016-04-17 21:10:34 UTC
In case it help, here a simplified patch without conditional statement.
The patch is based on youtube-dl-2016.04.06.ebuild and uses the same convention as the ebuilds dev-python/pip and dev-vcs/mercurial to install the zsh completion.

--- a/youtube-dl-2016.04.06.ebuild      2016-04-17 23:00:05.976628409 +0200
+++ b/youtube-dl-2016.04.06.ebuild      2016-04-17 23:01:32.607626857 +0200
@@ -83,5 +83,7 @@
        dodoc README.txt
        doman ${PN}.1
        newbashcomp ${PN}.bash-completion ${PN}
+       insinto /usr/share/zsh/site-functions
+       newins youtube-dl.zsh _youtube-dl
        python_fix_shebang "${ED}"
 }
Comment 4 gentoo_usr 2016-04-17 21:12:36 UTC
Created attachment 431028 [details, diff]
Simplified patch as file

Patch mentioned in previous comment as an attachment.
Comment 5 Jeroen Roovers (RETIRED) gentoo-dev 2016-04-22 13:01:15 UTC
Fixed in 2016.04.19-r1. Thanks for the report and patch.