Fixed so that stat file now also works on OSX
This commit is contained in:
parent
6cc78eb382
commit
027943eda6
11
src/_port
11
src/_port
|
@ -221,6 +221,13 @@ _port_select() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
stat -f%m . > /dev/null 2>&1
|
||||||
|
if [ "$?" = 0 ]; then
|
||||||
|
stat_cmd=(stat -f%Z)
|
||||||
|
else
|
||||||
|
stat_cmd=(stat --format=%Z)
|
||||||
|
fi
|
||||||
|
|
||||||
_port_caching_policy() {
|
_port_caching_policy() {
|
||||||
local reg_time comp_time check_file
|
local reg_time comp_time check_file
|
||||||
case "${1##*/}" in
|
case "${1##*/}" in
|
||||||
|
@ -231,8 +238,8 @@ _port_caching_policy() {
|
||||||
check_file=${$(port dir MacPorts)%/*/*}/PortIndex
|
check_file=${$(port dir MacPorts)%/*/*}/PortIndex
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
reg_time=$(stat -c '%Z' $check_file)
|
reg_time=$($stat_cmd $check_file)
|
||||||
comp_time=$(stat -c '%Z' $1)
|
comp_time=$($stat_cmd $1)
|
||||||
return $(( reg_time < comp_time ))
|
return $(( reg_time < comp_time ))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue