From: Eitan Adler on
On Wed, Nov 18, 2009 at 2:19 AM, Scot Hetzel <swhetzel(a)gmail.com> wrote:
> On Tue, Nov 17, 2009 at 3:59 PM, Eitan Adler <eitanadlerlist(a)gmail.com> wrote:
>>> Actually, I *had* a patch that got the source from svn, tarred it
>>> and checksummed it, with little modification to the do-fetch target
>>> and abusing FETCH_* variables.
>>> The unsolvable problem I ran in to, is that svn doesn't adjust
>>> timestamps for directories on export, so the checksum for the tar
>>> was always different. Hacking svn export was outside my timeframe
>>> and hacking tar to grow an option that sets all created dirs to
>>> a fixed time stamp, seemed too hackish, so I let it go.
>>
>> Creating deterministic tars (ignoring "metadeta") sounds like it
>> should be a solved problem by now. If it isn't then I will have to
>> make it my next project ;)
>>
> Instead of creating tar files, create zip files and then run them
> through torrentzip
>
> http://www.freebsd.org/cgi/cvsweb.cgi/ports/archivers/torrentzip/
>
> Torrentzip resets the date/time on the files and directories in the
> zip archive so that the checksum of the file will match, no matter who
> builds the zip file using the same set of files.
>
> Scot
>

Does such a tool exist for tar archives?
_______________________________________________
freebsd-ports(a)freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscribe(a)freebsd.org"

From: Thomas Sandford on
(Sorry, Ive lost track of the higher level attributions, but)
Eitan Adler wrote:
>>> Creating deterministic tars (ignoring "metadeta") sounds like it
>>> should be a solved problem by now. If it isn't then I will have to
>>> make it my next project ;)
>>>
>> Instead of creating tar files, create zip files and then run them
>> through torrentzip
>>
>> http://www.freebsd.org/cgi/cvsweb.cgi/ports/archivers/torrentzip/
>>
>> Torrentzip resets the date/time on the files and directories in the
>> zip archive so that the checksum of the file will match, no matter who
>> builds the zip file using the same set of files.
>>
>> Scot
>>
>
> Does such a tool exist for tar archives?

Couldn't you achieve the same thing by the use of touch(1)
--
Thomas Sandford
_______________________________________________
freebsd-ports(a)freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscribe(a)freebsd.org"

From: Mel Flynn on
On Wed, 18 Nov 2009 11:43:07 +0000, Thomas Sandford
<freebsduser(a)paradisegreen.co.uk> wrote:
> (Sorry, Ive lost track of the higher level attributions, but)
> Eitan Adler wrote:
>>>> Creating deterministic tars (ignoring "metadeta") sounds like it
>>>> should be a solved problem by now. If it isn't then I will have to
>>>> make it my next project ;)
>>>>
>>> Instead of creating tar files, create zip files and then run them
>>> through torrentzip
>>>
>>> http://www.freebsd.org/cgi/cvsweb.cgi/ports/archivers/torrentzip/
>>>
>>> Torrentzip resets the date/time on the files and directories in the
>>> zip archive so that the checksum of the file will match, no matter who
>>> builds the zip file using the same set of files.
>>>
>>> Scot
>>>
>>
>> Does such a tool exist for tar archives?
>
> Couldn't you achieve the same thing by the use of touch(1)

Probably, but my idea was at the time to provide a simple way to support
non-releases (like mplayer) and devel snapshots for which a tarball is
not or rarely rolled, with minimal change to bsd.port.mk.

Hence the abuse of FETCH_*. I found it again, I'll clean it up when I have
more time - there's more stuff in my bsd.local.mk so not a clean diff, but
the crux is this:
FETCH_BINARY=${SVN_CMD}
FETCH_ARGS=${SVN_QUIET} export
FETCH_BEFORE_ARGS=-r${SVN_REVISION}
DISABLE_SIZE=yes # screws with FETCH_BEFORE_ARGS
# cwd at this point is ${_DISTDIR}
FETCH_AFTER_ARGS=${_SVN_STAGE} && ${TAR} -C ${SVN_STAGE} -czf \
${PORTNAME}-${PORTVERSION}.tar.gz ${PORTNAME}-${PORTVERSION} \
WRKSRC?=${WRKDIR}/${SVN_ROOT}

FETCH_NO_APPEND_FILE=yes

pre-fetch:
@${MKDIR} ${SVN_STAGE}

# Once bsdtar supports remove after archiving, we don't need this anymore..
post-fetch:
@${RM} -rf ${_SVN_STAGE}

(Yes, I realize I should inject my own targets and not abuse
pre|post-fetch).

bsd.port.mk diff snippet (long line):
--- Mk/bsd.port.mk 21 Sep 2009 19:13:51 -0000 1.629
+++ Mk/bsd.port.mk 22 Sep 2009 01:21:26 -0000
@@ -3490,11 +3490,15 @@
for site in `eval $$SORTED_MASTER_SITES_CMD_TMP
${_RANDOMIZE_SITES}`; do \
${ECHO_MSG} "=> Attempting to fetch from $${site}."; \
CKSIZE=`alg=SIZE; ${DISTINFO_DATA}`; \
- case $${file} in \
- */*) ${MKDIR} $${file%/*}; \
- args="-o $${file} $${site}$${file}";; \
- *) args=$${site}$${file};; \
- esac; \
+ if test x"${FETCH_NO_APPEND_FILE}" != x"yes"; then \
+ case $${file} in \
+ */*) ${MKDIR} $${file%/*}; \
+ args="-o $${file} $${site}$${file}";; \
+ *) args=$${site}$${file};; \
+ esac; \
+ else \
+ args=$${site}; \
+ fi; \
if ${SETENV} ${FETCH_ENV} ${FETCH_CMD} ${FETCH_BEFORE_ARGS}
$${args} ${FETCH_AFTER_ARGS}; then \
continue 2; \
fi; \

--
--
Mel

_______________________________________________
freebsd-ports(a)freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscribe(a)freebsd.org"