Backport an upstream patch to handle ostree setting 0 mtime

This commit is contained in:
Kalev Lember 2017-08-01 20:32:19 +01:00
parent c785dd6e0a
commit 33375e52cb
2 changed files with 33 additions and 1 deletions

View File

@ -0,0 +1,28 @@
From b34f744ac3c8276a854b134d41c28d84664c7e7f Mon Sep 17 00:00:00 2001
From: Patrick Griffis <tingping@tingping.se>
Date: Mon, 20 Mar 2017 21:46:42 -0400
Subject: [PATCH] Work around mtime being set to 0 sometimes
---
src/disk_interface.cc | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/disk_interface.cc b/src/disk_interface.cc
index b418e04..28530b1 100644
--- a/src/disk_interface.cc
+++ b/src/disk_interface.cc
@@ -187,6 +187,11 @@ TimeStamp RealDiskInterface::Stat(const string& path, string* err) const {
*err = "stat(" + path + "): " + strerror(errno);
return -1;
}
+ // Some users (Flatpak) set mtime to 0, this should be harmless
+ // and avoids conflicting with our return value of 0 meaning
+ // that it doesn't exist.
+ if (st.st_mtime == 0)
+ return 1;
return st.st_mtime;
#endif
}
--
2.13.0

View File

@ -1,12 +1,13 @@
Name: ninja-build
Version: 1.7.2
Release: 5%{?dist}
Release: 6%{?dist}
Summary: A small build system with a focus on speed
License: ASL 2.0
URL: http://martine.github.com/ninja/
Source0: https://github.com/martine/ninja/archive/v%{version}.tar.gz#/ninja-%{version}.tar.gz
Source1: ninja.vim
Source2: macros.ninja
Patch0001: 0001-Work-around-mtime-being-set-to-0-sometimes.patch
Patch0002: 0002-Disable-test-which-takes-too-many-resources-for-koji.patch
BuildRequires: gcc-c++
%if 0%{?rhel} && 0%{?rhel} <= 7
@ -69,6 +70,9 @@ ln -s ninja %{buildroot}%{_bindir}/ninja-build
%{rpmmacrodir}/macros.ninja
%changelog
* Tue Aug 01 2017 Kalev Lember <klember@redhat.com> - 1.7.2-6
- Backport an upstream patch to handle ostree setting 0 mtime
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.2-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild