New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add an option to preserve timestamps of the downloaded files (RhBug:1688537) #149
Add an option to preserve timestamps of the downloaded files (RhBug:1688537) #149
Conversation
librepo/downloader.c
Outdated
@@ -18,7 +18,8 @@ | |||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |||
*/ | |||
|
|||
#define _XOPEN_SOURCE 500 // Because of fdopen() and ftruncate() | |||
#define _BSD_SOURCE | |||
#define _DEFAULT_SOURCE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you drop _XOPEN_SOURCE 500
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need futimes() to change file timestamps and this requires _DEFAULT_SOURCE (for glibc > 2.19) or _BSD_SOURCE (for glibc <= 2.19, which is the case for RHEL7).
Having _XOPEN_SOURCE explicitly defined means, that _DEFAULT_SOURCE is not defined.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does this affect non-glibc environments?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure. But I can return _XOPEN_SOURCE 500 back
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It shouldn't hurt anything to put it back, and I'm wary of accidentally breaking non-glibc builds (there are a few out there, including Yocto...).
…688537) If LRO_PRESERVETIME is set to True, librepo will try to keep the timestamps of downloaded files in sync with that on the remote side. https://bugzilla.redhat.com/show_bug.cgi?id=1688537
Seems like it would be better to enable this option by default or always use this Behavior with an out an option to closer match python URL grabber from yum 3 |
If LRO_PRESERVETIME is set to True, librepo will try to keep the timestamps
of downloaded files in sync with that on the remote side.
https://bugzilla.redhat.com/show_bug.cgi?id=1688537