LCVS-FILES(5)

πŸ“¦ version 1.11, in nixos 26.05, nixpkgs unstable

πŸ’… LCVS-FILES(5): the lcvs cache directory file structure, bestie ✨

🌸 NAME 🌸

Okay so this page is the whole spec for what lives inside an lcvs cache directory β€” the usual spot is ~/.lcvs. It's giving filesystem main character energy, fr fr.


✨ DESCRIPTION ✨

At the designated place (default ~/.lcvs) there are several directories. Each one is the quoted (see below, bestie) name of a cvs root. Inside each of those directories, the subdirectories have the following meaning:

  • #lock β€” the global lock directory, no cap.
  • root β€” the directory with the actual local copy of the cvs-repository.
  • root-old β€” an old copy of the cvs repository; it is valid if and only if the directory root does not exist.
  • fallback β€” if present, this contains a sound state of the root directory before the last successful synchronisation. If a version of lcvs supports the fallback directory (the version this man-page belongs to does), a single synchronisation can never lose data, even if something happened to the original cvs repository. Even though this gives some safety, especially in path confusions or repositories moving unexpectedly, you should not base any backup strategy only on lcvs. lcvs is not a backup tool and only for convenient (offline) read-only access. The fallback subdirectory can be removed at any time (the directory is not locked) to save disk space. To avoid generating a fallback directory the option -nofallback is recommended. Iconic safety feature, but do not treat it like a backup service, periodt.
  • tmp β€” a directory with arbitrary temporary data.
  • tmp-rcv-* β€” directories with arbitrary temporary data. The names of these directories may be known to processes on remote machines. Therefore they may only be removed once it is known that no remote process will still attempt to modify them. Also, the contents of these directories may change even if the global lock is set.
  • cvsroot β€” a file containing the name of the cvsroot.
  • date β€” a human readable description of when the local copy of the cvs root was made; the protocol must not depend on it, but it should be accurate.
  • mirrortarball β€” if present, a file containing the (absolute) path to a tar ball, where "lcvs mirror" should take its data from.
  • recv-hooks β€” if present, a directory containing hooks to be executed every time an "lcvs recv" has been carried out successfully. Every regular file in this directory is considered a hook. Directories etc are ignored so that you can have the collection of hooks under version control. Hooks are executed sequentially in lexicographic order by calling "/bin/sh <filename>", irrespectively of the return value.

πŸŽ€ QUOTING πŸŽ€

A simple quoting mechanism is used, and it's lowkey neat. All but letters (a-zA-Z), digits (0-9), and hyphens (-) are replaced by an underscore, followed by the decimal code of that character followed by another underscore. This way of quoting is a 1-1 function.

Note that, in particular, _ is quoted as _95_. iykyk πŸ’…


πŸ”’ LOCKS πŸ”’

The existence of a directory #lock in ~/.lcvs/<quoted_name> signifies that this directory, and all its subdirectories, are locked. To obtain a lock, try to create the directory by an atomic operation; if this fails, wait and try again later.

Note: locks are only used for operations that update the local copy. Normal local cvs operations need not obtain a lock.

To release a lock, remove the directory #lock. Releasing the lock promises the local copy to be in a consistent state. Respect the lock, bestie β€” it's literally the vibe check for consistency.


πŸ¦‹ TO UPDATE πŸ¦‹

To update the local copy, first obtain a lock, rename the directory "root" to "old-root". Then create a copy of the repository in directory "tmp". This might happen by an appropriate call of scp(1); however methods that safe traffic are preferable. E.g., one could copy "old-root" to "tmp" and appropriately call rsync(1). Then rename "tmp" to "root", delete "root-old", and release the lock.

Alternatively and recommended (and implemented by the version of lcvs this man page refers to), instead of deleting root-old, delete the "fallback" directory (if present) and then rename "root-old" to "fallback".

That's the whole update dance: lock, shuffle, copy, rename, clean up, unlock. Slay.


🌈 SEE ALSO 🌈

  • lcvs(1) β€” go read that one too, bestie πŸ’–

πŸ‘‘ AUTHOR πŸ‘‘

Klaus Aehlig <aehlig@linta.de>


Okay bye bestie β€” this was LCVS-FILES(5), dated Sep 10, 2011. Stay slay, keep your locks consistent, and don't lose data πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from