View previous topic :: View next topic |
Author |
Message |
bernhardd n00b
Joined: 31 Aug 2012 Posts: 8
|
Posted: Thu Jul 25, 2013 6:43 pm Post subject: How to test an ebuild without messing the system up |
|
|
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 |
|
|
Jaglover Watchman
Joined: 29 May 2005 Posts: 8291 Location: Saint Amant, Acadiana
|
|
Back to top |
|
|
ppurka Advocate
Joined: 26 Dec 2004 Posts: 3256
|
Posted: Fri Jul 26, 2013 2:46 am Post subject: |
|
|
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 |
|
|
Oniryczny Guru
Joined: 01 Dec 2011 Posts: 419 Location: Poland
|
Posted: Fri Jul 26, 2013 4:35 am Post subject: |
|
|
what about sandbox? _________________ cogito ergo sum |
|
Back to top |
|
|
John R. Graham Administrator
Joined: 08 Mar 2005 Posts: 10589 Location: Somewhere over Atlanta, Georgia
|
Posted: Fri Jul 26, 2013 10:23 am Post subject: |
|
|
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 |
|
|
Genone Retired Dev
Joined: 14 Mar 2003 Posts: 9531 Location: beyond the rim
|
Posted: Fri Jul 26, 2013 11:52 am Post subject: |
|
|
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 |
|
|
John R. Graham Administrator
Joined: 08 Mar 2005 Posts: 10589 Location: Somewhere over Atlanta, Georgia
|
Posted: Fri Jul 26, 2013 12:51 pm Post subject: |
|
|
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 |
|
|
bernhardd n00b
Joined: 31 Aug 2012 Posts: 8
|
Posted: Fri Jul 26, 2013 5:26 pm Post subject: |
|
|
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 |
|
|
phajdan.jr Retired Dev
Joined: 23 Mar 2006 Posts: 1777 Location: Poland
|
|
Back to top |
|
|
bernhardd n00b
Joined: 31 Aug 2012 Posts: 8
|
Posted: Sat Jul 27, 2013 6:44 am Post subject: |
|
|
I will take a look at it.
thanks
Bernhard |
|
Back to top |
|
|
|