[arch-general] best practices for rebuilding packages
Hello. If I have a package build from aur that depends on a library, and the library is updated, and package from aur requires rebuild, is it possible to somehow track and automate that? In other cases maintaining such configurations may be the trouble as you have to remember what aur packages depend on your library. Another question: what about modifying aur/abs pkgbuilds, like I replace the whole configure line because I want to do so, but to do such a configuration for a new version of the package, I have to manually modify any new pkgbuild I get to get the same result. How to make it nicer?
On Sun, Dec 06, 2015 at 06:52:58PM +0100, Michał Zegan wrote:
Hello.
If I have a package build from aur that depends on a library, and the library is updated, and package from aur requires rebuild, is it possible to somehow track and automate that? In other cases maintaining such configurations may be the trouble as you have to remember what aur packages depend on your library. Another question: what about modifying aur/abs pkgbuilds, like I replace the whole configure line because I want to do so, but to do such a configuration for a new version of the package, I have to manually modify any new pkgbuild I get to get the same result. How to make it nicer?
I personally only have ~10-20 AUR packages installed, so keeping up with them manually is not that difficult. My typical update process goes: * pacman -Syu * handle any .pacnew files * mkinitcpio -P (if kernel has been updated) * reboot (if kernel has been updated) * check for AUR updates (cower -u) * compile and install any AUR updates (if I feel like it) Generally, I won't update all AUR packages. If a package is broken when I go to use it, then I'll recompile. So yeah, probably not the best strategy in the world, but it works well for me. And as for modifying PKGBUILDs, you may try writing patches, but it might end up being more work updating the patches than just doing the mods by hand each time. --Sean
Here are a few ideas: For checking if a dependency is newer, use this script: aurPkgs=$(pacman -Qm | cut -d ' ' -f 1) for aurPkg in $aurPkgs; do aurDte=$(pacman -Qi $aurPkg | grep "Install Date" | cut -d ':' -f 2- | date '+%s') depPkgs=$(pacman -Qi $aurPkg | grep "Depends On" | cut -d ':' -f 2-) for depPkg in $depPkgs; do depDte=$(pacman -Qi $depPkg | grep "Install Date" | cut -d ':' -f 2- | date '+%s') if [[ $aurDte < $depDte ]]; then echo "update $aurPkg given $depPkg is more recent" fi done done I keep all my aur git repos in a directory and execute the following to see if there is anything new. It cd's into any git repo and fetches, printing out any updates: TEMP_OLDPWD=$OLDPWD for d in $(dirname $(find -name "\.git")); do cd $d echo "fetching " $d git fetch cd $OLDPWD done OLDPWD=$TEMP_OLDPWD To make custom changes to pkgbuilds, just create a branch in git (this assumes you are using aur4) and merge each time there is an update. The workflow would look something like this: git checkout -b my_branch git fetch git merge master # now do normal makepkg build/install step Eric ________________________________________ From: arch-general <arch-general-bounces@archlinux.org> on behalf of Michał Zegan <webczat_200@poczta.onet.pl> Sent: Sunday, December 6, 2015 12:52 PM To: General Discussion about Arch Linux Subject: [arch-general] best practices for rebuilding packages Hello. If I have a package build from aur that depends on a library, and the library is updated, and package from aur requires rebuild, is it possible to somehow track and automate that? In other cases maintaining such configurations may be the trouble as you have to remember what aur packages depend on your library. Another question: what about modifying aur/abs pkgbuilds, like I replace the whole configure line because I want to do so, but to do such a configuration for a new version of the package, I have to manually modify any new pkgbuild I get to get the same result. How to make it nicer?
I apparently messed up the date command in the script below. Here is an update aurPkgs=$(pacman -Qm | cut -d ' ' -f 1) for aurPkg in $aurPkgs; do aurDte=$(pacman -Qi $aurPkg | grep "Install Date" | cut -d ':' -f 2-) aurDte=$(date --date="$aurDte" "+%s") depPkgs=$(pacman -Qi $aurPkg | grep "Depends On" | cut -d ':' -f 2-) for depPkg in $depPkgs; do depDte=$(pacman -Qi $depPkg | grep "Install Date" | cut -d ':' -f 2-) depDte=$(date --date="$depDte" "+%s") if [[ $aurDte -lt $depDte ]]; then echo "update $aurPkg given $depPkg is more recent" fi done done Eric ________________________________________ From: arch-general <arch-general-bounces@archlinux.org> on behalf of Squires, Eric <Eric.Squires@gtri.gatech.edu> Sent: Monday, December 7, 2015 11:17 PM To: General Discussion about Arch Linux Subject: Re: [arch-general] best practices for rebuilding packages Here are a few ideas: For checking if a dependency is newer, use this script: aurPkgs=$(pacman -Qm | cut -d ' ' -f 1) for aurPkg in $aurPkgs; do aurDte=$(pacman -Qi $aurPkg | grep "Install Date" | cut -d ':' -f 2- | date '+%s') depPkgs=$(pacman -Qi $aurPkg | grep "Depends On" | cut -d ':' -f 2-) for depPkg in $depPkgs; do depDte=$(pacman -Qi $depPkg | grep "Install Date" | cut -d ':' -f 2- | date '+%s') if [[ $aurDte < $depDte ]]; then echo "update $aurPkg given $depPkg is more recent" fi done done I keep all my aur git repos in a directory and execute the following to see if there is anything new. It cd's into any git repo and fetches, printing out any updates: TEMP_OLDPWD=$OLDPWD for d in $(dirname $(find -name "\.git")); do cd $d echo "fetching " $d git fetch cd $OLDPWD done OLDPWD=$TEMP_OLDPWD To make custom changes to pkgbuilds, just create a branch in git (this assumes you are using aur4) and merge each time there is an update. The workflow would look something like this: git checkout -b my_branch git fetch git merge master # now do normal makepkg build/install step Eric ________________________________________ From: arch-general <arch-general-bounces@archlinux.org> on behalf of Michał Zegan <webczat_200@poczta.onet.pl> Sent: Sunday, December 6, 2015 12:52 PM To: General Discussion about Arch Linux Subject: [arch-general] best practices for rebuilding packages Hello. If I have a package build from aur that depends on a library, and the library is updated, and package from aur requires rebuild, is it possible to somehow track and automate that? In other cases maintaining such configurations may be the trouble as you have to remember what aur packages depend on your library. Another question: what about modifying aur/abs pkgbuilds, like I replace the whole configure line because I want to do so, but to do such a configuration for a new version of the package, I have to manually modify any new pkgbuild I get to get the same result. How to make it nicer?
participants (3)
-
Michał Zegan
-
Sean Greenslade
-
Squires, Eric