Giter Club home page Giter Club logo

Comments (4)

jarondl avatar jarondl commented on August 19, 2024

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.

steffenbusch avatar steffenbusch commented on August 19, 2024

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.

jarondl avatar jarondl commented on August 19, 2024

Can you check #46 and see if it fixes the bug?

from rpmpack.

steffenbusch avatar steffenbusch commented on August 19, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.