You are not logged in.
Pages: 1
I have built my first ever PKGBUILD for a small wrapper around pacaur that I am using (pacget). I like how pacaur works, but it does not provide the search functionality like yaourt. On the other hand yaourt prompts for confirmation before each install which is annoying. There are several wrappers of pacaur available, among them I tried pac which produced some errors. Anyway, I wanted to do something on my own, so I created a small script that wraps around pacaur and does some additional tasks that I require.
This is an example use case:
# Upgrade
pacget -Syu
# The following installs the package linux-lts
pacget -S linux-lts
# The following is a short form to pacget -S linux-lts
pacget linux-lts
# The following will search for gimp in both official repo and AUR
# and give you option to select packages to install
pacget -s gimp
# The following will search only arch official repo
# and give you option to select packages to install
pacget -Ss gimp
And an example screenshot:
https://neurobin.org/img/pacget-ex.png
N.B: Suggestions and critics are welcome.
Last edited by jahid (2017-08-22 01:27:41)
Offline
Read the Code of Conduct and only post thumbnails http://wiki.archlinux.org/index.php/Cod … s_and_code
and don't pacman -Sy $package, it breaks things.
Offline
don't pacman -Sy $package, it breaks things.
Thanks for the link, it explains it quite nicely. I have removed the -Sy thingy from the post and from my package.
Offline
I like how pacaur works, but it does not provide the search functionality
Are you sure? It has documented methods for searching the repos and AUR as well as others for AUR-only searches. It's also itself a wrapper to cower which definitely does search the AUR.
As for the PKGBUILD review, that'd be easier if it was posted here. But some first notes:
1) The code has a BSD license, but your PKGBUILD lists the license as GPL. Pick one.
2) Get rid of all the empty variables in the PKGBUILD.
3) This is not a vcs build, so use a checksum.
4) Get rid of all the empty functions (everything but package() can go).
Last edited by Trilby (2017-08-22 10:54:22)
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
jahid wrote:I like how pacaur works, but it does not provide the search functionality
Are you sure? It has documented methods for searching the repos and AUR as well as others for AUR-only searches. It's also itself a wrapper to cower which definitely does search the AUR.
I like how pacaur works, but it does not provide the search functionality like yaourt
yaourt search gives an interactive option to select single or multiple packages to install.
Thanks for the advices, I will implement them in next upload.
Offline
As for the PKGBUILD review, that'd be easier if it was posted here.
Current state of the PKGBUILD:
# Maintainer: Md. Jahidul Hamid <jahidulhamid@yahoo.com>
pkgname=pacget
pkgver=1.0.4
pkgrel=2
pkgdesc="A wrapper around pacaur to mimic yaourt's search feature"
arch=('any')
url="https://github.com/neurobin/pacget"
license=('BSD')
depends=('pacaur')
optdepends=('pkgfile: support for package search by file name')
source=("https://github.com/neurobin/$pkgname/archive/$pkgver.tar.gz")
md5sums=('6b1c401b998b4414c5ba7bb1099b28a7')
validpgpkeys=('3331 6137 5B22 27AC F7AA 6351 A4A2 CA5B 6BDA A871')
package() {
cd "$pkgname-$pkgver"
make DESTDIR="$pkgdir/" install
}
Last edited by jahid (2017-08-22 14:20:15)
Offline
You could rewrite the code to remove the pkgfile optdepend, all of pkgfiles functionality is now built directly into pacman (look at the man page for the -F switch).
Last edited by Slithery (2017-08-22 16:05:39)
Offline
You could rewrite the code to remove the pkgfile optdepend, all of pkgfiles functionality is now built directly into pacman (look at the man page for the -F switch).
Good point, I have updated it to wrap the -F switch to provide yaourt like search and install and removed pkgfile dependency.
Last edited by jahid (2017-08-27 13:58:33)
Offline
Run your pacget script through www.shellcheck.net, it will point out the typo that you've missed
Last edited by Slithery (2017-08-27 14:21:16)
Offline
Run your pacget script through www.shellcheck.net, it will point out the typo that you've missed
Thanks for pointing out. Though the typo was harmless in this case it did not have any impact. Other yellow colored warnings, you can ignore them, they have reasons to be like that
Last edited by jahid (2017-08-27 15:12:00)
Offline
Pages: 1