Pier Angelo Vendrame pushed to branch main at The Tor Project / Applications / tor-browser-build

Commits:

2 changed files:

Changes:

  • projects/browser/ddmg.sh
    ... ... @@ -14,9 +14,13 @@ hfsfile="\$dmg_tmpdir/tbb-uncompressed.dmg"
    14 14
     export LD_PRELOAD=[% c("var/faketime_path") %]
    
    15 15
     export FAKETIME="[% USE date; GET date.format(c('timestamp'), format = '%Y-%m-%d %H:%M:%S') %]"
    
    16 16
     
    
    17
    -# Use a similar strategy to Mozilla (they have 1.02, we have 1.1)
    
    18
    -size=\$(du -ms [% src %] | awk '{ print int( \$1 * 1.1 ) }')
    
    19
    -dd if=/dev/zero of="\$hfsfile" bs=1M count=\$size
    
    17
    +src_dir=[% src %]
    
    18
    +# 1 for ceiling and 1 for the inode
    
    19
    +fileblocks=\$(find "\$src_dir" -type f -printf '%s\n' | awk '{s += int(\$1 / 4096) + 2} END {print s}')
    
    20
    +directories=\$(find "\$src_dir" -type d | wc -l)
    
    21
    +# Give some room to breathe
    
    22
    +size=\$(echo \$((\$fileblocks + \$directories)) | awk '{print int(\$1 * 1.1)}')
    
    23
    +dd if=/dev/zero of="\$hfsfile" bs=4096 count=\$size
    
    20 24
     newfs_hfs -v "[% c("var/Project_Name") %]" "\$hfsfile"
    
    21 25
     
    
    22 26
     pushd [% src %]
    

  • tools/signing/ddmg.sh
    ... ... @@ -30,9 +30,12 @@ export FAKETIME="2000-01-01 01:01:01"
    30 30
     
    
    31 31
     echo "Starting: " $(basename $dest_file)
    
    32 32
     
    
    33
    -# Use a similar strategy to Mozilla (they have 1.02, we have 1.1)
    
    34
    -size=$(du -ms "$src_dir" | awk '{ print int( $1 * 1.1 ) }')
    
    35
    -dd if=/dev/zero of="$hfsfile" bs=1M count=$size
    
    33
    +# 1 for ceiling and 1 for the inode
    
    34
    +fileblocks=$(find "$src_dir" -type f -printf '%s\n' | awk '{s += int($1 / 4096) + 2} END {print s}')
    
    35
    +directories=$(find "$src_dir" -type d | wc -l)
    
    36
    +# Give some room to breathe
    
    37
    +size=$(echo $(($fileblocks + $directories)) | awk '{print int($1 * 1.1)}')
    
    38
    +dd if=/dev/zero of="$hfsfile" bs=4096 count=$size
    
    36 39
     newfs_hfs -v "$volume_label" "$hfsfile"
    
    37 40
     
    
    38 41
     cd $src_dir