[Qbs] Deploying broken symbolic links?

Richard Weickelt richard at weickelt.de
Sat Jul 18 19:33:19 CEST 2020


Hello Heiko,

> Is there any option to tell Qbs not to follow a symbolic link given
> within the "files" list?

This seems to be impossible, probably because Qbs for validity of source
artifacts. But you can write a rule that creates the symlink when building:

    Product {
        type: original.concat(["symlink"])

        Rule {
            requiresInputs: false

            Artifact {
                filePath: "link1.xxx"
                fileTags: "symlink"
                qbs.installDir: "dir1"
                qbs.install: true
            }

            prepare: {
                var cmd = new Command("ln", ["-sf", "destination",
output.filePath]);
                cmd.highlight = "filegen";
                cmd.description = "creating symbolic link '"
                    + output.fileName + "'";
                return cmd;
            }
        }
    }

Unfornately a bit verbose though.


More information about the Qbs mailing list