You are not logged in.

#1 2013-04-18 20:12:26

STUART
Member
From: Seattle, WA
Registered: 2010-08-19
Posts: 52
Website

aur.sh - the most minimal AUR helper possible

I've made an AUR helper that consists of nine lines of bash:

aur.sh

It downloads, unzips, and makepkgs every package listed with the specified options (so you can specify if you want to install the packages after building). The HTML documentation is only presented when visited through a recognized browser, so it can be used from bash with one line and no installation:

bash <(curl aur.sh) -si packer codecs ponysay-git

Thoughts? Personally, I find this to be a ton useful when I'm just setting up a new system and I need to get a package from the AUR without looking up the tarball URL.

Github: https://github.com/stuartpb/aur.sh

PS. If you're German and the name strikes you as a bit immodest, the same content is mirrored at the alternate name aur.so.

Last edited by STUART (2013-04-18 21:14:49)

Offline

#2 2013-04-18 20:39:18

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: aur.sh - the most minimal AUR helper possible

man page wrote:

To install every package and its main repo dependencies, first ensure that the main repo package databases are up to date:

sudo pacman -Sy

That should be -Syu...

Also, it would be a good idea to include the github link in your post https://github.com/stuartpb/aur.sh (as a courtesy).


Moving to Community Contributions


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2013-04-18 20:54:49

STUART
Member
From: Seattle, WA
Registered: 2010-08-19
Posts: 52
Website

Re: aur.sh - the most minimal AUR helper possible

jasonwryan wrote:
man page wrote:

To install every package and its main repo dependencies, first ensure that the main repo package databases are up to date:

sudo pacman -Sy

That should be -Syu...

No, just -Sy. The databases need to be synchronized, but the installed packages don't need to be upgraded unless the dependencies that would be installed are incompatible with your currently installed versions. (If that happens, then pacman -S <dependency> as necessary.)

Last edited by STUART (2013-04-18 20:58:47)

Offline

#4 2013-04-18 21:10:25

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: aur.sh - the most minimal AUR helper possible

STUART wrote:
jasonwryan wrote:
man page wrote:

To install every package and its main repo dependencies, first ensure that the main repo package databases are up to date:

sudo pacman -Sy

That should be -Syu...

No, just -Sy. The databases need to be synchronized, but the installed packages don't need to be upgraded unless the dependencies that would be installed are incompatible with your currently installed versions. (If that happens, then pacman -S <dependency> as necessary.)


You are effectively advising people to -Sy package. That is a bad idea.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#5 2013-04-21 08:25:18

cdown
Member
From: London, England
Registered: 2013-02-09
Posts: 55
Website

Re: aur.sh - the most minimal AUR helper possible

The concept is good. Here's a few things:

- You need to quote your expansions properly, this will break if BUILDDIR contains whitespace.
- The advice in the manpage to use -Sy without -u is concerning.
- You should not rely on #!/bin/sh as an interpreter for non-POSIX scripts (your substring expansion on line 6 is not portable). This will render your script non-functional on any environment that uses a POSIX interpreter to provide /bin/sh.
- Error handling is fairly poor in the case of a nonexistent package or broken pipe during the curl download.

Also, a small note on code style. Writing good shell is not about obfuscating the living hell out of it. Avoid parameter expansion without any meaningful explanation (which could simply be provided by a variable name). Variables like "p" and "d" are also not useful for anyone who would seek to read your code. Use proper variable names: "$pkg" and "$dir" at a minimum.

Last edited by cdown (2013-04-21 08:47:34)

Offline

#6 2013-04-21 09:25:18

Army
Member
Registered: 2007-12-07
Posts: 1,784

Re: aur.sh - the most minimal AUR helper possible

STUART wrote:

PS. If you're German and the name strikes you as a bit immodest, the same content is mirrored at the alternate name aur.so.

ymmd!

Offline

Board footer

Powered by FluxBB