Subject: package can be reinstalled without deleting first
To: None <tech-pkg@netbsd.org>
From: Jeremy C. Reed <reed@reedmedia.net>
List: tech-pkg
Date: 10/31/2002 21:04:47
I built a vixie-cron pkgsrc but I can "make install" it again and again
without the "is already installed" message and "pkg_delete" suggestion.
(I know it should fail, because other pkgsrc entries won't install if
already installed. Just tested.)
# ls -l /home/jeremy/netbsd/var/db/pkg/vixie-cron_4.0_b1/+BUILD_*
-rw-r--r-- 1 root jeremy 890 Oct 31 18:46
/home/jeremy/netbsd/var/db/pkg/vixie-cron_4.0_b1/+BUILD_INFO
-rw-r--r-- 1 root jeremy 162 Oct 31 18:46
/home/jeremy/netbsd/var/db/pkg/vixie-cron_4.0_b1/+BUILD_VERSION
# ls -l /home/jeremy/netbsd/usr/pkg/*bin/cron*
---s--x--x 1 root root 31732 Oct 31 20:43
/home/jeremy/netbsd/usr/pkg/bin/crontab
---x--x--x 1 root root 36552 Oct 31 20:43
/home/jeremy/netbsd/usr/pkg/sbin/cron
# pkg_info -e vixie-cron_4.0_b1
vixie-cron_4.0_b1
The following should fail:
# bmake install
===> Installing for vixie-cron_4.0_b1
install -c -m 111 -o root -s cron /home/jeremy/netbsd/usr/pkg/sbin/
install -c -m 4111 -o root -s crontab /home/jeremy/netbsd/usr/pkg/bin/
sh putman.sh crontab.1 /home/jeremy/netbsd/usr/pkg/man
+ cp crontab.1 /home/jeremy/netbsd/usr/pkg/man/man1/crontab.1
+ set +x
sh putman.sh cron.8 /home/jeremy/netbsd/usr/pkg/man
+ cp cron.8 /home/jeremy/netbsd/usr/pkg/man/man8/cron.8
+ set +x
sh putman.sh crontab.5 /home/jeremy/netbsd/usr/pkg/man
+ cp crontab.5 /home/jeremy/netbsd/usr/pkg/man/man5/crontab.5
+ set +x
It installs new files, but the pkg data doesn't get updated.
# ls -l /home/jeremy/netbsd/var/db/pkg/vixie-cron_4.0_b1/+BUILD_*
-rw-r--r-- 1 root jeremy 890 Oct 31 18:46
/home/jeremy/netbsd/var/db/pkg/vixie-cron_4.0_b1/+BUILD_INFO
-rw-r--r-- 1 root jeremy 162 Oct 31 18:46
/home/jeremy/netbsd/var/db/pkg/vixie-cron_4.0_b1/+BUILD_VERSION
So the package was not reregistered. But files were updated:
# ls -l
/home/jeremy/netbsd/usr/pkg/*bin/cron*
---s--x--x 1 root root 31732 Oct 31 20:56
/home/jeremy/netbsd/usr/pkg/bin/crontab
---x--x--x 1 root root 36552 Oct 31 20:56
/home/jeremy/netbsd/usr/pkg/sbin/cron
Here is the Makefile:
# grep -v '^$' Makefile
# $NetBSD$
# todo: edit man pages for paths
# todo: for some reason it allows install even when already installed
DISTNAME= cron_4.0_b1
PKGNAME= vixie-cron_4.0_b1
CATEGORIES= sysutils
MASTER_SITES= ftp://ftp.isc.org/isc/cron/
EXTRACT_SUFX= .shar
MAINTAINER= packages@NetBSD.ORG
COMMENT= Execute and maintain scheduled commands
WRKSRC= ${WRKDIR}
CPPFLAGS+= -DCRONDIR='\"${PREFIX}/var/cron\"'
MAKE_ENV+= DESTDIR=${PREFIX}
.include "../../mk/bsd.pkg.mk"
Any ideas on why this is allowed?
Thanks,
Jeremy C. Reed
http://bsd.reedmedia.net/
p.s. Bad setuid root crontab. Needs to be setgid "crontab".
p.p.s. Why package cron?
1) because I need cron for my OS which uses pkgsrc for all software.
2) To start merging in fixes so basesrc cron can be updated. The cron in
NetBSD has a bad license. Vixie has fixed the license in this newer
version.