You are not logged in.

#1 2011-12-26 17:08:10

broken pipe
Member
Registered: 2010-12-10
Posts: 248

[SOLVED] Rebuilding all installed AUR packages

Hi guys,

before starting to hack some dirty script on my own i would like to know if there's already any program/script which looks up the list of packages, which were installed from aur: pacman -Qqm, and rebuilds/exports them?

the reason why i ask: i have several machines running on arch64 and i need 50+ built packages to serve them in the intranet.

best regards

Last edited by broken pipe (2011-12-26 20:25:12)

Offline

#2 2011-12-26 17:14:02

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] Rebuilding all installed AUR packages

Not sure what you mean by 'rebuilding', you can update the packages any way you want and share in a number of ways e.g. http://xyne.archlinux.ca/projects/pacserve/
You can create a local repo and add it to pacman.conf on these machines.

Offline

#3 2011-12-26 18:33:05

broken pipe
Member
Registered: 2010-12-10
Posts: 248

Re: [SOLVED] Rebuilding all installed AUR packages

thx karol, i'm already using pacserve to avoid downloading packages for each machine in the network.

what i want to do is: read the output of 'pacman -Qqm' and rebuild + export the pkgs


i did a little bash script to achieve this. but i have to admit i'm not good at scripting but i gave my best big_smile improvements are welcomed smile


#/bin/bash

pkglist=/tmp/pkglist
builddir=/dev/shm/$(date +%F)/
exportdir=~/aurpkgbuilds

# Create builddir
if [ ! -d "$builddir" ];then mkdir $builddir
fi

# Create exportdir
if [ ! -d "$exportdir" ];then mkdir $exportdir
fi

#	Getting the list of pkgs which were installed from AUR
pacman -Qqm > $pkglist

#	Edit the list?
read -p "Would you like to edit the list? (y/N) " edit
if test "$edit" = "y"; 	then
	$EDITOR	$pkglist
fi

for i in $(cat $pkglist); do
	cd $builddir
	wget http://aur.archlinux.org/packages/${i}/${i}.tar.gz
	tar xvfz ${i}.tar.gz
	cd ${i}
	makepkg -f
	mv *.pkg.tar.xz "$exportdir"
done


# Clean up
read -p "Would you like to remove the builddir? (y/N) " rmbuilddir
if test "$rmbuilddir" = "y"; then
	rm -rf $builddir
fi

exit 0

Offline

#4 2011-12-26 18:57:51

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] Rebuilding all installed AUR packages

What about dependencies? You have to build stuff in the correct order.

I still don't know why do you want to rebuild all the packages.

Offline

#5 2011-12-26 19:10:04

Proofrific
Member
Registered: 2008-01-05
Posts: 216

Re: [SOLVED] Rebuilding all installed AUR packages

Your packages may still be in your pacman cache: /var/cache/pacman/pkg/. Then, you don't have to rebuild them. There's also the Arch Rollback Machine, which has old packages.

Offline

#6 2011-12-26 19:12:34

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] Rebuilding all installed AUR packages

@Proofrific
OP is talking about packages from the AUR.

Offline

#7 2011-12-26 19:52:58

broken pipe
Member
Registered: 2010-12-10
Posts: 248

Re: [SOLVED] Rebuilding all installed AUR packages

thx for your responses!

rebuilding because i need them as pkg.tar.xz to redistribute them to 5 other machines running in the local network. needed pkgs will be added to a list, built and then added to a local repo smile

Offline

#8 2011-12-26 19:57:12

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] Rebuilding all installed AUR packages

But you have them already installed so why not use bacman from pacman-contrib?

Offline

#9 2011-12-26 20:24:48

broken pipe
Member
Registered: 2010-12-10
Posts: 248

Re: [SOLVED] Rebuilding all installed AUR packages

ok thanks! never heard of it before yikes ... rebuilding is imho cleaner than gathering sth up and repacking  but this is more or less what i was looking for smile

Offline

#10 2011-12-26 20:35:47

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] Rebuilding all installed AUR packages

You can use makepkg's BUILDDIR and PKGDEST variables if you want.

Offline

Board footer

Powered by FluxBB