Message ID | 20200412131114.12749-1-sbabic@denx.de |
---|---|
State | Accepted |
Headers | show
Return-Path: <swupdate+bncBCXPLOXJ6IKRBJFHZT2AKGQED2KE37I@googlegroups.com> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4864:20::140; helo=mail-lf1-x140.google.com; envelope-from=swupdate+bncbcxploxj6ikrbjfhzt2akgqed2ke37i@googlegroups.com; receiver=<UNKNOWN>) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.a=rsa-sha256 header.s=20161025 header.b=PhfTGRKT; dkim-atps=neutral Received: from mail-lf1-x140.google.com (mail-lf1-x140.google.com [IPv6:2a00:1450:4864:20::140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 490XGN5zVHz9sSg for <incoming@patchwork.ozlabs.org>; Sun, 12 Apr 2020 23:12:11 +1000 (AEST) Received: by mail-lf1-x140.google.com with SMTP id y23sf2644036lfg.23 for <incoming@patchwork.ozlabs.org>; Sun, 12 Apr 2020 06:12:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1586697125; cv=pass; d=google.com; s=arc-20160816; b=0FPb7IafbJQC/jna+yFHePufUxkMhR+B4nkE7YGE7XjtJsu/ibvgQpK/IH4SdYPEsZ 0o2YfjxNE/JpKBaAglvgJ43uXS6SNDMfktEApik27OwQVHDYPuaOWpd/spgkkYuT3rE3 i8Faeu/L+HiHHBzl6F/NplEgGDMK/+9inzNY5LXTqHXjG/Iw6nHdHev7owJsMnqnapIn zVf9L96RMIKumLA4Fz1SYM3kNLi2oJ6XWRTXRaumyyPYw5Uzjd2s9tI8fbEwCIRuhoF+ I1uUwfTVzPml8QD80TIKj8874nw5BfnKLZXkKMCcQqPTg6ycTcHfnETTzAJfPcg1AOOb aOsA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:mime-version:message-id:date :subject:cc:to:from:sender:dkim-signature; bh=P7oe2P5HzpdXP/Q7GbitEDfiJaWAxhS1ZWlskWPAAqU=; b=izRkdteQ6biS/nxOduhFAnr0VB7IbiWCvG6jhPQat7UBst9IALUNxhaWWQyovethjF pcjnkKYB/242cWkg+GGy/KyOIWlMHPsksVIyOiMZl17xGgnnexKKlA/L4hHawbdpVze7 pDaUtNXGYWhRY955VSYnvlHHD1jTSjQUXFbKx8XYIVCTkfN4nkVF6E7yH56mGHBsDvQS w4BJQnoNORYIKmSg0njEI+qDiEkTmJ0CArfA/NMTIAHoemIwOhU2PtpgUq2MQko/uoKy APQTHJoscCxA1nZOah7ryMSi3aQwzlo50q8cMARc6GMZnmUhltSx06sVAtCbKxIDfd/8 zb+g== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=neutral (google.com: 2001:a60:0:28:0:1:25:1 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:mime-version :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=P7oe2P5HzpdXP/Q7GbitEDfiJaWAxhS1ZWlskWPAAqU=; b=PhfTGRKTkjSn/SUDxaNrsR2i+UmS55liSq50kbFdqoDps1rma7o9Y9Ye7uJutZ8bef foQkcF+MQS9IAnBrwa7b/rW0EgiZbS3/rDbDUuo+SSBub8ufg+sv+9HF0DE3QzknCYeC HCF8FuFGx1NvW3d1z1QYBZsZdeGmMfUXy9fnfh960Yn206r3zy/+kXZ/YKBoLrIJ6OAj VssuoCpRSy2KbKJnXfhhZJz9H57T8ScaQLPUkbtZqMuiM5zT/fVBgueIJjp7HM7bwUZJ +G+ubtgSKy2/fEqKNP2jVSib2ABt1BphOyY+clP5Z44T1TadTZYoYtUr6F1c8BG/ReJd KnEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:from:to:cc:subject:date:message-id :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=P7oe2P5HzpdXP/Q7GbitEDfiJaWAxhS1ZWlskWPAAqU=; b=keVZLH8QoW+bWMoz8mGYe2LU07wD8angOO7/tDHUZnF6jAOJmWkvkcd2RPj/zT9tLN 4hbJ0CPtEJ423LpR3khOkN5bPkDLFOePfY8T49PqRyjkDfTxnRw6jr1kiStLodVxbFfv M7CF9f2whWr1OkQO8e6CSbsUNOmUNuiieeweO93TU4wZFv9UUuTGAnS5/qBlkPw6wEUF l7XSZgSCyxCdeYlRWffQWvZi1ZZj0ZCG7Jt+SEsaGFWPvOJxTjEM6KXWcAuxmbWH0cFU ozopZWKZNRC+gHuqBBi57kUSq9+QnKLelh2dfImep3dLuBQIoiHyc2ImEsIi4tH8P3KK O8Bw== Sender: swupdate@googlegroups.com X-Gm-Message-State: AGi0PubgpTq7UbHnoNLTONEs1g4SvPkJqY00cl39CWjrAJyFWXapC5zH bKalmgwsI4z90DWmGO6vXRw= X-Google-Smtp-Source: APiQypL/mgpENfJEWDHDopLkHyPZhRubtQANvgwMXPM+vuJr1HKBBynOXUhO4tf6+Z+8aTozXeKeFA== X-Received: by 2002:a2e:870f:: with SMTP id m15mr8129397lji.16.1586697124980; Sun, 12 Apr 2020 06:12:04 -0700 (PDT) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a19:74f:: with SMTP id 76ls2384818lfh.0.gmail; Sun, 12 Apr 2020 06:12:04 -0700 (PDT) X-Received: by 2002:ac2:4da7:: with SMTP id h7mr7629962lfe.95.1586697124212; Sun, 12 Apr 2020 06:12:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586697124; cv=none; d=google.com; s=arc-20160816; b=FjG/YEtFtjHviYaZlDz4nvXIktiU5FeytHgPFre00R2xzkpWYgvMcg0asAlXK9R8EO TBVuJpv9oAq7S5DkSqLpYRfes9hCnDODldyMmjvCMur4kVm+4HCiLLZCDCefNQ8a/r0F aNnqCeamKC5FrWSH3vc9nqPWHEmA8wtiGJb1Sfakv7s5xFC76lSEOIUHxW1ooCHP3Bqn GIIkNbFKH8xeFl4EBXHBD3ZpwV2+8E+JH/gZyJm7hHTGvDJT+FcvLc0LjAb279RbOlWS 9vSNIVopdCtEDVyRLR6OYBGVGUp2LS2EaAM/tbe7C6hkTaYUQRvz7VqNdKqMJ0HYo86x CdgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from; bh=FBgY9hKCMXIifRBsQ229uH+pfAOgzhe9scte5a9lNdI=; b=pHeSM0zPcnGIc3HIEJlTfNae7NG26J1ARIfIk2xuwo8futVFEJA6kt1ALaTTBnnXTO +Il20fePpO0iPWaPJ/YBkP33y6ZpaeYXgE51zxtg7QMlwdsZJjHjb8IK4RoTNACp7fsU j1vBKMkJbxIR4+OXfLDNEJS8YS8Bw0tSy/zDZ9GyaTbyYISAwQ0xWBRE10vqijYsMDlX KA62ApBuSPIu0/24I38XIarv46jK2JmVRGc4OsJd4PR8n8E3LwOCL0C1NPERAp46LM11 GXeBrxux3dpgOU5l2iS5o01UOOAUpGGRvIuIG4GjzYXMXd8ZwBS73Z5V+D4RA3o8yySI YOIA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=neutral (google.com: 2001:a60:0:28:0:1:25:1 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de Received: from mail-out.m-online.net (mail-out.m-online.net. [2001:a60:0:28:0:1:25:1]) by gmr-mx.google.com with ESMTPS id a21si397155lfr.4.2020.04.12.06.12.04 for <swupdate@googlegroups.com> (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 12 Apr 2020 06:12:04 -0700 (PDT) Received-SPF: neutral (google.com: 2001:a60:0:28:0:1:25:1 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) client-ip=2001:a60:0:28:0:1:25:1; Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 490XGC3Hg2z1rqRQ; Sun, 12 Apr 2020 15:12:03 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 490XGC2wZLz1r0c9; Sun, 12 Apr 2020 15:12:03 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id e510ZBUY2G1Y; Sun, 12 Apr 2020 15:12:02 +0200 (CEST) Received: from babic.homelinux.org (host-88-217-136-221.customer.m-online.net [88.217.136.221]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPS; Sun, 12 Apr 2020 15:12:02 +0200 (CEST) Received: from localhost (mail.babic.homelinux.org [127.0.0.1]) by babic.homelinux.org (Postfix) with ESMTP id 4705B45405D1; Sun, 12 Apr 2020 15:12:02 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at babic.homelinux.org Received: from babic.homelinux.org ([IPv6:::1]) by localhost (mail.babic.homelinux.org [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id TvwyvQcmHY-A; Sun, 12 Apr 2020 15:11:15 +0200 (CEST) Received: from paperino.fritz.box (paperino.fritz.box [192.168.178.38]) by babic.homelinux.org (Postfix) with ESMTP id 51A3945403C6; Sun, 12 Apr 2020 15:11:15 +0200 (CEST) From: Stefano Babic <sbabic@denx.de> To: swupdate@googlegroups.com Cc: Stefano Babic <sbabic@denx.de> Subject: [swupdate] [PATCH] archive: support property "create-destination" Date: Sun, 12 Apr 2020 15:11:14 +0200 Message-Id: <20200412131114.12749-1-sbabic@denx.de> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-Original-Sender: sbabic@denx.de X-Original-Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 2001:a60:0:28:0:1:25:1 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: <swupdate.googlegroups.com> X-Spam-Checked-In-Group: swupdate@googlegroups.com X-Google-Group-Id: 605343134186 List-Post: <https://groups.google.com/group/swupdate/post>, <mailto:swupdate@googlegroups.com> List-Help: <https://groups.google.com/support/>, <mailto:swupdate+help@googlegroups.com> List-Archive: <https://groups.google.com/group/swupdate List-Subscribe: <https://groups.google.com/group/swupdate/subscribe>, <mailto:swupdate+subscribe@googlegroups.com> List-Unsubscribe: <mailto:googlegroups-manage+605343134186+unsubscribe@googlegroups.com>, <https://groups.google.com/group/swupdate/subscribe> |
Series |
archive: support property "create-destination"
|
expand
|
diff --git a/handlers/archive_handler.c b/handlers/archive_handler.c index b797277..f409ec5 100644 --- a/handlers/archive_handler.c +++ b/handlers/archive_handler.c @@ -246,6 +246,19 @@ static int install_archive_image(struct img_type *img, goto out; } + /* + * Check if path must be created + */ + char* make_path; + make_path = dict_get_value(&img->properties, "create-destination"); + if (make_path != NULL && strcmp(make_path, "true") == 0) { + ret = mkpath(path, 0755); + if (ret < 0) { + ERROR("I cannot create path %s: %s", path, strerror(errno)); + return -1; + } + } + /* * Change to directory where tarball must be extracted */
This property is already supported by eaw-handler, add it to the archive handler. If the directory where to extract te archive does not exist, create it if create-destination is set to "true" (properties are always strings). Signed-off-by: Stefano Babic <sbabic@denx.de> --- handlers/archive_handler.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)