Giter Site home page Giter Site logo

pydecomp's People

Contributors

dol-sen avatar vapier avatar

Stargazers

 avatar

pydecomp's Issues

rsync does not preserve hard links and does not provide other_options

Hi. COMPRESS_DEFINITIONS does not allow rsync to have other_options. Still, it uses only -a option that loses acls, xattrs, and hard-links during copy:

       --archive, -a            archive mode is -rlptgoD (no -A,-X,-U,-N,-H)

       --acls, -A               preserve ACLs (implies --perms)
       --xattrs, -X             preserve extended attributes
       --atimes, -U             preserve access (use) times
       --crtimes, -N            preserve create times (newness)
       --hard-links, -H         preserve hard links

For example, missing hard-links increase the size of directories more than 20x:

22M	/var/tmp/catalyst/tmp/hardened/livecd-stage1-core2-hardened-nomultilib-openrc-2023.03.04/usr/libexec/git-core/
502M	/var/tmp/catalyst/tmp/hardened/livecd-stage2-core2-hardened-nomultilib-openrc-2023.03.04/usr/libexec/git-core/

I'm looking for best solution here. Probably easiest solution will be to add H, A, and X options for rsync. Will you accept such change? Or should we add other_options for args definition, to allow catalyst check and set additional options and set these options there?

py3 compat handling w/popen results

the decomp module in contents.py doesn't work well with py3. this bit:

        try:
            proc = Popen(_cmd, stdout=PIPE, stderr=PIPE)
            results = proc.communicate()
            result = "\n".join(results)

will fail like so:

  File "/usr/lib64/python3.4/site-packages/DeComp/contents.py", line 66, in contents
    self._map[mode].cmd, self._map[mode].args, verbose)
  File "/usr/lib64/python3.4/site-packages/DeComp/contents.py", line 110, in _common
    result = "\n".join(results)
TypeError: sequence item 0: expected str instance, bytes found

the return of communicate is bytes in py3, so trying to use a string doesn't work. changing it to b"\n" will make the join work, but the result will still be bytes, so you'll need to also decode it. maybe something like:

            result = b"\n".join(results).decode("utf8")

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.