]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
ukify: Allow passing multiple directories to --tools
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 19 Dec 2022 14:36:07 +0000 (15:36 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Thu, 22 Dec 2022 11:19:55 +0000 (12:19 +0100)
man/ukify.xml
src/ukify/ukify.py

index 17546d543dfe4d8b77c1d1b75278f38ef7633326..c5bf91de02e782eb236e97698f7361322d39c24b 100644 (file)
       </varlistentry>
 
       <varlistentry>
-        <term><option>--tools=<replaceable>DIR</replaceable></option></term>
+        <term><option>--tools=<replaceable>DIRS</replaceable></option></term>
 
-        <listitem><para>Specify a directory with helper tools. <command>ukify</command> will look for helper
-        tools in that directory first, and if not found, try to load them from <varname>$PATH</varname> in
-        the usual fashion.</para></listitem>
+        <listitem><para>Specify one or more directories with helper tools. <command>ukify</command> will look
+        for helper tools in those directories first, and if not found, try to load them from
+        <varname>$PATH</varname> in the usual fashion.</para></listitem>
       </varlistentry>
 
       <varlistentry>
index e9e5d13d13ef309b7dba7c2b2672f1ceed43f2f0..80a4e9c9cabe3079f5a6c96f9dc15f00ce463f06 100755 (executable)
@@ -321,9 +321,10 @@ def check_inputs(opts):
 
 def find_tool(name, fallback=None, opts=None):
     if opts and opts.tools:
-        tool = opts.tools / name
-        if tool.exists():
-            return tool
+        for d in opts.tools:
+            tool = d / name
+            if tool.exists():
+                return tool
 
     return fallback or name
 
@@ -656,7 +657,8 @@ usage: ukify [options…] linux initrd…
 
     p.add_argument('--tools',
                    type=pathlib.Path,
-                   help='a directory with systemd-measure and other tools')
+                   nargs='+',
+                   help='Directories to search for tools (systemd-measure, llvm-objcopy, ...)')
 
     p.add_argument('--output', '-o',
                    type=pathlib.Path,