diff --git a/sysutils/gdisk/Makefile b/sysutils/gdisk/Makefile index e3e3a34d3a94..52443cd3ee63 100644 --- a/sysutils/gdisk/Makefile +++ b/sysutils/gdisk/Makefile @@ -1,48 +1,48 @@ PORTNAME= gdisk PORTVERSION= 1.0.9 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= sysutils MASTER_SITES= SF/gptfdisk/gptfdisk/${PORTVERSION} DISTNAME= gptfdisk-${PORTVERSION} MAINTAINER= sunpoet@FreeBSD.org COMMENT= GPT fdisk WWW= https://www.rodsbooks.com/fixparts/ LICENSE= GPLv2 LICENSE_FILE= ${WRKSRC}/COPYING ONLY_FOR_ARCHS= amd64 armv7 i386 powerpc powerpc64 powerpc64le LIB_DEPENDS= libpopt.so:devel/popt \ libuuid.so:misc/e2fsprogs-libuuid USES= localbase:ldflags ALL_TARGET= fixparts gdisk sgdisk MAKEFILE= Makefile.freebsd OPTIONS_DEFINE= CGDISK UTF16 OPTIONS_SUB= yes CGDISK_DESC= Curses-based interactive program UTF16_DESC= Support for Unicode partition names CGDISK_ALL_TARGET= cgdisk CGDISK_USES= ncurses UTF16_USES= compiler:c++11-lib UTF16_CPPFLAGS= -DUSE_UTF16 UTF16_CXXFLAGS= -std=gnu++11 UTF16_LDFLAGS= -licuio -licuuc UTF16_LIB_DEPENDS= libicuuc.so:devel/icu do-install: .for i in fixparts gdisk sgdisk ${INSTALL_PROGRAM} ${WRKSRC}/${i} ${STAGEDIR}${PREFIX}/sbin ${INSTALL_MAN} ${WRKSRC}/${i}.8 ${STAGEDIR}${PREFIX}/share/man/man8 .endfor do-install-CGDISK-on: ${INSTALL_PROGRAM} ${WRKSRC}/cgdisk ${STAGEDIR}${PREFIX}/sbin ${INSTALL_MAN} ${WRKSRC}/cgdisk.8 ${STAGEDIR}${PREFIX}/share/man/man8 .include diff --git a/sysutils/gdisk/files/patch-gptcl.cc b/sysutils/gdisk/files/patch-gptcl.cc new file mode 100644 index 000000000000..19e73564d9d0 --- /dev/null +++ b/sysutils/gdisk/files/patch-gptcl.cc @@ -0,0 +1,33 @@ +--- gptcl.cc.orig 2022-11-22 09:31:13 UTC ++++ gptcl.cc +@@ -71,7 +71,7 @@ int GPTDataCL::DoOptions(int argc, char* argv[]) { + uint64_t low, high, startSector, endSector, sSize, mainTableLBA; + uint64_t temp; // temporary variable; free to use in any case + char *device; +- string cmd, typeGUID, name; ++ string cmd, typeGUID, name, devstr; + PartType typeHelper; + + struct poptOption theOptions[] = +@@ -156,9 +156,11 @@ int GPTDataCL::DoOptions(int argc, char* argv[]) { + + // Assume first non-option argument is the device filename.... + device = (char*) poptGetArg(poptCon); ++ if (device != NULL) ++ devstr = device; + poptResetContext(poptCon); + +- if (device != NULL) { ++ if (devstr.empty()) { + JustLooking(); // reset as necessary + BeQuiet(); // Tell called functions to be less verbose & interactive + if (LoadPartitions(devstr)) { +@@ -498,7 +500,7 @@ int GPTDataCL::DoOptions(int argc, char* argv[]) { + cerr << "Error encountered; not saving changes.\n"; + retval = 4; + } // if +- } // if (device != NULL) ++ } // if (devstr empty) + poptFreeContext(poptCon); + return retval; + } // GPTDataCL::DoOptions()