Stegnation
January 21st, 2004, 18:50
Hi,

I have a question about the updating of ports.
This is the script I run every week:

#!/bin/sh
/usr/local/sbin/portsclean -CD
/usr/local/bin/cvsup -g -L 2 /usr/local/etc/cvsup/ports-all
/usr/local/sbin/portsdb -Uu
/usr/local/sbin/portversion -v | /usr/bin/grep needs | /usr/bin/mail -s "Ports that need updating" email@address.com


But I've never got any mail containing any updates.
When I run portversion -v it says all the ports are up to date. But when I check the FreeBSD Port Changes there are a lot of new versions out.

This is the output (http://stegg-inc.com/portsoutput.txt) I get of the script.

This is the portversion -v output (http://stegg-inc.com/versionoutput.txt).

Loop
January 22nd, 2004, 02:44
Hi,

I have a question about the updating of ports.
This is the script I run every week:

[code:1:0002e4c174]#!/bin/sh
/usr/local/sbin/portsclean -CD
/usr/local/bin/cvsup -g -L 2 /usr/local/etc/cvsup/ports-all
/usr/local/sbin/portsdb -Uu
/usr/local/sbin/portversion -v | /usr/bin/grep needs | /usr/bin/mail -s "Ports that need updating" email@address.com
[/code:1:0002e4c174]

But I've never got any mail containing any updates.
When I run portversion -v it says all the ports are up to date. But when I check the FreeBSD Port Changes there are a lot of new versions out.

This is the output (http://stegg-inc.com/portsoutput.txt) I get of the script.

This is the portversion -v output (http://stegg-inc.com/versionoutput.txt).

It's most likely because [code:1:0002e4c174]/usr/local/sbin/portsdb -Uu
[/code:1:0002e4c174] is not completing. It's probably not really required for the script to work either.

Stegnation
January 22nd, 2004, 04:45
I've left it out, but it still gives me no new versions.

Loop
January 22nd, 2004, 07:25
Here's what I use:
[code:1:b5cdd8bd49]
loop@erwin ~ % less /usr/local/bin/update-ports.sh
#!/usr/local/bin/zsh

# binaries used
SUDO=/usr/local/bin/sudo
GREP=/usr/bin/grep
MAIL=/usr/bin/mail
CVSUP=/usr/local/bin/cvsup
PORTSDB=/usr/local/sbin/portsdb
PKGVERSION=/usr/sbin/pkg_version
SUPFILE=/usr/local/etc/cvsup/ports-supfile
ECHO=/bin/echo

# user-settable variables
EMAIL=loop@erwin
HOSTNAME=`hostname`
OUTPUTFILE=/home/loop/ports-to-update

# Update the ports tree
${SUDO} ${CVSUP} ${SUPFILE}

# Update the ports index
#${SUDO} ${PORTSDB} -Uu

# Check for ports that need updating
MESSAGE=`${PKGVERSION} -vl '<'`
${ECHO} ${MESSAGE} > ${OUTPUTFILE}
${ECHO} ${MESSAGE}

# Mail an update of ports that can be updated
#${ECHO} ${MESSAGE} | ${MAIL} -s "${HOSTNAME}: Ports that need updating" ${EMAIL}[/code:1:b5cdd8bd49]

Stegnation
January 22nd, 2004, 12:36
Your script works. But when I try to do a 'portupgrade -a' I get these errors at the end.

[code:1:96e8ecf569]** The following packages were not installed or upgraded (*:skipped / !:failed)
! databases/mysql40-client (mysql-client-4.0.15) (backup error)
! archivers/p5-Archive-Tar (p5-Archive-Tar-1.07) (uninstall error)
! converters/p5-MIME-Base64 (p5-MIME-Base64-2.21) (uninstall error)
! security/vscan (uvscan-4.24e) (uninstall error)
! net/p5-URI (p5-URI-1.27) (uninstall error)
! textproc/p5-PodParser (p5-PodParser-1.24) (uninstall error)
! archivers/p5-Archive-Zip (p5-Archive-Zip-1.06) (uninstall error)
! databases/p5-DBD-mysql (p5-DBD-mysql-2.9002) (uninstall error)
! lang/ruby16-shim-ruby18 (ruby-shim-ruby18-1.8.0.p2.2003.04.19_1) (uninstall error)
! textproc/ruby-rdoc (ruby-rdoc-0.9.0) (port directory error)
! sysutils/portupgrade (portupgrade-20030723) (uninstall error)
! mail/p5-MIME-Tools (p5-MIME-Tools-5.411a_2) (uninstall error)
! databases/mysql40-server (mysql-server-4.0.15) (backup error)
! www/mod_php4 (mod_php4-4.3.4.r1,1) (backup error)
! security/clamav (clamav-0.60_3) (backup error)
! dns/p5-Net-DNS (p5-Net-DNS-0.41) (uninstall error)
! mail/razor-agents (razor-agents-2.36_1) (unknown build error)
* mail/p5-Mail-SpamAssassin (p5-Mail-SpamAssassin-2.60)
* security/amavisd-new (amavisd-new-20030616.p5)
[/code:1:96e8ecf569]

and when updating proftpd I get these:

[code:1:96e8ecf569]egrep: /var/db/pkg/apache+mod_ssl-1.3.28+2.8.15_1/+CONTENTS: No such file or directory
egrep: /var/db/pkg/arc-5.21e.8_1/+CONTENTS: No such file or directory
egrep: /var/db/pkg/clamav-0.60_3/+CONTENTS: No such file or directory
egrep: /var/db/pkg/courier-imap-2.1.2_1,1/+CONTENTS: No such file or directory
egrep: /var/db/pkg/mod_php4-4.3.4.r1,1/+CONTENTS: No such file or directory
egrep: /var/db/pkg/mysql-client-4.0.15/+CONTENTS: No such file or directory
egrep: /var/db/pkg/mysql-server-4.0.15/+CONTENTS: No such file or directory
egrep: /var/db/pkg/p5-Authen-SASL-2.05/+CONTENTS: No such file or directory
egrep: /var/db/pkg/p5-Compress-Zlib-1.22/+CONTENTS: No such file or directory
egrep: /var/db/pkg/p5-Convert-UUlib-0.31,1/+CONTENTS: No such file or directory
egrep: /var/db/pkg/p5-Digest-MD5-2.27/+CONTENTS: No such file or directory
egrep: /var/db/pkg/p5-Digest-SHA1-2.06/+CONTENTS: No such file or directory
egrep: /var/db/pkg/p5-HTML-Parser-3.32/+CONTENTS: No such file or directory
egrep: /var/db/pkg/p5-Test-Harness-2.30/+CONTENTS: No such file or directory
egrep: /var/db/pkg/p5-Time-HiRes-1.51,1/+CONTENTS: No such file or directory
egrep: /var/db/pkg/pcre-4.4/+CONTENTS: No such file or directory
egrep: /var/db/pkg/php-dbg-2.11.23/+CONTENTS: No such file or directory
egrep: /var/db/pkg/procmail-3.22_3/+CONTENTS: No such file or directory
egrep: /var/db/pkg/ruby-1.6.8.2003.04.19/+CONTENTS: No such file or directory
egrep: /var/db/pkg/ruby-rdoc-0.9.0/+CONTENTS: No such file or directory
egrep: /var/db/pkg/unrar-3.20,2/+CONTENTS: No such file or directory
egrep: /var/db/pkg/uvscan_dat-4298/+CONTENTS: No such file or directory
---> Backing up the old version
tar: etc/rc.d/proftpd.sh.sample: Cannot stat: No such file or directory
tar: Error exit delayed from previous errors
pkg_create: make_dist: tar command failed with code 512
---> Uninstalling the old version
---> Deinstalling 'proftpd-1.2.8_1'
pkg_delete: file '/usr/local/etc/rc.d/proftpd.sh.sample' doesn't really exist
pkg_delete: couldn't entirely delete package (perhaps the packing list is
incorrectly specified?)
[/code:1:96e8ecf569]

Loop
January 22nd, 2004, 18:52
Well, it's couldn't be anything to do with the script ...

Does everything work if you do the "standard"

[code:1:782c9b9d0f]cd /usr/ports
make update
portupgrade -aR
[/code:1:782c9b9d0f]

Stegnation
January 22nd, 2004, 20:00
This is what I get:

[code:1:133de2c449]server# portupgrade -aR
Stale dependency: mm-1.3.0 <-- apache+mod_ssl-1.3.29+2.8.16 -- manually run 'pkgdb -F' to fix, or specify -O to force.
server# pkgdb -F
---> Checking the package registry database
Stale origin: 'textproc/ruby-rdoc': perhaps moved or obsoleted.
-> The port 'textproc/ruby-rdoc' was removed on 2003-12-15 because:
"integrated into ruby18 and ruby16-shim-ruby18"
-> Hint: ruby-rdoc-0.9.0 is not required by any other package
-> Hint: checking for overwritten files...
-> No files installed by ruby-rdoc-0.9.0 have been overwritten by other packages.
Deinstall ruby-rdoc-0.9.0 ? [no] yes
---> Deinstalling 'ruby-rdoc-0.9.0'
pkg_delete: no such package 'ruby-rdoc-0.9.0' installed
** The following packages were not deinstalled (*:skipped / !:failed)
! ruby-rdoc-0.9.0 (pkg_delete failed)
--> Failed.
No such file or directory - "/var/db/pkg/arc-5.21e.8_1/+REQUIRED_BY"
server#
[/code:1:133de2c449]

Loop
January 23rd, 2004, 04:33
Looks like you can't delete ruby-rdoc because the file pkg_plist is gone (deleted with the removal of ruby-rdoc from the ports tree)

Not real sure of where to go, try running pkgdb -F and answering no, instead of yes to the question.

Stegnation
January 23rd, 2004, 04:41
[code:1:419ef20d72]server# pkgdb -F
---> Checking the package registry database
Stale origin: 'textproc/ruby-rdoc': perhaps moved or obsoleted.
-> The port 'textproc/ruby-rdoc' was removed on 2003-12-15 because:
"integrated into ruby18 and ruby16-shim-ruby18"
-> Hint: ruby-rdoc-0.9.0 is not required by any other package
-> Hint: checking for overwritten files...
-> No files installed by ruby-rdoc-0.9.0 have been overwritten by other packages.
Deinstall ruby-rdoc-0.9.0 ? [no] no
No such file or directory - "/var/db/pkg/arc-5.21e.8_1/+REQUIRED_BY"
[/code:1:419ef20d72]


This sort of lines..

[code:1:419ef20d72]No such file or directory - "/var/db/pkg/arc-5.21e.8_1/+REQUIRED_BY"[/code:1:419ef20d72]

I seem to get over and over. All with old package names that don't exist anymore. When I check the directory it has all new versions, but the portupgrade and pkgdb, etc keep looking for the old directories which don't exist anymore.

Stegnation
January 25th, 2004, 17:07
When I check /var/db/pkg I see directories with all the new version instead of the old versions. But the new versions aren't installed. When I try to upgrade a port it complaints it can't backup or deinstall the old version because the port's directory (the old version's) doesn't exist anymore.