[arch-general] Wrapper for yaourt and pacman
Hi, to write a wrapper for yaourt, e.g. "yaourt -Syua" and pacman e.g. "pacman -Syu" I need to redirect the output to a variable, since I need to know the packages. i=`yaourt -Syua` doesn't work, $i only contains the last package i=`pacman -Syu` does work, $i contains all packages How can I get a package list of the output "-Syua"? Btw. is there a way to get a cache for yaourt that isn't located in /tmp? if not, then this would be one of the tasks the wrapper should do. Regards, Ralf
[2013-07-13 23:16:25 +0200] Ralf Mardorf:
i=`pacman -Syu` does work, $i contains all packages
Just use: `pacman -Syu --print --print-format %n`
How can I get a package list of the output "-Syua"?
Btw. is there a way to get a cache for yaourt that isn't located in /tmp? if not, then this would be one of the tasks the wrapper should do.
You should put those questions to the yaourt user list. -- Gaetan
On Sat, Jul 13, 2013 at 11:16:25PM +0200, Ralf Mardorf wrote:
Hi,
to write a wrapper for yaourt, e.g. "yaourt -Syua" and pacman e.g. "pacman -Syu" I need to redirect the output to a variable, since I need to know the packages.
First off, I'm not a huge fan of yaourt, and would advise against using it at all.
i=`yaourt -Syua` doesn't work, $i only contains the last package i=`pacman -Syu` does work, $i contains all packages This second one seems to be what you want...unless you're saying it shows every package available.
How can I get a package list of the output "-Syua"?
Using the conveniently written pacman logs. You can even put them into your journal and use 'journalctl _COMM=pacman --since=<time of last check>'. Yes, it's not going to get the whole output, but it will tell you every package that was installed, upgraded, downgraded, or removed and at what time. Thanks, -- William Giokas | KaiSforza | http://kaictl.net/ GnuPG Key: 0x73CD09CF Fingerprint: F73F 50EF BBE2 9846 8306 E6B8 6902 06D8 73CD 09CF
Thank you Gaetan, thank you William, currently I have to manage 62 AUR packages, so using pacman only doesn't provide what I need. I noticed that yaourt is a script, so I could take a look at it, learn and include what I need to a wrapper for pacman, but I don't like to do it that way. You seem to have reasons not to like yaourt that much. Is one of the other helpers listed at https://wiki.archlinux.org/index.php/AUR_Helpers better? FWIW I want to have a cache for AUR packages, like there is for the official packages in /var/cache/pacman/pkg, linux-rt packages should be stored to another directory. I want to install linux and linux-rt headers first, because I need VBox modules. I want to add a history of what I've done when using pacman (and what I've done using something to manage AUR packages, e.g. yaourt). That's all, perhaps an app already does provide this? Regards, Ralf
Hi Ralf, Ralf Mardorf <ralf.mardorf@alice-dsl.net> writes:
Thank you Gaetan, thank you William,
currently I have to manage 62 AUR packages, so using pacman only doesn't provide what I need. I noticed that yaourt is a script, so I could take a look at it, learn and include what I need to a wrapper for pacman, but I don't like to do it that way.
You seem to have reasons not to like yaourt that much. Is one of the other helpers listed at https://wiki.archlinux.org/index.php/AUR_Helpers better?
FWIW I want to have a cache for AUR packages, like there is for the official packages in /var/cache/pacman/pkg, linux-rt packages should be stored to another directory.
Take a look at SRCDEST, PKGDEST, and SRCPKGDEST in /etc/makepkg.conf. If you want a different folder for specific packages, you can use an environment variable to override the default. So you can do something like this in the directory with the PKGBUILD: $ PKGDEST=~/aur/cache/linux-rt/ makepkg
I want to install linux and linux-rt headers first, because I need VBox modules.
This is the only thing you might have to do manually or write a script for.
I want to add a history of what I've done when using pacman (and what I've done using something to manage AUR packages, e.g. yaourt).
makepkg has a build log flag (-L or --log) and you can set LOGDEST in /etc/makepkg.conf. When your package is installed it will show up in pacman's logs because the only way to properly install it on your system is to call pacman -U /path/to/your/package.
That's all, perhaps an app already does provide this?
Regards, Ralf
Best, Chirantan
On Sun, 2013-07-14 at 10:57 -0700, Chirantan Ekbote wrote:
Ralf Mardorf <ralf.mardorf@alice-dsl.net> writes:
FWIW I want to have a cache for AUR packages, like there is for the official packages in /var/cache/pacman/pkg, linux-rt packages should be stored to another directory.
Take a look at SRCDEST, PKGDEST, and SRCPKGDEST in /etc/makepkg.conf. If you want a different folder for specific packages, you can use an environment variable to override the default. So you can do something like this in the directory with the PKGBUILD:
$ PKGDEST=~/aur/cache/linux-rt/ makepkg
I want to install linux and linux-rt headers first, because I need VBox modules.
This is the only thing you might have to do manually or write a script for.
I want to add a history of what I've done when using pacman (and what I've done using something to manage AUR packages, e.g. yaourt).
makepkg has a build log flag (-L or --log) and you can set LOGDEST in /etc/makepkg.conf. When your package is installed it will show up in pacman's logs because the only way to properly install it on your system is to call pacman -U /path/to/your/package.
Thank you Chirantan :) yes, the wanted history is in /var/log/pacman.log, there's nothing for me to do. Yes, makepkg --log does work, but I don't need it. No, PKGDEST in /etc/makepkg.conf won't help me. If I use yaourt PKGDEST is ignored, even if it wouldn't be ignored, I want to have a separated directory for linux-rt packages automatically. I don't want to run makepkg -s and pacman -U, with or without setting the PKGDEST variable. Perhaps another tool takes care about PKGDEST, sure it does work if I run makepkg -s instead of yaourt. To manage all the AUR packages I need a tool, yaourt or any other available tool or something I'll have to write myself. Gaetan's hint to use `pacman -Syu --print --print-format %n` will help me to write a wrapper, to install linux-headers first, but I still have no solution to install linux-rt-headers first, since they're in AUR. Regards, Ralf Regards, Ralf
Em 14/07/2013 22:12, Ralf Mardorf escreveu:
No, PKGDEST in /etc/makepkg.conf won't help me.
If I use yaourt PKGDEST is ignored, even if it wouldn't be ignored, I want to have a separated directory for linux-rt packages automatically. I don't want to run makepkg -s and pacman -U, with or without setting the PKGDEST variable.
Perhaps another tool takes care about PKGDEST, sure it does work if I run makepkg -s instead of yaourt.
Regards, Ralf
Regards, Ralf
To make PKGDEST work, set it in /etc/makepkg.conf and also change /etc/yaourtrc in the following lines to what you want: # Build #EXPORT=0 # Export to 1: EXPORTDIR or PKGDEST # 2: pacman cache (as root) #EXPORTSRC=0 # Need EXPORT>0 to be used #EXPORTDIR="" # If empty, use makepkg's connfiguration (see makepkg.conf) Regards, Rafael Ferreira
On Mon, 2013-07-15 at 00:13 -0300, Rafael Ferreira wrote:
To make PKGDEST work, set it in /etc/makepkg.conf and also change /etc/yaourtrc in the following lines to what you want:
# Build #EXPORT=0 # Export to 1: EXPORTDIR or PKGDEST # 2: pacman cache (as root) #EXPORTSRC=0 # Need EXPORT>0 to be used #EXPORTDIR="" # If empty, use makepkg's connfiguration (see makepkg.conf)
Thank you Rafael :) EXPORT=1 does the trick. Since I still don't know how to get a list of the packages that will be updated by yaourt -Syua, I'll make a script that runs pacman first, so I can install linux-headers first if needed. To be aware, if there was a linux-rt update by AUR, I'll let the script check the installed version of linux-rt by pacman -Q before and after I run yaourt -Syua, so if needed I'll let the script install linux-rt a second time to build modules. If somebody has got a better idea, that does avoid to install linux-rt two times, please let me know. Regards, Ralf
On Mon, 2013-07-15 at 11:49 +0200, I wrote:
If somebody has got a better idea, that does avoid to install linux-rt two times, please let me know.
Perhaps someday somebody else does miss the forest for the trees, so here's the forest I found: yaourt -aQu linux-rt does check if there's an update for the linux-rt aur package :). Tested with: [rocketmouse@archlinux ~]$ yaourt -aQu git google-earth extra/git 1.8.3.2-1 aur/google-earth 7.1.1.1888-1 [installed: 7.1.1.1871-1] (1876) [rocketmouse@archlinux ~]$ pacman -S git --print --print-format %v 1.8.3.3-1 If there isn't an update the output does look like this: [rocketmouse@archlinux ~]$ yaourt -Qua linux-rt aur/linux-rt 3.8.13_rt14-1 [installed] (162) Special thanks to Gaetan for the hint to use "--print --print-format". I haven't written a script yet, but now all the needed information is available. Regards, Ralf
participants (5)
-
Chirantan Ekbote
-
Gaetan Bisson
-
Rafael Ferreira
-
Ralf Mardorf
-
William Giokas