Skip to content

Commit 2b35603

Browse files
committed
Add a --docdir option, defaulting to /share/doc/rust
Now any files installed into /share/doc/.*/ will be installed in the path specified by --docdir. This is based on the work by orbea in rust-lang#49.
1 parent 755bc3d commit 2b35603

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

install-template.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -624,6 +624,12 @@ install_components() {
624624
_file_install_path="$CFG_MANDIR/$_f"
625625
fi
626626

627+
if echo "$_file" | grep "^share/doc/" > /dev/null
628+
then
629+
local _f="$(echo "$_file" | sed 's/^share\/doc\/[^/]*\///')"
630+
_file_install_path="$CFG_DOCDIR/$_f"
631+
fi
632+
627633
# Make sure there's a directory for it
628634
make_dir_recursive "$(dirname "$_file_install_path")"
629635
critical_need_ok "directory creation failed"
@@ -834,6 +840,7 @@ valopt components "" "comma-separated list of components to install"
834840
flag list-components "list available components"
835841
valopt libdir "$CFG_DESTDIR_PREFIX/lib" "install libraries"
836842
valopt mandir "$CFG_DESTDIR_PREFIX/share/man" "install man pages in PATH"
843+
valopt docdir "$CFG_DESTDIR_PREFIX/share/doc/rust" "install documentation in PATH"
837844
opt ldconfig 1 "run ldconfig after installation (Linux only)"
838845
opt verify 1 "obsolete"
839846
flag verbose "run with verbose output"

0 commit comments

Comments
 (0)