Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 927022 | Differences between
and this patch

Collapse All | Expand All

(-)a/copy-firmware.sh (-1 / +24 lines)
Lines 46-51 Link Here
46
            shift
46
            shift
47
            ;;
47
            ;;
48
48
49
        --firmware-list)
50
            if [ -n "$2" ]; then
51
                FIRMWARE_LIST=$2
52
                shift 2
53
            else
54
                echo "ERROR: '--firmware-list' requires a non-empty option argument of firmware files to install"
55
                exit 1
56
            fi
57
            ;;
58
49
        *)
59
        *)
50
            if test -n "$destdir"; then
60
            if test -n "$destdir"; then
51
                err "unknown command-line options: $*"
61
                err "unknown command-line options: $*"
Lines 70-77 Link Here
70
    ./check_whence.py || err "check_whence.py has detected errors."
80
    ./check_whence.py || err "check_whence.py has detected errors."
71
fi
81
fi
72
82
83
if test -n "${FIRMWARE_LIST}"; then
84
    grep -E '^Link:' WHENCE | sed -e 's/^Link: *//g;s/-> //g' | while read l t; do
85
        if ! cat "${FIRMWARE_LIST}" | grep -q "${l}"; then continue; fi
86
        target="$(realpath --relative-to="$(pwd)" -m -s "$(dirname "$l")/$t")"
87
        echo "${target}" >> "${FIRMWARE_LIST}"
88
    done
89
    FIRMWARE_LIST=$(cat "${FIRMWARE_LIST}")
90
fi
91
73
# shellcheck disable=SC2162 # file/folder name can include escaped symbols
92
# shellcheck disable=SC2162 # file/folder name can include escaped symbols
74
grep -E '^(RawFile|File):' WHENCE | sed -E -e 's/^(RawFile|File): */\1 /;s/"//g' | while read k f; do
93
grep -E '^(RawFile|File):' WHENCE | sed -E -e 's/^(RawFile|File): */\1 /;s/"//g' | while read k f; do
94
    [ -n "${FIRMWARE_LIST}" ]  && if ! echo "${FIRMWARE_LIST}" | grep -q "${f}"; then continue; fi
75
    install -d "$destdir/$(dirname "$f")"
95
    install -d "$destdir/$(dirname "$f")"
76
    $verbose "copying/compressing file $f$compext"
96
    $verbose "copying/compressing file $f$compext"
77
    if test "$compress" != "cat" && test "$k" = "RawFile"; then
97
    if test "$compress" != "cat" && test "$k" = "RawFile"; then
Lines 84-89 Link Here
84
104
85
# shellcheck disable=SC2162 # file/folder name can include escaped symbols
105
# shellcheck disable=SC2162 # file/folder name can include escaped symbols
86
grep -E '^Link:' WHENCE | sed -e 's/^Link: *//g;s/-> //g' | while read l t; do
106
grep -E '^Link:' WHENCE | sed -e 's/^Link: *//g;s/-> //g' | while read l t; do
107
    [ -n "${FIRMWARE_LIST}" ]  && if ! echo "${FIRMWARE_LIST}" | grep -q "${l}"; then continue; fi
87
    directory="$destdir/$(dirname "$l")"
108
    directory="$destdir/$(dirname "$l")"
88
    install -d "$directory"
109
    install -d "$directory"
89
    target="$(cd "$directory" && realpath -m -s "$t")"
110
    target="$(cd "$directory" && realpath -m -s "$t")"
Lines 98-104 Link Here
98
119
99
# Verify no broken symlinks
120
# Verify no broken symlinks
100
if test "$(find "$destdir" -xtype l | wc -l)" -ne 0 ; then
121
if test "$(find "$destdir" -xtype l | wc -l)" -ne 0 ; then
101
    err "Broken symlinks found:\\n$(find "$destdir" -xtype l)"
122
    if  [ -z "${FIRMWARE_LIST}" ]; then
123
        err "Broken symlinks found:\\n$(find "$destdir" -xtype l)"
124
    fi
102
fi
125
fi
103
126
104
exit 0
127
exit 0

Return to bug 927022