File: fixup_doc_links.sh

package info (click to toggle)
erlang 1%3A27.3.4.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 225,000 kB
  • sloc: erlang: 1,658,966; ansic: 405,769; cpp: 177,850; xml: 82,435; makefile: 15,031; sh: 14,401; lisp: 9,812; java: 8,603; asm: 6,541; perl: 5,836; python: 5,484; sed: 72
file content (23 lines) | stat: -rwxr-xr-x 665 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh

APP_VSNS=$(head -1 ${ERL_TOP}/otp_versions.table | awk -F: '{print $2}' | sed 's:#::g')

FIXUP="-e s:lib/\\.\\./::g"

if [ $(basename $(dirname "$1")) = "system" ]; then
    ADJUST_PATH="../"
    FIXUP="${FIXUP} -e s:\\.\\./\\.\\./\\.\\./doc:\\.\\.:g"
fi

FIXUP="${FIXUP} -e s:${ADJUST_PATH}system/doc/html:doc/system:g"

for APP_VSN in ${APP_VSNS}; do
    APP=$(echo ${APP_VSN} | awk -F- '{print $1}')
    if [ $APP = "erts" ]; then
        FIXUP="${FIXUP} -e s:${ADJUST_PATH}${APP}/doc/html/:${APP_VSN}/doc/html/:g"
    else
        FIXUP="${FIXUP} -e s:${ADJUST_PATH}lib/${APP}/doc/html/:lib/${APP_VSN}/doc/html/:g"
    fi
done

sed $FIXUP -i -- "$@"