Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ocrd-make -C to cleanup *.mk; link/copy only unless exists #13

Merged
merged 3 commits into from
Jun 3, 2020

Conversation

kba
Copy link
Contributor

@kba kba commented May 31, 2020

Two changes:

  • ocrd-make -c|-cleanup|-cleanup|cleanup to remove the Makefiles linked/copies to $PWD
  • Add a guard against overwriting existing files. Without such a check, calling the script twice (e.g. to see the --help) will result in the ln -s failiing and cp -f subsequently complaining that source and origin of file to copy are identical

@bertsky
Copy link
Owner

bertsky commented Jun 2, 2020

* `ocrd-make -c|-cleanup|-cleanup|cleanup` to remove the Makefiles linked/copies to `$PWD`

That's a good idea. So is the implementation!

* Add a guard against overwriting existing files. Without such a check, calling the script twice (e.g. to see the `--help`) will result in the `ln -s` failiing and `cp -fu` subsequently complaining that source and origin of file to copy are identical

Complaining yes, but that can be ignored (it's just stupid of cp to show an error and non-zero retvalue when -u has been requested; this was also fixed in most recent GNU coreutils BTW, so I was hoping to just sit this one out).

But I gather you're really after the complaint – and I admits it's confusing.

Still, that's no good reason to abandon the update semantics (cp -u). The reason for this was that after running in some target directory, subsequent updates to workflow-configuration / make install will need to also update the copied makefiles in the target directory next time.

@kba
Copy link
Contributor Author

kba commented Jun 3, 2020

subsequent updates to workflow-configuration / make install will need to also update the copied makefiles in the target directory next time.

That's a good point. I've added -nt (newer-than) check to copy/symlink if makefiles were updated.

Copy link
Owner

@bertsky bertsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@bertsky bertsky merged commit db3afad into bertsky:master Jun 3, 2020
@kba kba deleted the cleanup-cmd branch June 10, 2020 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants