You are not logged in.

#1 2009-10-06 06:28:37

StanIsTheMan
Member
Registered: 2009-09-18
Posts: 38

Bulid multiple packages at once (in order) w/ makepkg

I have several folders copied over into my build dir. Now instead of going into each folder and building each package separately, I'd like to automate this in one command...

I can do this... but it seems like it could be done differently. Just an example:

bld="~/home/builds"
cd $bld

  cd gcc && makepkg -s && cd ../firefox && makepkg -s && cd ../conky && makepkg -s && cd ../openbox && makepkg -s

Would there be an easier way...?

   Not looking to run makepkg in parallel, just one after the other.

Offline

#2 2009-10-06 06:35:02

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Bulid multiple packages at once (in order) w/ makepkg

Use a for loop.

Offline

#3 2009-10-06 06:55:34

StanIsTheMan
Member
Registered: 2009-09-18
Posts: 38

Re: Bulid multiple packages at once (in order) w/ makepkg

tomk wrote:

Use a for loop.

Would something like this work..?

for i in $(cat $log1)
      do
        makepkg -s $i  
     done

Contents of my grep in $log1

/home/builds/gcc/PKGBUILD
/home/builds/firefox/PKGBUILD
/home/builds/conky/PKGBUILD
/home/builds/openbox/PKGBUILD
/home/builds/rsync/PKGBUILD

Somewhat new to this ...

Offline

#4 2009-10-06 07:43:24

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,651
Website

Re: Bulid multiple packages at once (in order) w/ makepkg

cd /home/builds/
for pkg in gcc firefox conky openbox rsync; do
  cd $pkg
  makepkg -si
  cd ..
done

or even

cd /home/builds/
for in in *; do
...

Offline

#5 2009-10-06 08:33:52

StanIsTheMan
Member
Registered: 2009-09-18
Posts: 38

Re: Bulid multiple packages at once (in order) w/ makepkg

cd /home/builds/
for in in *; do
...

Thanks for the reply,  could you explain this to me .... I understand your other example

And how does the loop break after all packages have been installed?

Last edited by StanIsTheMan (2009-10-06 08:36:12)

Offline

#6 2009-10-06 16:56:32

Gen2ly
Member
From: Sevierville, TN
Registered: 2009-03-06
Posts: 1,529
Website

Re: Bulid multiple packages at once (in order) w/ makepkg

This is the same as above Stan, does a loop as above, Except it assumes that ALL package directories in /home/builds will want to be built.

http://steve-parker.org/sh/loops.shtml

Last edited by Gen2ly (2009-10-06 16:57:48)


Setting Up a Scripting Environment | Proud donor to wikipedia - link

Offline

#7 2009-10-06 21:52:41

StanIsTheMan
Member
Registered: 2009-09-18
Posts: 38

Re: Bulid multiple packages at once (in order) w/ makepkg

Gen2ly wrote:

This is the same as above Stan, does a loop as above, Except it assumes that ALL package directories in /home/builds will want to be built.

http://steve-parker.org/sh/loops.shtml

Thx... Its just been awhile since I had been writing any scripts ....



So, as you can see, for simply loops through whatever input it is given, until it runs out of input.

Last edited by StanIsTheMan (2009-10-06 21:53:48)

Offline

Board footer

Powered by FluxBB