Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Discussion & Documentation Gentoo Chat
  • Search

An Honest Comparison of Ports and Portage

Opinions, ideas and thoughts about Gentoo. Anything and everything about Gentoo except support questions.
Post Reply
  • Print view
Advanced search
18 posts • Page 1 of 1
Author
Message
Hydralisk
Tux's lil' helper
Tux's lil' helper
Posts: 83
Joined: Wed Mar 19, 2003 12:15 am

An Honest Comparison of Ports and Portage

  • Quote

Post by Hydralisk » Sat Sep 13, 2003 6:21 pm

I'm sure that everyone, Larry the Cow included, knows that the Gentoo Portage system finds its roots with FreeBSD's ports, which is over ten years old. I've asked people on both sides of the river what the differences are, but I've recieved varied responses from either side. I decided that the only way to find out what the differences are, and which one is better, is to try FreeBSD for a month or two.

That time has passed, and now I will try to outline the relative advantages and disadvantages of Ports and Portage. Although, I have to admit, I'm currently typing this in vim on my Gentoo system.

First, a quick overview of Ports is in order. Think of it as Portage with different commands, and a different syntax for ebuilds. Instead of being written in BASH like ebuilds, FreeBSD ports are written in (BSD, not GNU) Makefile syntax. Here is, for example, the ports makefile for /usr/ports/archivers/zip (this is BSD-licensed code):

Code: Select all

# New ports collection makefile for:    zip
# ftp://ftp.info-zip.org/pub/infozip/Info-ZIP.html
# Date created:		22 Dec 1994
# Whom:			ache
#
# $FreeBSD: ports/archivers/zip/Makefile,v 1.27 2003/03/08 22:55:34 kris Exp $
#

PORTNAME=	zip
PORTVERSION=	2.3
PORTREVISION=   1
CATEGORIES=	archivers
MASTER_SITES=	ftp://ftp.uu.net/pub/archiving/zip/src/ \
		${MASTER_SITE_TEX_CTAN:S,%SUBDIR%,tools/zip/info-zip/src/,}
ZCRYPT_SRC=	zcrypt29-exportable.zip
DISTFILES=	zip23${EXTRACT_SUFX} ${ZCRYPT_SRC}

MAINTAINER=	ache@FreeBSD.org
COMMENT=	Create/update ZIP files compatible with pkzip

EXTRACT_DEPENDS=unzip:${PORTSDIR}/archivers/unzip

WRKSRC=		${WRKDIR}/${PORTNAME}-${PORTVERSION}
EXTRACT_ONLY=	zip23${EXTRACT_SUFX}
MAKEFILE=	unix/Makefile
MAKE_FLAGS=	LOCAL_ZIP="-DUSE_CRYPT" -f
ALL_TARGET=	generic
MAN1=		zip.1

post-extract:
	unzip -q -aa -o ${_DISTDIR}${ZCRYPT_SRC} -d ${WRKSRC} -x WHERE

do-install:
.for file in zip zipcloak zipnote zipsplit
	${INSTALL_PROGRAM} ${WRKSRC}/${file} ${PREFIX}/bin
.endfor
	${INSTALL_MAN} ${WRKSRC}/man/zip.1 ${PREFIX}/man/man1

.include <bsd.port.mk>
That looks very similar to your average ebuild, but you can definitely see the evolutions Portage made (this is GPL-licensed code):

Code: Select all

# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /home/httpd/cvsroot/gentoo-x86/app-arch/zip/zip-2.3-r2.ebuild,v 1.5 2003/09/05 22:49:03 msterret Exp $

IUSE="crypt"

