Date: Thu, 27 Feb 2003 08:34:39 -0800 From: "Kevin Oberman" <oberman@es.net> To: "Brian T. Schellenberger" <bts@babbleon.org> Cc: Yann Golanski <yann@kierun.org>, Gordon Broom <gjbroom@alumni.uwaterloo.ca>, ajs@labs.mot.com, freebsd-stable@freebsd.org Subject: Re: Upgrading ports and such Message-ID: <20030227163439.A13145D04@ptavv.es.net> In-Reply-To: Your message of "Thu, 27 Feb 2003 09:18:51 EST." <200302270918.51075.bts@babbleon.org>
next in thread | previous in thread | raw e-mail | index | archive | help
> From: "Brian T. Schellenberger" <bts@babbleon.org> > Date: Thu, 27 Feb 2003 09:18:51 -0500 > Sender: owner-freebsd-stable@FreeBSD.ORG > > > Well, it's probably a case of "once bitten, twice shy" but the last time > I tried portupgrade it completely destroyed my system. (Well, the > /usr/local part anyway.) And since I wasn't banking on the downtime > then, and hadn't done the "pkg_info -aI" beforehand it was a lot worse > for me than my current approach. > > And I *did* try upgrading "all" the ports. (Among other things.) > > This script might work, though. The basic problem that portupgrade gave > me, I think, was that my pkgdb wasn't quite right to start with and > portupgrade can really screw things up badly. It looks like it tries > to warn you about that now but either it didn't then or I didn't follow > what it was trying to tell me to do. Brian, I have been using portupgrade since it was first added to ports and, for the past 5 or 6 months, it's been close to flawless. Before that it required a fair bit of hand-holding and occasion manual massage of the databases. portupgrade is also a good toll to mess up a system if not properly used. Read the man pages before trying to use it. My "standard" procedure is: 1. Create a ${prefix}/etc/pkgtools.conf file for ports that require special options. I use this for galeon2, nautilus2, and the like. Start with the .sample.config file supplied. I will append my file as an example. Normally I only need to touch the MAKE_ARGS section, but you may want to do other things and this tool allows lots of customizations. 2. cvsup ports tree 3. portsdb -Uu (There are several ways to cut down the time required to do this, but I'll leave it at the vanilla stage to avoid confusion.) 4. portversion -vL= (to list the ports in need to upgrade) 5. portupgrade -R portupgrade (Only needed if portupgrade was listed in 4.) 6. portupgrade -Ra (This upgrades everything in the proper order) This usually is all that is required. Occasionally there will be a change which REQUIRES that all ports dependent on some other port be upgraded (as was the case for Xft). For that you need to use the -f option (portupgrade -fR Xft). Oh, and in case you missed it the first time, READ THE MAN PAGES! R. Kevin Oberman, Network Engineer Energy Sciences Network (ESnet) Ernest O. Lawrence Berkeley National Laboratory (Berkeley Lab) E-mail: oberman@es.net Phone: +1 510 486-8634 --[[application/octet-stream Content-Disposition: attachment; filename="pkgtools.conf"][7bit]] # -*- ruby -*- # # pkgtools.conf - the configuration file for the pkgtools suite # # $Idaemons: /home/cvs/pkgtools/etc/pkgtools.conf,v 1.14 2002/04/28 19:52:12 knu Exp $ # Syntax: # string: '...' or "..."; use the `+' operator to concatinate # boolean: true or false # array: [ value, ... ]; use the `+' operator to concatinate # hash: { key => value, ... } # Useful predefined constants: # # Name: Example value: # OS_RELEASE: "5.0-CURRENT" # OS_REVISION: "5.0" # OS_MAJOR: "5" # OS_BRANCH: "CURRENT" # OS_PLATFORM: "i386" # Useful predefined functions: # # localbase() # Returns LOCALBASE. # # x11base() # Returns X11BASE. # # pkg_site_builder([latest]) # Returns a URI of the packages directory on the package builder site; # Equivalent to: # on i386: # sprintf('http://bento.FreeBSD.org/errorlogs/packages-%s-%s/', # OS_MAJOR, latest ? 'latest' : 'full') # on alpha: # sprintf('http://beta.FreeBSD.org/errorlogs/packages-%s-%s/', # OS_MAJOR, latest ? 'latest' : 'full') # # pkg_site_mirror([root]) # Returns a URI of the packages directory on the preferred mirror site; # Equivalent to: # sprintf('%s/pub/FreeBSD/ports/%s/packages-%s/', # root || ENV['PACKAGEROOT'] || 'ftp://ftp.FreeBSD.org', # OS_PLATFORM, OS_RELEASE.downcase) # # pkg_site_primary() # Returns a URI of the packages directory on the primary FTP site; # Equivalent to: # pkg_site_mirror('ftp://ftp.FreeBSD.org') module PkgConfig # Environment Variables: string # # Uncomment and edit as necessary. The `||=' operator means `set only # if it is not set', i.e. it gives a variable its default value. # # It is particularly recommendable that you set PORTS_INDEX to # something other than the default value to avoid conflict with CVS, # CVSup, or CTM. # # cf. portupgarde(1), pkg_which(1) # # defaults: # ENV['PORTSDIR'] ||= '/usr/ports' # ENV['PORTS_INDEX'] ||= ENV['PORTSDIR'] + '/INDEX' # ENV['PORTS_DBDIR'] ||= ENV['PORTSDIR'] # ENV['PKG_DBDIR'] ||= '/var/db/pkg' # # ENV['PKG_TMPDIR'] ||= '/var/tmp' # # ENV['PACKAGES'] ||= ENV['PORTSDIR'] + '/packages' # # e.g.: # ENV['PORTSDIR'] ||= '/export/freebsd/ports' # ENV['PORTS_INDEX'] ||= ENV['PORTSDIR'] + '/INDEX.txt' # ENV['PORTS_DBDIR'] ||= ENV['PKG_DBDIR'] # # ENV['PACKAGES'] ||= sprintf('/export/freebsd/packages-%s-%s', # OS_RELMAJOR, OS_BRANCH.downcase) # ENV['PKG_PATH'] ||= ENV['PACKAGES'] + '/All' # # ENV['PKG_FETCH'] = "wget -O '%2$s' '%1$s'" # ENV['PKG_FETCH'] = "curl '%s' -o '%s'" # ENV['PKG_FETCH'] = 'false' # never fetch packages from a remote site # ENV['PACKAGEROOT'] = 'ftp://ftpN.XX.FreeBSD.org' ENV['PORTSDIR'] ||= '/usr/ports' ENV['PACKAGES'] ||= ENV['PORTSDIR'] + '/packages' ENV['PKG_PATH'] ||= ENV['PACKAGES'] + '/All' # SANITY_CHECK: boolean (default: true) # # If true, perform sanity checks on stale dependencies. This makes # it up to 50% slower to parse package globs but offers unfailing # upgrades. If you are sure you won't forget to run `pkgdb -F' # regularly, turn this off to take performance. (default: true) # # cf. -O/--omit-check of pkg_deinstall(1), pkg_glob(1), # portupgrade(1) and portversion(1) SANITY_CHECK = true # IGNORE_CATEGORIES: array # # This is a list of port categories you want the pkgtools to ignore. # Typically you want to list language specific categories of the # languages you don't use. # # After configuring this list, you need to rebuild the ports # database to reflect the changes. (run 'portsdb -Ufu') # # e.g.: # IGNORE_CATEGORIES = [ # 'chinese', # 'french', # 'german', # 'hebrew', # 'japanese', # 'korean', # 'russian', # 'ukrainian', # 'vietnamese', #] IGNORE_CATEGORIES = [ ] # EXTRA_CATEGORIES: array # # This is a list of extra port categories you put your locally # maintained ports. You must prepare a Makefile in each directory # that defines a variable SUBDIR which lists all the ports in the # category. # # After configuring this list, you need to rebuild the ports # database to reflect the changes. (run 'portsdb -Ufu') # # e.g.: # EXTRA_CATEGORIES = [ # 'local', # ] EXTRA_CATEGORIES = [ ] # HOLD_PKGS: array # # This is a list of ports you don't want portupgrade(1) to upgrade, # portversion(1) to suggest upgrading, or pkgdb(1) to fix. # You can use wildcards ("ports glob" and "pkgname glob"). # -f/--force of each command will force the held status. # # cf. pkg_glob(1), ports_glob(1) # # e.g.: # HOLD_PKGS = [ # 'bsdpan-*', # 'x11/XFree86*', # ] HOLD_PKGS = [ 'bsdpan-*', ] # MAKE_ARGS: hash # # This is a hash of ports glob => arguments mapping. portupgrade(1) # and portinstall(1) look it up to pick command line arguments to # pass to make(1). You can use wildcards ("ports glob"). If a # port/package matches multiple entries, all the arguments are # joined using the space as separator. # # cf. -m/--make-args of portupgrade(1), ports_glob(1) # # e.g.: # MAKE_ARGS = { # 'databases/mysql323-*' => 'WITH_CHARSET=ujis', # } MAKE_ARGS = { 'www/galeon2' => '-DWITH_FULL_MOZILLA', 'x11-fm/nautilus2' => '-DWITH_FULL_MOZILLA', 'x11-servers/XFree86-4-Server' => '-DWITH_MATROX_GXX_DRIVER', 'multimedia/mplayer' => '-DWITHOUT_RUNTIME_CPUDETECTION', } # BEFOREBUILD: hash # # This is a hash of ports glob => command mapping. portupgrade(1) # and portinstall(1) look it up to pick commands to run before # building a port. You can use wildcards ("ports glob"). If a # port/package matches multiple entries, all the commands are joined # using the semicolon as separator and run. # # cf. -B/--beforebuild of portupgrade(1), ports_glob(1) # # e.g.: # BEFOREBUILD = { # # Always do cvs update before building a port # '*' => 'cvs update', # } BEFOREBUILD = { } # AFTERINSTALL: hash # # This is a hash of ports glob => command mapping. portupgrade(1) # and portinstall(1) look it up to pick commands to run after # installing a port. You can use wildcards ("ports glob"). If a # port/package matches multiple entries, all the commands are joined # using the semicolon as separator and run. # # cf. -B/--afterinstall of portupgrade(1), ports_glob(1) # # e.g.: # AFTERINSTALL = { # # Automatically start MySQL server # 'databases/mysql323-server' => localbase() + '/etc/rc.d/mysql-server.sh start', # # # Disable the startup script of Canna # 'ja-Canna' => 'cd ' + localbase() + '/etc/rc.d && mv canna.sh canna.sh.noauto', # } AFTERINSTALL = { } # PKG_SITES: array # # This is a list of URI's to get packages from. Each site directory # must contain directories named 'All' and 'Latest'. The value of # the environment variable `PKG_SITES' is automatically prepended to # the list. (default: [pkg_site_mirror()]) # # e.g.: # PKG_SITES = [ # sprintf('ftp://ftp.localdomain/pub/freebsd/packages-%s/', OS_MAJOR), # pkg_site_builder(true), # pkg_site_builder(), # pkg_site_mirror(), # pkg_site_primary(), # ] PKG_SITES = [ pkg_site_mirror(), ] # PORTUPGRADE_ARGS: string # # This sets the default options passed to portupgrade(1). # # e.g.: # PORTUPGRADE_ARGS = ENV['PORTUPGRADE'] || \ # '-v -l /var/tmp/portupgrade.results " + \ # '-L /var/tmp/portupgrade-' PORTUPGRADE_ARGS = ENV['PORTUPGRADE'] end To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030227163439.A13145D04>