Browse Source

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 7 years ago
parent
commit
950293c86c
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      src/stub

+ 1
- 1
src/stub View File

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