You are not logged in.
Hi all,
I'm new to ArchLinux but have some experience with Ubuntu, Fedora and Max OS X. From those OSs I was used to having quite good tab-completion for my dev-tools like maven, rubygems, npm etc.
However, those do not seem to be included in either the respective tool's package or in the bash-completion package.
I think I can just add new completions files to /usr/share/bash-completion/completions but I am wondering:
a) whether /usr/share/bash-completion/completions is the recommended place to put those files or if there some other mechanism I should use, and
b) where I would find a potential file with the corresponding completions.
Thanks in advance for any help.
Offline
Some packages include bash completions in their packages. A bunch of completion files come from 'bash-completion' package.
I do not see completions for maven, rubygems in the standard repositories. In this case algorithm is following:
- check AUR if there is a package for completion you are looking for
- if it exist then install it otherwise google for an opensource project
- If you found the project then create an AUR package for it.
For example here is maven completion https://github.com/juven/maven-bash-com … etion.bash Try to create an AUR package, it is not difficult at all.
As alternative to package creation you can put the file to /etc/bash_completion.d directory.
Another alternative is to ask maven maintainer to put these completions to maven package directly.
Read it before posting http://www.catb.org/esr/faqs/smart-questions.html
Ruby gems repository done right https://bbs.archlinux.org/viewtopic.php?id=182729
Fast initramfs generator with security in mind https://wiki.archlinux.org/index.php/Booster
Offline
Hi,
I tried creating an AUR package (inspired by leiningen-completions), which seems to be working locally. Would you mind taking a look at the PKGBUILD before I try to submit it?
I am not sure about what to put as "license". Also namcap warns me that dependencies are not needed. Maybe I'm not getting the purpose of the "depends" property. I understand it as "these packages are necessary for my package to function properly".
# Maintainer: heapifyman <heapifyman@gmail.com>
pkgname=maven-completions
pkgver=0.0.1
pkgrel=1
pkgdesc="Bash completion script for maven"
arch=('any')
url="https://github.com/juven/maven-bash-completion"
license=('unknown')
depends=('maven'
'bash-completion')
source=("https://raw.githubusercontent.com/juven/maven-bash-completion/03b9f006ddffbe4f6e3913dcf5dab5039822893c/bash_completion.bash")
sha1sums=('ec31a5cdbe9eb061e4158162552f9678c5c083af')
package() {
cd ${srcdir}
install -m 0644 -D "${srcdir}"/bash_completion.bash "${pkgdir}"/usr/share/bash-completion/completions/maven
}
Offline
I am not sure about what to put as "license".
unknown is okay, but maybe you should contact upstream and ask them to make a note of their licensing terms in the README or something.
Also namcap warns me that dependencies are not needed. Maybe I'm not getting the purpose of the "depends" property. I understand it as "these packages are necessary for my package to function properly".
Your PKGBUILD looks fine.
See `man namcap` under "depends" for why those warnings don't mean anything.
(Hint: namcap only checks ldd, that's why it is a warning, not an error.)
Managing AUR repos The Right Way -- aurpublish (now a standalone tool)
Offline
unknown is okay, but maybe you should contact upstream and ask them to make a note of their licensing terms in the README or something.
Thanks, I will do that.
Offline
source=("https://raw.githubusercontent.com/juven/maven-bash-completion/03b9f006ddffbe4f6e3913dcf5dab5039822893c/bash_completion.bash")
sha1sums=('ec31a5cdbe9eb061e4158162552f9678c5c083af')
It should be a VCS package with following version() function
pkgver() {
cd "$pkgname"
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}
The package should be called maven-bash-completion-git in this case.
package() {
cd ${srcdir}
install -m 0644 -D "${srcdir}"/bash_completion.bash "${pkgdir}"/usr/share/bash-completion/completions/maven
}
You don't need to cd to $srcdir as makepkg always starts package() in $srcdir.
Read it before posting http://www.catb.org/esr/faqs/smart-questions.html
Ruby gems repository done right https://bbs.archlinux.org/viewtopic.php?id=182729
Fast initramfs generator with security in mind https://wiki.archlinux.org/index.php/Booster
Offline
Oh...
Don't cd to $srcdir and then copy a file from $srcdir, that is rather redundant. But if you do, ALWAYS quote the variable! You don't control what is in it...
There is a de facto standard that functions begin in $srcdir, but some like to explicitly cd there anyway (I believe pacman 5.0 will make this de jure).
Upstream doesn't tag versions, so you can either pull arbitrary revisions and increment them yourself or transform the package into a git package as anatolik said. It's a fairly lightweight repo so you might just want to make it a git version.
Managing AUR repos The Right Way -- aurpublish (now a standalone tool)
Offline
Does this look ok to you?
And if it does, how do I remove the "old" maven-completions from AUR? Just flag it as out of date?
# Maintainer: heapifyman <heapifyman@gmail.com>
pkgname=maven-bash-completion-git
pkgdesc="Bash completion script for maven"
pkgver=r160.e27e290
pkgrel=1
arch=('any')
url="https://github.com/juven/maven-bash-completion"
license=('APACHE')
depends=('maven'
'bash-completion')
makedepends=('git')
source=("$pkgname::git+https://github.com/juven/maven-bash-completion.git")
sha256sums=('SKIP')
pkgver() {
cd "$srcdir/$pkgname"
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}
package() {
install -m 0644 -D "${srcdir}"/"$pkgname"/bash_completion.bash "${pkgdir}"/usr/share/bash-completion/completions/mvn
}
Offline
Looks fine. All that is left is subjective style choices, which don't actually affect the usefulness of the PKGBUILD in any way.
in package() --- "${srcdir}"/"$pkgname" --- could just as easily be "${srcdir}/$pkgname" , also it isn't strictly necessary to bracket that variable, but I like to anyway. I am a bit surprised though, to see a mix of both styles.
A random trick I use for the url/other of git packages is ${pkgname%-git} --- which In my subjective opinion looks nicer (or perhaps just more sophisticated and frilly).
...
I don't think there is any way to change the pkgbase of a package, so just upload this as normal, then submit a deletion request for the other package.
(You can file a merge request instead, which I believe would move comments over to the new package, probably not necessary...)
Last edited by eschwartz (2016-01-14 22:14:07)
Managing AUR repos The Right Way -- aurpublish (now a standalone tool)
Offline
A random trick I use for the url/other of git packages is ${pkgname%-git} --- which In my subjective opinion looks nicer (or perhaps just more sophisticated and frilly).
Not sure if I understand what you mean. Could you give an example?
Offline
Several of my packages are git packages: https://github.com/eli-schwartz/pkgbuilds
See for example the vim-*-git ones. Most of them are by tpope, so the only thing I need to change to add a new one is the pkgname and pkgdesc...
It makes it easy(ier) to repurpose a PKGBUILD.
Managing AUR repos The Right Way -- aurpublish (now a standalone tool)
Offline
Ok, got it. Thanks
What do you think of this one now?
# Maintainer: heapifyman <heapifyman@gmail.com>
pkgname=maven-bash-completion-git
pkgdesc="Bash completion script for maven"
pkgver=r160.e27e290
pkgrel=1
arch=('any')
url="https://github.com/juven/${pkgname%-git}"
license=('APACHE')
depends=('maven'
'bash-completion')
makedepends=('git')
source=("git://github.com/juven/${pkgname%-git}.git")
sha256sums=('SKIP')
pkgver() {
cd "${srcdir}/${pkgname%-git}"
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}
package() {
install -m 0644 -D "${srcdir}/${pkgname%-git}"/bash_completion.bash "${pkgdir}"/usr/share/bash-completion/completions/mvn
}
Offline
A brilliant homage to my style preferences.
Managing AUR repos The Right Way -- aurpublish (now a standalone tool)
Offline