[Svardos-users] Change pkg command output

Back to archive index
Mateusz Viste mateu****@viste*****
Tue Dec 27 21:37:27 JST 2022


On 26/12/2022 16:12, Robert Riebisch via Svardos-users wrote:
> Today I noticed a bug in the "pkg install" command.
> Using a manipulated .svp file, "pkg install blocek.svp" displays
> "ERROR: failed extracting ...", but later displays:
> "Package blocek installed: 122 files extracted, 0 errors."
> 
> Cause of "0 errors" is the use of %d instead of %ld in the pkg language
> files. (But the comment in pkginst.c is right. :-D)

You are right, the translation strings are wrong and this indeed leads 
to the problem you noticed.

Boring explanation (for nerds): The translation strings reads two 16-bit 
values while the program pushes two 32-bit counters. In effect, the 
first (count of files) is displayed correctly when less than 64K because 
x86 is a little endian platform, but the second value (errors count) 
reads the 16 highest bits of the file counter, which is usually zero.

I have fixed all translation strings right now on svn.

> But do we need these numbers at all?
> Do the numbers really matter for the next steps?
> I think, when there's at least one error, a user should grab the package
> again and repeat pkg install. Or run chkdsk. Or run Memtest.

You are right, but personally I really like to know how much files have 
been installed with the package. This gives me a loose idea of how 
huge/messy the installed application is, esp. since the screen area is 
short so only last extracted files are visible on screen.
I also like to have the information about the number of errors, so if I 
read "1 error" and I see in the listing that it is some stupid txt file 
that went bad I don't have to wonder whether or not some other errors 
occurred higher in the listing (outside of the screen).

A possibly nice evolution would be to log the entire activity of package 
installation (incl. errors), and if at least one error occurred then 
display something like "please consult the log file at xyz for details".

Mateusz



More information about the Svardos-users mailing list
Back to archive index