Bug 2430 - pkgsend add of non-existent file causes traceback
: pkgsend add of non-existent file causes traceback
Status: RESOLVED FIXINSOURCE
Product: pkg
pkgsend
: unspecified
: ANY/Generic OpenSolaris
: P4 minor (vote)
: ---
Assigned To: Shawn Walker
: pkg/pkgsend watcher
:
:
:
:
:
  Show dependency treegraph
 
Reported: 2008-07-13 19:15 UTC by Shawn Walker
Modified: 2009-02-13 12:08 UTC (History)
0 users (show)

See Also:


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description Shawn Walker 2008-07-13 19:15:30 UTC
While working with pkgsend to test out my changes for bug 1324, I forgot to
create a file I was adding to a test package. This is the resulting traceback:

pkgsend add file /tmp/libc.so.1 mode=0555 owner=root group=bin
path=/lib/libc.so.1
Traceback (most recent call last):
  File "/export/home/swalker/devel/pkg-1324/proto/root_i386/usr/bin/pkgsend",
line 408, in ?
    ret = main_func()
  File "/export/home/swalker/devel/pkg-1324/proto/root_i386/usr/bin/pkgsend",
line 379, in main_func
    trans_add(pcfg, pargs)
  File "/export/home/swalker/devel/pkg-1324/proto/root_i386/usr/bin/pkgsend",
line 177, in trans_add
    status, msg, body = t.add(config, trans_id, action)
  File "/usr/lib/python2.4/vendor-packages/pkg/publish/transaction.py", line
101, in add
    datastream = action.data()
  File "/export/home/swalker/devel/pkg-1324/proto/root_i386/usr/bin/pkgsend",
line 167, in opener
    return open(args[1], "rb")
IOError: [Errno 2] No such file or directory: '/tmp/libc.so.1'

=========

It really should fail with a friendlier message.
Comment 1 Dan Price 2008-08-28 17:25:57 UTC
Bulk move of pkgsend bugs to new category.
Comment 2 Shawn Walker 2009-02-03 23:32:44 UTC
The file action just needs to do a bit more robust checking and the pkgsend
program needs to catch those related exceptions.
Comment 3 Shawn Walker 2009-02-06 15:07:15 UTC
The case in comment 0 now fails this way:

pkgsend add file /tmp/libc.so.1 mode=0555 owner=root group=bin
pkgsend: No such file: '/tmp/libc.so.1'.
Comment 4 Shawn Walker 2009-02-13 12:08:22 UTC
Fixed in changeset 873 / b95d76c53b5eeece7335982e3ccf7047770decc4.