Quellcode durchsuchen

Do not use `[roots]` in example `[tokens]`

Use of `[roots]` in `[tokens]` is tricky, because final value of a
`[roots:foo]` will "silently" depend on DESTDIR, while DESTDIR is
only known during install time.  On the other hand, `[tokens]` are used only
during build time.

In other words, YOU CANNOT RELY on the value of keys in `[roots]` to be
consistent.  For example, consider root:

    [roots]
        foo = /bar
        qux = [ENV:PREFIX]:/quux

`[roots:foo]` will be '/bar' at build time, but "$DESTDIR/bar" at
install time, and `[roots:qux]` will be "$PREFIX/quux" at build time,
but "$DESTDIR/$PREFIX/quux" at install time.

Just about only case when you might want to use it is mentioning it in
a document, when you want the value to be rather "standard" than
"correct", while you still want to respect PREFIX.

So let's not lead new users directly into that rabbit hole.
Alois Mahdal vor 7 Jahren
Ursprung
Commit
950293c86c
1 geänderte Dateien mit 1 neuen und 1 gelöschten Zeilen
  1. 1
    1
      src/stub

+ 1
- 1
src/stub Datei anzeigen

@@ -106,7 +106,7 @@ deploy() {
106 106
                 echo "    doc     = [ENV:PREFIX]/share/doc/$PackageName"
107 107
                 echo ""
108 108
                 echo "[tokens]"
109
-                echo "    __BIN_DIR__ = [roots:bin]"
109
+                echo "    __${PackageName^^}_FOO__ = Barr.."
110 110
                 echo ""
111 111
                 echo "[modes]"
112 112
                 echo "    bin     = 755"