| View previous topic :: View next topic |
| Author |
Message |
Windstoss n00b

Joined: 08 Jul 2002 Posts: 19
|
Posted: Fri Aug 16, 2002 4:09 pm Post subject: building packages without installing them |
|
|
Hi,
How to build a .tbz2 package without actually installing the application?
As I understand emerge -b makes a package *and* installs.
Thanks alot _________________ 42 |
|
| Back to top |
|
 |
rizzo Retired Dev


Joined: 30 Apr 2002 Posts: 1067 Location: Manitowoc, WI, USA
|
Posted: Fri Aug 16, 2002 4:58 pm Post subject: |
|
|
| You can use the ebuild command. man ebuild. |
|
| Back to top |
|
 |
Windstoss n00b

Joined: 08 Jul 2002 Posts: 19
|
Posted: Fri Aug 16, 2002 9:54 pm Post subject: |
|
|
.. okay, its possible to build packages manually, but thats unhandy, because ebuild does not have something like a dependency system.. so you habe to start every compile by yourself...
It would be very handy if one could use something like
| Code: | | emerge --without-install -b package |
_________________ 42 |
|
| Back to top |
|
 |
rac Bodhisattva


Joined: 30 May 2002 Posts: 6553 Location: Japanifornia
|
Posted: Fri Aug 16, 2002 10:41 pm Post subject: |
|
|
| Windstoss wrote: | It would be very handy if one could use something like
| Code: | | emerge --without-install -b package |
|
Should this create one tbz2 or several? _________________ For every higher wall, there is a taller ladder |
|
| Back to top |
|
 |
Windstoss n00b

Joined: 08 Jul 2002 Posts: 19
|
Posted: Fri Aug 16, 2002 10:47 pm Post subject: |
|
|
one tbz2 per package... why? _________________ 42 |
|
| Back to top |
|
 |
delta407 Bodhisattva


Joined: 23 Apr 2002 Posts: 2876 Location: Chicago, IL
|
Posted: Fri Aug 16, 2002 10:51 pm Post subject: |
|
|
Can't you emerge -p it and then run ebuild for each of the listed packages? _________________ I don't believe in witty sigs. |
|
| Back to top |
|
 |
Windstoss n00b

Joined: 08 Jul 2002 Posts: 19
|
Posted: Fri Aug 16, 2002 11:54 pm Post subject: |
|
|
of course, its possible, but not very handy.. in some cases (say bootstrap) you have to run ebuild xxxx package more than 40 times... _________________ 42 |
|
| Back to top |
|
 |
rac Bodhisattva


Joined: 30 May 2002 Posts: 6553 Location: Japanifornia
|
Posted: Sat Aug 17, 2002 12:00 am Post subject: |
|
|
I think what delta407 was getting at (and me too after you said that you wanted multiple .tbz2s) is that you could take the output of "emerge -p", use sed/awk/perl/whatever to extract the individual package names to be built, and then use xargs or something to call "ebuild package" on each one of them. _________________ For every higher wall, there is a taller ladder |
|
| Back to top |
|
 |
Windstoss n00b

Joined: 08 Jul 2002 Posts: 19
|
Posted: Sat Aug 17, 2002 12:10 am Post subject: |
|
|
well.. this would be a solution, but I'm not used to sed/awk.. I'll try it _________________ 42 |
|
| Back to top |
|
 |
rac Bodhisattva


