You are not logged in.

#1 2011-05-24 08:39:40

yanhan
Member
Registered: 2011-05-24
Posts: 11

powaur - an AUR helper with a pacman-like interface

Hi guys,

I've just written this minimalistic AUR helper called powaur, with an interface like pacman / yaourt, so
there's no need to learn an addition set of commands. C is the only language I'm really really comfortable
with, so powaur is written in C.

Links
Github - https://github.com/yanhan/powaur
AUR - http://aur.archlinux.org/packages.php?ID=49296

Updates
24 Jan 2012:  - Updated to work with pacman 4 (!!)
10 July 2011:  - allow uppercase answers for questions
28 June 2011: - --noconfirm option added
                       - --list-aur option added; lists installed AUR packages and their version
                       - only resolve dependencies for new / outdated AUR packages
26 June 2011: - allow installing of packages as root
                       - add per-user directory in form of /tmp/powaur-username, please comment out
                         "TmpDir" section of your powaur.conf for this to take effect
                       - print immediate dependencies for -S
                       - only print dependency graph for -S when --debug is supplied
10 June 2011: -S supports dependency resolution
                       -Su available to update outdated AUR packages
                       --crawl to output topological order of packages
                       -G --deps uses similar dependency resolution algorithm with -S
31 May 2011: Colorized output is now available!
26 May 2011: Multithreaded downloading is now supported!

Features

Currently, powaur offers the following feature set:

-G, --getpkgbuild        Downloads PKGBUILDS of listed packages from the AUR
    --deps               Resolve dependencies for packages. This is turned off by default.
    --threads <N>        Limits the maximum number of threads to N (max of 10)

-S, --sync               When used alone, installs packages from the AUR without dependency resolution.
    --check              Only meaningful with -u. Checks for outdated AUR packages without upgrading them
    -i, --info           Similar to that of pacman
    -s, --search         Searches the AUR for a single package
    -u, --upgrade        Updates outdated AUR packages
    --vote               Used with -s, orders search results by vote count (highest first) instead of alphabetical order

-Q, --query              Queries installed packages
    -i, --info           Similar to that of pacman
    -s, --search         Similar to that of pacman

--crawl <package(s)>     Shows a valid topological order of given packages

-B, --backup [dir]       Backup the pacman local database in <dir>, or the current directory if unspecified

-M, --maintainer         Searches the AUR for a maintainer
     --vote              Orders the maintainer's packages by vote count (highest first) instead of alphabetical order

--color                  Enable colorized output
--nocolor                Turn off colorized output
--debug                  Displays debug information
-h, --help               Displays help
-V, --version            Displays version

Credits

Many thanks to Dave Reisner (falconindy) for allowing me to use code in cower for json parsing.
I also referred to source code from pacman and git.

Finally
Feature requests are welcome!

Last edited by yanhan (2012-01-24 11:27:33)

Offline

#2 2011-05-24 15:22:11

Nordwin
Member
Registered: 2011-04-10
Posts: 5

Re: powaur - an AUR helper with a pacman-like interface

Hey, just downloaded it, want to try it later....


but is ist on purpose that the PKGBUILD only lists 'x86_64' as architecture?

Offline

#3 2011-05-25 00:39:46

yanhan
Member
Registered: 2011-05-24
Posts: 11

Re: powaur - an AUR helper with a pacman-like interface

Hi, thanks for replying! smile I actually thought nobody is going to care...

It's really not on purpose that I only listed x86_64. It's just that I don't have a 32-bit system to test whether it'll work.
I'm not really that experienced a programmer so yep. But I believe the code doesn't assume anything about the
architecture of the machine.

I think I'll just add x86 to the list of architectures as well then.

Offline

#4 2011-05-28 04:05:06

anonymous_user
Member
Registered: 2009-08-28
Posts: 3,058

Re: powaur - an AUR helper with a pacman-like interface

Does this program work with the AUR exclusively? Also it would be nice if it had included "-Su" to update packages.

Offline

#5 2011-05-29 06:40:28

Barthalion
Developer
From: Poland
Registered: 2010-02-26
Posts: 109

Re: powaur - an AUR helper with a pacman-like interface

And colored output will be great.


Arch Linux - rolling release distro, which users want to downgrade to the previous version

Offline

#6 2011-05-30 08:21:23

