You are not logged in.
A small command-line application to check for the AUR package installed on your machine. This is only useful for ArchLinux (and derived distros)
pacman
go
AUR package is located at https://aur.archlinux.org/packages/aur-pkg-status/
Feedback is welcome!
Last edited by tinhtruong (2018-09-03 12:06:22)
Offline
yaourt is full of security issues [1]. You should not suggest it.
Offline
Thank yan12125 for your feedback. I will update my post to use yay instead.
Offline
*headdesk* just point users to the AUR package. If you are going to suggest a tool to install it, just suggest the officially supported tool: makepkg?
Please also revise your PKGBUILD to build from source, or alternatively (but not advised) rename it to aur-pkg-status-bin.
Last edited by Trilby (2018-09-02 12:42:11)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Alternatively, there is cower:
% cower -u
:: distccd-alarm-armv6h 8.2.0-2 -> 8.2.0-3
:: distccd-alarm-armv7h 8.2.0-2 -> 8.2.0-3
:: distccd-alarm-armv8 8.2.0-2 -> 8.2.0-3
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
Please also revise your PKGBUILD to build from source, or alternatively (but not advised) rename it to aur-pkg-status-bin.
I'd just like to highlight this advice, and reinforce it with *my* advice that as these are actually the Rules of Submission
Managing AUR repos The Right Way -- aurpublish (now a standalone tool)
Offline
Alternatively, there is cower:
% cower -u :: distccd-alarm-armv6h 8.2.0-2 -> 8.2.0-3 :: distccd-alarm-armv7h 8.2.0-2 -> 8.2.0-3 :: distccd-alarm-armv8 8.2.0-2 -> 8.2.0-3
cower doesn't indicate if a package has been removed.
Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.
Offline
Thank you all for your feedback. I've updated the origin post and the PKGBUILD so that the installation will build from the source.
Offline
Some issues: a) there are no quotes around $srcdir. b) The license file is missing in the final package.
Offline
thanks a821 for the feedback. I've updated the PKDBUILD file.
Offline
Is there a reason why you're installing to `/opt`? why not just copy your program to `/usr/bin` and the license to `/usr/share/licenses/aur-pkg-status/LICENSE`?
Last edited by a821 (2018-09-05 12:37:47)
Offline
Is there a reason why you're installing to `/opt`? why not just copy your program to `/usr/bin` and the license to `/usr/share/licenses/aur-pkg-status/LICENSE`?
I did not know that there's a standard location for license files.
PKGBUILD has been updated.
Offline
I made a comment on the AUR comment page.
Offline
I would rewrite the GOPATH declaration line in build() as
export GOPATH="$(pwd):$(pwd)/vendor"
i.e. use $(...) instead of backticks (EDIT: or just use $PWD instead of invoking pwd; see below), and quote it correctly (see below).
Why is the makedepends array commented out? For building a go program, go is indeed required.
The package() function could be rewritten as
package() {
install -Dm0755 aur-pkg-status-$pkgver/src/github.com/tinhtruong/aur-pkg-status/aur-pkg-status "$pkgdir/usr/bin/aur-pkg-status"
install -Dm0644 aur-pkg-status-$pkgver/LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
i.e. use the -D option to create all leading paths for the target, and don't use unnecessary ${...} as there is no parameter expansion (see below). I assume that $pkgver needs no quoting here. There is also no real need to use $srcdir here, as package() already starts in $srcdir (see below). And finally, I believe the style guidelines and example PKGBUILDs use 2 spaces for indentation (see below).
Last edited by ayekat (2018-09-09 14:16:42)
Offline
@Stefan Husmann and @ayakat: I've updated the PKGBUILD as your suggestions. Thank you.
Offline
... and quote it correctly.
Quotes are harmless there, but they also serve no purpose. It doesn't matter whether there are spaces or other oddities in the current path as it will still be assigned correctly. Quotes would be needed when the value of a variable that may contain spaces is expanded and used in a context where it'd be wrongly tokenized. That is not the case here:
$ cd /tmp
$ mkdir "one dir"
$ cd "one dir"
$ var=$(pwd)
$ echo $var
/tmp/one dir
Works just fine with no quotes on the right side of 'var' assignment. Quotes would be needed if I wanted to do something like `cd "$var"`.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
I would rewrite the GOPATH declaration line in build() as
export GOPATH="$(pwd):$(pwd)/vendor"
i.e. use $(...) instead of backticks, and quote it correctly.
... or use $PWD which saves a subprocess and a builtin invocation in exchange for accessing a variable that is set by the shell to the same value.
and don't use unnecessary ${...} as there is no parameter expansion. I assume that $pkgver needs no quoting here. There is also no real need to use $srcdir here, as package() already starts in $srcdir. And finally, I believe the style guidelines and example PKGBUILDs use 2 spaces for indentation.
Or, you could stop telling other people what style of bash to prefer, as there is most definitely no "official style" for how many spaces to use for indentation (I religiously use 4), and "unnecessary" ${...} is in fact yet another personal bash programming style choice.
It is, however, correct that we document all functions to start in $srcdir, and therefore it is not required to explicitly cd there. (Some people prefer cd'ing to absolute paths anyway, and depending on the situation you may need to use it in the middle of a function, but I digress.)
Managing AUR repos The Right Way -- aurpublish (now a standalone tool)
Offline
there is most definitely no "official style" for how many spaces to use for indentation (I religiously use 4)
Hmm - I have encountered quite some PKGBUILDs that had vim modelines in them that set expandtab and tabstop=2, so I assumed they all originated from the same sample PKGBUILD file. Hence I assumed that this is the preferred PKGBUILD style (because I would otherwise also use 4 spaces and no expandtab for shell scripts).
But now that I took another look at the sample PKGBUILDs provided, this doesn't seem to be true. I must've misremembered that. I apologise.
As for the ${...}, I guess I'm just a bit allergic to it because it (1) is indeed unnecessary, and (2) I occasionally see people mistake it for proper quoting (so they often use ${...} all over the place, and no quoting at all). But it is not wrong per se, so sorry for the noise there.
As for $PWD, I seem to (mis)remember cases where one cannot rely on the variable being set correctly, so I stopped using it in my scripts in favour of calling `pwd`. Will have to check that assumption...
EDIT: After correcting my initial comment, I guess my "feedback" was largely useless. Apologies to the OP - I'll probably leave PKGBUILD reviewing to the more experienced people from now on
Last edited by ayekat (2018-09-09 14:16:14)
Offline
The sample PKGBUILDs are even worse they use ugly tabs.
As for the unquoted ${...} with spaces in them, I solve this problem by doing both. But sure, it's a problem and people should definitely be reminded where appropriate, that those need to be quoted.
Managing AUR repos The Right Way -- aurpublish (now a standalone tool)
Offline
As for $PWD, I seem to (mis)remember cases where one cannot rely on the variable being set correctly, so I stopped using it in my scripts in favour of calling `pwd`. Will have to check that assumption...
It depends on which version of $(pwd) you use!
By default, the shell builtin will align with the value of $PWD. You can enforce absolute path resolution using $(pwd -P), and the external binary $(/usr/bin/pwd) will use the absolute path resolution regardless.
Use the builtin rather than the environment variable in the event that you're worried some crazy person will decide to be funny and `export PWD=/this/is/not/my/real/pwd` -- but I think in any other case it should be fine.
Managing AUR repos The Right Way -- aurpublish (now a standalone tool)
Offline
EDIT: After correcting my initial comment, I guess my "feedback" was largely useless. Apologies to the OP - I'll probably leave PKGBUILD reviewing to the more experienced people from now on
Far from it - the feedback provided in this thread provided productive discussions of what is necessary and proper in a PKGBUILD (as opposed to what is stlyistic). Without this discussion people may miss important things or may wrongly assume importance of other things. Whether or not this specific thread is the ideal place for such a discussion is a fair question (to which I'd respond "yes" as separate discussions on rules/style will be mostly ignored or overlooked).
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
To get back on discussing the actual software... I'd like to see a way to take package names/versions from stdin, rather than have them hardcoded through pacman -Qm. In particular, that would add support for local repos containing AUR packages.
Mods are just community members who have the occasionally necessary option to move threads around and edit posts. -- Trilby
Offline