This fixes issue #10 by avoiding realpath() and using the lower level readlink(). This is fine as the target is canonicalized already. Also adjust for the different failures of readlink and realpath and improve the caller so that only particular errors are caught.
Ignore the standard EPIPE exception which is generated like this for example: seq 1000 | funcpy uniq | head -n10 Note os.errno only seems available since python 2.5.2 and it doesn't seem to be documented in any case, so using errno.EPIPE directly * scripts/ps_mem.py: Update the excepthook * scripts/whatrequires: Likewise * scripts/funcpy: Move handling to excepthook for consistency
* scripts/ps_mem.py: If the exe symlink contains (deleted), then append [deleted] or [updated] as appropriate. Also if the exe link is not present as was the case for the #prelink# entry mentioned in the script, then try the first command line parameter, as this might contain the full path to the program. Note we don't default to using the cmdline as often it just contains the name and also arbitrary (information) values are often present.
* scripts/ps_mem.py: checksum each smaps so if a program has many identical smaps, we assume that they all have the same VM area. I.E. they're specified CLONE_VM but not CLONE_THREAD. This was seen in the wild for some java programs at least.