From patchwork Wed Feb 5 12:24:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Po-Hsu Lin X-Patchwork-Id: 1233816 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48CLPS3r3Yz9sSV; Wed, 5 Feb 2020 23:25:30 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1izJkE-0004eu-2z; Wed, 05 Feb 2020 12:25:26 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1izJkC-0004ei-Le for kernel-team@lists.ubuntu.com; Wed, 05 Feb 2020 12:25:24 +0000 Received: from mail-pl1-f199.google.com ([209.85.214.199]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1izJkC-0007CP-8u for kernel-team@lists.ubuntu.com; Wed, 05 Feb 2020 12:25:24 +0000 Received: by mail-pl1-f199.google.com with SMTP id w11so1058802plp.22 for ; Wed, 05 Feb 2020 04:25:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=mTRESITxgYdMk+5P2GLmxwBqvTgp+kd2L8sMDwvrmOw=; b=M1Ynnlvf3d5k35r4jobDo4L8k19N2zGtvOhvbFzxquhhGxUpEulAOCFhcZIR/Yn0Yq hbavWhBpXX21sAgFapuT2LC6PbzpA3E0VXA6p5rxGY9pYrvH5hnPdEphr62brHQGSHpP H6+MgOZcu+Ou7vPupI7t4517l8V2dCSMiOObEB9EodHzJbFXytAD97P1sNjosvQ09O6p NNq69nKZZ5bEiF6w5Z0CyDNg2vOkioIq1qzQ0zq/V6moThzfnZrTKyNpt2KIeHQP6sBU CbQz4BtQ2KaJoPgbfvyzSDT52KItv1xauMtp+5Bc6jMTTtBtPx+8Aqlft8EzwcyLk4Vh 2D8A== X-Gm-Message-State: APjAAAUT4aXaD0w8hsKSJ+TRmmuJ0kEKiY00XXvK5bp5uppYF+TfCS+/ 0tVkMQSajSywFtbacHIhcgdLLW0LWtKGm0o17KuXK1r2pw0gbZV2Chqayn6QzKYUAnOP8ajbXoU Mu9ZVh3x21ek9LCIgedNcrs9EKDRJOtDZUf6X6h8V X-Received: by 2002:a62:1cd6:: with SMTP id c205mr36269730pfc.179.1580905522644; Wed, 05 Feb 2020 04:25:22 -0800 (PST) X-Google-Smtp-Source: APXvYqzK4spvHaQHG1c4ZH5DyczD+00gioIgndtuSLTQG5OcoNcYL4ci30ngD6l+uCr5+q5dPDB6Ug== X-Received: by 2002:a62:1cd6:: with SMTP id c205mr36269716pfc.179.1580905522363; Wed, 05 Feb 2020 04:25:22 -0800 (PST) Received: from Leggiero.taipei.internal (61-220-137-37.HINET-IP.hinet.net. [61.220.137.37]) by smtp.gmail.com with ESMTPSA id o9sm25204270pfg.130.2020.02.05.04.25.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Feb 2020 04:25:21 -0800 (PST) From: Po-Hsu Lin To: kernel-team@lists.ubuntu.com Subject: [Xenial][SRU][PATCH 1/1] UBUNTU: [Debian] autoreconstruct - add resoration of execute permissions Date: Wed, 5 Feb 2020 20:24:59 +0800 Message-Id: <20200205122459.4398-2-po-hsu.lin@canonical.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200205122459.4398-1-po-hsu.lin@canonical.com> References: <20200205122459.4398-1-po-hsu.lin@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Seth Forshee BugLink: https://bugs.launchpad.net/bugs/1861973 Debian source package diffs cannot represent that a file should be executable. This is a problem for us if a patch adds a script which is invoked directly during the build, as happened with a recent stable update for 4.14. Update gen-auto-reconstruct to detect this situation and restore the execute permissions in the reconstruct script. Exclude the debian packaging directories as the scripts here already account for the loss of execute permissions. Signed-off-by: Seth Forshee Signed-off-by: Po-Hsu Lin --- debian/scripts/misc/gen-auto-reconstruct | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/debian/scripts/misc/gen-auto-reconstruct b/debian/scripts/misc/gen-auto-reconstruct index acc90fe..b20551e 100755 --- a/debian/scripts/misc/gen-auto-reconstruct +++ b/debian/scripts/misc/gen-auto-reconstruct @@ -42,6 +42,23 @@ fi echo "rm -f '$name'" done + # Identify files with execute permissions added since the proffered tag. + git diff "$tag.." --raw --no-renames | awk -F '[: \t]' '{print $2, $3, $NF }' | \ + while IFS=" " read old new name + do + # Exclude files in debian* directories + if [[ "$name" =~ ^debian ]]; then + continue + fi + + old=$( printf "0%s" $old ) + new=$( printf "0%s" $new ) + changed=$(( (old ^ new) & 0111 )) + if [ "$changed" -ne 0 ]; then + echo "chmod +x '$name'" + fi + done + # All done, make sure this does not complete in error. echo "exit 0" ) >"$reconstruct"