]> git.proxmox.com Git - pve-firmware.git/commitdiff
assemble: use full path when searching for GLOBs
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 30 Oct 2023 06:13:15 +0000 (07:13 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 30 Oct 2023 06:13:17 +0000 (07:13 +0100)
as otherwise a GLOB like vendor/dev-class/* will cause all FW files to
be included..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
assemble-firmware.pl

index d0e7667d2fa8d57ac986f61fc1ee7c897aeb4912..7c2877b26e575cef8e1dbffd7998281fd19f80fa 100755 (executable)
@@ -537,13 +537,17 @@ sub add_fw :prototype($$) {
 
     my $module = basename($mod);
     my $name = basename($fw);
+    my $fw_dir = dirname($fw);
 
     if ($name =~ /\*/) {
-       my $sr = `find '$target' \\( -type f -o -type l \\) -name '$name'`;
+       die "cannot handle GLOBs in path stem ('$fw_dir'), switch find below to regex and transform GLOB to regex"
+           if $fw_dir =~ /\*/;
+
+       my $sr = `find '$target/$fw_dir' \\( -type f -o -type l \\) -name '$name'`;
        chomp $sr;
        if ($sr) {
            for my $f (split("\n", $sr)) {
-               print "found $f for GLOB '$name'\n";
+               print "found $f for GLOB '$fw'\n";
                my $f_name = basename($f);
                $fwbase_name->{$f_name} = 1;
            }