On Fri, Mar 13, 2015 at 01:13:39PM -0700, Constantine A. Murenin wrote: > Hello, > > The commit below from 2014-09-16 must have broken the snapshot time > detection on http://ports.su/ , which must have been broken since > 2014-09-21. > > Is there a cross-platform way to best get it back from the package file? Yes, parse the +CONTENTS file and restore the associated @ts.
Any tool that reads files can do so easily. In perl, perl -ne '$seen = 1 if m/sqlports-compact/; if ($seen == 1 && m/\@ts\s+(.*)/) { system("date -r $1"); exit 0; }' /var/db/pkg/sqlports-compact-*/+CONTENTS will retrieve and display the timestamp. Something similar can be easily cobbled using any kind of sed/awk/grep > I guess the easiest way would be to fix the date with the snippet as > follows; or is there a better way? > > %sh -c 'touch -d $(env TZ=GMT date -r $(stat -f"%m" +CONTENTS) > +%FT%TZ) share/sqlports-compact' You assume sqlports-compacts should/can have the snapshots of +CONTENTS... this is not quite true.