Class to represent a package in the contents(4) file. Package names may be prefixed with a single character (and passed to the constructor). The semantics of that single character are not publicly supported but are described in usr/src/cmd/svr4pkg/hdrs/libinst.h:
#define INST_RDY '+' entry is ready to installf -f #define RM_RDY '-' entry is ready for removef -f #define NOT_FND '!' /* entry (or part of entry) was not found */ #define SERVED_FILE '%' /* using the file server's RO partition */ #define STAT_NEXT '@' /* this is awaiting eptstat */ #define DUP_ENTRY '#' /* there's a duplicate of this */ #define CONFIRM_CONT '*' /* need to confirm contents */ #define CONFIRM_ATTR '~' /* need to confirm attributes */ #define ENTRY_OK '\0' /* entry is a confirmed file */
Hash to map status strings to their symbolic representation.
Hash to map status symbols to their string representation.
The name of this package, without status indicator.
The status if this package as a symbol (see STATUS_BY_SYM).
# File lib/solaris/contents/pkg.rb, line 44 def initialize(pkg) # Use #chr for ruby 1.8 compatibility status_char = pkg[0].chr if STATUS_BY_STR.keys.include?(status_char) @name = pkg[1..-1] @status = STATUS_BY_STR[status_char] else @name = pkg @status = :entry_ok end end
# File lib/solaris/contents/pkg.rb, line 56 def to_s STATUS_BY_SYM[@status] + @name end