[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v5 2/3] automation: Add a clean rule for containers


  • To: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Wed, 30 Nov 2022 16:14:09 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=zdLrt8oGwGedd9qds9SmzNqss5hiRtG6YsnpTrVKvSY=; b=C+Y19OWOnZHZcMC4bROIBrkMnAj4f+psYJZwjvgUwW9z+4Z8wReokKsKY5RhnL4rv6w1fJruPvKaN60R2uDFAe0A0jgCc/8YP6sy3VlWtaBCa0BTloBACnN3Nh/JPersIFFBm49nelef5AByRkGKD7IuSOCT0o1MhVX49gjHPwheaRix+ZSCY8/joCLiT4rk3V6s+X/6d9ugp208VfGCWmXL9W1rYEt7qFQVE/p70l+/6I7exB6cCmRgy3vId4kLMPyaBpWINgoqfqLmWl1t0VWyxFiH5h8SGCfWWExMBKJLaYkGAlmYwufZtM6px4xw800ofwAYg8qt0bM3FV8HjA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JR78n9GxYOr+AYVpn461UIDQb/Bo5buCVXSUg2ak1AlZqQVWNtbXVBmrscqw+8Ff1mmuz6xeMYMMBYjm8rQ8cLoq8qyG1b12yxfW/+LC2dZ9pUn2U5puFee591KR+zsLU90jy/bpp06W4xQ2xLv+FZCZs5W09nD/LdsE9LDMBvn6wKIKIYIwv8K1B0P3FpCLSehOjltI3MaJyBW1XXzejHaeTv3IsAJdfmFIkIraHwO9Zih38ZLP4x910EGOw5of5i3zos2AvRPxZXrf3vLc15uspx5Dp92elU7rFyjruekGiZnxpbESO2I2262I3U2X3NoGDpDemuCDTUzZ3bGh5w==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "michal.orzel@xxxxxxx" <michal.orzel@xxxxxxx>, Doug Goldstein <cardoe@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • Delivery-date: Wed, 30 Nov 2022 16:14:33 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Thread-index: AQHZBLWCwuaJdzRhgku5EuukHQuC4a5XnPoAgAAHJwA=
  • Thread-topic: [PATCH v5 2/3] automation: Add a clean rule for containers

Hi Anthony,

> On 30 Nov 2022, at 15:48, Anthony PERARD <anthony.perard@xxxxxxxxxx> wrote:
> 
> On Wed, Nov 30, 2022 at 12:15:08PM +0000, Bertrand Marquis wrote:
>> --- a/automation/build/Makefile
>> +++ b/automation/build/Makefile
>> @@ -28,3 +28,13 @@ all: $(CONTAINERS)
>> clean:
>>      rm -f yocto/*.dockerfiles
>> 
>> +define CLEAN_RULE
>> +.PHONY: clean-$(1)
>> +clean-$(1):
>> +ifneq ($$(shell docker image ls -q $(REGISTRY)/$(subst /,:,$(1))),)
> 
> Please, don't use "ifneq" in a rule's recipe, especially when running a
> shell command. That shell command is evaluated every time make parse the
> makefile, so we are going to run `docker image ls` 23 times!
> 
> Just write the call to `docker image ls` and evaluate the result in
> shell. I guess something like:
>    [ "$(docker image ls -q ...)" ] && docker image rm ...

Very good point, I will fix that in v6.

Cheers
Bertrand

> 
> 
> Cheers,
> 
> -- 
> Anthony PERARD




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.