diff options
| author | Alexander Kanavin <alex.kanavin@gmail.com> | 2021-10-27 11:07:30 +0200 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-10-28 14:16:31 +0100 |
| commit | b3d1a8ac9b496c2faca39fe35e947445adb3055a (patch) | |
| tree | 29f0d55cba7c097a374cc648f4f37da1942b22c0 | |
| parent | 77c631a6f98ec6cc76a461f910cd5cef5471c210 (diff) | |
| download | poky-b3d1a8ac9b496c2faca39fe35e947445adb3055a.tar.gz | |
gptfdisk: address ncurses 6.3 compatibility
(From OE-Core rev: 1a5254939a72319ffcd302449c0187c0383da0c9)
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/recipes-devtools/fdisk/gptfdisk/0001-gptcurses-correct-ncurses-6.3-errors.patch | 99 | ||||
| -rw-r--r-- | meta/recipes-devtools/fdisk/gptfdisk_1.0.8.bb | 1 |
2 files changed, 100 insertions, 0 deletions
diff --git a/meta/recipes-devtools/fdisk/gptfdisk/0001-gptcurses-correct-ncurses-6.3-errors.patch b/meta/recipes-devtools/fdisk/gptfdisk/0001-gptcurses-correct-ncurses-6.3-errors.patch new file mode 100644 index 0000000000..9d0443e524 --- /dev/null +++ b/meta/recipes-devtools/fdisk/gptfdisk/0001-gptcurses-correct-ncurses-6.3-errors.patch | |||
| @@ -0,0 +1,99 @@ | |||
| 1 | From e301f7dd650c9e56f954a7c49661d938079e1a9b Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Alexander Kanavin <alex@linutronix.de> | ||
| 3 | Date: Mon, 25 Oct 2021 17:27:51 +0200 | ||
| 4 | Subject: [PATCH] gptcurses: correct ncurses 6.3 errors | ||
| 5 | |||
| 6 | Upstream-Status: Pending | ||
| 7 | Signed-off-by: Alexander Kanavin <alex@linutronix.de> | ||
| 8 | --- | ||
| 9 | gptcurses.cc | 28 ++++++++++++++-------------- | ||
| 10 | 1 file changed, 14 insertions(+), 14 deletions(-) | ||
| 11 | |||
| 12 | diff --git a/gptcurses.cc b/gptcurses.cc | ||
| 13 | index d0de024..70be999 100644 | ||
| 14 | --- a/gptcurses.cc | ||
| 15 | +++ b/gptcurses.cc | ||
| 16 | @@ -235,22 +235,22 @@ Space* GPTDataCurses::ShowSpace(int spaceNum, int lineNum) { | ||
| 17 | ClearLine(lineNum); | ||
| 18 | if (space->partNum == -1) { // space is empty | ||
| 19 | move(lineNum, 12); | ||
| 20 | - printw(BytesToIeee((space->lastLBA - space->firstLBA + 1), blockSize).c_str()); | ||
| 21 | + printw("%s",BytesToIeee((space->lastLBA - space->firstLBA + 1), blockSize).c_str()); | ||
| 22 | move(lineNum, 24); | ||
| 23 | - printw("free space"); | ||
| 24 | + printw("%s","free space"); | ||
| 25 | } else { // space holds a partition | ||
| 26 | move(lineNum, 3); | ||
| 27 | printw("%d", space->partNum + 1); | ||
| 28 | move(lineNum, 12); | ||
| 29 | - printw(BytesToIeee((space->lastLBA - space->firstLBA + 1), blockSize).c_str()); | ||
| 30 | + printw("%s",BytesToIeee((space->lastLBA - space->firstLBA + 1), blockSize).c_str()); | ||
| 31 | move(lineNum, 24); | ||
| 32 | - printw(space->origPart->GetTypeName().c_str()); | ||
| 33 | + printw("%s",space->origPart->GetTypeName().c_str()); | ||
| 34 | move(lineNum, 50); | ||
| 35 | #ifdef USE_UTF16 | ||
| 36 | space->origPart->GetDescription().extract(0, 39, temp, 39); | ||
| 37 | - printw(temp); | ||
| 38 | + printw("%s",temp); | ||
| 39 | #else | ||
| 40 | - printw(space->origPart->GetDescription().c_str()); | ||
| 41 | + printw("%s",space->origPart->GetDescription().c_str()); | ||
| 42 | #endif | ||
| 43 | } // if/else | ||
| 44 | } // if | ||
| 45 | @@ -267,10 +267,10 @@ int GPTDataCurses::DisplayParts(int selected) { | ||
| 46 | |||
| 47 | move(lineNum++, 0); | ||
| 48 | theLine = "Part. # Size Partition Type Partition Name"; | ||
| 49 | - printw(theLine.c_str()); | ||
| 50 | + printw("%s",theLine.c_str()); | ||
| 51 | move(lineNum++, 0); | ||
| 52 | theLine = "----------------------------------------------------------------"; | ||
| 53 | - printw(theLine.c_str()); | ||
| 54 | + printw("%s",theLine.c_str()); | ||
| 55 | numToShow = LINES - RESERVED_TOP - RESERVED_BOTTOM; | ||
| 56 | pageNum = selected / numToShow; | ||
| 57 | for (i = pageNum * numToShow; i <= (pageNum + 1) * numToShow - 1; i++) { | ||
| 58 | @@ -284,7 +284,7 @@ int GPTDataCurses::DisplayParts(int selected) { | ||
| 59 | } else { | ||
| 60 | currentSpace = ShowSpace(i, lineNum); | ||
| 61 | move(lineNum++, 0); | ||
| 62 | - printw(">"); | ||
| 63 | + printw("%s",">"); | ||
| 64 | } | ||
| 65 | DisplayOptions(i); | ||
| 66 | retval = selected; | ||
| 67 | @@ -632,7 +632,7 @@ void GPTDataCurses::DisplayOptions(char selectedKey) { | ||
| 68 | } // if/else | ||
| 69 | } // for | ||
| 70 | move(LINES - 1, (COLS - optionDesc.length()) / 2); | ||
| 71 | - printw(optionDesc.c_str()); | ||
| 72 | + printw("%s",optionDesc.c_str()); | ||
| 73 | currentKey = selectedKey; | ||
| 74 | } // if | ||
| 75 | } // GPTDataCurses::DisplayOptions() | ||
| 76 | @@ -744,11 +744,11 @@ void GPTDataCurses::DrawMenu(void) { | ||
| 77 | |||
| 78 | clear(); | ||
| 79 | move(0, (COLS - title.length()) / 2); | ||
| 80 | - printw(title.c_str()); | ||
| 81 | + printw("%s",title.c_str()); | ||
| 82 | move(2, (COLS - drive.length()) / 2); | ||
| 83 | - printw(drive.c_str()); | ||
| 84 | + printw("%s",drive.c_str()); | ||
| 85 | move(3, (COLS - size.str().length()) / 2); | ||
| 86 | - printw(size.str().c_str()); | ||
| 87 | + printw("%s",size.str().c_str()); | ||
| 88 | DisplayParts(currentSpaceNum); | ||
| 89 | } // DrawMenu | ||
| 90 | |||
| 91 | @@ -798,7 +798,7 @@ void PromptToContinue(void) { | ||
| 92 | void Report(string theText) { | ||
| 93 | clear(); | ||
| 94 | move(0, 0); | ||
| 95 | - printw(theText.c_str()); | ||
| 96 | + printw("%s", theText.c_str()); | ||
| 97 | move(LINES - 2, (COLS - 29) / 2); | ||
| 98 | printw("Press any key to continue...."); | ||
| 99 | cbreak(); | ||
diff --git a/meta/recipes-devtools/fdisk/gptfdisk_1.0.8.bb b/meta/recipes-devtools/fdisk/gptfdisk_1.0.8.bb index 16fe540968..c5a153ab0c 100644 --- a/meta/recipes-devtools/fdisk/gptfdisk_1.0.8.bb +++ b/meta/recipes-devtools/fdisk/gptfdisk_1.0.8.bb | |||
| @@ -9,6 +9,7 @@ DEPENDS = "util-linux" | |||
| 9 | 9 | ||
| 10 | SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${PV}/${BP}.tar.gz \ | 10 | SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${PV}/${BP}.tar.gz \ |
| 11 | file://0001-gptcurses-correctly-include-curses.h.patch \ | 11 | file://0001-gptcurses-correctly-include-curses.h.patch \ |
| 12 | file://0001-gptcurses-correct-ncurses-6.3-errors.patch \ | ||
| 12 | " | 13 | " |
| 13 | SRC_URI[sha256sum] = "95d19856f004dabc4b8c342b2612e8d0a9eebdd52004297188369f152e9dc6df" | 14 | SRC_URI[sha256sum] = "95d19856f004dabc4b8c342b2612e8d0a9eebdd52004297188369f152e9dc6df" |
| 14 | 15 | ||
