Skip to content

Commit

Permalink
fix a rerun loop in some cases of manual targets
Browse files Browse the repository at this point in the history
  • Loading branch information
cesar-douady committed May 2, 2024
1 parent 8cdb1ad commit 48cd4a3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/rpc_job.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,8 @@ ::pair_s<bool/*ok*/> do_file_actions( ::vector_s* unlnks/*out*/ , ::vmap_s<FileA
for( auto const& [f,a] : pre_actions ) { // pre_actions are adequately sorted
SWEAR(+f) ; // acting on root dir is non-sense
switch (a.tag) {
case FileActionTag::None : break ;
case FileActionTag::Uniquify : if (uniquify(nfs_guard.change(f))) append_to_string(msg,"uniquified ",mk_file(f),'\n') ; break ;
case FileActionTag::Mkdir : mkdir(f,nfs_guard) ; break ;
case FileActionTag::Unlnk : {
case FileActionTag::None :
case FileActionTag::Unlnk : {
FileSig sig { nfs_guard.access(f) } ;
if (!sig) break ; // file does not exist, nothing to do
bool done = true/*garbage*/ ;
Expand All @@ -58,7 +56,9 @@ ::pair_s<bool/*ok*/> do_file_actions( ::vector_s* unlnks/*out*/ , ::vmap_s<FileA
if ( done && unlnks ) unlnks->push_back(f) ;
ok &= done ;
} break ;
case FileActionTag::Rmdir :
case FileActionTag::Uniquify : if (uniquify(nfs_guard.change(f))) append_to_string(msg,"uniquified ",mk_file(f),'\n') ; break ;
case FileActionTag::Mkdir : mkdir(f,nfs_guard) ; break ;
case FileActionTag::Rmdir :
if (!keep_dirs.contains(f))
try { rmdir(nfs_guard.change(f)) ; }
catch (::string const&) { for( ::string d=f ; +d ; d = dir_name(d) ) if (!keep_dirs.insert(d).second) break ; } // if a dir cannot rmdir'ed, no need to try those uphill
Expand Down

0 comments on commit 48cd4a3

Please sign in to comment.