CRUX

Welcome to CRUX bug tracking.
Tasklist

FS#619 - prt-get thinks a package is installed if disk space runs out while installing a prebuilt package

Attached to Project: CRUX
Opened by K.Mandla (K.Mandla) - Thursday, 12 August 2010, 11:38 GMT
Task Type Bug Report
Category tools → prt-get
Status New
Assigned To CRUX Developers (crux)
Operating System Linux
Severity Medium
Priority Normal
Reported Version 2.6
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No

Details

Hello. Under Crux 2.6 and prt-get version 5.18, if the disk runs out of space while prt-get is installing a precompiled package, pkgadd will report disk space errors, but prt-get will still mark the package as installed.

This might help visualize:

---
bash-4.1# prt-get depinst alpine
prt-get: installing /usr/ports/local/alpine
=======> Package '/usr/ports/local/alpine/alpine#2.00-1.pkg.tar.gz' is up to date.
prt-get: installing alpine 2.00-1
pkgadd: could not install usr/bin/rpload: Write failed
pkgadd: could not install usr/man/man1/pilot.1.gz: Write failed
pkgadd: could not install usr/man/man1/rpdump.1.gz: Write failed
pkgadd: could not install usr/man/man1/rpload.1.gz: Write failed
pkgadd: could not install usr/man/man1/alpine.1.gz: Write failed
pkgadd: could not install usr/man/man1/pico.1.gz: Write failed
/sbin/ldconfig: Writing of cache data failed: No space left on device

-- Packages installed
alpine
---
Using prt-get isinst on that package reports it as installed. If disk space is freed, the package must be "removed" before it can be installed again.

Cheers and thanks!
This task depends upon

Comment by Johannes Winkelmann (jw) - Thursday, 12 August 2010, 11:49 GMT
prt-get does not manipulate the package database itself, that pkgadd's responsibility. 'prt-get isinst' uses that same database to determine whether a package is installed, thus if it reports a package to be installed, that's because pkgadd added it to the database earlier.

Also, prt-get uses pkgadd's return value to determine whether an install transaction was successful, so I'm pretty sure that pkgadd returns with a return value of zero, thus prt-get will assume the installation worked, and thus print the package in the "Packages installed" section
Comment by Johannes Winkelmann (jw) - Thursday, 12 August 2010, 12:07 GMT
Context: http://crux.nu/gitweb/?p=tools/pkgutils.git;a=blob;f=pkgutil.cc;h=f549b893e12b92884a6b437cfb9b9752868606bd;hb=HEAD#l434

The comment there states: "If a file fails to install we just print an error message and continue trying to install the rest of the package." Not sure if there's an easy way to detect "Write failed" errors, I guess these should cause pkgadd to fail
Comment by K.Mandla (K.Mandla) - Thursday, 12 August 2010, 12:19 GMT
I understand, thank you; I see where I misunderstood what prt-get was doing. Should I create a similar task (bug) to this one, for pkgadd?
Comment by Johannes Winkelmann (jw) - Thursday, 12 August 2010, 14:06 GMT
yeah, please do; also, it's probably a good idea to add this task here as "related task"

Loading...