summaryrefslogtreecommitdiff
path: root/src/metastore.c
AgeCommit message (Collapse)Author
2022-05-24Change "compare" output from MSG_QUIET to MSG_NORMAL.Adam Spragg
Compare output is... just output. We shouldn't need to pass two "-q" options to shut it up. Likening the metastore MSG_* levels to syslog() LOG_* levels, MSG_DEBUG works like LOG_DEBUG, and the WARNING/ERROR/CRITICAL also have similar roles. That leaves MSG_NORMAL as the equivalent of LOG_INFO, and MSG_QUIET as the equivalent of LOG_NOTICE. LOG_NOTICE is documented as for "normal, but significant, condition" which tracks what MSG_QUIET is for - things that aren't errors, but that you want to know about even when you've asked for quiet. Whereas the output of "compare" is just regular output. Finding a difference isn't a significant condition - it's exactly what you've asked it to look for.
2022-05-24Return non-zero exit status if "compare" finds differencesAdam Spragg
This makes `metastore` more useful in scripts, just to check if it found anything, in the same way as `diff` and `grep`. Note that POSIX requires that EXIT_SUCCESS is 0, and EXIT_FAILURE is 1, so I've defined EXIT_DIFFERENCES as 2 which, while different from the values `diff` and `grep` use (1 for finding something, 2 for errors), maintains a certain amount of backwards compatibility with previous versions of metastore.
2022-05-24Make "--no-mtime" apply to "dump" actionAdam Spragg
2022-05-24Add ability to not save mtime in metadata filesAdam Spragg
If you're storing metadata in a version control system with multiple branches, mtime differences are going to produce a whole bunch of conflicts that you likely don't care about. This allows you to not save mtime and avoid those. Note that we use a sentinel value of -1 for the mentry `mtimensec` field to indicate this in the data, as all values of `mtime` are theoretically valid, but `mtimensec` must always be between 0 and 999,999,999 in the real world. I'm not 100% sure about the mechanism for selecting this feature. The legacy behaviour for metastore was to save mtimes in the metadata files, but ignore them for compare/apply by default, with a `--mtime` option to use the mtime data. Keeping the legacy behaviour for backwards compatibility, but adding a `--no-mtime` option to ignore mtimes when saving felt like a reasonable way of making this happen, but something about it doesn't feel great. Maybe I just didn't figure out how to make the documentation clear enough. ¯\_(ツ)_/¯
2022-05-18Add -r/--format option to pick the format to save asAdam Spragg
Only version 0 is supported here.
2021-04-08Fix "changing owner" message to show owner instead of group.HEADmasterPrzemyslaw Pawelczyk
2018-09-08Add missing argument to "Failed to get metadata for %s\n" message.Przemyslaw Pawelczyk
2018-02-19Support building with empty -DNO_XATTR= (equivalent to -DNO_XATTR=0).Przemyslaw Pawelczyk
2018-02-19Support building with no extended attributes support.Przemyslaw Pawelczyk
Support building with no extended attributes support when NO_XATTR macro is predefined to non-0 value (e.g. put -DNO_XATTR in CFLAGS).
2018-02-18metastore.c: Version information cannot be suppressed.Przemyslaw Pawelczyk
2018-02-18metastore.c: Print usage to stdout if help is requested.Przemyslaw Pawelczyk
Also change level of usage message shown after critical one to error, so it can be suppressed without hiding critical one if desired (-qqq).
2018-02-03Update copyright notices.Przemyslaw Pawelczyk
2018-02-03Add SPDX License Identifier to all source files.Przemyslaw Pawelczyk
The Software Package Data Exchange (SPDX) is a good initiative, it has matured over time and deserves accelerated adoption in open-source. https://spdx.org/learn https://spdx.org/using-spdx https://spdx.org/license-list
2018-02-03Slightly reformat and modernize GPLv2 only license notices.Przemyslaw Pawelczyk
Reformat second paragraph for better look. It had awkward line wrap. Modernize third paragraph. No need to send letters to FSF in Boston.
2016-02-22metastore.c: Be more strict about arguments in compare_print().Przemyslaw Pawelczyk
That way we can avoid possible (yet not feasible in current code) NULL pointer dereference.
2016-02-06Define also _DEFAULT_SOURCE where _BSD_SOURCE is already defined.Przemyslaw Pawelczyk
It's required to avoid getting warnings w/ glibc >= 2.20.
2016-02-05Use C99 predefined identifier __func__ instead of non-std __FUNCTION__.Przemyslaw Pawelczyk
2016-02-01Improve code formatting and convert `unsigned int` to `unsigned`.Przemyslaw Pawelczyk
2015-12-01Add action to show metastore version: -v / --version.Przemyslaw Pawelczyk
Fixes #36.
2015-09-13Move source files to src/ directory.Przemyslaw Pawelczyk
As a bonus you can build out-of-tree now via make -f. It's part of the work related to issue #22.