From patchwork Mon Feb 12 10:56:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 1897685 X-Patchwork-Delegate: zajec5@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=YUikrDLq; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=m4atoFL2; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TYLzt4P14z23nM for ; Mon, 12 Feb 2024 21:58:50 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=MaPPuCUecMgGV/ItqktqiaOOaa4EUDSPQSXVRFbVRSM=; b=YUikrDLqyRW3xl 9Drbnz1f/bqAM0+wmdSTf9j6ghON5/uNEzMVC5I6eHBMewXUpRbF58Y6wPaTpKNoiGBanVLw7lMGs ADAFTgKPi2SxZ+lhDoUzul80ggUP2P274qseKVG4ytZNWm6tkX9p6bcbukMNDtyWZrHJkOVCCTtt/ OJf1L0X0LmFzrudMOlZbuJE5I/WJ3hkaWRYjRoYUlQnQYJlR056UqhsJoewJRtltkHzRxV1vl6rSV +rOWzFB9G8hvbXIfhbCYZ0WH7gVXD81cBVtMj6juh2nyqKBLnBS5Y1L1bE3fYD/Dwqpw735X/YoHi nogs803d4yEQD/cfwu+g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rZU0P-000000050O4-3vo2; Mon, 12 Feb 2024 10:57:45 +0000 Received: from mail-ed1-x52b.google.com ([2a00:1450:4864:20::52b]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rZU0N-000000050ND-1eaE for openwrt-devel@lists.openwrt.org; Mon, 12 Feb 2024 10:57:44 +0000 Received: by mail-ed1-x52b.google.com with SMTP id 4fb4d7f45d1cf-55a5e7fa471so3938848a12.1 for ; Mon, 12 Feb 2024 02:57:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707735461; x=1708340261; darn=lists.openwrt.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=ri/1z65F4/i7leLgN+8h/QcwIMM6I1swqTL/KqYq/mU=; b=m4atoFL2i2dhy0iC+eypnKlyjC5Y2FVCqqbQ4dAPSO0LeCRl6HG9bOh3cVsdZDC3v+ QriC0qXDnY5t6F49yB86+mGmEo9wKOzy+UtQks1PxjWFp712I8iSdOSJYKlkmu76B4DL 4c40d7cejLvKt9K6nThLJsCMcj351ZI87I2TP4w/mQ4jC+C3Au5o+a2RM/GRebq5iTzt cqkU2yHnm8064FPRHCFeVp4F81kQYiH9lkOYyR6UFnfKtm+T7URRWpFAsF/8ARrgO8cn 7KgbpzLtfmgW8A/MlrImTNGvulUodhpG5/F/CeIEiyUs+0n7wxFpfyE5zm1dp/pzgPev uoxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707735461; x=1708340261; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ri/1z65F4/i7leLgN+8h/QcwIMM6I1swqTL/KqYq/mU=; b=AI2s3YmQpeasuoKDQN17FU0KafxUTK9lzvd8PY3x+84gBW1B5Ycl2EyzgawOrGs9oA iPFzS+nhaWLccAB51JwTn0xkMN32EM52OekrhQ+piDCpD+Re0A9KbZZwqPHuO3961FI2 qdYxbr2+E+9UE4THKwQlfPyxL45PoDDJKu/gTdSCsMekrMBd/e4KIPjhamH/skeaKYFk ThuLBWe822UKO/WHykxXnpboNBtvZgaVOW4U5xmr447hAIsm10Vk1C+6CN99bgh5Kn6V fX0bRxQcUcwQoubvTRqcvhyKG5U5UbMUQ/W1JDJ5ETqfrjp6wuaEI9pb/Z4QxBTYbi/3 SnoQ== X-Gm-Message-State: AOJu0YyAJfp044Qh0QMP/PQDLg1fC+yHfHSmRf2WgUe9UdthyZgVXTjs UHv8/FxStTzsfwAURdTBoplbTCysv99zk2K02kAa98qFCJJs42O1ei2kSeIM X-Google-Smtp-Source: AGHT+IHVPbVAq1gnhUGW1o695Ru+x9AKfrXtwBKJVU1GbL4c0W65hcbPRUkNHv5DYuxvMiogayMYfA== X-Received: by 2002:a17:906:68cc:b0:a3c:908b:bb29 with SMTP id y12-20020a17090668cc00b00a3c908bbb29mr2271013ejr.6.1707735461378; Mon, 12 Feb 2024 02:57:41 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCUAG9vKlp87zEJGUzEaGKv7nA5vx66uflUygKVhTQ2puy2DIWnFYQLdju/qaNgAZsKfIzJ5OFBBjcZug5+4Z3XEKvYfua0Imp7GSA== Received: from localhost.lan (031011218106.poznan.vectranet.pl. [31.11.218.106]) by smtp.gmail.com with ESMTPSA id e2-20020a17090681c200b00a3c8f4bc31bsm91394ejx.38.2024.02.12.02.57.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 02:57:41 -0800 (PST) From: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= To: openwrt-devel@lists.openwrt.org Cc: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= Subject: [PATCH 1/5] base-files: sysupgrade: replace UMOUNT_ETCBACKUP_DIR with a local variable Date: Mon, 12 Feb 2024 11:56:57 +0100 Message-Id: <20240212105701.5812-1-zajec5@gmail.com> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240212_025743_463495_A754F19C X-CRM114-Status: GOOD ( 10.18 ) X-Spam-Score: 0.0 (/) X-Spam-Report: =?unknown-8bit?q?Spam_detection_software=2C_running_on_the_sy?= =?unknown-8bit?q?stem_=22bombadil=2Einfradead=2Eorg=22=2C?= =?unknown-8bit?q?_has_NOT_identified_this_incoming_email_as_spam=2E__The_ori?= =?unknown-8bit?q?ginal?= =?unknown-8bit?q?_message_has_been_attached_to_this_so_you_can_view_it_or_la?= =?unknown-8bit?q?bel?= =?unknown-8bit?q?_similar_future_email=2E__If_you_have_any_questions=2C_see?= =?unknown-8bit?q?_the_administrator_of_that_system_for_details=2E?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_Content_preview=3A__From=3A_Rafa=C5=82_Mi=C5=82ecki_It_was?= =?unknown-8bit?q?_used_inside_do=5Fsave=5Fconffiles=28=29?= =?unknown-8bit?q?_only=2E_Signed-off-by=3A_Rafa=C5=82_Mi=C5=82ecki_---_packa?= =?unknown-8bit?q?ge/base-files/files/sbin/sysupgrade?= =?unknown-8bit?q?_=7C_7_++++---_1_file_changed=2C_4_insertions=28+=29=2C_3_d?= =?unknown-8bit?q?eletions=28-=29_?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_Content_analysis_details=3A___=280=2E0_points=2C_5=2E0_req?= =?unknown-8bit?q?uired=29?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_pts_rule_name______________description?= =?unknown-8bit?q?_----_----------------------_------------------------------?= =?unknown-8bit?q?--------------------?= =?unknown-8bit?q?_-0=2E0_RCVD=5FIN=5FDNSWL=5FNONE_____RBL=3A_Sender_listed_a?= =?unknown-8bit?q?t_https=3A//www=2Ednswl=2Eorg/=2C_no?= =?unknown-8bit?q?_trust?= =?unknown-8bit?b?IFsyYTAwOjE0NTA6NDg2NDoyMDowOjA6MDo1MmIgbGlzdGVkIGluXQ==?= =?unknown-8bit?b?IFtsaXN0LmRuc3dsLm9yZ10=?= =?unknown-8bit?q?_-0=2E0_SPF=5FPASS_______________SPF=3A_sender_matches_SPF_?= =?unknown-8bit?q?record?= =?unknown-8bit?q?_0=2E0_SPF=5FHELO=5FNONE__________SPF=3A_HELO_does_not_publ?= =?unknown-8bit?q?ish_an_SPF_Record?= =?unknown-8bit?q?_-0=2E1_DKIM=5FVALID_____________Message_has_at_least_one_v?= =?unknown-8bit?q?alid_DKIM_or_DK_signature?= =?unknown-8bit?q?_-0=2E1_DKIM=5FVALID=5FAU__________Message_has_a_valid_DKIM?= =?unknown-8bit?q?_or_DK_signature_from_author=27s?= =?unknown-8bit?q?_domain?= =?unknown-8bit?q?_0=2E1_DKIM=5FSIGNED____________Message_has_a_DKIM_or_DK_si?= =?unknown-8bit?q?gnature=2C_not_necessarily_valid?= =?unknown-8bit?q?_-0=2E1_DKIM=5FVALID=5FEF__________Message_has_a_valid_DKIM?= =?unknown-8bit?q?_or_DK_signature_from?= =?unknown-8bit?q?_envelope-from_domain?= =?unknown-8bit?q?_0=2E2_FREEMAIL=5FENVFROM=5FEND=5FDIGIT_Envelope-from_freem?= =?unknown-8bit?q?ail_username_ends_in?= =?unknown-8bit?q?_digit?= =?unknown-8bit?q?_=5Bzajec5=28at=29gmail=2Ecom=5D?= =?unknown-8bit?q?_0=2E0_FREEMAIL=5FFROM__________Sender_email_is_commonly_ab?= =?unknown-8bit?q?used_enduser_mail_provider?= =?unknown-8bit?q?_=5Bzajec5=28at=29gmail=2Ecom=5D?= =?unknown-8bit?q?_-0=2E0_T=5FSCC=5FBODY=5FTEXT=5FLINE___No_description_avail?= =?unknown-8bit?q?able=2E?= X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org From: Rafał Miłecki It was used inside do_save_conffiles() only. Signed-off-by: Rafał Miłecki --- package/base-files/files/sbin/sysupgrade | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/package/base-files/files/sbin/sysupgrade b/package/base-files/files/sbin/sysupgrade index 9315091302..afcd868bae 100755 --- a/package/base-files/files/sbin/sysupgrade +++ b/package/base-files/files/sbin/sysupgrade @@ -24,7 +24,6 @@ export NEED_IMAGE= export HELP=0 export FORCE=0 export TEST=0 -export UMOUNT_ETCBACKUP_DIR=0 # parse options while [ -n "$1" ]; do @@ -225,6 +224,8 @@ include /lib/upgrade do_save_conffiles() { local conf_tar="$1" + local umount_etcbackup_dir=0 + [ "$(rootfs_type)" = "tmpfs" ] && { echo "Cannot save config while running from ramdisk." >&2 ask_bool 0 "Abort" && exit @@ -241,7 +242,7 @@ do_save_conffiles() { RAMFS="$(mktemp -d -t sysupgrade.XXXXXX)" mkdir -p "$RAMFS/upper" "$RAMFS/work" mount -t overlay overlay -o lowerdir=$ETCBACKUP_DIR,upperdir=$RAMFS/upper,workdir=$RAMFS/work $ETCBACKUP_DIR && - UMOUNT_ETCBACKUP_DIR=1 || { + umount_etcbackup_dir=1 || { echo "Cannot mount '$ETCBACKUP_DIR' as tmpfs to avoid touching disk while saving the list of installed packages." >&2 ask_bool 0 "Abort" && exit } @@ -264,7 +265,7 @@ do_save_conffiles() { exit 1 fi - [ "$UMOUNT_ETCBACKUP_DIR" -eq 1 ] && { + [ "$umount_etcbackup_dir" -eq 1 ] && { umount "$ETCBACKUP_DIR" rm -rf "$RAMFS" } From patchwork Mon Feb 12 10:56:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 1897687 X-Patchwork-Delegate: zajec5@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=Ag67wdMQ; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=eqBxtEjX; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TYLzt4qd4z23r3 for ; Mon, 12 Feb 2024 21:58:50 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=j37+jBiPEfHit3hkPPOr7SlmlUXKNbbaVGA5IS7GRog=; b=Ag67wdMQdeMPYy eA2VmtvzU5Ut9vkDmL+EGWNOdBpPlcjvxyKs38QyhkGgC1LgOQU86uv7vq7wVEdOmjj+GgzP1lBpw 5/aRbfNorYRQ2aeL9L8rHHKcgnpSg74ML2ab8OdodyyW7SRAfclwdnjxaQ62Yw40jTYQlFUXXJMCP hlrXu3qypAnjx1ULHogjra4FKnQXamEDY9EiWdI2ALEXIgFWMJQgvpJUqEtxnHX0+k/UeelsQ/12U KEubhMEBUFdPlExPbv5XrLFuYOi8seOXPsjD3oihwIFeQ6QN0/KaRwjvlreEVlY3BVQ5762onOTUP HJRrUCDHVlxY1b04tRqg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rZU0R-000000050OX-27Lj; Mon, 12 Feb 2024 10:57:47 +0000 Received: from mail-ed1-x52e.google.com ([2a00:1450:4864:20::52e]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rZU0P-000000050Ni-20XJ for openwrt-devel@lists.openwrt.org; Mon, 12 Feb 2024 10:57:46 +0000 Received: by mail-ed1-x52e.google.com with SMTP id 4fb4d7f45d1cf-55a5e7fa471so3938893a12.1 for ; Mon, 12 Feb 2024 02:57:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707735463; x=1708340263; darn=lists.openwrt.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=U/QEFeTrKRL4sHoIlZmkPS4ZOQXU1LUa7AElhpjTEzc=; b=eqBxtEjXbPN5z8mxNx+YviElkWV1ei3kO5+Gudjkr0H2Tk58EQhxV0dzw9B8dWKyq9 Dwxn8jagIRSHECIP9eirgTxIgPxAQty86SvRatuVL/oJGaghgV0bIWZszWEwLmeKUwId fY6YLxyz6UvJs5ExKdxH8WnXEElD8F8QH/9A6TUsR456/Is42nkTbN8JjekyBcKP/0HP JCIygk0GOcsF01awxNykbOhdkdNuwpL6eV1mvh5XsxXWO7XgNRfO1j3nfoAzWQVizl76 HSYHuvt3qWD+hHjTo4Sze8pOqa7Zxp46RREaih9wjfNcWFReyH2o5IwuRni7LHTEYDlA nAlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707735463; x=1708340263; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=U/QEFeTrKRL4sHoIlZmkPS4ZOQXU1LUa7AElhpjTEzc=; b=kAiNDPr5JhAsBb+R/0cQqJuCLLajx2gRYq1dWdPf9yNa5qBdnPHVPqLZL06ls8qsKv XHUalfLp2zsrO+LxmAbvGGlFqurCl05dZm54upbh6JBa2WGH9B4p7cj25Z3lr5dCJj2q f8QluWEkjHylRzHtjFPr4vzp8dkcY8LGxIL3A7QCL1Ql218AkUrYZIKe1gqyaO+gSjD+ ROo+TK5uh3hQhrMJRIKPR2D56S1BCVhaDOPZRm7Mwuavr8HUe4583lkr0TgedwZDXoLb wJy195ZGQTVbLKSCMn220G857IBKKAm9wej1pu+sivw8MIiQSOqOLJCPE6iF1InugDoT mZ3w== X-Gm-Message-State: AOJu0YwEpxyOdiJptGEW7Y1sh7LZMnUPbIhodXaoASBTsnVFoz05F2nQ 5vEB4PA05euMOmRZ7rsu++/Lg4DN8zar6u6lf4HIlcUoydOO4t70bHyOvn1F X-Google-Smtp-Source: AGHT+IFsuisfm9arL8kKW39C4bgxsYGuKBjYQ5NFPLrpAqB38sZtDjR47/7pUCcJfL1qEKWvNCk0UA== X-Received: by 2002:a17:906:b259:b0:a3c:6052:2f53 with SMTP id ce25-20020a170906b25900b00a3c60522f53mr2816683ejb.37.1707735463344; Mon, 12 Feb 2024 02:57:43 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCX84JHO8GJ3rDNTGa/FpFlx5qB3ltqOt7veBOyAC0ePoxAdW888eRDvm3C9Wd9ucdmMJ44j+nHtd0JR1ajdQMT6uZ7z/9lbXkMEXg== Received: from localhost.lan (031011218106.poznan.vectranet.pl. [31.11.218.106]) by smtp.gmail.com with ESMTPSA id e2-20020a17090681c200b00a3c8f4bc31bsm91394ejx.38.2024.02.12.02.57.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 02:57:43 -0800 (PST) From: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= To: openwrt-devel@lists.openwrt.org Cc: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= Subject: [PATCH 2/5] base-files: sysupgrade: group & cleanup global variables Date: Mon, 12 Feb 2024 11:56:58 +0100 Message-Id: <20240212105701.5812-2-zajec5@gmail.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240212105701.5812-1-zajec5@gmail.com> References: <20240212105701.5812-1-zajec5@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240212_025745_546385_5DAB9F2A X-CRM114-Status: UNSURE ( 8.72 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 1.7 (+) X-Spam-Report: =?unknown-8bit?q?Spam_detection_software=2C_running_on_the_sy?= =?unknown-8bit?q?stem_=22bombadil=2Einfradead=2Eorg=22=2C?= =?unknown-8bit?q?_has_NOT_identified_this_incoming_email_as_spam=2E__The_ori?= =?unknown-8bit?q?ginal?= =?unknown-8bit?q?_message_has_been_attached_to_this_so_you_can_view_it_or_la?= =?unknown-8bit?q?bel?= =?unknown-8bit?q?_similar_future_email=2E__If_you_have_any_questions=2C_see?= =?unknown-8bit?q?_the_administrator_of_that_system_for_details=2E?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_Content_preview=3A__From=3A_Rafa=C5=82_Mi=C5=82ecki_Group_?= =?unknown-8bit?q?=26_describe_them_by_type=2C_drop?= =?unknown-8bit?q?_unneeded_exports=2E_Signed-off-by=3A_Rafa=C5=82_Mi=C5=82ec?= =?unknown-8bit?q?ki_---_package/base-files/files/sbin/sysupgrade?= =?unknown-8bit?q?_=7C_64_++++++++++++_1_file_changed=2C_33_insertions=28+=29?= =?unknown-8bit?q?=2C_31_deletions=28-=29_?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_Content_analysis_details=3A___=281=2E7_points=2C_5=2E0_req?= =?unknown-8bit?q?uired=29?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_pts_rule_name______________description?= =?unknown-8bit?q?_----_----------------------_------------------------------?= =?unknown-8bit?q?--------------------?= =?unknown-8bit?q?_-0=2E0_RCVD=5FIN=5FDNSWL=5FNONE_____RBL=3A_Sender_listed_a?= =?unknown-8bit?q?t_https=3A//www=2Ednswl=2Eorg/=2C_no?= =?unknown-8bit?q?_trust?= =?unknown-8bit?b?IFsyYTAwOjE0NTA6NDg2NDoyMDowOjA6MDo1MmUgbGlzdGVkIGluXQ==?= =?unknown-8bit?b?IFtsaXN0LmRuc3dsLm9yZ10=?= =?unknown-8bit?q?_1=2E7_URIBL=5FBLACK____________Contains_an_URL_listed_in_t?= =?unknown-8bit?q?he_URIBL_blacklist?= =?unknown-8bit?b?IFtVUkk6IHN5c3RlbS5zaF0=?= =?unknown-8bit?q?_-0=2E0_SPF=5FPASS_______________SPF=3A_sender_matches_SPF_?= =?unknown-8bit?q?record?= =?unknown-8bit?q?_0=2E0_SPF=5FHELO=5FNONE__________SPF=3A_HELO_does_not_publ?= =?unknown-8bit?q?ish_an_SPF_Record?= =?unknown-8bit?q?_-0=2E1_DKIM=5FVALID_____________Message_has_at_least_one_v?= =?unknown-8bit?q?alid_DKIM_or_DK_signature?= =?unknown-8bit?q?_-0=2E1_DKIM=5FVALID=5FAU__________Message_has_a_valid_DKIM?= =?unknown-8bit?q?_or_DK_signature_from_author=27s?= =?unknown-8bit?q?_domain?= =?unknown-8bit?q?_0=2E1_DKIM=5FSIGNED____________Message_has_a_DKIM_or_DK_si?= =?unknown-8bit?q?gnature=2C_not_necessarily_valid?= =?unknown-8bit?q?_-0=2E1_DKIM=5FVALID=5FEF__________Message_has_a_valid_DKIM?= =?unknown-8bit?q?_or_DK_signature_from?= =?unknown-8bit?q?_envelope-from_domain?= =?unknown-8bit?q?_0=2E2_FREEMAIL=5FENVFROM=5FEND=5FDIGIT_Envelope-from_freem?= =?unknown-8bit?q?ail_username_ends_in?= =?unknown-8bit?q?_digit?= =?unknown-8bit?q?_=5Bzajec5=28at=29gmail=2Ecom=5D?= =?unknown-8bit?q?_0=2E0_FREEMAIL=5FFROM__________Sender_email_is_commonly_ab?= =?unknown-8bit?q?used_enduser_mail_provider?= =?unknown-8bit?q?_=5Bzajec5=28at=29gmail=2Ecom=5D?= =?unknown-8bit?q?_-0=2E0_T=5FSCC=5FBODY=5FTEXT=5FLINE___No_description_avail?= =?unknown-8bit?q?able=2E?= X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org From: Rafał Miłecki Group & describe them by type, drop unneeded exports. Signed-off-by: Rafał Miłecki --- package/base-files/files/sbin/sysupgrade | 64 ++++++++++++------------ 1 file changed, 33 insertions(+), 31 deletions(-) diff --git a/package/base-files/files/sbin/sysupgrade b/package/base-files/files/sbin/sysupgrade index afcd868bae..38dda3b9a4 100755 --- a/package/base-files/files/sbin/sysupgrade +++ b/package/base-files/files/sbin/sysupgrade @@ -4,26 +4,35 @@ . /lib/functions/system.sh . /usr/share/libubox/jshn.sh -# initialize defaults +# File-local constants +CONF_TAR=/tmp/sysupgrade.tgz +ETCBACKUP_DIR=/etc/backup +INSTALLED_PACKAGES=${ETCBACKUP_DIR}/installed_packages.txt +COMMAND=/lib/upgrade/do_stage2 + +# File-local globals +SAVE_OVERLAY=0 +SAVE_OVERLAY_PATH= +SAVE_PARTITIONS=1 +SAVE_INSTALLED_PKGS=0 +SKIP_UNCHANGED=0 +CONF_IMAGE= +CONF_BACKUP_LIST=0 +CONF_BACKUP= +CONF_RESTORE= +NEED_IMAGE= +HELP=0 +TEST=0 + +# Globals accessed in other files export MTD_ARGS="" export MTD_CONFIG_ARGS="" export INTERACTIVE=0 export VERBOSE=1 export SAVE_CONFIG=1 -export SAVE_OVERLAY=0 -export SAVE_OVERLAY_PATH= -export SAVE_PARTITIONS=1 -export SAVE_INSTALLED_PKGS=0 -export SKIP_UNCHANGED=0 -export CONF_IMAGE= -export CONF_BACKUP_LIST=0 -export CONF_BACKUP= -export CONF_RESTORE= export IGNORE_MINOR_COMPAT=0 -export NEED_IMAGE= -export HELP=0 export FORCE=0 -export TEST=0 +export CONFFILES=/tmp/sysupgrade.conffiles # parse options while [ -n "$1" ]; do @@ -32,18 +41,18 @@ while [ -n "$1" ]; do -v) export VERBOSE="$(($VERBOSE + 1))";; -q) export VERBOSE="$(($VERBOSE - 1))";; -n) export SAVE_CONFIG=0;; - -c) export SAVE_OVERLAY=1 SAVE_OVERLAY_PATH=/etc;; - -o) export SAVE_OVERLAY=1 SAVE_OVERLAY_PATH=/;; - -p) export SAVE_PARTITIONS=0;; - -k) export SAVE_INSTALLED_PKGS=1;; - -u) export SKIP_UNCHANGED=1;; - -b|--create-backup) export CONF_BACKUP="$2" NEED_IMAGE=1; shift;; - -r|--restore-backup) export CONF_RESTORE="$2" NEED_IMAGE=1; shift;; - -l|--list-backup) export CONF_BACKUP_LIST=1;; - -f) export CONF_IMAGE="$2"; shift;; + -c) SAVE_OVERLAY=1 SAVE_OVERLAY_PATH=/etc;; + -o) SAVE_OVERLAY=1 SAVE_OVERLAY_PATH=/;; + -p) SAVE_PARTITIONS=0;; + -k) SAVE_INSTALLED_PKGS=1;; + -u) SKIP_UNCHANGED=1;; + -b|--create-backup) CONF_BACKUP="$2" NEED_IMAGE=1; shift;; + -r|--restore-backup) CONF_RESTORE="$2" NEED_IMAGE=1; shift;; + -l|--list-backup) CONF_BACKUP_LIST=1;; + -f) CONF_IMAGE="$2"; shift;; -F|--force) export FORCE=1;; - -T|--test) export TEST=1;; - -h|--help) export HELP=1; break;; + -T|--test) TEST=1;; + -h|--help) HELP=1; break;; --ignore-minor-compat-version) export IGNORE_MINOR_COMPAT=1;; -*) echo "Invalid option: $1" >&2 @@ -54,11 +63,6 @@ while [ -n "$1" ]; do shift; done -export CONFFILES=/tmp/sysupgrade.conffiles -export CONF_TAR=/tmp/sysupgrade.tgz -export ETCBACKUP_DIR=/etc/backup -export INSTALLED_PACKAGES=${ETCBACKUP_DIR}/installed_packages.txt - IMAGE="$1" [ -z "$IMAGE" -a -z "$NEED_IMAGE" -a $CONF_BACKUP_LIST -eq 0 -o $HELP -gt 0 ] && { @@ -365,8 +369,6 @@ fi install_bin /sbin/upgraded v "Commencing upgrade. Closing all shell sessions." -COMMAND='/lib/upgrade/do_stage2' - if [ -n "$FAILSAFE" ]; then printf '%s\x00%s\x00%s' "$RAM_ROOT" "$IMAGE" "$COMMAND" >/tmp/sysupgrade lock -u /tmp/.failsafe From patchwork Mon Feb 12 10:56:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 1897689 X-Patchwork-Delegate: zajec5@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=RoOncdp/; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=BfwpBPH4; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TYLzv6gyNz23nM for ; Mon, 12 Feb 2024 21:58:51 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=oeRdYUZLPIk3bD2jd9lF6GQnNmaO9OkB367n9b0/ERw=; b=RoOncdp/yqceXw xhU2ww4J3DxA0KC8TuwR6+6QmJW+GGoZhxUz92a3duFkVIdgW3h1A+taIqNqjUftIRoLd05gMRDMk 9VDkgLrbfEXd/G12EleC+vGvRnpFZe82y9dITcNG/fLuAIKWR+QVuoqqzbEDpom/fZKM7Bg7CNlHu VMGVzB6dhy/rhn4Z1jRkWamW4/5I+9R/1VXrYyHn2gAdOp5jUHzPvIK5S5CyeRbM7BkNVPUHxtwuO LfJEvNUDwoNbfudVxU+HREs4cg2Chj0q2X0yPUwnyTtAwXENRt2POfmnsxID8rzGdvGQzsjgDNtSw MH/RutxZ5F3E28Jax6yA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rZU0T-000000050Ov-0Cqi; Mon, 12 Feb 2024 10:57:49 +0000 Received: from mail-ej1-x631.google.com ([2a00:1450:4864:20::631]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rZU0Q-000000050O0-2B3g for openwrt-devel@lists.openwrt.org; Mon, 12 Feb 2024 10:57:47 +0000 Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-a2f22bfb4e6so404731666b.0 for ; Mon, 12 Feb 2024 02:57:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707735465; x=1708340265; darn=lists.openwrt.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=LPuHK8AURgP3qqGBJBp60FImewPA5UGYcm1BX3N3wIk=; b=BfwpBPH4n0x4n4Gicc8MzuHvxQzEx1lMLuqNO3BU31h2LtbQVegbxkmOdTMjWR7ksH 5VBQX2TNhIuM2uOJkjSr3c86x/V1jLstPq7XWDDsdJPDJmHr5ApAcbeH46Hjcp6aJa1A ttkfwuY8Y5kXE1gyPspkx4PLypbj4PJtd+C+MjO8hA5Ro1wZOzKHt2Ht3ovTh/l8kUG9 5b7mcQe8gd/DPaUu6W/ASjMLVupx3rGILIsHK9lmJkyzclJslKBdTtqhhK8Nq27XZb0V PdzzxklQw6zWSMWQDADoEf8UAVccU4jN4cR4p9004Z1fyRadh60hnpnsiooLQZG/T92k +gbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707735465; x=1708340265; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LPuHK8AURgP3qqGBJBp60FImewPA5UGYcm1BX3N3wIk=; b=G4WgZkPlo1UtaAQRjOn1cxbUsjMKd0K7X9itrcd3FIWv508IrUoBeuH1eSXbCuNRAw V8X7nGl9q4pl8t6B79Yo9N9p2L2U7Sfq9s5O2oL9hqlIHFfm9hAxgd/5pPY5NzL+g4Xg A4Y+doFHXfdumg0Qpd7ngBZhQX8e4f8wGRcB9oz+uswi5Ke/eGs9b2iAfbjNmiqFeJIZ Qb4r9v7hR+qogND2zlS+r8ZPazLX3xTjenNdBl70pQliBtlZccIlpi0a5XonqWEm8Dly RMkN0vQ2jM9Q/EW4jbPqqdnZavXduNiHTmYQ/FDURUs72TuUC9daPT4Ki3Q+r2Ckanhc eepg== X-Gm-Message-State: AOJu0YwxgLx3at/EQfVixh6gd8fODZQsqlcKs6R8oxji3BwUPz6TsrNc Ax4knzGP7p0sz85M5Lc+xEu+0Q2VpucXqTXudmfznZunfHOYgmuE/eKFN9/L X-Google-Smtp-Source: AGHT+IEGQtIaW5FYAmUf1kCgqDZU4RcLESspVxwrpB1e+OzD4GOK3cCMe6hyhuq5ot/kSdJUhw/Chw== X-Received: by 2002:a17:906:d118:b0:a3c:98aa:5ad1 with SMTP id b24-20020a170906d11800b00a3c98aa5ad1mr1787327ejz.56.1707735464844; Mon, 12 Feb 2024 02:57:44 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCUR8q8yk6AYCR5x4fTKqA/HHythemfSyvz0juOgHhmBZbO4jybC/qiLIHYszuPhLPw6FtM2tc8PyDASctwyCH1Qjnv9YmVrjBC7oQ== Received: from localhost.lan (031011218106.poznan.vectranet.pl. [31.11.218.106]) by smtp.gmail.com with ESMTPSA id e2-20020a17090681c200b00a3c8f4bc31bsm91394ejx.38.2024.02.12.02.57.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 02:57:44 -0800 (PST) From: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= To: openwrt-devel@lists.openwrt.org Cc: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= Subject: [PATCH 3/5] base-files: sysupgrade: exit with no error for --help Date: Mon, 12 Feb 2024 11:56:59 +0100 Message-Id: <20240212105701.5812-3-zajec5@gmail.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240212105701.5812-1-zajec5@gmail.com> References: <20240212105701.5812-1-zajec5@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240212_025746_587316_67720E99 X-CRM114-Status: GOOD ( 10.40 ) X-Spam-Score: 0.0 (/) X-Spam-Report: =?unknown-8bit?q?Spam_detection_software=2C_running_on_the_sy?= =?unknown-8bit?q?stem_=22bombadil=2Einfradead=2Eorg=22=2C?= =?unknown-8bit?q?_has_NOT_identified_this_incoming_email_as_spam=2E__The_ori?= =?unknown-8bit?q?ginal?= =?unknown-8bit?q?_message_has_been_attached_to_this_so_you_can_view_it_or_la?= =?unknown-8bit?q?bel?= =?unknown-8bit?q?_similar_future_email=2E__If_you_have_any_questions=2C_see?= =?unknown-8bit?q?_the_administrator_of_that_system_for_details=2E?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_Content_preview=3A__From=3A_Rafa=C5=82_Mi=C5=82ecki_Callin?= =?unknown-8bit?q?g_=22sysupgrade_--help=22_should_result?= =?unknown-8bit?q?_in_printing_help_and_exiting_with_0_code=2E_Signed-off-by?= =?unknown-8bit?q?=3A_Rafa=C5=82_Mi=C5=82ecki?= =?unknown-8bit?q?_---_package/base-files/files/sbin/sysupgrade_=7C_17_++++++?= =?unknown-8bit?q?+++++++----_1_file?= =?unknown-8bit?q?_changed=2C_13_insertions=28+=29=2C_4_deletions=28-=29_?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_Content_analysis_details=3A___=280=2E0_points=2C_5=2E0_req?= =?unknown-8bit?q?uired=29?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_pts_rule_name______________description?= =?unknown-8bit?q?_----_----------------------_------------------------------?= =?unknown-8bit?q?--------------------?= =?unknown-8bit?q?_-0=2E0_RCVD=5FIN=5FDNSWL=5FNONE_____RBL=3A_Sender_listed_a?= =?unknown-8bit?q?t_https=3A//www=2Ednswl=2Eorg/=2C_no?= =?unknown-8bit?q?_trust?= =?unknown-8bit?b?IFsyYTAwOjE0NTA6NDg2NDoyMDowOjA6MDo2MzEgbGlzdGVkIGluXQ==?= =?unknown-8bit?b?IFtsaXN0LmRuc3dsLm9yZ10=?= =?unknown-8bit?q?_-0=2E0_SPF=5FPASS_______________SPF=3A_sender_matches_SPF_?= =?unknown-8bit?q?record?= =?unknown-8bit?q?_0=2E0_SPF=5FHELO=5FNONE__________SPF=3A_HELO_does_not_publ?= =?unknown-8bit?q?ish_an_SPF_Record?= =?unknown-8bit?q?_-0=2E1_DKIM=5FVALID_____________Message_has_at_least_one_v?= =?unknown-8bit?q?alid_DKIM_or_DK_signature?= =?unknown-8bit?q?_-0=2E1_DKIM=5FVALID=5FAU__________Message_has_a_valid_DKIM?= =?unknown-8bit?q?_or_DK_signature_from_author=27s?= =?unknown-8bit?q?_domain?= =?unknown-8bit?q?_0=2E1_DKIM=5FSIGNED____________Message_has_a_DKIM_or_DK_si?= =?unknown-8bit?q?gnature=2C_not_necessarily_valid?= =?unknown-8bit?q?_-0=2E1_DKIM=5FVALID=5FEF__________Message_has_a_valid_DKIM?= =?unknown-8bit?q?_or_DK_signature_from?= =?unknown-8bit?q?_envelope-from_domain?= =?unknown-8bit?q?_0=2E2_FREEMAIL=5FENVFROM=5FEND=5FDIGIT_Envelope-from_freem?= =?unknown-8bit?q?ail_username_ends_in?= =?unknown-8bit?q?_digit?= =?unknown-8bit?q?_=5Bzajec5=28at=29gmail=2Ecom=5D?= =?unknown-8bit?q?_0=2E0_FREEMAIL=5FFROM__________Sender_email_is_commonly_ab?= =?unknown-8bit?q?used_enduser_mail_provider?= =?unknown-8bit?q?_=5Bzajec5=28at=29gmail=2Ecom=5D?= =?unknown-8bit?q?_-0=2E0_T=5FSCC=5FBODY=5FTEXT=5FLINE___No_description_avail?= =?unknown-8bit?q?able=2E?= X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org From: Rafał Miłecki Calling "sysupgrade --help" should result in printing help and exiting with 0 code. Signed-off-by: Rafał Miłecki --- package/base-files/files/sbin/sysupgrade | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/package/base-files/files/sbin/sysupgrade b/package/base-files/files/sbin/sysupgrade index 38dda3b9a4..f5a4441dc9 100755 --- a/package/base-files/files/sbin/sysupgrade +++ b/package/base-files/files/sbin/sysupgrade @@ -63,9 +63,7 @@ while [ -n "$1" ]; do shift; done -IMAGE="$1" - -[ -z "$IMAGE" -a -z "$NEED_IMAGE" -a $CONF_BACKUP_LIST -eq 0 -o $HELP -gt 0 ] && { +print_help() { cat <...] $0 [-q] [-i] [-c] [-u] [-o] [-k] @@ -105,9 +103,20 @@ backup-command: sysupgrade -b. Does not create a backup file. EOF - exit 1 } +IMAGE="$1" + +if [ $HELP -gt 0 ]; then + print_help + exit 0 +fi + +if [ -z "$IMAGE" -a -z "$NEED_IMAGE" -a $CONF_BACKUP_LIST -eq 0 ]; then + print_help + exit 1 +fi + [ -n "$IMAGE" -a -n "$NEED_IMAGE" ] && { cat <<-EOF -b|--create-backup and -r|--restore-backup do not perform a firmware upgrade. From patchwork Mon Feb 12 10:57:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 1897688 X-Patchwork-Delegate: zajec5@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=x/lHwh41; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=VPhdp6JY; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TYLzv5KYnz23hw for ; Mon, 12 Feb 2024 21:58:51 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=7ZwRX04qf11Xa/IHFBPzgu54CXFgv5y/zNqdZr89qj8=; b=x/lHwh41dlSD97 wFhrsuU9dBtMvVK6FHH7YKfjOM8TQEDvUAbKguFEK156RY3hur73JrtlrOaNeZK8dLIL1TseNelOp qQSSqSNTWqU7soXxv3HhT6bN0x6lXxWIviuII7hMQWYa9rqtrFx32lplHVYOzmS1MDVT5Cnc9LkNu c6kBelQdquTdD/lB/T+OOxQsCcNl26ALnkVT3Iks1gaU/CG1rgHdfdPumn0esPEeGYODHnNxgWP5S K2DiZ9VliMwo5RF0pp60mRF8CKx28sJ4X0ySNuto185yQKF8MECZPFaNm9xabs8fhV+JLXhN6RrKE WG3wmWzZGFd63kSBHBoQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rZU0W-000000050QC-2YZg; Mon, 12 Feb 2024 10:57:52 +0000 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rZU0T-000000050Oh-09pm for openwrt-devel@lists.openwrt.org; Mon, 12 Feb 2024 10:57:50 +0000 Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-55790581457so4645626a12.3 for ; Mon, 12 Feb 2024 02:57:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707735467; x=1708340267; darn=lists.openwrt.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=H611WmUd5z5weMSS1qyN8+TT9ITlfWTV3msxYLN1d0c=; b=VPhdp6JY7enIGdqiycYIVckhVnMBIK/NHAKF6vQJUlGDrnYGSwwhQQkOwrRodmwm3r 6QPNaM4Q2/WFCtXlAFhW7ZIl8oD2xjs4Is3IMBO8MMaRDNl3xhY2rDHxlFpdCM2uyojQ wkcQo5bB+CiAMGTRalw6lsNkzITDNH8BYOKeTQHn21hGKQKnimNlt52w9SQOLTvt25ku 3zmQcVpOlVd5DLxruDlBYH27FlTWDcPLGbEJ7QujnmrUuw70xpXCUZ/ht5TLCuHogeK9 jkfiPgXVugTRsnV6TKKVwAGrhP4kP0BVucg/jqfdgA1Isk7q1nRAOy7R4jSPaxNdXkRL vHRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707735467; x=1708340267; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=H611WmUd5z5weMSS1qyN8+TT9ITlfWTV3msxYLN1d0c=; b=WLZxtAdwIYAaPvljIxY9PSYXc9PpIXQZ90aCR5esnxxOVSR8ZCx2sHIn4+xboQt1ix f+ep5CAunQJd8RDrSaBAhSoAiq2uaT8zDk9q+qjMtl5BbNkO6Q4pBkE6VAc7vSebZREw +3TC+0qI4Xx1QKKMLAgrw3HJLZkndw3+8mIKosKma3Nmz+dQnPfcPNrYjUZ+QA0Rc6b7 fUqiTZapDpmQMtuNDFHcCFe5COIXubwndtqjB0vz5qwmCjaTFTB8OqMuMpc+pr0xbBGF Vaj1dCUdo1heIlFRjEPe84Mv/J7kSG9wQJ5v1f/nRfjIbs0bz2Ogg3VG9xluObbU/iS4 rK2Q== X-Gm-Message-State: AOJu0YzSjLBvQY8lRJ1nWSSHWyeFG7viigkmpyPMNKli9dEwLETUlwb5 MS3e8ytaE1SF3JVlVLL108eCkJYW8TlnPxUIOpHo5m8oy3Nl6f6ZTsAwhMuI X-Google-Smtp-Source: AGHT+IHeikFYVgp6tLf7pPu81AtqwQZZAZ4oMWo19URar2L3uczUN6Wv9DGH3TGFgbAyK2ZO/1Svzw== X-Received: by 2002:a17:906:af94:b0:a38:970a:75df with SMTP id mj20-20020a170906af9400b00a38970a75dfmr4783948ejb.15.1707735466073; Mon, 12 Feb 2024 02:57:46 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCV6Ozd1QUkMMM8WUlAwi8IbhwDRbBcl390xhVp5pGpWpxYKyQPQN2gnx7ZqqI0ywCo5bgq/Viax/Gu32eOaCyp4PcqsLCpoK6HtYw== Received: from localhost.lan (031011218106.poznan.vectranet.pl. [31.11.218.106]) by smtp.gmail.com with ESMTPSA id e2-20020a17090681c200b00a3c8f4bc31bsm91394ejx.38.2024.02.12.02.57.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 02:57:45 -0800 (PST) From: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= To: openwrt-devel@lists.openwrt.org Cc: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= Subject: [PATCH 4/5] base-files: sysupgrade: s/do_save_conffiles/create_backup_archive/ Date: Mon, 12 Feb 2024 11:57:00 +0100 Message-Id: <20240212105701.5812-4-zajec5@gmail.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240212105701.5812-1-zajec5@gmail.com> References: <20240212105701.5812-1-zajec5@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240212_025749_107233_58529EBF X-CRM114-Status: GOOD ( 10.05 ) X-Spam-Score: 0.0 (/) X-Spam-Report: =?unknown-8bit?q?Spam_detection_software=2C_running_on_the_sy?= =?unknown-8bit?q?stem_=22bombadil=2Einfradead=2Eorg=22=2C?= =?unknown-8bit?q?_has_NOT_identified_this_incoming_email_as_spam=2E__The_ori?= =?unknown-8bit?q?ginal?= =?unknown-8bit?q?_message_has_been_attached_to_this_so_you_can_view_it_or_la?= =?unknown-8bit?q?bel?= =?unknown-8bit?q?_similar_future_email=2E__If_you_have_any_questions=2C_see?= =?unknown-8bit?q?_the_administrator_of_that_system_for_details=2E?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_Content_preview=3A__From=3A_Rafa=C5=82_Mi=C5=82ecki_Rename?= =?unknown-8bit?q?_function_to_more_accurate_and?= =?unknown-8bit?q?_self-explanatory_name=3A_1=2E_Use_=22archive=22_in_name_as?= =?unknown-8bit?q?_this_functions_creates?= =?unknown-8bit?q?_tar_archive_2=2E_Avoid_=22conffiles=22_as_this_function_ma?= =?unknown-8bit?q?y_archive_more_than_that?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_Content_analysis_details=3A___=280=2E0_points=2C_5=2E0_req?= =?unknown-8bit?q?uired=29?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_pts_rule_name______________description?= =?unknown-8bit?q?_----_----------------------_------------------------------?= =?unknown-8bit?q?--------------------?= =?unknown-8bit?q?_-0=2E0_RCVD=5FIN=5FDNSWL=5FNONE_____RBL=3A_Sender_listed_a?= =?unknown-8bit?q?t_https=3A//www=2Ednswl=2Eorg/=2C_no?= =?unknown-8bit?q?_trust?= =?unknown-8bit?b?IFsyYTAwOjE0NTA6NDg2NDoyMDowOjA6MDo1MzMgbGlzdGVkIGluXQ==?= =?unknown-8bit?b?IFtsaXN0LmRuc3dsLm9yZ10=?= =?unknown-8bit?q?_-0=2E0_SPF=5FPASS_______________SPF=3A_sender_matches_SPF_?= =?unknown-8bit?q?record?= =?unknown-8bit?q?_0=2E0_SPF=5FHELO=5FNONE__________SPF=3A_HELO_does_not_publ?= =?unknown-8bit?q?ish_an_SPF_Record?= =?unknown-8bit?q?_-0=2E1_DKIM=5FVALID_____________Message_has_at_least_one_v?= =?unknown-8bit?q?alid_DKIM_or_DK_signature?= =?unknown-8bit?q?_-0=2E1_DKIM=5FVALID=5FAU__________Message_has_a_valid_DKIM?= =?unknown-8bit?q?_or_DK_signature_from_author=27s?= =?unknown-8bit?q?_domain?= =?unknown-8bit?q?_0=2E1_DKIM=5FSIGNED____________Message_has_a_DKIM_or_DK_si?= =?unknown-8bit?q?gnature=2C_not_necessarily_valid?= =?unknown-8bit?q?_-0=2E1_DKIM=5FVALID=5FEF__________Message_has_a_valid_DKIM?= =?unknown-8bit?q?_or_DK_signature_from?= =?unknown-8bit?q?_envelope-from_domain?= =?unknown-8bit?q?_0=2E2_FREEMAIL=5FENVFROM=5FEND=5FDIGIT_Envelope-from_freem?= =?unknown-8bit?q?ail_username_ends_in?= =?unknown-8bit?q?_digit?= =?unknown-8bit?q?_=5Bzajec5=28at=29gmail=2Ecom=5D?= =?unknown-8bit?q?_0=2E0_FREEMAIL=5FFROM__________Sender_email_is_commonly_ab?= =?unknown-8bit?q?used_enduser_mail_provider?= =?unknown-8bit?q?_=5Bzajec5=28at=29gmail=2Ecom=5D?= =?unknown-8bit?q?_-0=2E0_T=5FSCC=5FBODY=5FTEXT=5FLINE___No_description_avail?= =?unknown-8bit?q?able=2E?= X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org From: Rafał Miłecki Rename function to more accurate and self-explanatory name: 1. Use "archive" in name as this functions creates tar archive 2. Avoid "conffiles" as this function may archive more than that Signed-off-by: Rafał Miłecki --- package/base-files/files/sbin/sysupgrade | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/base-files/files/sbin/sysupgrade b/package/base-files/files/sbin/sysupgrade index f5a4441dc9..e7de1f3446 100755 --- a/package/base-files/files/sbin/sysupgrade +++ b/package/base-files/files/sbin/sysupgrade @@ -234,7 +234,7 @@ fi include /lib/upgrade -do_save_conffiles() { +create_backup_archive() { local conf_tar="$1" local umount_etcbackup_dir=0 @@ -294,7 +294,7 @@ if [ $CONF_BACKUP_LIST -eq 1 ]; then fi if [ -n "$CONF_BACKUP" ]; then - do_save_conffiles "$CONF_BACKUP" + create_backup_archive "$CONF_BACKUP" exit $? fi @@ -364,7 +364,7 @@ if [ -n "$CONF_IMAGE" ]; then get_image "$CONF_IMAGE" "cat" > "$CONF_TAR" export SAVE_CONFIG=1 elif ask_bool $SAVE_CONFIG "Keep config files over reflash"; then - [ $TEST -eq 1 ] || do_save_conffiles "$CONF_TAR" + [ $TEST -eq 1 ] || create_backup_archive "$CONF_TAR" export SAVE_CONFIG=1 else [ $TEST -eq 1 ] || rm -f "$CONF_TAR" From patchwork Mon Feb 12 10:57:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 1897686 X-Patchwork-Delegate: zajec5@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=lMMorCkL; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=koq25mNZ; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TYLzt4KqQz23hw for ; Mon, 12 Feb 2024 21:58:49 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=tjM/0vMQh2l/h7us+dQshz+7YlmSxbd+VE4M1qPRP3U=; b=lMMorCkLMeESh+ zq108QC1K8IJYl0hAyY0lVhzCHfYypsB2vNhMJ64Hd/IS7hy181GqiOWNOlTzj5NLtM9wzkl2hkZ1 3mAMolJ7sQ1QkyCNpth81ROnf9hRihopD3s40SiuqPgUmTId1dBuIDQiiTLe73dNK/fl4/6HqcPYi peZGfT1ZojmhO0GxkalF+Hw3fpRNHvNrVg0X242+dtUVRgNqGhEVEBls3eOpekbsSt8RhfQEBvCv9 +zz3aITV0EEV5qDYPcSyzHCVd7YsHpA4YoXRGBwviO61BvtNxzPG3ovhpDQDbOycEEXWbk4w6QDif FA6+cUlcijyKoNIbm4WA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rZU0Y-000000050Qc-23x7; Mon, 12 Feb 2024 10:57:54 +0000 Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rZU0U-000000050PH-0pbA for openwrt-devel@lists.openwrt.org; Mon, 12 Feb 2024 10:57:51 +0000 Received: by mail-ed1-x530.google.com with SMTP id 4fb4d7f45d1cf-55a179f5fa1so4002689a12.0 for ; Mon, 12 Feb 2024 02:57:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707735469; x=1708340269; darn=lists.openwrt.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4HjQZ3s96np4wR6yO+y54ychE2u5IfTueXcuWRKUyK0=; b=koq25mNZdBIXj/eymFVrZD7WNSRayXcMg3FZlipNsQnD0Rm2ywano3fCaOZXdwiiZy yUE8VJut49s4r9ZteQtXDmvd7+zs/U5qcOpKzUENmw+3ZfHMJU4P3VBN/Bh0pT3WO1Cb URwj+f/VupUrq3HtVzbtVR7DFmMWsPQ/rShH+G1RsyjLdOX3V/AkJ4Sofu87zHqtappK qvBNE36LkwcaYsvbi5EHIWI/hIqovWCeQs8SQJSq/Li6v9245/z+MhfYlMIrNTxVPJJV DMhRVrltUq37rR3GVVu9BXMSqmuIgmcEiGv8iMWbgpXjyRJnLd+o/PXPEd017fdPDSPJ R5Dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707735469; x=1708340269; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4HjQZ3s96np4wR6yO+y54ychE2u5IfTueXcuWRKUyK0=; b=CDjUnaJFofEI4u+ZPDsQP9f1b2ZTvSUQjGV+bBPuI562wQ59XelumvOylpw1Gmj+7q twqpzYFpbxZEHiQjcpG7Is4l1UrSJbWa3w9SLCo7DLG798v1F3fLfSLB1jcyEsJQgpyz vXyt27mvk1+Z4RVRS1yWl9VkK9QK0i1fk+wmw7ZhpPe7kXK4GiGIy5ytfGgW9kyN+EUG DmVrIjpipzb6ukrcJF9uIGFIV5dW5t7KZoi9d7g8BWG1Vfl1xmaf5d3+PS9fyD4tlHzb 3S4x+JbgF+sps8w08KWG4frJ3V47Rw/p/6kJQ4ctTtdiTfnO4RxMZRerQ9t4ubWtwdEa PLcQ== X-Gm-Message-State: AOJu0Yx2UQDOJJKGfJ3P7/SvRGVm5ECQa0/5sKHFMJPLa31tRJ15V6Av ooSra5a90UePxQHDo+vDKB8qRSEDgBBYKsknMptto6JbA8EG2msxTP05FLWH X-Google-Smtp-Source: AGHT+IFdeUkBp1JOHb5Hvyh4P9veVUqdOAX/KnJPbHEdQli5QKEl45wNMuhNBfJT1ofu3QIMYdo0PQ== X-Received: by 2002:a17:906:e0e:b0:a38:47f:51b4 with SMTP id l14-20020a1709060e0e00b00a38047f51b4mr4552910eji.47.1707735468508; Mon, 12 Feb 2024 02:57:48 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCV2ZavAtoaC2JTpZfRs6D+iYaqkwnGHNyzcWHF4PhxrddszcgE7VYwDalQe9H3c8MPzBLMVfwjJ5SqNJ/geigH0jQh1wlNcgSnURA== Received: from localhost.lan (031011218106.poznan.vectranet.pl. [31.11.218.106]) by smtp.gmail.com with ESMTPSA id e2-20020a17090681c200b00a3c8f4bc31bsm91394ejx.38.2024.02.12.02.57.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 02:57:48 -0800 (PST) From: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= To: openwrt-devel@lists.openwrt.org Cc: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= Subject: [PATCH 5/5] base-files: sysupgrade: rename add_*files() functions Date: Mon, 12 Feb 2024 11:57:01 +0100 Message-Id: <20240212105701.5812-5-zajec5@gmail.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240212105701.5812-1-zajec5@gmail.com> References: <20240212105701.5812-1-zajec5@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240212_025750_264687_FB1745EB X-CRM114-Status: GOOD ( 10.26 ) X-Spam-Score: 0.0 (/) X-Spam-Report: =?unknown-8bit?q?Spam_detection_software=2C_running_on_the_sy?= =?unknown-8bit?q?stem_=22bombadil=2Einfradead=2Eorg=22=2C?= =?unknown-8bit?q?_has_NOT_identified_this_incoming_email_as_spam=2E__The_ori?= =?unknown-8bit?q?ginal?= =?unknown-8bit?q?_message_has_been_attached_to_this_so_you_can_view_it_or_la?= =?unknown-8bit?q?bel?= =?unknown-8bit?q?_similar_future_email=2E__If_you_have_any_questions=2C_see?= =?unknown-8bit?q?_the_administrator_of_that_system_for_details=2E?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_Content_preview=3A__From=3A_Rafa=C5=82_Mi=C5=82ecki_Usage_?= =?unknown-8bit?q?of_word_=22add=22_was_somehow_misleading?= =?unknown-8bit?q?_in_those_functions=3A_1=2E_They_don=27t_really_add_=28as_i?= =?unknown-8bit?q?n=3A_append=29_anything=2E_Result?= =?unknown-8bit?q?_files_are_created_from_scratch=2E_2=2E_It_wasn=27t_clear_w?= =?unknown-8bit?q?hat_adding_files_means=2E?= =?unknown-8bit?b?IEl0IFsuLi5dIA==?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_Content_analysis_details=3A___=280=2E0_points=2C_5=2E0_req?= =?unknown-8bit?q?uired=29?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_pts_rule_name______________description?= =?unknown-8bit?q?_----_----------------------_------------------------------?= =?unknown-8bit?q?--------------------?= =?unknown-8bit?q?_-0=2E0_RCVD=5FIN=5FDNSWL=5FNONE_____RBL=3A_Sender_listed_a?= =?unknown-8bit?q?t_https=3A//www=2Ednswl=2Eorg/=2C_no?= =?unknown-8bit?q?_trust?= =?unknown-8bit?b?IFsyYTAwOjE0NTA6NDg2NDoyMDowOjA6MDo1MzAgbGlzdGVkIGluXQ==?= =?unknown-8bit?b?IFtsaXN0LmRuc3dsLm9yZ10=?= =?unknown-8bit?q?_-0=2E0_SPF=5FPASS_______________SPF=3A_sender_matches_SPF_?= =?unknown-8bit?q?record?= =?unknown-8bit?q?_0=2E0_SPF=5FHELO=5FNONE__________SPF=3A_HELO_does_not_publ?= =?unknown-8bit?q?ish_an_SPF_Record?= =?unknown-8bit?q?_-0=2E1_DKIM=5FVALID_____________Message_has_at_least_one_v?= =?unknown-8bit?q?alid_DKIM_or_DK_signature?= =?unknown-8bit?q?_-0=2E1_DKIM=5FVALID=5FAU__________Message_has_a_valid_DKIM?= =?unknown-8bit?q?_or_DK_signature_from_author=27s?= =?unknown-8bit?q?_domain?= =?unknown-8bit?q?_0=2E1_DKIM=5FSIGNED____________Message_has_a_DKIM_or_DK_si?= =?unknown-8bit?q?gnature=2C_not_necessarily_valid?= =?unknown-8bit?q?_-0=2E1_DKIM=5FVALID=5FEF__________Message_has_a_valid_DKIM?= =?unknown-8bit?q?_or_DK_signature_from?= =?unknown-8bit?q?_envelope-from_domain?= =?unknown-8bit?q?_0=2E2_FREEMAIL=5FENVFROM=5FEND=5FDIGIT_Envelope-from_freem?= =?unknown-8bit?q?ail_username_ends_in?= =?unknown-8bit?q?_digit?= =?unknown-8bit?q?_=5Bzajec5=28at=29gmail=2Ecom=5D?= =?unknown-8bit?q?_0=2E0_FREEMAIL=5FFROM__________Sender_email_is_commonly_ab?= =?unknown-8bit?q?used_enduser_mail_provider?= =?unknown-8bit?q?_=5Bzajec5=28at=29gmail=2Ecom=5D?= =?unknown-8bit?q?_-0=2E0_T=5FSCC=5FBODY=5FTEXT=5FLINE___No_description_avail?= =?unknown-8bit?q?able=2E?= X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org From: Rafał Miłecki Usage of word "add" was somehow misleading in those functions: 1. They don't really add (as in: append) anything. Result files are created from scratch. 2. It wasn't clear what adding files means. It could be understood as adding actual files somewhere (to existing archive?). Also the word "add" was also a bit ambiguous. Signed-off-by: Rafał Miłecki --- package/base-files/files/sbin/sysupgrade | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package/base-files/files/sbin/sysupgrade b/package/base-files/files/sbin/sysupgrade index e7de1f3446..1fcd44da2a 100755 --- a/package/base-files/files/sbin/sysupgrade +++ b/package/base-files/files/sbin/sysupgrade @@ -155,7 +155,7 @@ list_static_conffiles() { \( -type f -o -type l \) $filter 2>/dev/null } -add_conffiles() { +build_list_of_backup_config_files() { local file="$1" ( list_static_conffiles "$find_filter"; list_changed_conffiles ) | @@ -163,7 +163,7 @@ add_conffiles() { return 0 } -add_overlayfiles() { +build_list_of_backup_overlay_files() { local file="$1" local packagesfiles=$1.packagesfiles @@ -218,9 +218,9 @@ if [ $SAVE_OVERLAY = 1 ]; then echo "Cannot find '/overlay/upper/etc', required for '-c'" >&2 exit 1 } - sysupgrade_init_conffiles="add_overlayfiles" + sysupgrade_init_conffiles="build_list_of_backup_overlay_files" else - sysupgrade_init_conffiles="add_conffiles" + sysupgrade_init_conffiles="build_list_of_backup_config_files" fi find_filter=""