Skip to content

cmirror next #15

Merged
merged 5 commits into from
Aug 23, 2022
Merged

cmirror next #15

merged 5 commits into from
Aug 23, 2022

Conversation

donald
Copy link
Contributor

@donald donald commented Aug 23, 2022

  • Fix nonsense error message ( Missing printf argument #14 )
  • Fix other printf format errors and add check macro
  • Fix bug that directories, which were replaced by another file type (e.g. plain files), would not actually be deleted, but would be left lingering around as "DIR.deleteme". For regular mirrors, the directory would be deleted during the the next pass.
  • Fix bug, that directories, which were replaced by another file type (e.g. plain files), would be deleted even with --noop
  • Fix bug, that directories, which were replaced by another file type (e.g. plain files), would no be deleted because of a missing --delete

The actual deletion of directories which where added to CLEAN_DIRS by
out_of_the_way() is missing in the code:

buczek@theinternet:~/git/cmirror (fix-printf-formats)$ rm -rf /scratch/local/a
buczek@theinternet:~/git/cmirror (fix-printf-formats)$ rm -rf /scratch/local/b
buczek@theinternet:~/git/cmirror (fix-printf-formats)$ mkdir /scratch/local/a
buczek@theinternet:~/git/cmirror (fix-printf-formats)$ touch /scratch/local/a/test
buczek@theinternet:~/git/cmirror (fix-printf-formats)$ mkdir /scratch/local/b
buczek@theinternet:~/git/cmirror (fix-printf-formats)$ mkdir /scratch/local/b/test
buczek@theinternet:~/git/cmirror (fix-printf-formats)$ cmirror --delete  /scratch/local/a /scratch/local/b
theinternet.molgen.mpg.de: creating empty ./test
theinternet.molgen.mpg.de: rm -r ./test.deleteme
theinternet.molgen.mpg.de: fix directory mtime of . -> 1661234914
buczek@theinternet:~/git/cmirror (fix-printf-formats)$ find /scratch/local/b
/scratch/local/b
/scratch/local/b/test.deleteme
/scratch/local/b/test

Add call to remove directory.
If we are running under --noop and a target directory would be replaced
by another file type, we currently delete the target directory, although
the actual replacement is not installed because of --noop.

Do not remove to-be-replaced directory when --noop is selected.
When a directory is replaced by another type (e.g. a plain file), it is
first renamed and later removed. This later removal should be done
regardless of whether --delete was selected or not.
@donald donald merged commit 14bd1ac into main Aug 23, 2022
@donald donald mentioned this pull request Aug 23, 2022
Sign in to join this conversation on GitHub.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant