Changeset 3cd5f55 in wspkg-data


Ignore:
Timestamp:
Feb 28, 2019, 10:06:13 PM (3 years ago)
Author:
Ting-Wei Lan <lantw44@…>
Branches:
master
Children:
eb2bca3
Parents:
4825588
git-author:
Ting-Wei Lan <lantw44@…> (02/28/19 21:52:34)
git-committer:
Ting-Wei Lan <lantw44@…> (02/28/19 22:06:13)
Message:

mrtg: Don't reuse the workspace under /tmp

It is possibly unsafe to trust anything under /tmp.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 217-mrtg.sh

    r4825588 r3cd5f55  
    1919}
    2020
    21 export WRKDIR="/tmp/wspkg-build"
     21cleanup () {
     22        rm -r -- "${WRKDIR}"
     23}
     24
     25# Create a workspace
     26WRKDIR="$(mktemp -d)"
     27trap cleanup EXIT
     28
    2229export WSPKGDIR="${WRKDIR}/wspkg"
    2330export REPODIR="/usr/local/git/repositories"
     
    2532unset  GIT_DIR
    2633
    27 # Update sources
     34# Fetch sources
    2835for repo in wspkg wspkg-data; do
    29         if [ ! -d "${WRKDIR}/${repo}" ]; then
    30                 echo_cmd git clone -- "${REPODIR}/${repo}.git" "${WRKDIR}/${repo}"
    31         else
    32                 echo_cmd cd "${WRKDIR}/${repo}"
    33                 echo_cmd git pull -- "${REPODIR}/${repo}.git"
    34         fi
     36        echo_cmd git clone -- "${REPODIR}/${repo}.git" "${WRKDIR}/${repo}"
    3537done
    3638
Note: See TracChangeset for help on using the changeset viewer.