From patchwork Sun Dec 22 21:31:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiko Thiery X-Patchwork-Id: 1214780 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="ieiBo89R"; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47gwgM00Jmz9sNH for ; Mon, 23 Dec 2019 08:32:30 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 25BB8878F0; Sun, 22 Dec 2019 21:32:29 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cc6D944y6MwT; Sun, 22 Dec 2019 21:32:28 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 82C6F8790D; Sun, 22 Dec 2019 21:32:28 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 3F8831BF316 for ; Sun, 22 Dec 2019 21:32:27 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 31DE48790D for ; Sun, 22 Dec 2019 21:32:27 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VK-IlPeY9LQo for ; Sun, 22 Dec 2019 21:32:26 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by hemlock.osuosl.org (Postfix) with ESMTPS id 44A1D878F0 for ; Sun, 22 Dec 2019 21:32:26 +0000 (UTC) Received: by mail-wr1-f66.google.com with SMTP id z3so14722325wru.3 for ; Sun, 22 Dec 2019 13:32:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=QzeCo9NZpI03HfdHEoxsdLDvLyf641I+/64euDmwGzY=; b=ieiBo89RMTKyFtN6oYiTHGoc12ARBiG++AeJLI5JgZQqZRlQInmndYiqvOWh7DPi6x QWEKBeJ+ul4Ox5b77l3lggVOLces/5BIa10GVPWU3GDh+TGXdIJp7TB3kvtb4Fv7nlv0 qSmz2Jmc4Fdjk4d3O8a7YD2UyDZAw6TA9PQVztUqS6Wc3V3/vK0YOM4efzJaaPV0tFKZ P4z6fvgr4rA2ftoHM/x3kFyeXgGOF81ezwM9IsK/GaYLgJPnHnBk6BRNhJ3yGN9K52xL Dsl6Q+tbQf8ZIFFaqJdn+M1MMJhBNMDdCFJlh1/7cwBr92ep/bNuSY6KoDBpp3NM8FsS AX1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=QzeCo9NZpI03HfdHEoxsdLDvLyf641I+/64euDmwGzY=; b=SYVe6uPOrG2TCrSYHwT8ScndgIVyakL7xnVq2cLFxfmk4SiUjTuQg1D7BQsZleqTob gqLZegndVQLcVaYCA08Nj3I3NCri4dX5oK4H4EB04iFlW51tsw4KCnHwFlP589gekLaj Y/ZdP8mVfm5lOM+0EefMqNWAl+dANA6UDAzVYmPgf1+4iViNhyOu7LVWrvs8SzbKrhmD IXYjHVRoNOzDGXWPJMGiygy4BsEfypWD/exzi9nCMC2Us1T6WRhSzUXRoZr8kPi5OAYe g67rSTHJHUZd2LxNM7ejwGVHsRwzf+ZWbVcbmsA+qR0wiULaqhjw8Mgy2jAEf3KoTntS JvPQ== X-Gm-Message-State: APjAAAVgV/R2rP8nwMCsmrY12b0v4th3ES9f3816XhVRYkWQldNDCAyW lYRnMrLJ37HGj5j9LJk0vb8JfA3y X-Google-Smtp-Source: APXvYqyUtgwYMhpvKpyj9+xN465gcpZOp1qaRIHqehXVPm1tZNX/MC82r08/YzPi7GtaMb3CJhG03Q== X-Received: by 2002:adf:f80b:: with SMTP id s11mr25223863wrp.12.1577050344260; Sun, 22 Dec 2019 13:32:24 -0800 (PST) Received: from t450s.fritz.box (ip5f589a3a.dynamic.kabel-deutschland.de. [95.88.154.58]) by smtp.gmail.com with ESMTPSA id z11sm18087434wrt.82.2019.12.22.13.32.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Dec 2019 13:32:23 -0800 (PST) From: Heiko Thiery To: buildroot@buildroot.org Date: Sun, 22 Dec 2019 22:31:49 +0100 Message-Id: <20191222213148.13762-1-heiko.thiery@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [Buildroot] [PATCH] support/download/svn: generate reproducible svn archives X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Heiko Thiery , "Yann E . MORIN" , Thomas Petazzoni Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" To generate a reproducible archive from a svn repository mainly the same aproach is done like for the archives from a git repository. Signed-off-by: Heiko Thiery --- support/download/svn | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/support/download/svn b/support/download/svn index 542b25c0a2..505cdd58b1 100755 --- a/support/download/svn +++ b/support/download/svn @@ -38,4 +38,19 @@ _svn() { _svn export ${verbose} "${@}" "'${uri}@${rev}'" "'${basename}'" -tar czf "${output}" "${basename}" +# Generate the archive, sort with the C locale so that it is reproducible. +# We do not want the .svn dir; we keep other .svn files, in case they are the +# only files in their directory. +find "${basename}" -not -type d \ + -and -not -path "./.svn/*" >"${output}.list" +LC_ALL=C sort <"${output}.list" >"${output}.list.sorted" + +# Create GNU-format tarballs, since that's the format of the tarballs on +# sources.buildroot.org and used in the *.hash files +tar cf - --transform="s#^\./#${basename}/#" \ + --numeric-owner --owner=0 --group=0 --mtime="${date}" --format=gnu \ + -T "${output}.list.sorted" >"${output}.tar" +gzip -6 -n <"${output}.tar" >"${output}" + +rm -f "${output}.list" +rm -f "${output}.list.sorted"