Code Monkey home page Code Monkey logo

Comments (11)

jacky8hyf avatar jacky8hyf commented on June 28, 2024

This could be worked around by providing -T or directly providing the list of files to archive, instead of using a directory (. in this case)

from toybox.

landley avatar landley commented on June 28, 2024

I tried to reproduce this on the host debian one (to see what success looked like) and got "tar: invalid argument ‘-C’ for ‘--sort’, Valid arguments are: - ‘none’ - ‘name’ - ‘inode’". I see I did (sort);: so the argument to sort is optional (takes it if cuddled ala -snone or --sort=none, but "-s sort" is two unrelated arguments...). The argument thing is kind of bonkers because "none" is what you get without the argument, "inode" is essentially random on modern filesystems, so only "name" makes any sense?

I used --sort=name and got:

$ tar tvf testing.tar
drwxr-xr-x landley/landley 0 2023-09-30 11:14 ./
-rw-r--r-- landley/landley 0 2023-09-30 11:13 ./bar
hrw-r--r-- landley/landley 0 2023-09-30 11:13 ./foo link to ./bar

Is that the output you expect here? First entry is type 5 (dir), second is 0 (file), third is 1 (hardlink).

Rob

from toybox.

landley avatar landley commented on June 28, 2024

Ha, interesting corner case. I added the missing dereference flag, but it's still not treating entry 3 as a hardlink because the link count is 1, and I'm only adding entries with a link count >1 to the seen inode list because I didn't bother to do a fancy tree or hash table and instead used "most non-directory nodes have a link count of 1" as a filter to keep the linear search from getting punitive.

Probably the dirtree plumbing should record that the dirent saw a symlink but we read through it in the returned node somewhere, and then I can use that as a flag to add it to the potential hardlink list. Hmmm...

from toybox.

landley avatar landley commented on June 28, 2024

Nope, doing that doesn't help. And the reason it doesn't is the second entry aliased with the first by following a symlink, but the first is a perfectly normal file (which already went past unremarked), and it has to record BOTH to see the collision. So with -h it has to record normal files with link count 1. Hmmm...

from toybox.

landley avatar landley commented on June 28, 2024

Ok, try commit 658a944 and note that I didn't try to optimize the hardlink list; if performance obviously suffers doing tar -ch on giant directories I assume someone will let me know.

from toybox.

jacky8hyf avatar jacky8hyf commented on June 28, 2024

Thank you @landley ! Let us update our prebuilts and try out the new commit you have.

from toybox.

enh-google avatar enh-google commented on June 28, 2024

Thank you @landley ! Let us update our prebuilts and try out the new commit you have.

i'll take that as a request for new prebuilts... coming up!

from toybox.

enh-google avatar enh-google commented on June 28, 2024

https://android-review.googlesource.com/c/platform/prebuilts/build-tools/+/2776234 has a toybox with everything up to and including yesterday's timeout fix.

from toybox.

enh-google avatar enh-google commented on June 28, 2024

(currently blocked on a one-true-awk bug: onetrueawk/awk#199)

from toybox.

landley avatar landley commented on June 28, 2024

I plead the third.

from toybox.

enh-google avatar enh-google commented on June 28, 2024

(updated toybox by just skipping one-true-awk for now...)

from toybox.

Related Issues (20)

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.