yanhan
Member
Registered: 2011-05-24
Posts: 11

Re: powaur - an AUR helper with a pacman-like interface

Hi guys, thanks for the responses!

@anonymous_user : To be honest I was pretty torn over whether to wrap over pacman by providing functionality like -Su.
I think it'll be no for now. If I were to include it, I'd either have to wrap pacman or copy its code.

If I were to wrap pacman:
-> A bash script will be better. I think I might create a wrapper to do this in the future.

If I were to copy code from pacman:
-> I really try not to. I did so for the command parsing parts because I thought it was pretty elegant
how pacman looked for the operations (-S, -Q, -U, etc) and then go on to parse the operation specific
options and global options. I didn't have a better solution. But as much as possible, I tried not to
copy code from there.

I hope you understand me for now...

@Barthalion: I'll get colourized output up asap.

Offline

#7 2011-05-30 16:10:11

anonymous_user
Member
Registered: 2009-08-28
Posts: 3,058

Re: powaur - an AUR helper with a pacman-like interface

I wasn't talking about wrapping Pacman specifically, but just some method to update AUR packages.

Offline

#8 2011-05-31 07:52:21

yanhan
Member
Registered: 2011-05-24
Posts: 11

Re: powaur - an AUR helper with a pacman-like interface

Sorry for the misunderstanding, anonymous_user. I get what you mean now. Rest assured that I've been
working on it for the past couple of hours. I hope I can get it out by midnight at where I live, if not the day
after.

I really thank you and Barthalion for rekindling my passion in this, I almost wanted to give it up.

Offline

#9 2011-05-31 11:13:20

ethail
Member
From: Spain
Registered: 2011-02-10
Posts: 225

Re: powaur - an AUR helper with a pacman-like interface

I gave it a try and I like it. To me it seems a really nice AUR helper. As said by anonymus_user, any feature to check updates would be really appreciated.

From here on now, dependencies --> AUR dependencies. I have seen that in official repositories' dependencies, powaur does the job.

When getting packages (-G) you have the option to check dependencies, but, what about having that also in Sync (-S)? If I'm not mistaken, it could be used the same function in your code which you use to check dependencies when downloading packages, but not installing, when installing. Also, in case that AUR dependencies are not met, install them (or whatever).

Also, I found kind of a bug, that happens when some dependencies are written in terms of package<version, exemple--> yaourt:

powaur -G yaourt --deps                                                       
==> Downloading files to /home/akai/build/algo                                           
==> Downloaded yaourt.tar.gz                                                             
==> Downloaded package-query.tar.gz                                                     
error: curl responded with http code: 404                                               
error: downloading http://aur.archlinux.org/packages/pacma … 3.6.tar.gz failed.

It does not seem to happen on package>=version

