{"action":"opened","issue":{"url":"https://api.github.com/repos/jordansissel/fpm/issues/1538","repository_url":"https://api.github.com/repos/jordansissel/fpm","labels_url":"https://api.github.com/repos/jordansissel/fpm/issues/1538/labels{/name}","comments_url":"https://api.github.com/repos/jordansissel/fpm/issues/1538/comments","events_url":"https://api.github.com/repos/jordansissel/fpm/issues/1538/events","html_url":"https://github.com/jordansissel/fpm/issues/1538","id":348848141,"node_id":"MDU6SXNzdWUzNDg4NDgxNDE=","number":1538,"title":"Python rpms contain pyc files with invalid timestamps","user":{"login":"dmurnane","id":2912813,"node_id":"MDQ6VXNlcjI5MTI4MTM=","avatar_url":"https://avatars0.githubusercontent.com/u/2912813?v=4","gravatar_id":"","url":"https://api.github.com/users/dmurnane","html_url":"https://github.com/dmurnane","followers_url":"https://api.github.com/users/dmurnane/followers","following_url":"https://api.github.com/users/dmurnane/following{/other_user}","gists_url":"https://api.github.com/users/dmurnane/gists{/gist_id}","starred_url":"https://api.github.com/users/dmurnane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmurnane/subscriptions","organizations_url":"https://api.github.com/users/dmurnane/orgs","repos_url":"https://api.github.com/users/dmurnane/repos","events_url":"https://api.github.com/users/dmurnane/events{/privacy}","received_events_url":"https://api.github.com/users/dmurnane/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-08-08T18:50:26Z","updated_at":"2018-08-08T18:50:26Z","closed_at":null,"author_association":"NONE","body":"When fpm copies files from the python staging dir to the RPM staging dir, it doesn't preserve timestamps, so the timestamp in the pyc files don't match the py files contained in the RPM. This means when you install the RPM and import the package as root, it recompiles the pyc files and the RPM no longer verifies cleanly.\r\n\r\nThe rpm was generated with\r\n```\r\nfpm -s python -t rpm python-consul\r\n```\r\n\r\n```\r\nbash# rpm -qV python-consul\r\nbash# python\r\nPython 2.7.5 (default, Feb 20 2018, 09:19:12) \r\n[GCC 4.8.5 20150623 (Red Hat 4.8.5-28)] on linux2\r\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\r\n>>> import consul\r\n>>> \r\nbash# rpm -qV python-consul\r\n.M5....T.    /usr/lib/python2.7/site-packages/consul/__init__.pyc\r\nSM5....T.    /usr/lib/python2.7/site-packages/consul/base.pyc\r\n.M5....T.    /usr/lib/python2.7/site-packages/consul/std.pyc\r\n```\r\n\r\nIt looks like setting preserve=true on the copy_entry in lib/fpm/package/rpm.rb creates packages with valid pyc timestamps."}}
{"actor":{"display_login":"dmurnane"}}