Received: by 2002:ab2:7a55:0:b0:1f4:4a7d:290d with SMTP id u21csp62383lqp; Thu, 4 Apr 2024 07:12:10 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWm2QZjPrYrTMRqPyBwXHhWC0Gsp9+vu5uSw3rCt5glXejvTOLIfT2p3ps9dR8tM6MH+hS8JOJkTuQq1mTTFiZxZ7LF2Vd22dUyueSDSQ== X-Google-Smtp-Source: AGHT+IHCfNfJqkxP2oMd6i2nwQgbG2rHAjeIAVtwKnMZN2p69VuoI6a/YowD1U+BOsNRkNMACUXG X-Received: by 2002:a50:cd1e:0:b0:56c:24e6:ca7e with SMTP id z30-20020a50cd1e000000b0056c24e6ca7emr1604939edi.2.1712239930420; Thu, 04 Apr 2024 07:12:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712239930; cv=pass; d=google.com; s=arc-20160816; b=zwLw2iSLAU/+RdnGNhL9YgypilD883JtB29h1DlWL5HfzvMTulcZluI2Rgq4/GHeSb x4qVK3DuqrtYwpgGWptd6HtQ0+JRVr45zX9IwVrWOW8NXfVAyNNA1LDeNIbzP7UWV/eq OOmqbtxfWk/EeXG5Oo8HQ1oeD3TIOYjZY0fybXKzvzM32vPh84K9s5BhFuET2N6+DoGq vkZkDMeDGYGSjt+Ojc25gelcCs6G4mLBJdcvkFcMToslQbwzRrGdHr2eWzz2L+LFgad2 JAtz519hVkxHCASrCY9NoS45DBDMQphcO/pKdrsQrpeeUjoZ2MFU6udy9yN6bOP0+Zva nxOQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date; bh=FspSGkAoVxAtr160fd1suOfNWx+3GBBXBSS5taqDvvQ=; fh=TVXd0y5hQDQwEB4X/X/dXXr2z1HYoOu7MkWvvlf648s=; b=ED4UelcAnjp4iBdF+ZDVKfd4S0x1SMOt6pw4yQxJsTLmaV6gdfmEH/pPMSAVti9uuW jHvXTt+vpIS3taAnQtQM8sXf15qQBSUSULAOh4tN5KQNefh+FnagCzJG1Sfk71ATSzdY 2/JYVgVQH/HIr9Pr26PdtdYPBZkv9b9/+MUkJUky98va1jGq8KxKqktTXd+I76zcVKag dMlNesPi2ai/7RNMEGAE6+pENdzDBX6nZuNbuuMTxYmGB2SS0VS9oKEX+RlHVm7gCvlE +/YZ4k4GmP59q9k8kbsWEDCa5CthSvm+Fod+u8PTkkGW5PgJO5Uy8EBjbL1/HO3q3102 Us8w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=tukaani.org); spf=pass (google.com: domain of linux-kernel+bounces-131571-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-131571-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id s16-20020a056402521000b0056e1343b911si952421edd.614.2024.04.04.07.12.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Apr 2024 07:12:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-131571-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=tukaani.org); spf=pass (google.com: domain of linux-kernel+bounces-131571-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-131571-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 1AC0E1F2C54E for ; Thu, 4 Apr 2024 14:10:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8CD2E12C81F; Thu, 4 Apr 2024 14:08:52 +0000 (UTC) Received: from mailscanner05.zoner.fi (mailscanner05.zoner.fi [5.44.246.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4404312B14B for ; Thu, 4 Apr 2024 14:08:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=5.44.246.14 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712239732; cv=none; b=UAnN91287xtJ4WM+SdonfBZSgxyFbNzdAkbqRZ95JhHxrepYShBymOFZg7WZA4wfruhex2P1lCuHBKtYVgUpDIvC92ETYCPPl54UNO3UMri/RzLxxYsYrSqPxAnnHLFZx+/8hDWpahCCU4zCPfXOwgKxvkPgk/h6KdVLvHZHQ/8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712239732; c=relaxed/simple; bh=M6DblwVE8DiuDynQ1JBmK+7fzA81IsqT2VdwDG2Puho=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=JlxbLZIlt+EpKCW2gokPF3KeWolz3GPN35UocuYZmiAWnjjx7/dWC2xJ5a15LkCyjawwbpIzXItjy+wx7do+1K7GudJZ119XDtfgSYylXVqp630Sfr96Uv+dxmLgIs8MaOBALYMliXStzzYcgdLVMvkPqNGYJ2hXKoh6ijKc+TM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tukaani.org; spf=pass smtp.mailfrom=tukaani.org; arc=none smtp.client-ip=5.44.246.14 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tukaani.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tukaani.org Received: from www25.zoner.fi (www25.zoner.fi [84.34.147.45]) by mailscanner05.zoner.fi (Postfix) with ESMTPS id CBA03212D6; Thu, 4 Apr 2024 17:01:18 +0300 (EEST) Received: from mail.zoner.fi ([84.34.147.244]) by www25.zoner.fi with esmtp (Exim 4.96.1-7-g79877b70e) (envelope-from ) id 1rsNeY-00084X-2E; Thu, 04 Apr 2024 17:01:18 +0300 Date: Thu, 4 Apr 2024 17:01:03 +0300 From: Lasse Collin To: Cc: Andrew Morton , Jubin Zhong , linux-kernel@vger.kernel.org, vegard.nossum@oracle.com Subject: Re: [PATCH 11/11] xz: Adjust arch-specific options for better kernel compression Message-ID: <20240404170103.1bc382b3@kaneli> In-Reply-To: <20240403225903.0773746d@kaneli> References: <20240320183846.19475-1-lasse.collin@tukaani.org> <20240320183846.19475-12-lasse.collin@tukaani.org> <27db456edeb6f72e7e229c2333c5d8449718c26e.camel@16bits.net> <20240403225903.0773746d@kaneli> X-Mailer: Claws Mail 4.2.0 (GTK 3.24.41; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On 2024-04-03 Lasse Collin wrote: > On 2024-03-31 angel.lkml@16bits.net wrote: > > So, in the spirit of keeping a fair amount of paranoia, and since it > > doesn't do any harm, any such code should be failproofed to ensure > > it can only import the expected shell variables with the right > > format[3]: > > > > eval "$($XZ --robot --version | grep > > '^\(XZ\|LIBLZMA\)_VERSION=[0-9]*$')" || exit > > I would rather get rid of eval. I committed the following to the > upstream repository: > > XZ_VERSION=$($XZ --robot --version | sed -n 's/^XZ_VERSION=//p') || > exit Both my new version and the suggested eval+grep version have error detection issues: - With the eval+grep version, if there are no matches, eval gets an empty string as an argument in which case eval's exit status is zero and "exit" won't be run. Exit status from $XZ is ignored. XZ_VERSION won't be set or it might be inherited from the environment. - With $XZ ... | sed ..., the exit status of $XZ is ignored. sed will exit with 0 and thus "exit" won't be run even if $XZ fails. Upstream I changed to this: XZ_VERSION=$($XZ --robot --version) || exit XZ_VERSION=$(printf '%s\n' "$XZ_VERSION" | sed -n 's/^XZ_VERSION=//p') If output from $XZ is weird, XZ_VERSION might still become weird too. But the way the variable is used later should at worst result in "integer expression expected" error message. I think the above is a good enough balance for a shell script like this. -- Lasse Collin