View previous topic :: View next topic |
Author |
Message |
carpman Advocate
Joined: 20 Jun 2002 Posts: 2202 Location: London - UK
|
Posted: Fri Mar 14, 2008 12:54 pm Post subject: emerging multiple apps |
|
|
Hello, ok i getting ready to do install this evening and want to emerge all applications i need overnight. I want to be able to do this without whole process dying if one ebuild fails?
I know emwrap script can do this for upgrades but this no suitable for new install, i text file of all apps i need to install.
any ideas?
cheers _________________ Work Station - 64bit
Gigabyte GA X48-DQ6 Core2duo E8400
8GB GSkill DDR2-1066
SATA Areca 1210 Raid
BFG OC2 8800 GTS 640mb
--------------------------------
Notebook
Samsung Q45 7100 4gb |
|
Back to top |
|
|
djinnZ Advocate
Joined: 02 Nov 2006 Posts: 4831 Location: somewhere in L.O.S.
|
Posted: Fri Mar 14, 2008 2:24 pm Post subject: |
|
|
simply use a script with emerge --resume --skipfirst or a script with single emerge but If you are thinking to emerge world or system is not so good to do (I think you know the reason) but if you are know what are doing is suitable.
If you are only thinking to emerge the various applications after the base system is competed, by example if you will not use of the kde/gnome full packages but only by splitted ebuiild try this or something similar:
Code: | #!/bin/bash
appications="cat/package1 cat/package2 ..."
failed=""
for p in $applications
#or to use command line
#for p in $@
#or to use a file
#for p in $((cat mylsit))
do
emerge $p || failed="$failed $p"
#or if you will to try to build some of the dependancies to save time as try to rebuild the failed compile:
# emerge $p && { failed="$failed\n $p"
# e=0
# until [ $e != 0 ]
# do
# emerge --resume --skipfirst ; e=$?
# done
done
echo "Fail to build: $failed"
#or
#echo $failed > failed_list | bash scripting is your friend and there is a good guide to begin in the gentoo documentation.
Note: emerge --resume --skipfirst will return 0 if there are no more builds to resume and an error code >0 if some of them fail. This is the secret. _________________ scita et risus abundant in ore stultorum sed etiam semper severi insani sunt
mala tempora currunt...mater stultorum semper pregna est
Murpy'sLaw:If anything can go wrong, it will - O'Toole's Corollary:Murphy was an optimist
Last edited by djinnZ on Sun Mar 16, 2008 2:40 pm; edited 2 times in total |
|
Back to top |
|
|
carpman Advocate
Joined: 20 Jun 2002 Posts: 2202 Location: London - UK
|
Posted: Fri Mar 14, 2008 5:42 pm Post subject: |
|
|
Thanks for reply, i no good at bash scripting
I want to install main system then install all the apps i normally use including kde-meta xorg etc.
I have a text file with list apps though may need refining this to remove some apps that would compile twice as they are dependencies, would it be possible to modify your script to pull in apps to be emerge from this text file?
cheers _________________ Work Station - 64bit
Gigabyte GA X48-DQ6 Core2duo E8400
8GB GSkill DDR2-1066
SATA Areca 1210 Raid
BFG OC2 8800 GTS 640mb
--------------------------------
Notebook
Samsung Q45 7100 4gb |
|
Back to top |
|
|
carpman Advocate
Joined: 20 Jun 2002 Posts: 2202 Location: London - UK
|
Posted: Sun Mar 16, 2008 8:32 am Post subject: |
|
|
Hello, your script worked, well sort of, the only problem was that if an app was dependency of more than one app it would end emerging it again and again, it did not seem to recognise that it was already installed?
cheers _________________ Work Station - 64bit
Gigabyte GA X48-DQ6 Core2duo E8400
8GB GSkill DDR2-1066
SATA Areca 1210 Raid
BFG OC2 8800 GTS 640mb
--------------------------------
Notebook
Samsung Q45 7100 4gb |
|
Back to top |
|
|
djinnZ Advocate
Joined: 02 Nov 2006 Posts: 4831 Location: somewhere in L.O.S.
|
Posted: Sun Mar 16, 2008 2:00 pm Post subject: |
|
|
Having a dependance in the world file can be a problem (in update you will emerge the latest stable version of the package and can be greater than the latest version required) but simply you can use the -n option of emerge if is your intention or test if is installed and skip it.
In the second case the script will be Code: |
#!/bin/bash
applicatons="cat/package1 cat/package2 ..."
for p in $application
#or to use command line
#for p in $@
#or to use a file
#for p in $((cat /somewhere/mylist))
installed=$((eix -I --only-names $p | grep -v "No matches found" | wc -l))
if [ $installed -gt 0 ]; then
emerge $p || echo $p >> /somewhere/failed-lst
#or if you will to try to build some of the dependancies to save time as try to rebuild the failed compile:
# emerge $p && { echo $p >> /somewhere/faled-list
# e=0
# until [ $e != 0 ]
# do
# emerge --resume --skipfirst ; e=$?
# done
else
echo $p >> /somewhere/skiped-list
fi
done
echo "Fail to build:"
cat /somewhere/failed-list
echo "skipped as already installed:"
cat /somewhere/skipped-list
|
_________________ scita et risus abundant in ore stultorum sed etiam semper severi insani sunt
mala tempora currunt...mater stultorum semper pregna est
Murpy'sLaw:If anything can go wrong, it will - O'Toole's Corollary:Murphy was an optimist |
|
Back to top |
|
|
carpman Advocate
Joined: 20 Jun 2002 Posts: 2202 Location: London - UK
|
Posted: Sun Mar 16, 2008 6:33 pm Post subject: |
|
|
Thanks for reply, i had this issue with new install so there was no updates, just that when looking at portage logs i could see some apps had been compiled 2/times even though they had only been listed once in script. _________________ Work Station - 64bit
Gigabyte GA X48-DQ6 Core2duo E8400
8GB GSkill DDR2-1066
SATA Areca 1210 Raid
BFG OC2 8800 GTS 640mb
--------------------------------
Notebook
Samsung Q45 7100 4gb |
|
Back to top |
|
|
|