Topic: https://brettterpstra.com/2014/07/03/mavericks-tags-and-coreutils-a-warning/
hide preview

What's next? verify your email address for reply notifications!

Michael de Jeu 10y, 259d ago

Just out of curiosity, why would you change to these tools? Because you like to tinker and you're good at it or do they do something different/better than the included tools. Sorry for my ignorance but I always learn new things from you.

remark link
hide preview

What's next? verify your email address for reply notifications!

Tom 10y, 259d ago

Actually there can be good reasons to install the coreutils. For example coreutils’ ln is much more versatile than OSX’s ln.

Anyway there isn’t really a problem: If you install the corutils with homebrew (“gnutls”) they get installed in /usr/local/Cellar/coreutils/ with symlinks in /usr/local/bin, all prefixed with a “g”, that is gcp, gmv, gln etc. So there is no way that they get accidentally used instead of the original cp, mv, ln etc.

remark link parent
hide preview

What's next? verify your email address for reply notifications!

ttscoff 10y, 259d ago

They're prefixed, but brew also puts the bin directory for them in your path and symlinks the standard names into it. `which cp` will point to the gcp symlink.

remark link parent
hide preview

What's next? verify your email address for reply notifications!

Tom 10y, 259d ago

I just removed the coreutils with ‘brew rm -f coreutils’ and reinstalled with ‘brew install coreutils’ and it’s the same as before. All prefixed with “g” and no standard names symlinked to the coreutils.
(Yes the correct name is “coreutils”, not “gnutls” as I stated before.)

hide preview

What's next? verify your email address for reply notifications!

Tom 10y, 259d ago

Hmm, I have the coreutils installed via homebrew since quite some time, and – just verified – in my /bin directory I have the original cp, mv, etc. (no symlinks).

In my /usr/bin I don’t have any mv, cp, ln, etc. (neither symlinks nor files)

In my /usr/local/bin I don’t have any cp, mv, ln. I *do* have gcp, gmv, gln, all pointing to /usr/local/Cellar/coreutils/8.22/bin/gcp, gmv, gln, etc.

‘which cp’ gives me ‘bin/cp’ which is the original cp. And “/usr/local/bin” is in my interactive path, but it doesn’t matter, because the concerned bins are all named differently (g).

So, either we are talking about different things, or something went wrong with your (or my) Homebrew install of corutils ;-)

Are you sure you installed with Homebrew? Maybe you did reconfigure HB to install to a different directory? Where are your other HB binaries located?

remark link parent

load more (1 remarks)
hide preview

What's next? verify your email address for reply notifications!

ttscoff 10y, 259d ago

brew link coreutils

The symlinks I'm talking about are in /usr/local/opt/coreutils/libexec/gnubin, which ended up in my $PATH. I know that's outside of the cellar, but I never intentionally installed them any other way. I also have the g* links in /usr/local/bin, which makes me wonder where this other set could have come from.

Either way, the point stands. If you've installed coreutils and you want to keep your tags, just make sure that you're using the OS X defaults for cp and mv.

remark link parent
hide preview

What's next? verify your email address for reply notifications!

Tom 10y, 258d ago

Yes, indeed it seems something went wrong with your HB install. In “/usr/local/opt” you should have a symlink named “coreutils” pointing to “/usr/local/Cellar/coreutils/8.22/” and nothing more. I have no idea where your “libexec/gnubin” comes from. Maybe it stems from a very old HB install? If this is the case I would recommend you to erase the whole HB directory, which normally is located in /usr/local but in your case it may be spread to some othe directories too. Do a git hard-reset too, not sure, have a look at the HB documentation.

Anyway HB is a very well thought approach, and it would have make me wonder if they replaced standard bins with custom bins without asking the user. No way.

hide preview

What's next? verify your email address for reply notifications!

ttscoff 10y, 259d ago

`which whoami` leads me to: /usr/local/opt/coreutils/libexec/gnubin/whoami, which is a symlink to: /usr/local/Cellar/coreutils/8.22/bin/gwhoami

hide preview

What's next? verify your email address for reply notifications!

ttscoff 10y, 259d ago

I actually installed them to get some of the additional utilities the package offers. I didn't think twice about the fact that it was replacing the "core" utilities I was used to. Not very smart in retrospect.

hide preview

What's next? verify your email address for reply notifications!

Juha Ranta 10y, 259d ago

I haven’t installed GNU Coreutils. I tried Ruby FileUtils with both system Ruby and custom installed Ruby. Moving files with `FileUtils.mv` preserved the tags, but copying files with `FileUtils.cp` lost the tags.

hide preview

What's next? verify your email address for reply notifications!

Pádraig Brady 10y, 260d ago

Note mv within a file system should not strip meta data right. Are you just taking about a cross file system mv here? Also it's very surprising that cp -p works, while mv doesn't as they should use the same code. What version of coreutils are you using (mv --version). If this is still an issue, it would be worth reporting to bug-coreutils@gnu.org mentioning the particular extended attribute and version of coreutils.

remark link
hide preview

What's next? verify your email address for reply notifications!

ttscoff 10y, 260d ago

I'm using coreutils 8.22. Based on my tests, it happens just copying a file in the same directory or just moving it to a different filename. I'll drop a line to the list.

hide preview

What's next? verify your email address for reply notifications!