lib/pione/util/zip.rb in pione-0.3.2 vs lib/pione/util/zip.rb in pione-0.4.0

- old
+ new

@@ -22,12 +22,17 @@ relpath = relpath.to_s location = _src + relpath if location.directory? zip.mkdir(relpath) else - entry = zip.add(relpath, location.path.to_s) - entry.time = ::Zip::DOSTime.at(location.mtime) - entry.extra.delete("UniversalTime") + # expand only if it exists, e.g. broken symbolinks are ignored + if location.exist? + entry = zip.add(relpath, location.path.to_s) + entry.time = ::Zip::DOSTime.at(location.mtime) + entry.extra.delete("UniversalTime") + else + Log::Debug.system("Try to archive the file at %s, but it was ignored because of broken link." % location.address) + end end end end # upload archive