From b4477c59d957e7d78b9ad6b7ebb957542614af71 Mon Sep 17 00:00:00 2001 From: Jason Tibbitts Date: May 09 2017 22:39:29 +0000 Subject: Make 5 second paranoia disablable. --- diff --git a/quick-fedora-mirror b/quick-fedora-mirror index d51f845..cd4137a 100755 --- a/quick-fedora-mirror +++ b/quick-fedora-mirror @@ -16,8 +16,6 @@ IFS=$'\n' # Do this very early starttime=$(date +%s) -# Paranoia; give us a few extra seconds. -starttime=$(($starttime-5)) # Debug output; # Level 0: nothing except errors. @@ -382,6 +380,10 @@ parse_args () { dumpmmcheckin=$2 shift ;; + --no-paranoia) + # Don't backdate the last mirrortime + noparanoia=1 + ;; *) (>&2 echo "Unrecognized argument.") exit 1 @@ -389,8 +391,6 @@ parse_args () { esac shift done - - } read_config () { @@ -959,6 +959,9 @@ process_module () { linecount2=$(wc -l < newdirs-$module) db2f "New on server: %7d files, %4d dirs.\n" $linecount $linecount2 + echo XXXXXXXXXXXXXXXXXXXX + cat newfiles-$modules + # Add extra files to the transfer list echo $moduledir/$fl >> newfiles-$module for extra in $EXTRAFILES; do @@ -1019,8 +1022,12 @@ process_module () { # Find files on the client which don't exist on the server sort allfiles-$module allfiles-$module localfiles-$module \ - | uniq -u > deletefiles-$module - remove_filelists_from_file deletefiles-$module $moduledir + | uniq -u \ + | egrep -v '^[^/]*/fullfile(time)?list' > deletefiles-$module + cat deletefiles-$module + #| uniq -u > deletefiles-$module + + #remove_filelists_from_file deletefiles-$module $moduledir cat deletefiles-$module >> master-deletefiles # Find dirs on the client which don't exist on the server @@ -1122,6 +1129,9 @@ set_default_vars read_config # XXX check_dependencies +# Paranoia; give us a few extra seconds. +[[ -z $noparanoia ]] && starttime=$(($starttime-5)) + # Find the previous mirror time, and backdate if necessary LASTTIME=0 if [[ -r $TIMEFILE ]]; then diff --git a/test/mirror/test b/test/mirror/test index 8dfe5fa..25bb33c 100755 --- a/test/mirror/test +++ b/test/mirror/test @@ -149,6 +149,20 @@ test_extrafiles_1 () { assertTrue 'The initial copy did not succeed' \ "$qfm -c $testdir/simple.conf &> $so" assertTrue 'imagelist was not copied' "[[ -f $destdir/module-a/imagelist-module-a ]]" + + ls -lR $destdir/module-a + + # Force a file list update + sleep 1 + touch $td1/z + $cf -d $td1 -s -f $td1/fullfilelist -t $td1/fullfiletimelist-module-a #-i $td1/imagelist-module-a + sleep 5 + assertTrue 'An update did not succeed' \ + "$qfm -c $testdir/simple.conf &> $so" + cat $so + assertTrue 'imagelist seems to have been deleted' "[[ -f $destdir/module-a/imagelist-module-a ]]" + + ls -lR $destdir/module-a } test_extrafiles_2 () {