I honestly don't know what the best option is, and I agree with them that it is probably best to not hardcode paths, although, it might not hurt to do a quick if/else if statement checking for the existence of udevadm in several common locations and then set a variable for that. (NOTE: the following is a quick "back of the napkin" code and may be slightly off... I've been taking a java programming class and a python class before that, so my bash scripting might be a bit rusty.)
Code:
if [ -e /usr/bin/udevadm ]; then
UDEVADM_PATH=/usr/bin
elif [ -e /usr/sbin/udevadm ]; then
UDEVADM_PATH=/usr/sbin
elif [ -e /bin/udevadm ]; then
UDEVADM_PATH=/bin
elif [ -e /sbin/udevadm ]; then
UDEVADM_PATH=/sbin
else
echo "udevadm is not accessible"
exit 1
fi
Then they could just call udevadm with that variable in front of it... this should feasibly work for almost all distros and any new exceptions could be quickly added.
Code:
const udevadm = `$UDEVADM_PATH/udevadm info --query=property -p $(udevadm info -q path -n ${file})`;
Barring them from updating the program/script, you could also set an alias for udevadm. As a regular user, you still have the ability to run udevadm (just without root permissions), it just isn't in your PATH file. This prevents you from cluttering up the actual filesystem with symlinks. So you could set up something like the following in a ~/.bashrc to have it map the udevadm command to the correct location.
Code:
alias udevadm=/sbin/udevadm