Joined: 30 May 2002 Posts: 6553 Location: Japanifornia
|
Posted: Sat Aug 17, 2002 12:42 am Post subject: |
|
|
OK, this is hardly tested at all, but see if it's close to what you are looking for. Actually, wait about 15 minutes, and I'm sure delta407 will come by with some bugfixes.
Just call it with the simple names of packages you want to put in the pool.
| Code: | #! /usr/bin/perl -w
use Carp;
my $PORTAGE_BASEDIR = '/usr/portage';
my @wanted_packages = @ARGV;
my @needed_packages = ();
for my $wanted ( @wanted_packages ) {
# check for bad characters in $wanted if we are suid
my $emerge = `/usr/bin/emerge -pe $wanted`;
my @needed = $emerge =~ /\] (\S+)/g;
push( @needed_packages, @needed );
}
# traditional perl idiom for eliminating duplicates in a list is to
# assign to a hash and then use keys, but the order here is critical,
# so we'll live with shared duplicates for now.
for my $package ( @needed_packages ) {
$package =~ /(.+)\/([^[0-9]+)(-.+)/ or croak( "can't understand $package" );
my $ebuild_file = $PORTAGE_BASEDIR.'/'.$1.'/'.$2.'/'.$2.$3.'.ebuild';
print STDERR "processing $ebuild_file\n";
system( '/usr/sbin/ebuild', $ebuild_file, 'package' );
} |
--japh
EDIT: thanks to cbrese for bugfixes posted later in the thread. _________________ For every higher wall, there is a taller ladder
Last edited by rac on Thu Jan 30, 2003 10:34 pm; edited 2 times in total |
|
| Back to top |
|
 |
wilbertnl Tux's lil' helper


Joined: 01 Jul 2002 Posts: 89 Location: Tulsa, OK, USA
|
Posted: Sat Aug 17, 2002 3:52 am Post subject: Re: building packages without installing them |
|
|
| Windstoss wrote: | Hi,
How to build a .tbz2 package without actually installing the application?
As I understand emerge -b makes a package *and* installs. |
I had the same question too a while ago.
| Code: | | ebuild <packagename> package | is creating the package.tbz2 without installing it.
But how are you going to build a package if you didn't install the dependencies either?
For example: you want a package of fluxbox, but it cannot build if the X-headers are not installed. You cannot build gnome packages without installing the library headers (like gtk-2).
Nice discussion, though _________________ Wilbert van Bakel
Strive for excellence, not perfection |
|
| Back to top |
|
 |
cbrese Tux's lil' helper

Joined: 12 Jul 2002 Posts: 126 Location: San Diego, CA
|
Posted: Thu Jan 30, 2003 10:00 pm Post subject: |
|
|
rac,
I just made a couple of small changes to your perl script.
the first change was this:
| Code: |
-my $emerge = `/usr/bin/emerge -pb $wanted`;
+my $emerge = `/usr/bin/emerge -pe $wanted`;
|
the 2nd change fixed a small bug if the was a "-" in the package name:
| Code: |
-$package =~ /(.+)\/([^-]+)(-.+)/ or croak( "can't understand $package" );
+$package =~ /(.+)\/([^0-9]+)(-.+)/ or croak( "can't understand $package" );
|
With this script I am now building a package for everything on my system by passing world. |
|
| Back to top |
|
 |
pjp Administrator


Joined: 16 Apr 2002 Posts: 16029 Location: Colorado
|
Posted: Thu Jan 30, 2003 11:43 pm Post subject: |
|
|
Moved from Installing Gentoo. _________________ lolgov. 'cause where we're going, you don't have civil liberties.
In Loving Memory
1787 - 2008 |
|
| Back to top |
|
 |
VisualPhoenix Tux's lil' helper

Joined: 26 Sep 2002 Posts: 135 Location: (CT v NJ)
|
Posted: Mon Feb 03, 2003 2:39 am Post subject: |
|
|
| So i assume then there is an easy method (or if there isnt i'm sure someone will code one) to use this method to compile an ebuild on another system and then install it remotely to another system? It'd be great to use this in some way to compile my laptop apps on a separate system but for my architecture, with my make.conf configs, etc and have it install over a network to my laptop. |
|
| Back to top |
|
 |
Gerk Retired Dev


Joined: 07 May 2002 Posts: 434
|
Posted: Mon Feb 03, 2003 5:41 pm Post subject: |
|
|
You can also try for fun...
emerge -B foo
Gerk |
|
| Back to top |
|
 |
cbrese Tux's lil' helper

Joined: 12 Jul 2002 Posts: 126 Location: San Diego, CA
|
Posted: Mon Feb 03, 2003 6:31 pm Post subject: |
|
|
I don't see the -B option in the emerge man page. What does it do?
Also there is still a bug in the perl script when a package a number in it name, such m4 or mp3.
I'm know the regex in the following line needs to be modified, but I can't figure it out.
| Code: |
$package =~ /(.+)\/([^0-9]+)(-.+)/ or croak( "can't understand $package" );
|
The 2nd capture should be matching a -[0-9] not just a [0-9]. |
|
| Back to top |
|
 |
Gerk Retired Dev


Joined: 07 May 2002 Posts: 434
|
Posted: Mon Feb 03, 2003 7:40 pm Post subject: |
|
|
emerge -B is --buildpkgonly
I dont think its documented yet, there are a few things like that in portage, always, takes a while for the docs to catch up with the release  |
|
| Back to top |
|
 |
cbrese Tux's lil' helper

Joined: 12 Jul 2002 Posts: 126 Location: San Diego, CA
|
Posted: Mon Feb 03, 2003 7:51 pm Post subject: |
|
|
Cool, thanks for the tip.
Looks like emerge -Be will do what I was trying to get the perl script to do. |
|
| Back to top |
|
 |
JeroenV Guru


Joined: 16 Jul 2002 Posts: 447 Location: Amsterdam / Hamburg
|
Posted: Mon Feb 03, 2003 10:38 pm Post subject: |
|
|
Hey, cool!
I didn' t know my unofficial hack has been adapted yet
Is that since 2.0.46-r9
Good work  _________________ Cheers
Jeroen
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
May The Source be with you! |
|
| Back to top |
|
 |
trombone n00b

Joined: 20 Feb 2003 Posts: 1
|
Posted: Thu Feb 20, 2003 10:22 am Post subject: |
|
|
cbrese,
I think the following modification is OK!
| Code: |
- $package =~ /(.+)\/([^[0-9]+)(-.+)/ or croak("can't understand $package");
+ $package =~ /(.+)\/(.+)(-\d.*)/ or croak("can't understand $package");
|
|
|
| Back to top |
|
 |
|