Skip to content

Commit

Permalink
Select sha256 for rpm digest (#181)
Browse files Browse the repository at this point in the history
  • Loading branch information
crohr authored Sep 11, 2023
1 parent b48cfd6 commit b214f47
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 6 deletions.
8 changes: 3 additions & 5 deletions lib/pkgr/distributions/amazon.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
module Pkgr

module Distributions

class Amazon < Base
def rpm?
true
end

def release
@release[/^[0-9]+/]
Expand Down Expand Up @@ -35,9 +36,6 @@ def args
list
end
end

end

end

end
8 changes: 8 additions & 0 deletions lib/pkgr/distributions/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ def os
self.class.name.split("::")[-1].downcase
end # def os

def rpm?
false
end

def deb?
false
end

# e.g. ubuntu-12.04
def slug
[os, release].join("-")
Expand Down
4 changes: 4 additions & 0 deletions lib/pkgr/distributions/debian.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ module Pkgr
module Distributions
# Contains the various components required to make a packaged app integrate well with a Debian system.
class Debian < Base
def deb?
true
end

# Only keep major digits
def release
@release[/^[0-9]+/]
Expand Down
4 changes: 4 additions & 0 deletions lib/pkgr/distributions/fedora.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ module Pkgr
module Distributions
# Contains the various components required to make a packaged app integrate well with a Debian system.
class Fedora < Base
def rpm?
true
end

# Only keep major digits
def release
@release[/^[0-9]+/]
Expand Down
1 change: 0 additions & 1 deletion lib/pkgr/distributions/redhat.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ def templates
super
end
end

end
end
end
4 changes: 4 additions & 0 deletions lib/pkgr/distributions/sles.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
module Pkgr
module Distributions
class Sles < Base
def rpm?
true
end

# Only keep major digits
def release
@release[/^[0-9]+/]
Expand Down
1 change: 1 addition & 0 deletions lib/pkgr/fpm_command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def args
list << "--before-remove" << distribution.preuninstall_file
list << "--after-remove" << distribution.postuninstall_file
list << "--directories" << config.directories unless config.directories.nil?
list << "--rpm-digest" << "sha256" if distribution.rpm?
distribution.dependencies(config.dependencies).each{|d| list << "-d" << d}
list.compact
end
Expand Down

0 comments on commit b214f47

Please sign in to comment.