Subject: pkg_add extract to stage area even if already installed
To: None <>
From: Jeremy C. Reed <>
List: tech-pkg
Date: 04/02/2004 10:06:26
It appears that pkg_add extracts to staging area even if already

 Requested space: 29308 bytes, free space: 1084674048 bytes in
 pkg_add: other version 'gethost-0.03' already installed
 pkg_add: 1 package addition failed

(It should exit here.)

 parsing: .
 path: /home/reed/my-pkg-tool/.
 increasing RLIMIT_NOFILE to max. 1024 open files
 running: /usr/bin/tar --fast-read --use-compress-program bzip2 -xpf
 /scratch/packages/Linux/2.6.3/i386/All/gethost-0.03nb100.tbz +CONTENTS
 Extracting to staging area: /var/tmp/instmp.JgFlZM.
 running: /usr/bin/tar  --use-compress-program bzip2 -xpf

The "Extracting to staging area" comment is my extra debugging added.

I had also added a sleep() so I could look in the staging area before it

So it does:

if (findmatchingname(dbdir, buf, note_whats_installed, installed) > 0)
displays the "other version 'gethost-0.03' already installed"

And then later extracts to staging area (and immediately cleans up).

Am I seeing this wrong? Is this a real waste of time or resources?

Also the output sent to standard output or stderr is delayed and sometimes
outputted at same time so is read as junk. Is there some curses/termcap
behaviour that is disabling output for a while? (If so, why?)

   Jeremy C. Reed