Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   ArchLinux Pacman Development (http://www.linux-archive.org/archlinux-pacman-development/)
-   -   makepkg: do not ignore errors from pacman (http://www.linux-archive.org/archlinux-pacman-development/388303-makepkg-do-not-ignore-errors-pacman.html)

Andres P 06-20-2010 02:13 AM

makepkg: do not ignore errors from pacman
 
* check_deps is being run in a subshell, so exit 1 has no meaning.

* Its return value was also being ignored by the enclosing funcion.

* Local assignments *always* take precedence over subshell's $?

Fixes FS#19840

Although this really ignored *all* errors from pacman except 127, not just
illegal directives in pacman.conf.

Signed-off-by: Andres P <aepd87@gmail.com>
---

Let's not go crazy with them subshells.

$ fn() { foo=$(false); echo $?; local bar=$(false); echo $?; }
$ fn
1
0

scripts/makepkg.sh.in | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index b0215c8..41e6978 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -434,14 +434,15 @@ resolve_deps() {
local R_DEPS_SATISFIED=0
local R_DEPS_MISSING=1

- local deplist="$(check_deps $*)"
+ local deplist
+ deplist="$(check_deps $*)" || return
if [[ -z $deplist ]]; then
return $R_DEPS_SATISFIED
fi

if handle_deps $deplist; then
# check deps again to make sure they were resolved
- deplist="$(check_deps $*)"
+ deplist="$(check_deps $*)" || return
[[ -z $deplist ]] && return $R_DEPS_SATISFIED
elif (( DEP_BIN )); then
error "$(gettext "Failed to install all missing dependencies.")"
--
1.7.1

Allan McRae 06-20-2010 04:03 AM

makepkg: do not ignore errors from pacman
 
On 20/06/10 12:13, Andres P wrote:

* check_deps is being run in a subshell, so exit 1 has no meaning.


If a line of code has no meaning, remove it. Perhaps add a comment why
there is not exit after the error.


Otherwise the patch is fine.

Allan

Andres P 06-20-2010 04:17 AM

makepkg: do not ignore errors from pacman
 
On Sat, Jun 19, 2010 at 11:33 PM, Allan McRae <allan@archlinux.org> wrote:
> If a line of code has no meaning, remove it. Perhaps add a comment why there
> is not exit after the error.
>

I can't do that until I can diff against another one of my patches, 'makepkg:
undeclared local variables', which was accepted [1].

The patch also touches check_deps().

Andres P

[1] http://mailman.archlinux.org/pipermail/pacman-dev/2010-June/011166.html


Sun Jun 20 07:30:01 2010
Return-path: <devel-bounces@lists.fedoraproject.org>
Envelope-to: tom@linux-archive.org
Delivery-date: Sun, 20 Jun 2010 06:38:32 +0300
Received: from bastion02.fedoraproject.org ([209.132.181.3]:58313 helo=bastion.fedoraproject.org)
by s2.java-tips.org with esmtp (Exim 4.69)
(envelope-from <devel-bounces@lists.fedoraproject.org>)
id 1OQBMe-00007A-Gn
for tom@linux-archive.org; Sun, 20 Jun 2010 06:38:32 +0300
Received: from lists.fedoraproject.org (collab1.vpn.fedoraproject.org [192.168.1.21])
by bastion02.phx2.fedoraproject.org (Postfix) with ESMTP id 1A66B1107D7;
Sun, 20 Jun 2010 04:18:00 +0000 (UTC)
Received: from collab1.fedoraproject.org (localhost.localdomain [127.0.0.1])
by lists.fedoraproject.org (Postfix) with ESMTP id 5068E3267A3;
Sun, 20 Jun 2010 04:17:59 +0000 (UTC)
X-Original-To: devel@lists.fedoraproject.org
Delivered-To: devel@lists.fedoraproject.org
Received: from smtp-mm1.fedoraproject.org (smtp-mm1.fedoraproject.org
[80.239.156.217])
by lists.fedoraproject.org (Postfix) with ESMTP id B537D32676F
for <devel@lists.fedoraproject.org>;
Sun, 20 Jun 2010 04:17:57 +0000 (UTC)
Received: from mail-ww0-f45.google.com (mail-ww0-f45.google.com [74.125.82.45])
by smtp-mm1.fedoraproject.org (Postfix) with ESMTP id 3CDBF87E76
for <devel@lists.fedoraproject.org>;
Sun, 20 Jun 2010 04:17:57 +0000 (UTC)
Received: by wwa36 with SMTP id 36so1742698wwa.32
for <devel@lists.fedoraproject.org>;
Sat, 19 Jun 2010 21:17:57 -0700 (PDT)
Received: by 10.227.144.146 with SMTP id z18mr3089043wbu.131.1277007476916;
Sat, 19 Jun 2010 21:17:56 -0700 (PDT)
Received: from [192.168.1.66] (host86-138-48-204.range86-138.btcentralplus.com
[86.138.48.204])
by mx.google.com with ESMTPS id y31sm3024129wby.10.2010.06.19.21.17.55
(version=SSLv3 cipher=RC4-MD5); Sat, 19 Jun 2010 21:17:56 -0700 (PDT)
Message-ID: <4c1d9674.df0ce30a.0db9.0e6c@mx.google.com>
To: "=?utf-8?B?UmFrZXNoIFBhbmRpdA==?=" <rakesh.pandit@gmail.com>,
"=?utf-8?B?RGV2ZWxvcG1lbnQgZGlzY3Vzc2lvbnMgcmVsYXRlZCB0by BGZWRvcmE=?="
<devel@lists.fedoraproject.org>
From: "=?utf-8?B?aWFucmljaGFyZGJha2VyQGdtYWlsLmNvbQ==?="
<ianrichardbaker@gmail.com>
Subject: =?utf-8?B?UmU6IE93bmVyc2hpcCBvZiBETWl0cnk=?=
Date: Sun, 20 Jun 2010 05:17:56 +0100
MIME-Version: 1.0
X-BeenThere: devel@lists.fedoraproject.org
X-Mailman-Version: 2.1.9
Precedence: list
Reply-To: Development discussions related to Fedora
<devel@lists.fedoraproject.org>
List-Id: Development discussions related to Fedora
<devel.lists.fedoraproject.org>
List-Unsubscribe: <https://admin.fedoraproject.org/mailman/listinfo/devel>,
<mailto:devel-request@lists.fedoraproject.org?subject=unsubscrib e>
List-Archive: <http://lists.fedoraproject.org/pipermail/devel>
List-Post: <mailto:devel@lists.fedoraproject.org>
List-Help: <mailto:devel-request@lists.fedoraproject.org?subject=help>
List-Subscribe: <https://admin.fedoraproject.org/mailman/listinfo/devel>,
<mailto:devel-request@lists.fedoraproject.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============6624178184383084383=="
Sender: devel-bounces@lists.fedoraproject.org
Errors-To: devel-bounces@lists.fedoraproject.org

--===============6624178184383084383==
Content-Type: multipart/alternative;
boundary="----=_Part_2_1277007476247"

------=_Part_2_1277007476247
Content-Type: text/plain;
charset=utf-8
Content-Transfer-Encoding: base64
Content-Disposition: inline

VGhhbmtzIGZvciB5b3VyI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2FnZS4KCi0tIApSYWtlc2gg
UGFuZGl0Cmh0dHBzOi8vZmVkb3JhcHJvamVjdC5vcmcvd2lraS 9Vc2VyOlJha2VzaApmcmVlZG9t
LCBmcmllbmRzLCBmZWF0dXJlcywgZmlyc3QKLS0gCmRldmVsIG 1haWxpbmcgbGlzdApkZXZlbEBs
aXN0cy5mZWRvcmFwcm9qZWN0Lm9yZwpodHRwczovL2FkbWluLm ZlZG9yYXByb2plY3Qub3JnL21h
aWxtYW4vbGlzdGluZm8vZGV2ZWwKCgoKCg==


------=_Part_2_1277007476247
Content-Type: text/html;
charset=utf-8
Content-Transfer-Encoding: base64
Content-Disposition: inline

VGhhbmtzIGZvciB5b3VyIHJlcGx5LiAmbmJzcDs8YnI+PGJyPk kgaGFkIHJlYWQgdGhlIFdpa2kg
cGFnZSwgYnV0IHRoZXJlJiMzOTtzIG5vIG1lbnRpb24gb2Ygbm V3IGNvbnRyaWJ1dG9ycyBhZG9w
dGluZyBvcnBoYW5lZCBwYWNrYWdlcy48YnI+PGJyPlNvIEkgaG F2ZSB0byBzdWJtaXQgdGhlIG9y
cGhhbiBhcyBuZXcgYWxsIG92ZXIgYWdhaW4gaW4gb3JkZXIgdG 8ga2lja3N0YXJ0IHRoZSBuZXcg
Y29udHJpYnV0b3IgcHJvY2Vzcz88YnI+PGJyPlRoYW5rcy48Yn I+PGJyPklhbjxicj48YnI+PGJy
Pi0tLS0tIFJlcGx5IG1lc3NhZ2UgLS0tLS08YnI+RnJvbTogJn F1b3Q7UmFrZXNoIFBhbmRpdCZx
dW90OyAmbHQ7cmFrZXNoLnBhbmRpdEBnbWFpbC5jb20mZ3Q7PG JyPkRhdGU6IFN1biwgSnVuIDIw
LCAyMDEwIDA0OjUzPGJyPlN1YmplY3Q6IE93bmVyc2hpcCBvZi BETWl0eTxicj5UbzogJnF1b3Q7
RGV2ZWxvcG1lbnQgZGlzY3Vzc2lvbnMgcmVsYXRlZCB0byBGZW RvcmEmcXVvdDsgJmx0O2RldmV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sQGxpc3RzLm ZlZG9yYXByb2plY3Qub3JnPGJy
PjxhIGhyZWY9Imh0dHBzOi8vYWRtaW4uZmVkb3JhcHJvamVjdC 5vcmcvbWFpbG1hbi9saXN0aW5m
by9kZXZlbCI+aHR0cHM6Ly9hZG1pbi5mZWRvcmFwcm9qZWN0Lm 9yZy9tYWlsbWFuL2xpc3RpbmZv
L2RldmVsPC9hPjxicj48YnI+PGJyPjxicj48YnI+PGJyPjxicj 4=


------=_Part_2_1277007476247--


--===============6624178184383084383==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
--===============6624178184383084383==--


All times are GMT. The time now is 11:57 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.