File: linkcheck

package info (click to toggle)
daps 3.3.2%2Bcleaned1-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,540 kB
  • sloc: xml: 9,773; sh: 3,059; python: 1,322; lisp: 380; makefile: 239
file content (59 lines) | stat: -rw-r--r-- 1,802 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# -*-Shell-script-*-
#
# Copyright (C) 2015-2020 SUSE Software Solutions Germany GmbH
#
# Author:
# Frank Sundermeyer <fsundermeyer at opensuse dot org>
#
###########################################################################
#
#  LINKCHECK
#
#  checks http links in file or from rootid
#
###########################################################################

function linkcheck {
    local SHORT_OPTS LONG_OPTS SUB_CMD

    SUB_CMD=$1
    shift

    SHORT_OPTS="h"
    LONG_OPTS="file:,help,not-validate-tables,rootid:,show"

    parse_args "$SHORT_OPTS" "$LONG_OPTS" "$SUB_CMD" "$@"
    eval set -- "$P_REMAIN_ARGS"

    #------ Computing the values returned from the parser -----
    if [[ 1 -eq $P_HELP ]]; then
        help_scmd_head "$SUB_CMD" "${HELP_SUBCOMMAND[$SUB_CMD]}"
        help_file
        help_help
        help_not-validate-tables
        help_rootid
        help_show_check
        cat <<EOF
   NOTES: * Options --file (-f) and --rootid exclude one another.
           * If neither file nor rootid is specified, the rootid
             from the DC-file is used
           * $SUB_CMD follows xi:includes
EOF
    exit 0
    fi

    if [[ -z "$P_ROOTID" && -z "$P_FILE" ]]; then
        if [[ 0 != $VERBOSITY ]]; then
            ccecho "info" "Neither file nor rootid specified, using rootid from DC-file"
        fi
    elif [[ -n "$P_ROOTID" && -n "$P_FILE" ]]; then
        exit_on_error "Options --file (-f) and --rootid exclude one another.\nPlease specify only one of these options"
    fi

    if [[ -n "$P_FILE" ]]; then
        ROOTID=$($XSLTPROC --stylesheet "$DAPSROOT/daps-xslt/common/get-rootelement-id.xsl" --file "$P_FILE" "$XSLTPROCESSOR") || exit_on_error "Cannot get a rootid from file $FILE"
        export ROOTID
    fi

    call_make "$SUB_CMD" "$@"
}