#!/bin/bash
# 2017-09-08 use most recent date inside to touch the package - rzm@icm.edu.pl
# 2020-03-19 list files to be able to assign an error message [not used yet?]

while [ "$1" != "" ]; do
	file="$1"
	echo $file
	date=`tar tvaf "$file" | awk '{ print $4, $5 }' | sort | tail -1`
	# if [ $? -ne 0 ]; then echo ERROR on "$file"; fi
	touch -d "$date" "$file"
	shift
done
