Skip to content

Conversation

fghalasz
Copy link
Member

  1. add back a ln_or_cp function and use it to cp only when ln fails. Deploy t5his function for all instances of linking/copying in the script;
  2. better handling of case where the unversioned destination file does not exist but versioned destination file DOES exist. In this case creates a new next higher versioned file. Previously, in this case just created a new unversioned file and did not create a new higher version file.
  3. more informative error messages

…t to cp only when ln fails for all instances of linking/copying in the script; better handling of case where the unversioned dest file does not exist but version versions of the file DO exst.
Copy link
Contributor

@nbriggs nbriggs left a comment

Choose a reason for hiding this comment

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

Doesn't make Solaris happy, because /bin/sh does not support the "local" declarations, so an attempt to use cpv results in

% scripts/cpv /tmp/xxx /var/tmp/yyy
scripts/cpv[7]: local: not found [No such file or directory]
scripts/cpv[8]: local: not found [No such file or directory]
cp: Insufficient arguments (1)
Usage: cp [-f] [-i] [-p] [-P] [-z] [-@] [-/] f1 f2
       cp [-f] [-i] [-p] [-P] [-z] [-@] [-/] f1 ... fn d1
       cp -r [-H|-L|-P] [-f] [-i] [-p] [-z] [-@] [-/] d1 ... dn-1 dn
       cp -R [-H|-L|-P] [-f] [-i] [-p] [-z] [-@] [-/] d1 ... dn-1 dn
Error: failed to add yyy to /var/tmp

@masinter
Copy link
Member

masinter commented Mar 5, 2024

note that #1352 inconsistent

@fghalasz
Copy link
Member Author

fghalasz commented Mar 9, 2024

OK. Removed local declarations from cpv script to make it POSIX-compliant. Ready for re-review.

Copy link
Member

@masinter masinter left a comment

Choose a reason for hiding this comment

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

lgtm -- not sure why this wasn't reviewed before.

@masinter masinter merged commit 2a88ad7 into master Mar 20, 2024
@masinter masinter deleted the fgh_cpv-cleanup-2 branch April 5, 2024 20:02
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.

3 participants