Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
building packages without installing them
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
Windstoss
n00b
n00b


Joined: 08 Jul 2002
Posts: 19

PostPosted: Fri Aug 16, 2002 4:09 pm    Post subject: building packages without installing them Reply with quote

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
View user's profile Send private message
rizzo
Retired Dev
Retired Dev


Joined: 30 Apr 2002
Posts: 1067
Location: Manitowoc, WI, USA

PostPosted: Fri Aug 16, 2002 4:58 pm    Post subject: Reply with quote

You can use the ebuild command. man ebuild.
Back to top
View user's profile Send private message
Windstoss
n00b
n00b


Joined: 08 Jul 2002
Posts: 19

PostPosted: Fri Aug 16, 2002 9:54 pm    Post subject: Reply with quote

.. 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
View user's profile Send private message
rac
Bodhisattva
Bodhisattva


Joined: 30 May 2002
Posts: 6553
Location: Japanifornia

PostPosted: Fri Aug 16, 2002 10:41 pm    Post subject: Reply with quote

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
View user's profile Send private message
Windstoss
n00b
n00b


Joined: 08 Jul 2002
Posts: 19

PostPosted: Fri Aug 16, 2002 10:47 pm    Post subject: Reply with quote

one tbz2 per package... why?
_________________
42
Back to top
View user's profile Send private message
delta407
Bodhisattva
Bodhisattva


Joined: 23 Apr 2002
Posts: 2876
Location: Chicago, IL

PostPosted: Fri Aug 16, 2002 10:51 pm    Post subject: Reply with quote

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
View user's profile Send private message
Windstoss
n00b
n00b


Joined: 08 Jul 2002
Posts: 19

PostPosted: Fri Aug 16, 2002 11:54 pm    Post subject: Reply with quote

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
View user's profile Send private message
rac
Bodhisattva
Bodhisattva


Joined: 30 May 2002
Posts: 6553
Location: Japanifornia

PostPosted: Sat Aug 17, 2002 12:00 am    Post subject: Reply with quote

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
View user's profile Send private message
Windstoss
n00b
n00b


Joined: 08 Jul 2002
Posts: 19

PostPosted: Sat Aug 17, 2002 12:10 am    Post subject: Reply with quote

well.. this would be a solution, but I'm not used to sed/awk.. I'll try it
_________________
42
Back to top
View user's profile Send private message
rac
Bodhisattva
Bodhisattva


Joined: 30 May 2002
Posts: 6553
Location: Japanifornia

PostPosted: Sat Aug 17, 2002 12:42 am    Post subject: Reply with quote

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
View user's profile Send private message
wilbertnl
Tux's lil' helper
Tux's lil' helper


Joined: 01 Jul 2002
Posts: 89
Location: Tulsa, OK, USA

PostPosted: Sat Aug 17, 2002 3:52 am    Post subject: Re: building packages without installing them Reply with quote

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
View user's profile Send private message
cbrese
Tux's lil' helper
Tux's lil' helper


Joined: 12 Jul 2002
Posts: 126
Location: San Diego, CA

PostPosted: Thu Jan 30, 2003 10:00 pm    Post subject: Reply with quote

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
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 16029
Location: Colorado

PostPosted: Thu Jan 30, 2003 11:43 pm    Post subject: Reply with quote

Moved from Installing Gentoo.
_________________
lolgov. 'cause where we're going, you don't have civil liberties.

In Loving Memory
1787 - 2008
Back to top
View user's profile Send private message
VisualPhoenix
Tux's lil' helper
Tux's lil' helper


Joined: 26 Sep 2002
Posts: 135
Location: (CT v NJ)

PostPosted: Mon Feb 03, 2003 2:39 am    Post subject: Reply with quote

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
View user's profile Send private message
Gerk
Retired Dev
Retired Dev


Joined: 07 May 2002
Posts: 434

PostPosted: Mon Feb 03, 2003 5:41 pm    Post subject: Reply with quote

You can also try for fun...

emerge -B foo


:)

Gerk
Back to top
View user's profile Send private message
cbrese
Tux's lil' helper
Tux's lil' helper


Joined: 12 Jul 2002
Posts: 126
Location: San Diego, CA

PostPosted: Mon Feb 03, 2003 6:31 pm    Post subject: Reply with quote

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
View user's profile Send private message
Gerk
Retired Dev
Retired Dev


Joined: 07 May 2002
Posts: 434

PostPosted: Mon Feb 03, 2003 7:40 pm    Post subject: Reply with quote

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
View user's profile Send private message
cbrese
Tux's lil' helper
Tux's lil' helper


Joined: 12 Jul 2002
Posts: 126
Location: San Diego, CA

PostPosted: Mon Feb 03, 2003 7:51 pm    Post subject: Reply with quote

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
View user's profile Send private message
JeroenV
Guru
Guru


Joined: 16 Jul 2002
Posts: 447
Location: Amsterdam / Hamburg

PostPosted: Mon Feb 03, 2003 10:38 pm    Post subject: Reply with quote

Hey, cool! :D

I didn' t know my unofficial hack has been adapted yet :!:
Is that since 2.0.46-r9 :?:
Good work 8)
_________________
Cheers 8)
Jeroen
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
May The Source be with you!
Back to top
View user's profile Send private message
trombone
n00b
n00b


Joined: 20 Feb 2003
Posts: 1

PostPosted: Thu Feb 20, 2003 10:22 am    Post subject: Reply with quote

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
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