[Rpm-maint] [PATCH 2/2] set mtime of all .py files to date of last Changelog
bmorbach
bmorbach at redhat.com
Wed Aug 13 12:27:29 UTC 2014
On Wed, 2014-08-13 at 14:12 +0200, bmorbach at redhat.com wrote:
> From: Benedikt Morbach <bmorbach at redhat.com>
>
> 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.
>
> The downside here is that we don't preserve the mtime of the sources
> anymore. However, as of right now a user can't tell by looking at a file
> on disk if it has the original source mtime or was modified during build,
> which makes having the mtime near useless anyway, in my opinion.
> ---
> scripts/brp-python-bytecompile | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/brp-python-bytecompile b/scripts/brp-python-bytecompile
> index 39fca60..6d93441 100644
> --- a/scripts/brp-python-bytecompile
> +++ b/scripts/brp-python-bytecompile
> @@ -14,7 +14,7 @@ fi
>
> # Figure out how deep we need to descend. We could pick an insanely high
> # number and hope it's enough, but somewhere, somebody's sure to run into it.
> -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
Apparently I didn't test this one correctly, please disregard for now.
More information about the Rpm-maint
mailing list