From owner-freebsd-questions@FreeBSD.ORG Wed Mar 9 09:53:17 2011 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D890106564A for ; Wed, 9 Mar 2011 09:53:17 +0000 (UTC) (envelope-from nr1c0re@gmail.com) Received: from mail-pv0-f182.google.com (mail-pv0-f182.google.com [74.125.83.182]) by mx1.freebsd.org (Postfix) with ESMTP id 415D78FC0A for ; Wed, 9 Mar 2011 09:53:16 +0000 (UTC) Received: by pvg11 with SMTP id 11so72493pvg.13 for ; Wed, 09 Mar 2011 01:53:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=lEKpRGe7qEOUc8IdRyXX+zIPUnAVaWqFTyys6kCUOac=; b=l7lZgRpvDlF3oA1jhhEMbSb30USgRuKsukLAmheopaU3IZrmd4D/g091hMIo/43V7+ XSJD28fLTu0++QMXubFM1mYUD21YEuR+M9OPuRDjqdepBaK+Q2BToGuQr6EFTBHJoQAp OAFn6c8zTkveqPpbjHrbu+yy9eYMhnAKH3Eqg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=oa+0BTIFehOZAjGZjNCx59E3cSx1WaFlriMWmrgQmoHz/XGjGN6pllgj9It6eIS85D h7/hXjW+zzV+kv3cuoqz7k15zUCQtOFQgjGUf8U5wWmpz4MUuNy//Kp7IVDctjXXwO2H ab5SlbNqBPO/fu83RZ9Nz3tji13LRN08WChno= MIME-Version: 1.0 Received: by 10.142.245.10 with SMTP id s10mr4341180wfh.423.1299664396649; Wed, 09 Mar 2011 01:53:16 -0800 (PST) Received: by 10.142.225.18 with HTTP; Wed, 9 Mar 2011 01:53:16 -0800 (PST) In-Reply-To: References: Date: Wed, 9 Mar 2011 12:53:16 +0300 Message-ID: From: c0re To: "illoai@gmail.com" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: FreeBSD Subject: Re: Portupgrade and "Updating the portsdb" X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Mar 2011 09:53:17 -0000 2011/2/11 illoai@gmail.com : > On 10 February 2011 08:33, c0re wrote: >> Hello all! >> >> I've got set of servers that uses NFS mounted /usr/ports. When I use >> "portupgrade samba" on 1st server it says >> [/usr/ports/INDEX-7.db: unexpected file type or format -- Invalid >> argument] [Updating the portsdb in /usr/ports ... - >> 22601 port entries found =A0error] Remove and try again. >> [Updating the portsdb in /usr/ports ... - 22601 port >> entries found ..... >> ..... done] >> >> Okay. It took 10-15 mins to rebuild. >> >> Then I say "portupgrade samba" on 2nd server it says again >> [/usr/ports/INDEX-7.db: unexpected file type or format -- Invalid >> argument] [Updating the portsdb in /usr/ports ... - >> 22601 port entries found =A0error] Remove and try again. >> and rebuild portsdb. >> >> Why is it so? >> >> Ports are updated via "portsnap fetch update". >> >> /etc/portsnap.conf has >> INDEX INDEX-5 DESCRIBE.5 >> INDEX INDEX-6 DESCRIBE.6 >> INDEX INDEX-7 DESCRIBE.7 >> INDEX INDEX-8 DESCRIBE.8 >> >> So while portupgrade rebuilds portsdb it's not possible use >> portupgrade on 2nd server because later build process will fail on 1st >> or second server. >> >> What can I do with it? Why portupgrade always thinks that >> [/usr/ports/INDEX-7.db: unexpected file type or format -- Invalid >> argument]? >> > > The INDEX-n.db is a locally generated portupgrade thing. > > Edit your /usr/local/etc/pkgtools.conf for each machine to > include a line such as: > ENV['PORTS_INDEX'] ||=3D ENV['PORTSDIR'] + '/INDEX.local' > > Only instead of '/INDEX.local' use '/INDEX.your_hostname_here'. > > You might also look at changing the part ENV['PORTSDIR'] to > something local (speed, etc), like adding a line up from that: > ENV['LOCALINDICES'] ||=3D '/var/db' > > then > > ENV['PORTS_INDEX'] ||=3D ENV['LOCALINDICES'] + '/INDEX.thy_hostname_here' > > > Also, if you have local space, settin' WRKDIRPREFIX=3D in > /etc/make.conf will speed things up & allow multiple machines > to build at the same time. > > HTH > -- > -- > It's time to make upgrade of some packages. I configured ENV['PORTS_INDEX'] =3D '/var/db/INDEX' ENV['PORTS_DBDIR'] =3D ENV['PKG_DBDIR'] in /usr/local/etc/pkgtools.conf, assuming that PKG_DBDIR is /var/db/pkg and "portupgrade sudo" results Fetching the ports index ... fetch: /usr/ports/INDEX-7.bz2: open(): Read-only file system *** Error code 1 Stop in /usr/ports. failed to fetch INDEX! Updating the ports index ... Generating INDEX.tmp - please wait..cannot create /usr/ports/INDEX.tmp.tmp: Read-only file system Warning: Duplicate INDEX entry: py25-bsddb-2.5.5_2 *** Error code 2 Stop in /usr/ports. *** Error code 1 Stop in /usr/ports. failed to generate INDEX! index generation error /usr/local/lib/ruby/site_ruby/1.8/portsdb.rb:493:in `open_db': database file error (PortsDB::DBError) from /usr/local/lib/ruby/site_ruby/1.8/portsdb.rb:661:in `port' from /usr/local/lib/ruby/site_ruby/1.8/portsdb.rb:849:in `all_depends_list' from /usr/local/lib/ruby/site_ruby/1.8/pkgdb.rb:843:in `tsort_build= ' from /usr/local/lib/ruby/site_ruby/1.8/pkgdb.rb:835:in `each' from /usr/local/lib/ruby/site_ruby/1.8/pkgdb.rb:835:in `tsort_build= ' from /usr/local/lib/ruby/site_ruby/1.8/pkgdb.rb:857:in `sort_build' from /usr/local/lib/ruby/site_ruby/1.8/pkgdb.rb:861:in `sort_build!= ' from /usr/local/sbin/portupgrade:792:in `main' from /usr/local/lib/ruby/1.8/optparse.rb:791:in `initialize' from /usr/local/sbin/portupgrade:229:in `new' from /usr/local/sbin/portupgrade:229:in `main' from /usr/local/sbin/portupgrade:2213 Any workaround with "Fetching the ports index"? There exists /usr/ports/INDEX-7, but portupgrade tryes to fetch it again and failes, cose /usr/ports is read-only mounted. Changing ENV['PORTSDIR'] ||=3D '/var/ports' make no sense because it's obvious that PORTSDIR should look at ports base (/usr/ports) # portupgrade sudo ** Port directory not found: security/sudo ** Listing the failed packages (-:ignored / *:skipped / !:failed) - security/sudo (port directory error) Still looking for a solution about using portupgrade with read-only mounted /usr/ports. And yes, i'm using WRKDIRPREFIX in /etc/make.conf.