[Rpm-maint] [PATCH 2/2] set mtime of all .py files to date of last Changelog

Colin Walters walters at verbum.org
Fri Feb 13 03:55:27 UTC 2015

On Wed, Aug 13, 2014, at 07:12 AM, bmorbach at redhat.com wrote:

> This ensures that rebuilds of an srpm result in the same .py{c,o} files,
> even if the source files were modified during the build.
> This should make the builds of most python packages reproducible.

I like the idea here.  Timestamps on .pyc files have caused me
extreme pain in the past wrt multilib ( https://bugzilla.redhat.com/show_bug.cgi?id=718404 )

> -depth=`(find "$RPM_BUILD_ROOT" -type f -name "*.py" -print0 ; echo /) | \
> +depth=`(find "$RPM_BUILD_ROOT" -type f -name "*.py" -exec touch "$RPM_CHANGELOG_DATE" {} \+ -print0 ; echo /) | \
>         xargs -0 -n 1 dirname | sed 's,[^/],,g' | sort -u | tail -n 1 | wc -c`
>  if [ -z "$depth" -o "$depth" -le "1" ]; then
>  	exit 0

At some point, it becomes a lot saner to use an actual programming language...this might be the time?  Can we write brp-python-bytecompile in python?

I'm guessing the reason this patch broke is it looks like you're missing the ";" to close the -exec ?

More information about the Rpm-maint mailing list