# Remove any permission signatures from the manifest.
self[:manifest_text] = self.class.munge_manifest_locators!(self[:manifest_text]) do |match|
- if not in_old_manifest[match[1]] && !cleared_replication_confirmed
+ if not cleared_replication_confirmed and not in_old_manifest[match[1]]
self.replication_confirmed_at = nil
self.replication_confirmed = nil
cleared_replication_confirmed = true
end
new_lines << new_words.join(' ')
end
- manifest = new_lines.join("\n")+"\n" if !new_lines.empty?
+
+ if !new_lines.empty?
+ ends_with_newline = manifest.end_with?("\n")
+ manifest = new_lines.join("\n")
+ manifest += "\n" if ends_with_newline
+ end
+
manifest
end