]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Better log message for --output
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 11 Sep 2023 09:04:19 +0000 (11:04 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 15 Sep 2023 15:23:50 +0000 (17:23 +0200)
207af68047ce22777b06878b7efe77491a7c4108 broke backwards-compat. mkosi-initrd
used a call like this:
  mkosi --default /usr/lib/mkosi-initrd/fedora.mkosi --finalize-script=/usr/lib/mkosi-initrd/mkosi.finalize --image-version=6.5.0-0.rc7.20230821gitf7757129e3de.50.fc39.x86_64 --environment=KERNEL_VERSION=6.5.0-0.rc7.20230821gitf7757129e3de.50.fc39.x86_64 -o /tmp/kernel-install.staging.JEzApD/initrd
which is now refused with:
  /tmp/initrd is not a valid filename
which is not very clear, because "/tmp/initrd" is an OK filename.

Let's make the error message very clear about what is wrong.

mkosi/config.py

index 1da591e02a73319c0c0b720420fa6f64ef61a69c..5b1a087772ac08c79501ecb3d7ccd1585bd83b17 100644 (file)
@@ -456,7 +456,7 @@ def config_parse_filename(value: Optional[str], old: Optional[str]) -> Optional[
         die(". and .. are not valid filenames")
 
     if "/" in value:
-        die(f"{value} is not a valid filename")
+        die(f"{value!r} is not a valid filename. (Output= requires a filename with no path components, relative to output directory.)")
 
     return value