From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 733641382C5 for ; Sun, 14 Feb 2021 18:06:44 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 9D08EE08FE; Sun, 14 Feb 2021 18:06:43 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 6FAD5E08FE for ; Sun, 14 Feb 2021 18:06:43 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 38B0133FE7D for ; Sun, 14 Feb 2021 18:06:42 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id CCB1149 for ; Sun, 14 Feb 2021 18:06:40 +0000 (UTC) From: "Lars Wendler" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Lars Wendler" Message-ID: <1613325998.e6c25c10b42a2e0d7c926bded8c7babe93fa320c.polynomial-c@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/gptfdisk/files/, sys-apps/gptfdisk/ X-VCS-Repository: repo/gentoo X-VCS-Files: sys-apps/gptfdisk/files/gptfdisk-1.0.6.1-spurious_mbr_warnings.patch sys-apps/gptfdisk/gptfdisk-1.0.6-r1.ebuild X-VCS-Directories: sys-apps/gptfdisk/ sys-apps/gptfdisk/files/ X-VCS-Committer: polynomial-c X-VCS-Committer-Name: Lars Wendler X-VCS-Revision: e6c25c10b42a2e0d7c926bded8c7babe93fa320c X-VCS-Branch: master Date: Sun, 14 Feb 2021 18:06:40 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 02e9586d-9789-4de7-83f8-fcdfd5bc639e X-Archives-Hash: b644c0c91de0b5e7b71b64db8524e4ba commit: e6c25c10b42a2e0d7c926bded8c7babe93fa320c Author: Lars Wendler gentoo org> AuthorDate: Sun Feb 14 18:06:17 2021 +0000 Commit: Lars Wendler gentoo org> CommitDate: Sun Feb 14 18:06:38 2021 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e6c25c10 sys-apps/gptfdisk: Revbump to fix spurious MBR warnings Package-Manager: Portage-3.0.14, Repoman-3.0.2 Signed-off-by: Lars Wendler gentoo.org> .../gptfdisk-1.0.6.1-spurious_mbr_warnings.patch | 71 ++++++++++++++++++++++ sys-apps/gptfdisk/gptfdisk-1.0.6-r1.ebuild | 60 ++++++++++++++++++ 2 files changed, 131 insertions(+) diff --git a/sys-apps/gptfdisk/files/gptfdisk-1.0.6.1-spurious_mbr_warnings.patch b/sys-apps/gptfdisk/files/gptfdisk-1.0.6.1-spurious_mbr_warnings.patch new file mode 100644 index 00000000000..e60aa9feeff --- /dev/null +++ b/sys-apps/gptfdisk/files/gptfdisk-1.0.6.1-spurious_mbr_warnings.patch @@ -0,0 +1,71 @@ +From f063fe08e424c99f133df18bf9dce49c851bcb0a Mon Sep 17 00:00:00 2001 +From: Rod Smith +Date: Mon, 1 Feb 2021 10:19:50 -0500 +Subject: [PATCH] Fix spurious warnings of problems on MBR disks + +--- + NEWS | 7 +++++++ + gpt.cc | 18 +++++++++++++----- + support.h | 2 +- + 3 files changed, 21 insertions(+), 6 deletions(-) + +diff --git a/NEWS b/NEWS +index f74bad0..a7131aa 100644 +--- a/NEWS ++++ b/NEWS +@@ -1,3 +1,10 @@ ++1.0.7 (?/??/2021): ++------------------ ++ ++- Fixed bug that caused spurious warnings about the partition table ++ header claiming an invalid size of partition entries when reading ++ some MBR disks. ++ + 1.0.6 (1/13/2021): + ------------------ + +diff --git a/gpt.cc b/gpt.cc +index 1b4e10f..842dfb1 100644 +--- a/gpt.cc ++++ b/gpt.cc +@@ -1042,11 +1042,19 @@ int GPTData::LoadHeader(struct GPTHeader *header, DiskIO & disk, uint64_t sector + *crcOk = CheckHeaderCRC(&tempHeader); + + if (tempHeader.sizeOfPartitionEntries != sizeof(GPTPart)) { +- cerr << "Warning: Partition table header claims that the size of partition table\n"; +- cerr << "entries is " << tempHeader.sizeOfPartitionEntries << " bytes, but this program "; +- cerr << " supports only " << sizeof(GPTPart) << "-byte entries.\n"; +- cerr << "Adjusting accordingly, but partition table may be garbage.\n"; +- tempHeader.sizeOfPartitionEntries = sizeof(GPTPart); ++ // Print the below warning only if the CRC is OK -- but correct the ++ // problem either way. The warning is printed only on a valid CRC ++ // because otherwise this warning will display inappropriately when ++ // reading MBR disks. If the CRC is invalid, then a warning about ++ // that will be shown later, so the user will still know that ++ // something is wrong. ++ if (*crcOk) { ++ cerr << "Warning: Partition table header claims that the size of partition table\n"; ++ cerr << "entries is " << tempHeader.sizeOfPartitionEntries << " bytes, but this program "; ++ cerr << " supports only " << sizeof(GPTPart) << "-byte entries.\n"; ++ cerr << "Adjusting accordingly, but partition table may be garbage.\n"; ++ } ++ tempHeader.sizeOfPartitionEntries = sizeof(GPTPart); + } + + if (allOK && (numParts != tempHeader.numParts) && *crcOk) { +diff --git a/support.h b/support.h +index d87fe9a..e3e1e12 100644 +--- a/support.h ++++ b/support.h +@@ -8,7 +8,7 @@ + #include + #include + +-#define GPTFDISK_VERSION "1.0.6" ++#define GPTFDISK_VERSION "1.0.6.1" + + #if defined (__FreeBSD__) || defined (__FreeBSD_kernel__) || defined (__APPLE__) + // Darwin (Mac OS) & FreeBSD: disk IOCTLs are different, and there is no lseek64 +-- +2.30.1 + diff --git a/sys-apps/gptfdisk/gptfdisk-1.0.6-r1.ebuild b/sys-apps/gptfdisk/gptfdisk-1.0.6-r1.ebuild new file mode 100644 index 00000000000..ee9f1782ded --- /dev/null +++ b/sys-apps/gptfdisk/gptfdisk-1.0.6-r1.ebuild @@ -0,0 +1,60 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit flag-o-matic toolchain-funcs + +DESCRIPTION="GPT partition table manipulator for Linux" +HOMEPAGE="https://www.rodsbooks.com/gdisk/" +SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux" +IUSE="kernel_linux ncurses static" + +# libuuid from util-linux is required. +RDEPEND="!static? ( + dev-libs/popt + ncurses? ( >=sys-libs/ncurses-5.7-r7:0=[unicode] ) + kernel_linux? ( sys-apps/util-linux ) + )" +DEPEND=" + ${RDEPEND} + static? ( + dev-libs/popt[static-libs(+)] + ncurses? ( >=sys-libs/ncurses-5.7-r7:0=[unicode,static-libs(+)] ) + kernel_linux? ( sys-apps/util-linux[static-libs(+)] ) + ) + virtual/pkgconfig +" + +PATCHES=( + "${FILESDIR}/${P}.1-spurious_mbr_warnings.patch" +) + +src_prepare() { + default + + tc-export CXX PKG_CONFIG + + if ! use ncurses ; then + sed -i \ + -e '/^all:/s: cgdisk::' \ + Makefile || die + fi + + sed \ + -e '/g++/s:=:?=:g' \ + -e 's:-lncursesw:$(shell $(PKG_CONFIG) --libs ncursesw):g' \ + -i Makefile || die + + use static && append-ldflags -static +} + +src_install() { + dosbin gdisk sgdisk $(usex ncurses cgdisk '') fixparts + doman *.8 + dodoc NEWS README +}