DESCRIPTION="Info ZIP (encryption support)"
SRC_URI="http://www.ibiblio.org/pub/Linux/distributions/gentoo/distfiles/${PN}23.tar.gz
        crypt? ( ftp://ftp.icce.rug.nl/infozip/src/zcrypt29.zip )"
HOMEPAGE="ftp://ftp.freesoftware.com/pub/infozip/Zip.html"

SLOT="0"
KEYWORDS="~x86 ~ppc ~sparc ~alpha ~amd64"
LICENSE="Info-ZIP"

DEPEND="crypt? ( app-arch/unzip )"

src_unpack() {
        unpack ${A}
        if [ "`use crypt`" ]; then
                mv -f crypt.h ${S}
                mv -f crypt.c ${S}
        fi
        cd ${S}/unix
        cp Makefile Makefile.orig
        sed -e "s:-O2:${CFLAGS}:" Makefile.orig > Makefile
}

src_compile() {
        emake -f unix/Makefile generic_gcc || die
}

src_install() {
        dobin zip zipcloak zipnote zipsplit
        doman man/zip.1
        dodoc BUGS CHANGES LICENSE MANUAL README TODO WHATSNEW WHERE
}
If I wanted to install this port, I would type 'portinstall zip' (or 'portinstall archives/zip'), and the package would be automagically installed for me similar to what would happen if I typed 'emerge zip'.

Now, let's move on to the relative advantages of each system.

* In sheer number of Ports/Ebuilds, FreeBSD wins. FreeBSD passed 9,000 ports a month ago, and Gentoo was somewhere around 4,500 the last time I checked. However, Gentoo has many ebuilds that aren't in Ports, and FreeBSD has many ports that aren't in Portage. FreeBSD and Gentoo are both kept up to date similarly. However, FreeBSD had both KDE 3.1.3 and GNOME 2.4 in its ports tree before Gentoo.

* In ease of installing packages, Gentoo wins here. While the commands are very similar and what happens when you type them is almost identical, the deciding factor is the Gentoo --pretend option. It is vastly superior to the FreeBSD counterpart.

* In ease of removing packages, FreeBSD has a huge edge on Gentoo. This is because Portage completely ignores dependencies when you emerge --unmerge something. I could emerge --unmerge kdelibs and Gentoo will orphan the other KDE packages I just spend 8 hours compiling without a second thought. FreeBSD, on the other hand, has something called reverse dependencies. If I 'pkg_deinstall -r gtk-2.2.4', FreeBSD, will remove all packages that depend on GTK2 (GNOME2, gvim, galeon, etc.). This makes tasks that are incredibly difficult on Gentoo, such as removing GNOME, incredibly easy on FreeBSD. Reverse dependencies are, of course, my most-wanted new feature in Portage.

* When we consider updating the ports/portage tree, it is essentially a comparison of rsync and cvsup. The primary method of updating the ports tree in FreeBSD is cvsup, and Gentoo uses rsync. Comparing them would take another article, but the short story is that cvsup is superior to rsync. Gentoo makes it easier to actually give the command to upgrade the tree, by building it into emerge (i.e. 'emerge rsync'). With FreeBSD, I have to call it externally (i.e. 'cvsup -g -L 2 /root/ports-sup').

CVSup vs. Rsync was discussed in the December 23, 2002 GWN:
There has been some discussion in the Gentoo developer community about migrating away from Portage's dependency on rsync and instead utilizing CVSup. Currently used in FreeBSD's ports system, CVSup offers a few distinct advantages, as well as challenges, over rsync:

Local changes will be preserved if you want them to, just like anoncvs. Anyone who's ever had their package.mask file overwritten by an emerge rsync will appreciate this feature.

CVSup is faster and more efficient than rsync. This means that CVSup can improve the efficiency of our Portage mirroring system.

CVSup's threaded design allows for file transfer begin almost immediately, unlike rsync which must build a complete file list first. Surprisingly, CVSup uses the rsync algorithm (which is very efficient) internally to synchronize individual files, but uses a better approach than rsync when coordinating the updates of large numbers of files.

CVSup is written in Modula 3, which means that transitioning to CVSup will require some non-trivial steps to ensure that we have proper Modula 3 support on all architectures.

CVSup also has the added psychological benefit of making FreeBSD users feel more at home.
* Once you've updated the ports/portage tree, you have to update the actual packages on your system. I would say this is a draw, as I have never had problems using 'emerge -Dup world' or 'portupgrade -Rva', respectively, on either system. However, I think Gentoo deserves a win here because it's emerge -p flag is more useful (and more colorful :) ) than FreeBSD's portupgrade -n flag.

