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

[tor-commits] [Git][tpo/applications/tor-browser-build][main] Bug 41720: Switch back from cp -l to mv.



Title: GitLab

boklm pushed to branch main at The Tor Project / Applications / tor-browser-build

Commits:

  • 6bb082cb
    by Pier Angelo Vendrame at 2026-02-09T19:24:54+01:00
    Bug 41720: Switch back from cp -l to mv.
    
    We switched to cp -l to avoid errors when trying to move an inode to
    itself (case we might enocunter when re-running projects/release/build,
    since we hard-link release files when possible).
    However, `cp -l` does not fall back to a copy when hard link is not
    possible, instead it fails.
    So, go back to `mv`, but run `rm -f` before running mv, to avoid the
    error when trying to move the file to itself.
    

1 changed file:

Changes:

  • projects/release/build
    ... ... @@ -5,47 +5,58 @@
    5 5
     destdir="[% dest_dir _ '/' _ c("var/publish_dir") %]"
    
    6 6
     mkdir -p "$destdir"
    
    7 7
     
    
    8
    +function merge_directory {
    
    9
    +  pushd $1
    
    10
    +  find -type d -exec mkdir -p $destdir/{} \;
    
    11
    +  # tor-browser-build#40338: Try to remove any existing destination, as it might
    
    12
    +  # be the same inode when re-running this script, which makes mv fail.
    
    13
    +  find -type f -exec rm -f $destdir/{} \;
    
    14
    +  find -type f -exec mv {} $destdir/{} \;
    
    15
    +  popd
    
    16
    +}
    
    17
    +
    
    8 18
     [% IF c("var/browser_platforms/android-armv7") -%]
    
    9
    -  cp -alf "[% c('input_files_by_name/android-armv7') %]"/* "$destdir"/
    
    19
    +  merge_directory "[% c('input_files_by_name/android-armv7') %]"
    
    10 20
     [% END -%]
    
    11 21
     [% IF c("var/browser_platforms/android-x86_64") -%]
    
    12
    -  cp -alf "[% c('input_files_by_name/android-x86_64') %]"/* "$destdir"/
    
    22
    +  merge_directory "[% c('input_files_by_name/android-x86_64') %]"
    
    13 23
     [% END -%]
    
    14 24
     [% IF c("var/browser_platforms/android-aarch64") -%]
    
    15
    -  cp -alf "[% c('input_files_by_name/android-aarch64') %]"/* "$destdir"/
    
    25
    +  merge_directory "[% c('input_files_by_name/android-aarch64') %]"
    
    16 26
     [% END -%]
    
    17 27
     [% IF c("var/browser_platforms/windows-i686") -%]
    
    18
    -  cp -alf "[% c('input_files_by_name/windows-i686') %]"/* "$destdir"/
    
    28
    +  merge_directory "[% c('input_files_by_name/windows-i686') %]"
    
    19 29
     [% END -%]
    
    20 30
     [% IF c("var/browser_platforms/windows-x86_64") -%]
    
    21
    -  cp -alf "[% c('input_files_by_name/windows-x86_64') %]"/* "$destdir"/
    
    31
    +  merge_directory "[% c('input_files_by_name/windows-x86_64') %]"
    
    22 32
     [% END -%]
    
    23 33
     [% IF c("var/browser_platforms/macos") -%]
    
    24
    -  cp -alf "[% c('input_files_by_name/macos') %]"/* "$destdir"/
    
    34
    +  merge_directory "[% c('input_files_by_name/macos') %]"
    
    25 35
     [% END -%]
    
    26 36
     [% IF c("var/browser_platforms/macos-x86_64") -%]
    
    27
    -  cp -alf "[% c('input_files_by_name/macos-x86_64') %]"/* "$destdir"/
    
    37
    +  merge_directory "[% c('input_files_by_name/macos-x86_64') %]"
    
    28 38
     [% END -%]
    
    29 39
     [% IF c("var/browser_platforms/macos-aarch64") -%]
    
    30
    -  cp -alf "[% c('input_files_by_name/macos-aarch64') %]"/* "$destdir"/
    
    40
    +  merge_directory "[% c('input_files_by_name/macos-aarch64') %]"
    
    31 41
     [% END -%]
    
    32 42
     [% IF c("var/browser_platforms/linux-x86_64") -%]
    
    33
    -  cp -alf "[% c('input_files_by_name/linux-x86_64') %]"/* "$destdir"/
    
    43
    +  merge_directory "[% c('input_files_by_name/linux-x86_64') %]"
    
    34 44
     [% END -%]
    
    35 45
     [% IF c("var/browser_platforms/linux-aarch64") -%]
    
    36
    -  cp -alf "[% c('input_files_by_name/linux-aarch64') %]"/* "$destdir"/
    
    46
    +  merge_directory "[% c('input_files_by_name/linux-aarch64') %]"
    
    37 47
     [% END -%]
    
    38 48
     [% IF c("var/linux-packages") || c("var/linux-packages-aarch64") -%]
    
    39 49
       [% IF c("var/linux-packages") -%]
    
    40
    -    cp -alf "[% c('input_files_by_name/deb-packages') %]"/* "$destdir"/
    
    50
    +    merge_directory "[% c('input_files_by_name/deb-packages') %]"
    
    41 51
       [% END -%]
    
    42 52
       [% IF c("var/linux-packages-aarch64") -%]
    
    43
    -    cp -alf "[% c('input_files_by_name/deb-packages-aarch64') %]"/* "$destdir"/
    
    53
    +    merge_directory "[% c('input_files_by_name/deb-packages-aarch64') %]"
    
    44 54
       [% END -%]
    
    45
    -  cp -alf "[% c('input_files_by_name/rpm-packages') %]"/* "$destdir"/
    
    55
    +  merge_directory "[% c('input_files_by_name/rpm-packages') %]"
    
    46 56
     [% END -%]
    
    47 57
     [% IF c("var/browser-src") -%]
    
    48
    -  cp -alf "[% c('input_files_by_name/src-firefox') %]" "$destdir"/
    
    58
    +  rm -f "$destdir/[% c('input_files_by_name/src-firefox') %]"
    
    59
    +  mv [% c('input_files_by_name/src-firefox') %] "$destdir"/
    
    49 60
     [% END -%]
    
    50 61
     cd "$destdir"
    
    51 62
     cat > .htaccess <<'EOF'
    

  • _______________________________________________
    tor-commits mailing list -- tor-commits@xxxxxxxxxxxxxxxxxxxx
    To unsubscribe send an email to tor-commits-leave@xxxxxxxxxxxxxxxxxxxx