]> git.ipfire.org Git - thirdparty/systemd.git/commit
generators: accept one or three args, do not write to /tmp
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 13 Jul 2022 16:19:04 +0000 (18:19 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 15 Jul 2022 11:10:39 +0000 (13:10 +0200)
commit17021368fc5b9b3800125414362e82daf43a785d
tree53377b5e93f402871ff10bad2df1e9ee8ac001c1
parentb711a9ee185dfffe8ef05d145cdbd6253986ba91
generators: accept one or three args, do not write to /tmp

Since the general generator logic was established in the rewrite in
07719a21b6425d378b36bb8d7f47ad5ec5296d28, generators would always write to /tmp
by default. I think this not a good default at all, because generators write a
bunch of files and would create a mess in /tmp. And for debugging, one
generally needs to remove all the files in the output directory, because
generators will complain in the output paths are already present. Thus the
approach of disabling console logging and writing many files to /tmp when
invoked with no arguments is not nice, so let's disallow operation with no
args.

But when debugging, one generally does not care about the separate output dirs
(most generators use only one). Thus the general pattern I use is something
like:
  rm -rf /tmp/x && mkdir /tmp/x && build/some-generator /tmp/{x,x,x}
This commit allows only one directory to be specified and simplifies this to:
  rm -rf /tmp/x && mkdir /tmp/x && build/some-generator /tmp/x
man/systemd.generator.xml
src/shared/generator.h