* In support of Java packages, Gentoo easily beats FreeBSD because of java-config. This allows much easier, on-the-fly, switching of JVMs than anything currently on FreeBSD. The current FreeBSD java-config is unnacceptable. (I read somewhere, when looking into this, that the FreeBSD Java people were considering writing a java-config similar to Gentoo's.)

* Finally, when it comes to installing packages (i.e. precompiled ports or ebuilds), FreeBSD wins. For every release (and periodically in the interim), FreeBSD builds packages for just about every port in the tree. These packages can be install using 'pkg_add <package-file>' or 'pkg_add -r <package-name>'. The latter automatically downloads the package from a FreeBSD ftp mirror.

Overall, I don't think I can decide. Portage and Ports are both great systems; I would surely use one if the other did not exist. When (hopefully, not if) Portage gets reverse dependency handling (qpkg --query-deps and emerge depclean do not count), Portage would win decisively over Ports.
Top
drjimmy42
Guru
Guru
User avatar
Posts: 512
Joined: Mon Feb 03, 2003 10:24 pm
Location: Nashua, NH

  • Quote

Post by drjimmy42 » Sat Sep 13, 2003 6:39 pm

Wow, great article. Very informative.
Top
rogue
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 99
Joined: Wed May 15, 2002 3:27 am
Location: Falls Church, VA
Contact:
Contact rogue
Website

  • Quote

Post by rogue » Sat Sep 13, 2003 6:44 pm

good post. I used to run OpenBSD (might switch my server back to it if I ever get it out from behind my firewall) which uses the ports system. it may be because I've used gentoo for a bit longer, but I've found the portage system to be more "friendlier" to use then the ports system.
(rob)
Top
lghman
Guru
Guru
User avatar
Posts: 548
Joined: Fri Nov 29, 2002 7:01 am
Location: Florida

  • Quote

Post by lghman » Sat Sep 13, 2003 7:13 pm

Very well written and informative article. :D

--sonik
"What a distressing contrast there is between the radiant intelligence of a child and the feeble mentality of the average adult" --Freud
Top
scriptkiddie
l33t
l33t
User avatar
Posts: 955
Joined: Sun Mar 30, 2003 2:47 am
Contact:
Contact scriptkiddie
Website

  • Quote

Post by scriptkiddie » Sat Sep 13, 2003 7:15 pm

I use to have a freeBSD system as a sever before I used Tru64 Unix and I found ports to be a great program, although when I found gentoo and debian, I began to like apt-get and portage a lot more :D
Top
pilla
Bodhisattva
Bodhisattva
User avatar
Posts: 7732
Joined: Wed Aug 07, 2002 8:19 pm
Location: Underworld

  • Quote

Post by pilla » Sat Sep 13, 2003 9:18 pm

Moving to Gentoo Chat.
"I'm just very selective about the reality I choose to accept." -- Calvin
Top
Sir_Stinksalot
Apprentice
Apprentice
User avatar
Posts: 195
Joined: Fri Jul 26, 2002 5:22 pm
Location: Behind you. BOO!!!

  • Quote

Post by Sir_Stinksalot » Sat Sep 13, 2003 9:25 pm

I have never used freebsd but have heard of the portage/ports relationship. I am just curious though are the peeps in charge working on a better unmerge system for portage. I have found that gentoo compared to other linux distros is the easiest to get up to date packages. I liked apt-get but sometimes tracking down a server with a particular package could be like searching for a dependancy in redhat. I have used the unmerge option a few times but not on anything major that may be intertwined with other packages. So an improved unmerge option would make me want nothing and only be blessed by the future improvements.

BTW I love gentoo and probably shouldn't want more but uninstalling a package with intertwined deps would be cool.

Since I am writing this there are two things I would like to see but ain't complaining about. One would be to see an option in search that would allow for exact match only. Such as emerge -s gnome only coming up with gnome or something that starts with gnome or all packages coming up alphabetical order regardless of the category it resides in. And two it would be nice to be able to see all the packages in a particular category without going to the web.

If either of these suggestions already exist please share them with me. If you like my suggestions then please pass them on to somone who has the ability toi make them work
Top
arand
Apprentice
Apprentice
Posts: 215
Joined: Tue Apr 22, 2003 9:03 pm

  • Quote

Post by arand » Sat Sep 13, 2003 9:34 pm

Hydralisk,

Excellent write up and very informative. One question. Was there an equivlent of the use varibles in ports?

Thanks
Last edited by arand on Sat Sep 13, 2003 10:43 pm, edited 1 time in total.
Top
pjp
Administrator
Administrator
User avatar
Posts: 20668
Joined: Tue Apr 16, 2002 10:35 pm

Re: An Honest Comparison of Ports and Portage

  • Quote

Post by pjp » Sat Sep 13, 2003 10:00 pm

Good writeup. I'm not surprised to see that each system has advantages over the other. The primary area I see Portage winning in the not too distant future is volunteer support. Linux has managed to attract more users, so I think its safe to say that Gentoo/Portage might be the beneficiary of more input. For not being very old, Portage has nearly matched or beaten Ports (Ports being Portage's mentor certainly helped).
Hydralisk wrote:* In sheer number of Ports/Ebuilds, FreeBSD wins. FreeBSD passed 9,000 ports a month ago, and Gentoo was somewhere around 4,500 the last time I checked.
If w.g.o is current (not sure how its updated), there are currently 5356 packages (not nitpicking ;)). I don't expect another 5000 packages in the same timeframe, but it will be interesting to see how the number of packages increases.
Quis separabit? Quo animo?
Top
gsfgf
Veteran
Veteran
User avatar
Posts: 1266
Joined: Wed May 08, 2002 3:24 pm

  • Quote

Post by gsfgf » Sat Sep 13, 2003 10:38 pm

