I Forgot to restore one of the information output line in the previous patch (hunk quoted below)
In the new attachment it is
> @@ -110,8 +110,11 @@
> successful = 0
> errors = []
> records.each do |r|
> - print "Creating record #{r.name}..."
> - IO.popen("pass insert -m#{"f" if FORCE} '#{r.name}' > /dev/null",
> 'w') do |io|
> + if File.exist?("#{r.name}.gpg") and FORCE == false
> + puts "skipped #{r.name}: already exists"
> + next
> + end
> + IO.popen("pass insert -m '#{r.name}' > /dev/null", 'w') do |io|
> io.puts r
> end
> if $? == 0
--- /usr/share/pass/lastpass2pass.rb.orig 2015-04-07 23:58:12.833822830 -0300
+++ /usr/share/pass/lastpass2pass.rb 2015-04-08 00:16:24.283234948 -0300
@@ -76,7 +76,7 @@
begin
file = File.open(filename)
file.each do |line|
- if line =~ /^http/
+ if line =~ /^(http|ftp|ssh)/
entries.push(entry)
entry = ""
end
@@ -110,8 +110,12 @@
successful = 0
errors = []
records.each do |r|
+ if File.exist?("#{r.name}.gpg") and FORCE == false
+ puts "skipped #{r.name}: already exists"
+ next
+ end
print "Creating record #{r.name}..."
- IO.popen("pass insert -m#{"f" if FORCE} '#{r.name}' > /dev/null", 'w') do |io|
+ IO.popen("pass insert -m '#{r.name}' > /dev/null", 'w') do |io|
io.puts r
end
if $? == 0
@@ -124,7 +128,7 @@
end
puts "#{successful} records successfully imported!"
-if errors
+if errors.length > 0
puts "There were #{errors.length} errors:"
errors.each { |e| print e.name + (e == errors.last ? ".\n" : ", ")}
puts "These probably occurred because an identically-named record already existed, or because there were multiple entries with the same name in the csv file."
signature.asc
Description: Digital signature
_______________________________________________ Password-Store mailing list [email protected] http://lists.zx2c4.com/mailman/listinfo/password-store
