lib/s3repo/metadata.rb in s3repo-0.3.2 vs lib/s3repo/metadata.rb in s3repo-0.3.3
- old
+ new
@@ -31,9 +31,15 @@
def update!
sign_db if ENV['S3REPO_SIGN_DB']
client.upload!('repo.db', db_path)
end
+ def packages
+ return @packages if @packages
+ cmd = "tar tf #{db_path}"
+ @packages = run(cmd).split.map { |x| x.split('/').first }.uniq
+ end
+
private
def sign_db
run "gpg --detach-sign --use-agent #{db_path}"
client.upload!('repo.db.sig', "#{db_path}.sig")