bertsky / workflow-configuration

a makefilization for OCR-D workflows, with configuration examples
Apache License 2.0
9 stars 5 forks source link

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

Closed kba closed 4 years ago

kba commented 4 years ago

Two changes:

bertsky commented 4 years ago
* `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 commented 4 years ago

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.