#152 PR merged
: Translate by-uuid names of devices for filesystems¶
Labels: bug
thumm opened issue at 2012-09-01 18:46:¶
See https://github.com/rear/rear/issues/151
This fixes #151
dagwieers commented at 2012-09-01 21:16:¶
This looks correct to me.
@jhoekx Interested in your expert opinion.
jhoekx commented at 2012-09-02 14:10:¶
It's indeed the issue, but the fix here will not work because the realpath function does not exist :-) I think @thumm wrote it but forgot to add it to the pull request.
$(get_device_name $(get_sysfs_name $device))
should also do the trick
and otherwise we should make that work instead of adding a new function
for this.
Also, and this is nitpicking, but I prefer descriptive commit messages, like 'Translate by-uuid names of devices for filesystems. This fixes #151.'
jhoekx commented at 2012-09-02 14:47:¶
Ok, sorry, realpath
is a utility. Dag, can you check if it's available
in RHEL4, I don't have one nearby.
dagwieers commented at 2012-09-02 19:46:¶
Hmmm, I know os.path.realpath() in python though.
But realpath is not even a utility in RHEL6 :-/ It's probably not wise
to add this as another dependency. Why not just use readlink -f
like
we've done before ?
thumm commented at 2012-09-02 19:54:¶
realpath isn't a bash function but a command line utility.
If the result of the mentioned bash expression is a absolute path name for the by-uuid-symbolic-link it's definitly a better solution because it avoids an additional installation dependency (package realpath must not be installed). I'll test it the next days when I'm back from business trip.
Regards, Thomas
dagwieers commented at 2012-09-02 20:31:¶
Just for kicks I packaged realpath for RHEL, and the description of the
package says it is basically the same as readlink -f
:-)
jhoekx commented at 2012-09-03 06:54:¶
I just checked, the get_sysfs_path
function only work on devices, not
partitions. So use readlink -f
.
dagwieers commented at 2012-09-04 16:46:¶
@thumm Do you like to fix it yourself and request a new pull ? Or shall I add the fix in your name ?
thumm commented at 2012-09-04 20:37:¶
Here is the update which uses readlink instead of realpath. I've tested it on Debian.
dagwieers commented at 2012-09-04 20:50:¶
Thanks, accepted !
[Export of Github issue for rear/rear.]