Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 9 Mar 2011 12:53:16 +0300
From:      c0re <nr1c0re@gmail.com>
To:        "illoai@gmail.com" <illoai@gmail.com>
Cc:        FreeBSD <freebsd-questions@freebsd.org>
Subject:   Re: Portupgrade and "Updating the portsdb"
Message-ID:  <AANLkTik68Jf2KK_=euRu32rtWhVBLamjCTeF5aHmZtfK@mail.gmail.com>
In-Reply-To: <AANLkTik_qh1DK65n_0N7EkvpjesKOLXRgRMPZ%2BizyiTe@mail.gmail.com>
References:  <AANLkTi=amTTpG=RTJ=P-m5JbypMoS=vtfN%2BuS8Qc4p92@mail.gmail.com> <AANLkTik_qh1DK65n_0N7EkvpjesKOLXRgRMPZ%2BizyiTe@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
2011/2/11 illoai@gmail.com <illoai@gmail.com>:
> On 10 February 2011 08:33, c0re <nr1c0re@gmail.com> 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 <format:bdb_btree> in /usr/ports ... -
>> 22601 port entries found =A0error] Remove and try again.
>> [Updating the portsdb <format:dbm_hash> 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 <format:bdb_btree> 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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTik68Jf2KK_=euRu32rtWhVBLamjCTeF5aHmZtfK>