Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to test an ebuild without messing the system up
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
bernhardd
n00b
n00b


Joined: 31 Aug 2012
Posts: 8

PostPosted: Thu Jul 25, 2013 6:43 pm    Post subject: How to test an ebuild without messing the system up Reply with quote

Hi,

Is there an easy way to test a modified ebuild without messing the system up, e.g, no install into /usr. I have modified the openfoam ebuild and I dont want to overwrite the installed version, while testing the new ebuild.

regards,
Bernhard
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 8291
Location: Saint Amant, Acadiana

PostPosted: Thu Jul 25, 2013 11:20 pm    Post subject: Reply with quote

You can install into /usr/local, it should be before /usr on your $PATH, so it will take precedence over version in /usr.
_________________
My Gentoo installation notes.
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
ppurka
Advocate
Advocate


Joined: 26 Dec 2004
Posts: 3256

PostPosted: Fri Jul 26, 2013 2:46 am    Post subject: Reply with quote

Don't install it! Use --buildpkgonly to only build it and package it without installing it. This emerge switch has one caveat - the dependencies of the ebuild must already be installed in the system.
_________________
emerge --quiet redefined | E17 vids: I, II | Now using kde5 | e is unstable :-/
Back to top
View user's profile Send private message
Oniryczny
Guru
Guru


Joined: 01 Dec 2011
Posts: 419
Location: Poland

PostPosted: Fri Jul 26, 2013 4:35 am    Post subject: Reply with quote

what about sandbox?
_________________
cogito ergo sum
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10589
Location: Somewhere over Atlanta, Georgia

PostPosted: Fri Jul 26, 2013 10:23 am    Post subject: Reply with quote

Too complicated. How about the ebuild command? Or, just use quickpkg on the installed version so you have a good backup.

- John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
Back to top
View user's profile Send private message
Genone
Retired Dev
Retired Dev


Joined: 14 Mar 2003
Posts: 9531
Location: beyond the rim

PostPosted: Fri Jul 26, 2013 11:52 am    Post subject: Reply with quote

The main question is what you want to test. For a simple build test ebuild(1) or --buildpkgonly can work. For a runtime test it may be possible to run it from the image/ build directory without running the "merge" phase, but that depends on the software. In doubt there's always the option to setup a chroot/VM/container for testing.
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10589
Location: Somewhere over Atlanta, Georgia

PostPosted: Fri Jul 26, 2013 12:51 pm    Post subject: Reply with quote

One other point that hasn't been mentioned. Portage is fairly clever about when it makes permanent modifications to your system. Unless the ebuild-driven package build and install (which Portage does to a temporary location) are completely successful, Portage won't make any modifications to your installed packages. So, in truth, I think you're over thinking this. The easiest way to test a modified ebuild is to emerge it.

- John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
Back to top
View user's profile Send private message
bernhardd
n00b
n00b


Joined: 31 Aug 2012
Posts: 8

PostPosted: Fri Jul 26, 2013 5:26 pm    Post subject: Reply with quote

Thank you very much for all your suggestions. I have not thought of a chroot environment before. Would this work to create a copy of my system for chroot:

mkdir /path/to/chroot/{bin,dev,etc,lib32,lib64,opt,proc,root,run,sbin,sys,tmp,usr,var}
cp -a -t /path/to/chroot/ /bin /etc /lib* /sbin /usr
mount -t proc none /path/to/chroot/proc
mount --rbind /sys /patch/to/chroot/sys
mount --rbind /dev /path/to/chroot/dev

regards
Bernhard
Back to top
View user's profile Send private message
phajdan.jr
Retired Dev
Retired Dev


Joined: 23 Mar 2006
Posts: 1777
Location: Poland

PostPosted: Sat Jul 27, 2013 4:36 am    Post subject: Reply with quote

I rather recommend something similar to http://www.gentoo.org/proj/en/base/x86/chroot.xml to create the chroot.
_________________
http://phajdan-jr.blogspot.com/
Back to top
View user's profile Send private message
bernhardd
n00b
n00b


Joined: 31 Aug 2012
Posts: 8

PostPosted: Sat Jul 27, 2013 6:44 am    Post subject: Reply with quote

I will take a look at it.

thanks
Bernhard
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum