-
-
Notifications
You must be signed in to change notification settings - Fork 11.3k
new patch DSL, with support for checksums #21648
Conversation
I'm in favour of this in theory as long as Homebrew can provide new checksums (which isn't clear from the code) and we can do something about the line length (perhaps use a block instead)? |
What do you mean by homebrew providing new checksums? For the long lines, you can just break them:
|
Test suite needs to be updated, it doesn't even run after applying this |
@@ -43,6 +43,7 @@ def klass | |||
# have a "no such formula" message. | |||
raise | |||
rescue LoadError, NameError | |||
raise if ARGV.debug? # let's see the REAL error |
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.
This should be a separate pull request (because it can be pulled while the patches DSL is still under review.)
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.
Does this support sha1 patches or just sha256 patches? |
NOTE: I'm going to edit out the large animated gif above |
@jacknagel test suit updated. |
For now, we don't need to use anything but sha256, so a raw string is enough. |
@camillol I mean some way of (even if an option or I still would rather we split this into a block rather than adding another argument onto a method invocation. |
Check the checksum length to see if it should be treated as sha1 or sha256. |
@MikeMcQuaid now you can give an empty string for the patch checksum ( @adamv I don't see the need to support sha1. |
@camillol That sounds good. Probably want to make that only print for developers so we don't spam too hard existing formulae that haven't been updated. Might want to make it an audit rule (@jacknagel)? I dunno. I do, however, think it's really important we both have SHA-1 support and default to that rather than SHA-256. Unless I'm overruled by a few other maintainers I kinda insist on it. |
Why is SHA-1 support important? |
Because we use it most widely for archive checksums and I think SHA-256 is overkill at this point (as I explained in the other PR). |
Ok, but what's the problem? Are you concerned that it might be too secure? Is there a performance issue? |
Removed the formulary change, btw. |
@camillol Why not use SHA-512 or SHA-3? If we want to use SHA-256 as default everywhere in Homebrew that's a different discussion. As SHA-1 is the default for formulae tarballs it should be the default for patches too. |
Just a suggestion, as I'm considering taking a stab at this and also include cache support for patches. patch do
url 'https://trac.macports.org/export/90442/trunk/dports/sysutils/socat/files/patch-xioexit.c.diff'
sha256 '4a72f278d960310144556f7e1c2645f492b289bdc28de9f786a1ecd6dcdf21b7'
end
patch do
data DATA
sha1 '40840f60975de4010e490a8c0f97c3082d32e60c'
end Maybe even allow this, thoughts? patch do
applyUnless OS.Linux?
url 'https://trac.macports.org/export/90442/trunk/dports/sysutils/socat/files/patch-xioexit.c.diff'
sha256 '4a72f278d960310144556f7e1c2645f492b289bdc28de9f786a1ecd6dcdf21b7'
end
patch do
applyIf MacOS.version > 14
url 'https://trac.macports.org/export/90442/trunk/dports/sysutils/socat/files/patch-xioexit.c.diff'
sha256 '4a72f278d960310144556f7e1c2645f492b289bdc28de9f786a1ecd6dcdf21b7'
end |
Closing since we're going a different direction here. |
@jacknagel Cool! |
Man has long dreamed of having checksumming supported for patches (#6795, #10199).
Unfortunately, all who have tried the challenge ended up giving up (#11956).
Until now.
New DSL examples (from the socat formula):
Yes, the lines are long.
[SNIP]