From f7c67ab312f55dfc153f96e6b8a09b34bb322b07 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 25 Jan 2016 01:10:00 +0000 Subject: mlib: support --force option We will allow forcing updates since upgrading dependent software (e.g. sox, avprobe, ffprobe) may allow previously-ignored files to become support --- lib/dtas/mlib.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lib/dtas/mlib.rb') diff --git a/lib/dtas/mlib.rb b/lib/dtas/mlib.rb index 3bfed8f..ffd0cc3 100644 --- a/lib/dtas/mlib.rb +++ b/lib/dtas/mlib.rb @@ -145,6 +145,7 @@ class DTAS::Mlib # :nodoc: # this generates opts ||= {} jobs = opts[:jobs] || 8 + @force = opts[:force] || false init_suffixes st = File.stat(path) # we always follow the first dir even if it's a symlink @@ -208,8 +209,10 @@ class DTAS::Mlib # :nodoc: return if @suffixes !~ path || st.size == 0 # no-op if no change - if node = @db[:nodes][name: path, parent_id: parent_id] - return if st.ctime.to_i == node[:ctime] || node[:tlen] == DM_IGN + unless @force + if node = @db[:nodes][name: path, parent_id: parent_id] + return if st.ctime.to_i == node[:ctime] || node[:tlen] == DM_IGN + end end job = Job.new(@pwd, st.ctime.to_i, parent_id, path) -- cgit v1.2.3-24-ge0c7