[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [Git][tpo/applications/rbm][main] 2 commits: Bug 40062: Copy input_files directories recursively



Title: GitLab

boklm pushed to branch main at The Tor Project / Applications / RBM

Commits:

  • 063c41f9
    by Nicolas Vigier at 2023-10-11T14:22:35+02:00
    Bug 40062: Copy input_files directories recursively
    
    When an input_files is a directory, instead of passing each files
    included in the directory individually to remote_put, we just pass the
    directory and expect remote_put to copy it recursively.
    
    Since in the case of container, each call to remote_put is a significant
    overhead, this makes it much faster when including a directory
    containing many files.
    
  • 0a47c75f
    by Nicolas Vigier at 2023-10-11T14:32:44+02:00
    Bug 40062: Avoid using run_chroot in copy_file_to
    
    When copying files to a container directory, we were running `chown` on
    the files using run_chroot, which in addition to using the chroot
    command is doing other things like setting up mount points and other
    things not needed for running `chown`. Simply using `chroot` should be
    enough and faster.
    

2 changed files:

Changes:

  • container
    ... ... @@ -110,7 +110,7 @@ sub copy_file_to {
    110 110
         my $filename = fileparse($src);
    
    111 111
         rcopy($src, "$rootfsdir/$dst/$filename")
    
    112 112
             or exit_error "Failed to copy $src to $rootfsdir/$dst/$filename";
    
    113
    -    return run_chroot($rootfsdir, ['chown', '-R', $owner, $dst]);
    
    113
    +    return system('/usr/sbin/chroot', $rootfsdir, 'chown', '-R', $owner, $dst);
    
    114 114
     }
    
    115 115
     
    
    116 116
     sub copy_file_from {
    

  • lib/RBM.pm
    ... ... @@ -1091,7 +1091,8 @@ sub input_files {
    1091 1091
             my $file_type = -d $fname ? 'directory' : 'file';
    
    1092 1092
             print "Using $file_type $fname\n";
    
    1093 1093
             mkdir dirname("$dest_dir/$name");
    
    1094
    -        push @res_copy, recursive_copy($fname, $name, $dest_dir, $action);
    
    1094
    +        recursive_copy($fname, $name, $dest_dir, $action);
    
    1095
    +        push @res_copy, $name;
    
    1095 1096
         }
    
    1096 1097
         chdir $old_cwd;
    
    1097 1098
         RETURN_RES:
    

  • _______________________________________________
    tor-commits mailing list
    tor-commits@xxxxxxxxxxxxxxxxxxxx
    https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits