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

[tor-commits] [Git][tpo/applications/rbm][main] Bug 40071: Add an option to create zip files using 7z



Title: GitLab

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

Commits:

  • 10c6b24e
    by Nicolas Vigier at 2024-02-08T13:26:40+01:00
    Bug 40071: Add an option to create zip files using 7z
    

2 changed files:

Changes:

  • doc/options_misc.asc
    ... ... @@ -41,6 +41,11 @@ zip::
    41 41
             and a +zip_args+ arguments which is usually the destination zip
    
    42 42
             file, and optionally other zip options. By default, GNU options
    
    43 43
             are used in find, but you can disable that with +gnu_utils+.
    
    44
    +        The 'zip' command will be used to create the zip file, unless
    
    45
    +        +use_7z+ is set, in which case '7z' will be used instead. In this
    
    46
    +        case, +7z_bin+ can be used to select the '7z' command (for cases
    
    47
    +        where the command is '7zz' instead of '7z') and +7z_opts+ can
    
    48
    +        be used to set additional options to the '7z' command.
    
    44 49
     
    
    45 50
     install_package::
    
    46 51
             This option can be used in a script when you need to install a
    

  • lib/RBM/DefaultConfig.pm
    ... ... @@ -597,14 +597,24 @@ TAR_END
    597 597
     ####
    
    598 598
     ####
    
    599 599
     ####
    
    600
    -    zip    => <<ZIP_END,
    
    600
    +    '7z_bin' => '7z',
    
    601
    +    zip      => <<ZIP_END,
    
    601 602
     [%- SET src = "">'zip_src', { error_if_undef => 1 }) -%]
    
    602 603
     [% USE date -%]
    
    604
    +[% IF c("use_7z") -%]
    
    605
    +  tmp7z=\$(mktemp)
    
    606
    +[% END -%]
    
    603 607
     find [% src.join(' ') %] -exec touch -m -t [% date.format(c('timestamp'), format = '%Y%m%d%H%M') %] -- {} +
    
    604 608
     find [% src.join(' ') %] [% IF c('gnu_utils') %]-executable[% ELSE %]-perm +0111[% END %] -exec chmod 700 {} \\;
    
    605 609
     find [% src.join(' ') %] ! [% IF c('gnu_utils') %]-executable[% ELSE %]-perm +0111[% END %] -exec chmod 600 {} \\;
    
    606 610
     find [% src.join(' ') %] | sort | \
    
    611
    +[% IF c("use_7z") -%]
    
    612
    +        cat > "\$tmp7z"
    
    613
    +        [% c('7z_bin') %] a -tzip -spf [% c('7z_opts') %] [% c('zip_args', { error_if_undef => 1 }) %] "@\$tmp7z"
    
    614
    +        rm -f "\$tmp7z"
    
    615
    +[% ELSE -%]
    
    607 616
             zip -q -@ -X [% c('zip_args', { error_if_undef => 1 }) %]
    
    617
    +[% END -%]
    
    608 618
     ZIP_END
    
    609 619
     ####
    
    610 620
     ####
    

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