Skip to content

Commit

Permalink
Fix add-pkg for deb repos.
Browse files Browse the repository at this point in the history
  • Loading branch information
SaltwaterC committed Apr 17, 2021
1 parent d75428b commit 9b9ea94
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## v0.1.1

* Fix add-pkg for deb repos. Exposing the signature checker via CLI broke the internal use case.

## v0.1.0

* Initial release.
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ begin

Jeweler::Tasks.new do |gem|
gem.name = 'repo-mgr'
gem.version = '0.1.0'
gem.version = '0.1.1'
gem.summary = %(deb and rpm repository manager)
gem.description = %(deb and rpm repository manager)
gem.author = 'Ștefan Rusu'
Expand Down
9 changes: 5 additions & 4 deletions lib/repo_mgr/backends/deb.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,19 @@ def remove_pkg(repo, pkg)
repo_publish repo
end

def check_sig(pkg)
def check_sig(pkg, allow_fail = false)
out, status = Open3.capture2e "dpkg-sig --verify #{pkg}"

return out if status.exitstatus.zero?
return out if status.exitstatus.zero? || allow_fail

Tools.error "unable to check package signature for #{pkg} - "\
"dpkg-sig returned:\n#{out}"
end

def sign_pkg(repo, pkg)
signature = check_sig(pkg)
unless signature.first[-6, 5] == 'NOSIG'
signature = check_sig pkg, true

unless signature[-6, 5] == 'NOSIG'
return puts "-- dpkg-sig returned:\n#{signature.first}"
end

Expand Down

0 comments on commit 9b9ea94

Please sign in to comment.