Does BSD haven anything like USE?
Aim:gsfgf0
Top
Hydralisk
Tux's lil' helper
Tux's lil' helper
Posts: 83
Joined: Wed Mar 19, 2003 12:15 am

  • Quote

Post by Hydralisk » Sat Sep 13, 2003 10:42 pm

arand wrote:Hydralisk,

Excellent right up and very informative. One question. Was there an equivlent of the use varibles in ports?

Thanks
There is an equivalent of USE variables in FreeBSD ports. For instance, editors/vim (or app-editors/vim in portage) can be built with either GTK1 or GTK2, and with our without X11.

If I want to build it with GTK2: I put the following line at the end of make.conf:

Code: Select all

# /etc/make.conf
# ...
WITH_GTK2=yes
If I want to build without X11 (i.e. no gvim), I put this at the bottom instead:

Code: Select all

# /etc/make.conf
...
WITHOUT_X11=yes
Alternatively, I can define those as environment variables (like defining USE on the command line).
Top
kesuari
n00b
n00b
Posts: 63
Joined: Sun May 18, 2003 12:48 am

  • Quote

Post by kesuari » Sun Sep 14, 2003 2:38 am

Good post. More bang for your buck than my comparison with Debian :)

-- A FreeBSD -> Gentoo convert.
Top
ba747heavy
Apprentice
Apprentice
Posts: 216
Joined: Mon Aug 11, 2003 12:17 am
Location: New Mexico, USA

  • Quote

Post by ba747heavy » Sun Sep 14, 2003 5:14 am

Excellent article!
Fred Clausen
"leet [speak] is a cry for help from a shallow mind" - Doomwookie Jan 05
Top
choco
n00b
n00b
User avatar
Posts: 49
Joined: Tue Jun 10, 2003 3:30 pm
Location: Jackson, MI

  • Quote

Post by choco » Mon Sep 15, 2003 1:40 am

Sir_Stinksalot:

1. The -s parameter of emerge takes a regular expression, so doing an

Code: Select all

 emerge -s '^gnome' 
would show only the ebuilds whose names start with gnome. And

Code: Select all

 emerge -s '^gnome$' 
would do an exact search for 'gnome'. '^' and '$' stand for the start and end of the ebuild name, respectively.

2. Since the ebuild files are grouped using directories in portage, to see all the files in category 'app-office' you could just go to /usr/portage/app-office and do an ls. On the other hand, I believe people have made utilities to browse the portage tree. 'pbrowser' is one of them, that I found in the forums but couldn't get to work for me.

Nothing like a "fair and balanced" article. Good read.
Who would win in a fight between Sandman and Clayface?
Top
mezz
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 111
Joined: Sat Jun 01, 2002 9:12 pm

  • Quote

Post by mezz » Mon Sep 15, 2003 1:59 am

Well written, I like it..

Umm, what about the controls and flexible? For example, in FreeBSD I can just put many different of varbles in the make.conf. For example, I can put where I want them to be install in like /opt instead /usr/local (prefix).. Can it be done in Portage without have to edit each ebuilds? I had to ask, because last time I tried Gentoo was like back in 1.2 or whatever, I don't remember what version.
Top
Vancouverite
Apprentice
Apprentice
User avatar
Posts: 162
Joined: Sat Sep 28, 2002 4:57 am
Location: Vancouver, Canada

  • Quote

Post by Vancouverite » Mon Sep 15, 2003 7:19 am

Great comparison of ports and portage! Now how do I get XMMS on FreeBSD to stop skipping when I do a whole bunch of things at once? The Con Kolivas patches do this for me on Linux, what settings am I missing on FreeBSD?
Screenshot
Top
charlieg
Advocate
Advocate
User avatar
Posts: 2149
Joined: Tue Jul 30, 2002 11:05 am
Location: Manchester UK
Contact:
Contact charlieg
Website

  • Quote

Post by charlieg » Mon Sep 15, 2003 8:58 am

This should be moved to 'Documentation, Tips & Tricks' as it's essentially a nice piece of Documentation.
Want Free games?
Free Gamer - open source games list & commentary

Open source web-enabled rich UI platform: Vexi
Top
asimon
l33t
l33t
User avatar
Posts: 979
Joined: Thu Jun 27, 2002 12:18 pm
Location: Germany, Old Europe

  • Quote

Post by asimon » Mon Sep 15, 2003 3:36 pm

FreeBSD uses nicer variable names in their ports, although I don't understand why they use WRKDIR instead of WORKDIR etc.

Gentoo's one-letter variables A, S, P, etc. are terrible.
Top
Post Reply
  • Print view

18 posts • Page 1 of 1

Return to “Gentoo Chat”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic