From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 121020 invoked by alias); 14 Jul 2019 19:39:45 -0000 Mailing-List: contact cygwin-apps-help@cygwin.com; run by ezmlm Precedence: bulk Sender: cygwin-apps-owner@cygwin.com List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Mail-Followup-To: cygwin-apps@cygwin.com Received: (qmail 120948 invoked by uid 89); 14 Jul 2019 19:39:45 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy=1887, chmod, mkdir, HContent-Transfer-Encoding:8bit X-HELO: mail-wm1-f42.google.com Received: from mail-wm1-f42.google.com (HELO mail-wm1-f42.google.com) (209.85.128.42) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 14 Jul 2019 19:39:44 +0000 Received: by mail-wm1-f42.google.com with SMTP id p74so13069703wme.4 for ; Sun, 14 Jul 2019 12:39:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=aPFcYZKh4YHdY1DDQNav2uGJIn39gITZ64+FggdfvmY=; b=Bm5durFgEL6NCnD5RL9YiBkSs9iTpp39HBHI2uO4mX8i3Die3eo9YvsbbIH1jL0Bo9 CIQREqWOnNxJGlUCdKYuX0fh/eSbUyuHFVb8cvzSjubB6K+JburJNSaJRinP277NwDaP luEQ7Y+NIudC797Vg5na+PMpfY6+ZSMTEkn4Se7LrjvAiCGUlgyAI58D6LD5z4jev7CI 14J6GEszZIgil2SAbljZsOnh9V/rmwpPbSzWya3dRu+cCOnEkWz25joEMs9oU8OZEOwP iqlIyo81vgV0IRMHu0NeXq1K4Xay2kLiO18pali9c67yBgqOuaZcVi/IO8zqmJJ/9nFh zMMA== Return-Path: Received: from df0-TUXEDO.localdomain ([2a01:c22:b83a:5400:8435:ac4a:e37e:e82b]) by smtp.googlemail.com with ESMTPSA id s188sm11521087wmf.40.2019.07.14.12.39.41 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sun, 14 Jul 2019 12:39:41 -0700 (PDT) From: Federico Kircheis To: cygwin-apps@cygwin.com Cc: Federico Kircheis Subject: [PATCH 2/2] Exit in case `cd` fails Date: Sun, 14 Jul 2019 19:39:00 -0000 Message-Id: <20190714193933.30549-2-federico.kircheis@gmail.com> In-Reply-To: <20190714193933.30549-1-federico.kircheis@gmail.com> References: <3501279f-70c8-042c-2e60-2cd315277ae9@SystematicSw.ab.ca> <20190714193933.30549-1-federico.kircheis@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2019-07/txt/msg00003.txt.bz2 --- lib/src_fetch.cygpart | 2 +- lib/src_prep.cygpart | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/src_fetch.cygpart b/lib/src_fetch.cygpart index ed61d25..4f3f17e 100644 --- a/lib/src_fetch.cygpart +++ b/lib/src_fetch.cygpart @@ -156,7 +156,7 @@ __src_fetch() { done # the RCS_fetch functions change PWD - cd "${top}"; + cd "${top}" || error "Unable to cd to ${top}" for uri in ${SRC_URI} ${PATCH_URI} do diff --git a/lib/src_prep.cygpart b/lib/src_prep.cygpart index fb94c56..593dfb6 100644 --- a/lib/src_prep.cygpart +++ b/lib/src_prep.cygpart @@ -188,7 +188,7 @@ __gpg_verify() { } __mkdirs() { - cd "${top}"; + cd "${top}" || error "Unable to cd to ${top}"; mkdir -p "${srcdir}" "${origsrcdir}" "${B}" "${D}" "${T}" "${configdir}" "${logdir}" "${distdir}" "${patchdir}" "${spkgdir}"; } @@ -267,7 +267,7 @@ __src_prep() { local tar_patch; local n=1; - cd "${top}"; + cd "${top}" || error "Unable to cd to ${top}"; __mkdirs; @@ -326,7 +326,7 @@ __src_prep() { __gpg_verify "${top}/${src_patchfile}" "SOURCE PATCH"; fi - cd "${origsrcdir}"; + cd "${origsrcdir}" || error "Unable to cd to ${origsrcdir}"; for src_pkg in ${_src_orig_pkgs} do @@ -358,7 +358,7 @@ __src_prep() { # cd will fail if not executable (e.g. dot2tex) chmod +x "${origsrcdir}/${SRC_DIR}"; - cd "${origsrcdir}/${SRC_DIR}"; + cd "${origsrcdir}/${SRC_DIR}" || error "Unable to cd to ${origsrcdir}/${SRC_DIR}"; #****v* Preparation/DISTCLEANFILES # DESCRIPTION @@ -379,7 +379,7 @@ __src_prep() { if __check_function src_unpack_hook then __check_unstable src_unpack_hook; - cd "${origsrcdir}/${SRC_DIR}"; + cd "${origsrcdir}/${SRC_DIR}" | error "Unable to cd to ${origsrcdir}/${SRC_DIR}"; fi for src_patch in ${_src_orig_patches} @@ -415,7 +415,7 @@ __src_prep() { if __check_function src_patch_hook then __check_unstable src_patch_hook; - cd "${origsrcdir}/${SRC_DIR}"; + cd "${origsrcdir}/${SRC_DIR}" || error "Unable to cd to ${origsrcdir}/${SRC_DIR}"; fi __step "Preparing working source directory"; @@ -425,7 +425,7 @@ __src_prep() { mkdir -p "${C}"; ln -sfn "${C}" "${workdir}/CYGWIN-PATCHES"; - cd "${S}"; + cd "${S}" || error "Unable to cd to ${S}"; if [ -f "${top}/${cygwin_patchfile}" ] then -- 2.20.1