1
0
mirror of https://github.com/PDP-10/its.git synced 2026-01-13 15:27:28 +00:00
PDP-10.its/build/stamp.sh
Lars Brinkhoff 0373bdd796 Add historical timestamps.
File names where compared against historical backup tapes, and time
stamps where listed in a text file.  Before a tape image is made, all
files are updated with timestamps from the listing.

Where no historical timestamp can be determined, the latest git author
date is taken.
2020-09-29 21:23:25 +02:00

28 lines
538 B
Bash
Executable File

#!/bin/sh
# Update timestamps to those listed in the file passed as $1.
# If there's no timestamp, we take the latest git author date.
list="$PWD/$1"
timestamps(){
for i in */*; do
set -f
t=`fgrep -- "$i " "$list" 2>/dev/null`
if test -n "$t"; then
set -- $t
t="$2"
else
t=`git log -1 --date=format:%Y%m%d%H%M.%S --format=%cd -- "$1"`
fi
touch -h -t "$t" -- "$i"
done
}
(cd bin; timestamps)
(cd doc; timestamps)
(cd src; timestamps)
exit 0