OCR-D / ocrd_all

Master repository which includes most other OCR-D repositories as submodules
MIT License
72 stars 17 forks source link

Remove useless commands in Makefile #322

Closed stweil closed 2 years ago

stweil commented 2 years ago

Signed-off-by: Stefan Weil sw@weilnetz.de

stweil commented 2 years ago

Those commands run in sudo context and "restore" the ownership to root.

stweil commented 2 years ago

@kba, @bertsky, can we merge this PR? That is required before a PR for "solution 2" can be made.

stweil commented 2 years ago

Please elaborate why you think this line can be removed.

See my comment above: those commands run in sudo context and "restore" the ownership to root.

They operate on /root/.parallel which is owned by root before and after that command.

kba commented 2 years ago

We change the permissions back because deps-ubuntu must be called with sudo.

With #323 we can be sure that the git calls and consequently the $(SEMGIT) calls are run as the user owning the repository.

That leaves the question whether deps-ubuntu in the submodules' Makefiles does things beyond apt-get install, right? or is there something else I am missing.

So, how about I merge this change into #323 and test in the context of that PR that for a fresh clone, sudo make deps-ubuntu leaves all files in the repo and subrepo with the right permissions?

bertsky commented 2 years ago

@stweil that line is meant to restore the permissions to ~/.parallel after the sudo actions. (We run parallel as root and might create configs there – at least on first use.)

stweil commented 2 years ago

@stweil that line is meant to restore the permissions to ~/.parallel after the sudo actions. (We run parallel as root and might create configs there – at least on first use.)

Yes, we run it as root. Therefore ~ is /root, and parallel puts its files there.

stweil commented 2 years ago

We change the permissions back because deps-ubuntu must be called with sudo.

We don't change any permissions for files created by parallel "back". Either it runs as root and writes files owned by root in the root home, or it runs as normal user and writes files owned by that user in the user's home. The comment which I removed, too, is simply misleading because it is wrong.

Note that the HOME macro changes to /root when running with sudo.