summaryrefslogtreecommitdiff
path: root/lib/chef/provider/package/dnf/version.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chef/provider/package/dnf/version.rb')
-rw-r--r--lib/chef/provider/package/dnf/version.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/chef/provider/package/dnf/version.rb b/lib/chef/provider/package/dnf/version.rb
index 3cff5b0437..5fe3a76e3e 100644
--- a/lib/chef/provider/package/dnf/version.rb
+++ b/lib/chef/provider/package/dnf/version.rb
@@ -1,5 +1,5 @@
#
-# Copyright:: Copyright 2016, Chef Software, Inc.
+# Copyright:: Copyright 2016-2020, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -33,13 +33,17 @@ class Chef
end
def to_s
- "#{name}-#{version}.#{arch}"
+ "#{name}-#{version}.#{arch}" unless version.nil?
end
def version_with_arch
"#{version}.#{arch}" unless version.nil?
end
+ def name_with_arch
+ "#{name}.#{arch}" unless name.nil?
+ end
+
def matches_name_and_arch?(other)
other.version == version && other.arch == arch
end