Comments (4)
The problem with embedding the actual build date, is that it makes the build non-reproducible and non-cachable. The tag is optional, and I expanded about why I don't like build dates in the discussion of #33, where the dates were added due to non-compliant consumers.
The reason you see 2042 is rather silly. In #33 we used signed int32, but apparently if you truncate the sign of the int64 golang zero value of time.Time
which is supposed to be in the year 1, with uint32, you get 2042.
https://play.golang.org/p/akDPNe6tLZb
I don't think we should use the actual date. We should fix the uint32 thing.
If you have an actual use case for having the real date, we can accept it as another flag, say --build_timestamp
with the unix timestamp of the build. But only if this is something you need, and not just something you've noticed.
from rpmpack.
Thanks for your swift feedback.
I definitely have a use case for this (especially to avoid repeating clients from asking about that bogus timestamp) and would really appreciate if the -build-timestamp
flag like you suggested could be added.
from rpmpack.
Can you check #46 and see if it fixes the bug?
from rpmpack.
Can you check #46 and see if it fixes the bug?
Yes, thanks a lot. This fixes the issue for me:
Testcase 1: Run tar2rpm as previously and verify that Build Date does not contain this weird year 2042 date:
kali@kali:~/tmp$ ./tar2rpm -file /tmp/example.rpm -name "Example" -version "1.0" --build_time "$(date +%s)" /tmp/input.tar && rpm -qip /tmp/example.rpm
Name : Example
Epoch : 0
Version : 1.0
Release :
Architecture: noarch
Install Date: (not installed)
Group :
Size : 3582239
License :
Signature : (none)
Source RPM : Example-1.0.src.rpm
Build Date : (none)
Build Host :
Relocations : (not relocatable)
Packager :
Vendor :
URL :
Summary :
Description :
Result: As expected. The Build Date of "(none)" is reasonable.
Testcase 2: Run tar2rpm with the new command line switch --build_time with argument of current unix timestamp from /bin/date
kali@kali:~/tmp$ ./tar2rpm -file /tmp/example.rpm -name "Example" -version "1.0" --build_time "$(date +%s)" /tmp/input.tar && rpm -qip /tmp/example.rpm
Name : Example
Epoch : 0
Version : 1.0
Release :
Architecture: noarch
Install Date: (not installed)
Group :
Size : 3582239
License :
Signature : (none)
Source RPM : Example-1.0.src.rpm
Build Date : Fr 17 Jul 2020 14:43:57 CEST
Build Host :
Relocations : (not relocatable)
Packager :
Vendor :
URL :
Summary :
Description :
Result: As expected. The Build Date contains the Timestamp when the rpm was created with tar2rpm.
Thanks a lot!
from rpmpack.
Related Issues (20)
- [idea] API to allow libary users to add and support their own tags HOT 1
- comparators ("senses") bitmasks in relations are not mapped correctly HOT 3
- Signing Support HOT 5
- Owner and Group seem reversed HOT 2
- Export fileType type and tag constants HOT 2
- tar2rpm: rpm -ivh of generated .rpm fails with cpio: Digest mismatch HOT 3
- Ghost files are not properly supported in the RPM - file is still installed when installing the package HOT 4
- Subprocess failed. Error HOT 1
- Size of payload in header is incorrect - should be size of compressed payload, not uncompressed HOT 2
- xz, lzma compression don't work HOT 6
- Unable to install the built rpm (without force) HOT 15
- Add support for `version_file` in `pkg_tar2rpm` HOT 2
- Support zstd compression (and optional compression levels) HOT 3
- cavaliercoder/go-cpio is renamed to cavaliergopher/cpio HOT 1
- The example depends on a deprecated version of pkg_tar HOT 6
- support boolean dependencies
- No prefix support for generated rpm HOT 2
- Copy back changes to `sense.go` from nfpm HOT 1
- bazel rules_docker is deprecated, implement an alternative.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rpmpack.