Index: usr.sbin/portsnap/portsnap/portsnap.8 =================================================================== --- usr.sbin/portsnap/portsnap/portsnap.8 (revision 296349) +++ usr.sbin/portsnap/portsnap/portsnap.8 (working copy) @@ -173,6 +173,9 @@ depending on whether .Ar portsdir exists. +.It times +Print the timestamp of the current snapshot and of the latest one available on +the server. .El .Sh TIPS .Bl -bullet Index: usr.sbin/portsnap/portsnap/portsnap.sh =================================================================== --- usr.sbin/portsnap/portsnap/portsnap.sh (revision 296349) +++ usr.sbin/portsnap/portsnap/portsnap.sh (working copy) @@ -63,6 +63,8 @@ files and directories which have changed. auto -- Fetch updates, and either extract a new ports tree or update an existing tree. + times -- Print the timestamp of the current snapshot and of the latest + one available on the server. EOF exit 0 } @@ -149,7 +151,7 @@ if [ ! -z "${SERVERNAME}" ]; then usage; fi shift; SERVERNAME="$1" ;; - cron | extract | fetch | update | auto) + cron | extract | fetch | update | auto | times) COMMANDS="${COMMANDS} $1" ;; up) @@ -1125,6 +1127,19 @@ fi } +# Times command. Fetch a new tags file, then print +# the timestamps of the local and new tags files. +cmd_times() { + fetch_check_params + while ! fetch_tag latest; do + fetch_pick_server || return 1 + done + rm -f tag.new + OLDSNAPSHOTDATE=`cut -f 2 -d '|' < tag` + echo "Local : $(date -r $OLDSNAPSHOTDATE)" + echo "Server: $(date -r $SNAPSHOTDATE)" +} + #### Entry point # Make sure we find utilities from the base system