aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Brett Witherspoon <spoonb@exherbo.org> 2011-02-24 02:05:35 +0000
committerAvatar Brett Witherspoon <spoonb@exherbo.org> 2011-02-24 02:05:35 +0000
commit54d823d99c802c5ac6228315a10dbcf06e854a56 (patch)
treebf4af34ae02a26665809e282f231a971af229664
parent1b790bc1931db2c523799b67a3a2a1b43f502c27 (diff)
downloaddexter-54d823d99c802c5ac6228315a10dbcf06e854a56.tar.gz
dexter-54d823d99c802c5ac6228315a10dbcf06e854a56.tar.xz
warn if commit id isn't found
-rwxr-xr-xdexter.rb31
1 files changed, 17 insertions, 14 deletions
diff --git a/dexter.rb b/dexter.rb
index 07afc18..bc31b3c 100755
--- a/dexter.rb
+++ b/dexter.rb
@@ -23,12 +23,12 @@ require 'getoptlong'
require 'strscan'
def error(msg)
- $stderr.puts "#$0: #{msg}"
+ $stderr.puts "#$0: error - #{msg}"
exit 1
end
def warn(msg)
- $stderr.puts "#$0: #{msg}"
+ $stderr.puts "#$0: warning - #{msg}"
end
module Enumerable
@@ -128,11 +128,11 @@ class Victim
end
def is_repo?
- return true if @is_repo
+ return @is_repo
end
def is_pkg?
- return true if @is_pkg
+ return @is_pkg
end
protected
@@ -144,9 +144,12 @@ protected
desc = "[no description available]"
grave = ""
- if self.is_pkg? and File.directory?(@location + "/packages")
- Dir.chdir(@location + "/packages") unless Dir.pwd == @location + "/packages"
- commit_id = `git log -1 --pretty=%h -- #{qpn}`.strip
+ if self.is_pkg?
+ if File.directory?(@location + "/packages")
+ Dir.chdir(@location + "/packages") unless Dir.pwd == @location + "/packages"
+ commit_id = `git log -1 --pretty=%h -- #{qpn}`.strip
+ end
+ warn "Unable to get commit id from '#{@location}'" if commit_id.empty?
end
slots = @env[Paludis::Selection::AllVersionsGroupedBySlot.new(
@@ -157,18 +160,18 @@ protected
first_slot_in_pkg = true
- slots.each do | slot |
+ slots.each do |slot|
if first_slot_in_pkg
first_slot_in_pkg = false
grave << " #{qpn.package}/\n"
end
grave << " :#{slot.last.slot_key.value}"
- slot.each { | id | grave << " #{id.version}" }
+ slot.each { |id| grave << " #{id.version}" }
have_desc = false
have_homepage = false
- slot.reverse_each do | id |
+ slot.reverse_each do |id|
if !have_desc &&
!id.short_description_key.nil? &&
!id.short_description_key.value.empty?
@@ -220,9 +223,9 @@ class Victim::Repository < Victim
def bury
graves = ""
- @repo.category_names do | cat |
+ @repo.category_names do |cat|
graves << "#{cat}/\n" if not @repo.package_names(cat).empty?
- @repo.package_names(cat) do | qpn |
+ @repo.package_names(cat) do |qpn|
graves << self.bury_single(qpn)
end
end
@@ -273,10 +276,10 @@ options.each do | opt, arg |
envspec = arg
when '--graveyard-dir'
- graveyard_dir = arg
+ graveyard_dir = arg.chomp("/")
when "--repository-dir"
- repo_dir = arg
+ repo_dir = arg.chomp("/")
when "--comment"
comment = arg