Skip to content
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

Merged

Conversation

m-blaha
Copy link
Member

@m-blaha m-blaha commented May 2, 2019

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

@@ -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
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member

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?

Copy link
Member Author

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

Copy link
Member

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
@Conan-Kudo Conan-Kudo self-assigned this May 3, 2019
@Conan-Kudo Conan-Kudo merged commit 11fd478 into rpm-software-management:master May 3, 2019
@jamescassell
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants