Changeset 637ce02 in wspkg-data


Ignore:
Timestamp:
Feb 28, 2019, 9:34:11 PM (3 years ago)
Author:
Ting-Wei Lan <lantw44@…>
Branches:
master
Children:
4825588
Parents:
c0ba16c
Message:

Fix all warnings reported by shellcheck

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • 217-mrtg.sh

    rc0ba16c r637ce02  
    2727# Update sources
    2828for repo in wspkg wspkg-data; do
    29         if [ '!' -d "${WRKDIR}/${repo}" ]; then
    30                 echo_cmd git clone "${REPODIR}/${repo}.git" "${WRKDIR}/${repo}"
     29        if [ ! -d "${WRKDIR}/${repo}" ]; then
     30                echo_cmd git clone -- "${REPODIR}/${repo}.git" "${WRKDIR}/${repo}"
    3131        else
    3232                echo_cmd cd "${WRKDIR}/${repo}"
    33                 echo_cmd git pull "${REPODIR}/${repo}.git"
     33                echo_cmd git pull -- "${REPODIR}/${repo}.git"
    3434        fi
    3535done
     
    3737
    3838# Fetch new index file
    39 cd "${PORTSDIR}"
     39cd "${PORTSDIR}" || exit
    4040[ -z "${DEBUG}" ] && echo_cmd make fetchindex
    4141
    4242
    4343# Setup wspkg
    44 cd "${WRKDIR}/wspkg"
     44cd "${WRKDIR}/wspkg" || exit
    4545echo_cmd make ASCIIDOC=true PANDOC=true
    4646
    4747
    4848# Generate lists from wslinux
    49 cd "${WRKDIR}/wspkg-data"
     49cd "${WRKDIR}/wspkg-data" || exit
    5050echo_cmd ./build.sh wslinux wslinux/out/wslinux.list
    5151
     
    5353exec 4> "${WRKDIR}/wslinux.html"
    5454
    55 while read pkg 0<&3; do
     55while read -r pkg 0<&3; do
    5656        case "${pkg}" in
    5757                tigervnc*)
     
    7272
    7373# Generate pages for wsbsd
    74 cd "${WRKDIR}/wspkg-data"
     74cd "${WRKDIR}/wspkg-data" || exit
    7575echo_cmd ./build.sh wsbsd wsbsd/out/wsbsd.ports
    7676
     
    7878exec 4> "${WRKDIR}/wsbsd.html"
    7979
    80 while read pkg origin flavor 0<&3; do
     80while read -r pkg origin _ 0<&3; do
    8181        write_string_to_fd 4 "<li><a target='_blank' href='https://www.freshports.org/${origin}'>${pkg}</a></li>"
    8282done
     
    8787
    8888# Generate lists from pclab
    89 cd "${WRKDIR}/wspkg-data"
     89cd "${WRKDIR}/wspkg-data" || exit
    9090echo_cmd ./build.sh pclab pclab/out/pclab.list
    9191
     
    9393exec 4> "${WRKDIR}/pclab.html"
    9494
    95 while read pkg 0<&3; do
     95while read -r pkg 0<&3; do
    9696        write_string_to_fd 4 "<li><a target='_blank' href='http://packages.ubuntu.com/trusty/${pkg}'>${pkg}</a></li>"
    9797done
     
    102102
    103103# Copy to mrtg.csie.ntu.edu.tw
    104 echo_cmd scp -i /usr/local/git/ssh-keys/to-mrtg \
     104echo_cmd scp -i /usr/local/git/ssh-keys/to-mrtg -- \
    105105        "${WRKDIR}/wslinux.html" \
    106106        pkgbuild@mrtg.csie.ntu.edu.tw:/var/www/wslinux.html
    107107
    108 echo_cmd scp -i /usr/local/git/ssh-keys/to-mrtg \
     108echo_cmd scp -i /usr/local/git/ssh-keys/to-mrtg -- \
    109109        "${WRKDIR}/wsbsd.html" \
    110110        pkgbuild@mrtg.csie.ntu.edu.tw:/var/www/wsbsd.html
    111111
    112 echo_cmd scp -i /usr/local/git/ssh-keys/to-mrtg \
     112echo_cmd scp -i /usr/local/git/ssh-keys/to-mrtg -- \
    113113        "${WRKDIR}/pclab.html" \
    114114        pkgbuild@mrtg.csie.ntu.edu.tw:/var/www/pclab.html
  • build.sh

    rc0ba16c r637ce02  
    2323shift
    2424
    25 : ${MAKE:="make"}
     25: "${MAKE:="make"}"
    2626printf '\033[1;33mRunning\033[m: %s -f "%s" WSPKGDIR="%s"' "${MAKE}" "$makefile" "$WSPKGDIR"
    2727for arg in "$@"; do
     
    2929done
    3030printf '\n\n'
    31 if ${MAKE} -f "$makefile" WSPKGDIR="$WSPKGDIR" "$@"; then
     31if "${MAKE}" -f "$makefile" WSPKGDIR="$WSPKGDIR" "$@"; then
    3232    printf '\n\033[1;32mDone! ;-)\033[m\n'
    3333else
  • wsbsd.files/patches-apply.sh

    rc0ba16c r637ce02  
    11#!/bin/sh
    22
    3 : ${PORTSDIR:="/usr/ports"}
    4 [ '!' -d "${PORTSDIR}/.svn" ] && \
    5     printf '%s is not a svn checkout\n' "${PORTSDIR}" && exit 1
     3: "${PORTSDIR:="/usr/ports"}"
     4[ ! -d "${PORTSDIR}/.svn" ] && \
     5        printf '%s is not a svn checkout\n' "${PORTSDIR}" && exit 1
    66
    77shdir="$(realpath "$(dirname "$0")")"
    8 : ${shdir:="."}
     8: "${shdir:="."}"
    99
    1010patchdir="${shdir}/patches"
    1111
    12 cd ${PORTSDIR}
     12cd "${PORTSDIR}" || exit
    1313for patch_file in "${patchdir}"/*; do
    1414        if patch -s -C -f -p0 < "${patch_file}"; then
  • wsbsd.files/patches-update.sh

    rc0ba16c r637ce02  
    11#!/bin/sh
    22
    3 : ${PORTSDIR:="/usr/ports"}
    4 [ '!' -d "${PORTSDIR}/.svn" ] && \
     3: "${PORTSDIR:="/usr/ports"}"
     4[ ! -d "${PORTSDIR}/.svn" ] && \
    55    printf '%s is not a svn checkout\n' "${PORTSDIR}" && exit 1
    66
    77shdir="$(realpath "$(dirname "$0")")"
    8 : ${shdir:="."}
     8: "${shdir:="."}"
    99
    1010patchdir="${shdir}/patches"
    1111
    12 cd ${PORTSDIR}
     12cd "${PORTSDIR}" || exit
    1313echo '==> Running svn status ...'
    1414svn status | sed -e '/^?/d' -e 's#^[A-Z]* *\([^/]*\/[^/]*\)\(/.*\)*$#\1#' | \
    1515    sort | uniq | (
    16     while read oneline; do
     16    while read -r oneline; do
    1717        printf '==> Generating patch for %s\n' "${oneline}"
    1818        patch_name="$(printf '%s\n' "${oneline}" | tr '/' '_')"
    19         svn diff --patch-compatible "${oneline}" \
     19        svn diff --patch-compatible -- "${oneline}" \
    2020            > "${patchdir}/${patch_name}.patch"
    2121    done )
Note: See TracChangeset for help on using the changeset viewer.