소스 검색

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 년 전
부모
커밋
950293c86c
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1
    1
      src/stub

+ 1
- 1
src/stub 파일 보기

@@ -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"