Also, there is kind of another "bug" when installing, related to the feature I proposed before. As said, it does official repositories' dependency checking BUT takes AUR packages as official ones:
(I don't know what the english text is, as my output is in Spanish, but I translated it)

==> Creating package: yaourt 0.10.1-2 (mar may 31 13:09:31 CEST 2011)                 
==> Checking dependencies...                                                         
==> Installing missing dependencies...                                           
Password:                                                                             
error: target not found: package-query>=0.7                                         
==> ERROR: 'pacman' failed to install missing dependencies.

I hope this helps

Last edited by ethail (2011-05-31 11:13:59)


My GitHub Page

Best Testing Repo Warning: [testing] means it can eat you hamster, catch fire and you should keep it away from children. And I'm serious here, it's not an April 1st joke.

Offline

#10 2011-05-31 12:59:57

yanhan
Member
Registered: 2011-05-24
Posts: 11

Re: powaur - an AUR helper with a pacman-like interface

ethail wrote:

I gave it a try and I like it. To me it seems a really nice AUR helper. As said by anonymus_user, any feature to check updates would be really appreciated.

Hi ethail, thanks for the compliment! And yes, I'm working on the check updates feature. It'll be kind of sluggish though.
It should be out within the next 2 days if nothing goes wrong.

ethail wrote:

Also, I found kind of a bug, that happens when some dependencies are written in terms of package<version, exemple--> yaourt:

powaur -G yaourt --deps                                                       
==> Downloading files to /home/akai/build/algo                                           
==> Downloaded yaourt.tar.gz                                                             
==> Downloaded package-query.tar.gz                                                     
error: curl responded with http code: 404                                               
error: downloading http://aur.archlinux.org/packages/pacma … 3.6.tar.gz failed.

It does not seem to happen on package>=version

Fixed in v0.1.3.1. Thanks for reporting. It also reminded me that currently this dependency resolution thing is still a hack.
This didn't happen to me because I happen to have archlinuxfr as a repository, so when yaourt's dependencies are resolved,
package-query is found in archlinuxfr db and hence not downloaded nor resolved.

ethail wrote:

Also, there is kind of another "bug" when installing, related to the feature I proposed before. As said, it does official repositories' dependency checking BUT takes AUR packages as official ones:
(I don't know what the english text is, as my output is in Spanish, but I translated it)

==> Creating package: yaourt 0.10.1-2 (mar may 31 13:09:31 CEST 2011)                 
==> Checking dependencies...                                                         
==> Installing missing dependencies...                                           
Password:                                                                             
error: target not found: package-query>=0.7                                         
==> ERROR: 'pacman' failed to install missing dependencies.

I hope this helps

The output above is from makepkg I believe, since the -S flag invokes makepkg after asking whether you want to edit the
PKGBUILD, .install, etc. I believe that makepkg can only pull in dependencies from sync databases.

By what I analyzed above, you probably dont have the archlinuxfr db as a sync database, so package-query is not found and
makepkg aborts.

Ok, right now the -S flag does not do any kind of dependency resolution. I MIGHT do it since it overlaps with the next feature
I'll be working on (checking whether AUR packages are out of date and updating them if necessary, which involves dependency
resolution).

I'm really glad that you like it. I think seeing users satisfied is a really great joy, even though the code is very ugly now. =P
I did choose the right field after all smile

Offline

#11 2011-06-15 20:40:48

Nordwin
Member
Registered: 2011-04-10
Posts: 5

Re: powaur - an AUR helper with a pacman-like interface

Hey,
I have no started to use powaur as my AUR-Helper on my two computers and I really like it!

On my i686 Laptop it just works and is simple and pacman-like..

But on my 64-bit Desktop I have recently started to have some weird problems:
When trying to install certain packages I get a 'cyclic dependencies detected'
http://pastebin.com/D5fjazGw

or, a simpler example:

http://pastebin.com/ir2w2wnc

even though the output of the --crawl does not seem to be very cyclic to me.


I have not looked at your code yet, just figured I might ask first if you know whats up here....


Oh, and: I have multilib enabled and have installed quite some lib32's. But I have no idea if that might cause a problem with the dependencies...


Well, thank you for the time and effort you put into powaur!

Offline

#12 2011-06-24 16:09:24

yanhan
Member
Registered: 2011-05-24
Posts: 11

Re: powaur - an AUR helper with a pacman-like interface

Hi Nordwin,

Sorry for the late reply. I've had a serious flu for the past 2 weeks and was rather busy
this week. Will definitely look into this issue asap.

Glad you enjoyed using powaur smile

Offline

#13 2011-06-25 05:53:24

musasabi
Member
From: Chicago, IL
Registered: 2011-06-23
Posts: 46

Re: powaur - an AUR helper with a pacman-like interface

Hey there, yanhan. smile I just switched over from Gentoo to Arch simply for my love of Gnome 3. Maybe when Gentoo jumps on their Gnome support, I'll switch back... but for now, I'm loving Arch.

I downloaded powaur because I like pacman and I wanted to handle the AUR as seamlessly as emerge handles its overlays. I've got a super newb question for you, though, as per I don't quite know pacman's in's and out's yet.

So, as I'd like the 64-bit flash binary. I go about doing this as root:

[root@laptop patrick]# powaur -S flashplugin-prerelease

Syncing:
flashplugin-prerelease

---------------------------------
==> Do you wish to proceed? [Y/n]
---------------------------------
==> y
---------------------------------
Resolving dependencies... Please wait
==> Dependency graph:
xineramaproto (installed) -> randrproto (installed) -> inputproto (installed) -> xextproto (installed) -> renderproto (installed) -> iana-etc (installed) -> xcb-proto (installed) -> kbproto (installed) -> xproto (installed) -> fixesproto (installed) -> compositeproto (installed) -> damageproto (installed) -> tzdata (installed) -> linux-api-headers (installed) -> glibc (installed) -> libice (installed) -> libdatrie (installed) -> libthai (installed) -> pixman (installed) -> libdaemon (installed) -> expat (installed) -> libjpeg-turbo (installed) -> libxdmcp (installed) -> libxau (installed) -> libxcb (installed) -> libx11 (installed) -> libxext (installed) -> libxinerama (installed) -> libxi (installed) -> libxfixes (installed) -> libxcomposite (installed) -> libxdamage (installed) -> libxrender (installed) -> libxcursor (installed) -> libxrandr (installed) -> nspr (installed) -> run-parts (installed) -> gcc-libs (installed) -> pcre (installed) -> glib2 (installed) -> atk (installed) -> attr (installed) -> acl (installed) -> libcap (installed) -> ncurses (installed) -> readline (installed) -> sqlite3 (installed) -> bash (installed) -> gzip (installed) -> libgpg-error (installed) -> libgcrypt (installed) -> keyutils (installed) -> findutils (installed) -> texinfo (installed) -> libtasn1 (installed) -> sed (installed) -> gdbm (installed) -> db (installed) -> libsasl (installed) -> gmp (installed) -> zlib (installed) -> libxml2 (installed) -> shared-mime-info (installed) -> freetype2 (installed) -> fontconfig (installed) -> libxft (installed) -> gnutls (installed) -> libpng (installed) -> cairo (installed) -> pango (installed) -> libtiff (installed) -> gdk-pixbuf2 (installed) -> gtk-update-icon-cache (installed) -> cracklib (installed) -> pam (installed) -> shadow (installed) -> coreutils (installed) -> filesystem (installed) -> util-linux (installed) -> libsm (installed) -> e2fsprogs (installed) -> dbus-core (installed) -> dbus (installed) -> avahi (installed) -> perl (installed) -> openssl (installed) -> libldap (installed) -> krb5 (installed) -> libcups (installed) -> ca-certificates (installed) -> libssh2 (installed) -> curl (installed) -> nss (installed) -> gtk2 (installed) -> libxt (installed) -> mozilla-common (installed) -> flashplugin-prerelease (AUR target)

==> Upgrading:
flashplugin-prerelease
-----------------------------------------------------
==> Edit PKGBUILD for flashplugin-prerelease? [Y/n/a]
-----------------------------------------------------
==> n
-----------------------------------------------------
==> Continue installing flashplugin-prerelease? [Y/n]
-----------------------------------------------------
==> y
-----------------------------------------------------
==> ERROR: Running makepkg as root is a BAD idea and can cause
    permanent, catastrophic damage to your system. If you
    wish to run as root, please use the --asroot option.

Ok, fair enough.

So, as _not_ root.

[patrick@laptop powaur]$ powaur -S flashplugin-prerelease

Syncing:
flashplugin-prerelease

---------------------------------
==> Do you wish to proceed? [Y/n]
---------------------------------
==> y
---------------------------------
Resolving dependencies... Please wait
Segmentation fault

So... what's my silly noob mistake that isn't allowing me to use your wonderful helper? smile

Offline

#14 2011-06-26 00:52:24

yanhan
Member
Registered: 2011-05-24
Posts: 11

Re: powaur - an AUR helper with a pacman-like interface

Hi, the first is due to lack of --asroot passed to makepkg. I will fix it asap.

But fret not. A workaround will be to add the following to your /etc/pacman.conf
after your main repositories:

[archlinuxfr]
Server = http://repo.archlinux.fr/$arch

Then proceed to

[root@localhost] # pacman -Syy

and make sure the archlinuxfr database gets downloaded, then

[root@localhost] # pacman -S flashplugin-prerelease

since the flashplugin-prerelease package is part of archlinuxfr db.

Now if you will allow me to digress.

As for the second issue, the segfault is a _very_ mysterious one. I encountered it
sometimes when initially testing out the current dependency resolution code and
failed to figure out why. But then it mysteriously disappeared forever after.

I was really really unable to figure out why it even happened in the first
place. Was too lazy to step into a debugger since it was all working for me.
Sorry about that. The kind of C bugs I'm getting these days will perplex most
people I think.  (Not your run of the mill segfaults)

Hope that helps. Will definitely resolve the first issue!

Offline

#15 2011-07-10 12:47:53

dbb
Member
From: New York City
Registered: 2008-12-14
Posts: 30
Website

Re: powaur - an AUR helper with a pacman-like interface

Been using powaur for a while, like it a lot. One thing I noticed is that for the edit PKGBUILD prompt if you enter "Y" instead of "y" it'll re-prompt you, instead of opening the PKGBUILD.

Offline

#16 2011-07-10 13:56:37

yanhan
Member
Registered: 2011-05-24
Posts: 11

Re: powaur - an AUR helper with a pacman-like interface

Hi dbb,

It's now fixed in v0.1.5.1. Thanks!

Offline

#17 2011-07-10 18:47:33

dbb
Member
From: New York City
Registered: 2008-12-14
Posts: 30
Website

Re: powaur - an AUR helper with a pacman-like interface

yanhan wrote:

Hi dbb,

It's now fixed in v0.1.5.1. Thanks!

Cool, thanks.

Offline

#18 2011-10-22 16:51:24

ato10
Member
Registered: 2010-03-07
Posts: 12

Re: powaur - an AUR helper with a pacman-like interface

Hi yanhan,
I cannot build it from aur.
This is the error

conf.c:342:5: warning: passing argument 1 of ‘alpm_db_register_sync’ from incompatible pointer type [enabled by default]
/usr/include/alpm.h:572:12: note: expected ‘struct alpm_handle_t *’ but argument is of type ‘char *’
conf.c:342:5: error: too few arguments to function ‘alpm_db_register_sync’
/usr/include/alpm.h:572:12: note: declared here
make: *** [conf.o] Errore 1

Any idea?

Offline

#19 2011-10-22 17:29:43

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,092
Website

Re: powaur - an AUR helper with a pacman-like interface

ato10 wrote:

Hi yanhan,
I cannot build it from aur.
This is the error

conf.c:342:5: warning: passing argument 1 of ‘alpm_db_register_sync’ from incompatible pointer type [enabled by default]
/usr/include/alpm.h:572:12: note: expected ‘struct alpm_handle_t *’ but argument is of type ‘char *’
conf.c:342:5: error: too few arguments to function ‘alpm_db_register_sync’
/usr/include/alpm.h:572:12: note: declared here
make: *** [conf.o] Errore 1

Any idea?

You've got pacman 4 installed and powaur hasn't been updated for the API changes.

Offline

#20 2011-10-22 17:56:33

ato10
Member
Registered: 2010-03-07
Posts: 12

Re: powaur - an AUR helper with a pacman-like interface

ah ok
thank you

Offline

#21 2011-10-25 14:19:20

bneate
Member
Registered: 2005-08-21
Posts: 36

Re: powaur - an AUR helper with a pacman-like interface

Hi yanhan,

I'm searching for a AUR helper that suits me and came across powaur. Currently I have Archlinux ARM installed on a trimslice at home and since most packages don't include the 'armv7h' architecture I've been using the makepkg -A argument to compile packages.  Is there anyway I can pass this argument to makepkg using powaur...if not could you add a way?

Offline

#22 2011-10-28 23:32:40

yanhan
Member
Registered: 2011-05-24
Posts: 11

Re: powaur - an AUR helper with a pacman-like interface

Hi bneate,

Sorry for the late reply. I've been pretty busy recently.
I will see what I can do by the end of this weekend.

Offline

#23 2011-11-18 08:34:57

yanhan
Member
Registered: 2011-05-24
Posts: 11

Re: powaur - an AUR helper with a pacman-like interface

Hi bneate,

Very sorry for the delays... been procrastinating too much for the
past few weeks.

Do try out the devel branch here: https://github.com/yanhan/powaur

Now you can supply arguments thru the configuration file, under the
"MakepkgOpts" key. The arguments are unquoted and multiple args
are separated by spaces.

For instance, if you wish to supply the "-A" and "--asroot" options to
makepkg invocations, here's what you'll put for MakepkgOpts:

MakepkgOpts = -A --asroot

Offline

#24 2011-11-18 15:16:31

bneate
Member
Registered: 2005-08-21
Posts: 36

Re: powaur - an AUR helper with a pacman-like interface

That works perfectly.  Thanks

Offline

Board footer

Powered by FluxBB