initial commit of file from CVS for whiptail on Fri 14 Jul 22:35:31 BST 2023
This commit is contained in:
parent
a8c9b9d6b1
commit
f99b03ba56
1
.gitattributes
vendored
Normal file
1
.gitattributes
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
*.tar.gz filter=lfs diff=lfs merge=lfs -text
|
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
*.rpm
|
||||||
|
*.log
|
||||||
|
*spec-20*
|
21
Makefile
Normal file
21
Makefile
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
# Makefile for source rpm: whiptail
|
||||||
|
# $Id: Makefile,v 1.1 2016/02/04 18:15:59 vip-ire Exp $
|
||||||
|
NAME := whiptail
|
||||||
|
SPECFILE = $(firstword $(wildcard *.spec))
|
||||||
|
|
||||||
|
define find-makefile-common
|
||||||
|
for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done
|
||||||
|
endef
|
||||||
|
|
||||||
|
MAKEFILE_COMMON := $(shell $(find-makefile-common))
|
||||||
|
|
||||||
|
ifeq ($(MAKEFILE_COMMON),)
|
||||||
|
# attept a checkout
|
||||||
|
define checkout-makefile-common
|
||||||
|
test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2
|
||||||
|
endef
|
||||||
|
|
||||||
|
MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
|
||||||
|
endif
|
||||||
|
|
||||||
|
include $(MAKEFILE_COMMON)
|
@ -1,3 +1,11 @@
|
|||||||
# whiptail
|
# whiptail
|
||||||
|
|
||||||
3rd Party (Maintained by Koozali) git repo for whiptail smeserver
|
3rd Party (Maintained by Koozali) git repo for whiptail smeserver
|
||||||
|
|
||||||
|
## Description
|
||||||
|
|
||||||
|
<br />*This description has been generated by an LLM AI system and cannot be relied on to be fully correct.*
|
||||||
|
*Once it has been checked, then this comment will be deleted*
|
||||||
|
<br />
|
||||||
|
|
||||||
|
WhipTail is a Unix shell utility for creating dialog boxes from shell scripts. It allows an user to display a variety of questions or display messages using dialog boxes from a shell script using the newt library. It can present a finite set of options from which the user can choose one, display forms, display calendars, etc.
|
||||||
|
1
contriborbase
Normal file
1
contriborbase
Normal file
@ -0,0 +1 @@
|
|||||||
|
sme10
|
374
newt-0.51.5.patch.2004082000
Normal file
374
newt-0.51.5.patch.2004082000
Normal file
@ -0,0 +1,374 @@
|
|||||||
|
diff -Nur -x '*.orig' -x '*.rej' newt-0.51.5/dialogboxes.c mezzanine_patched_newt-0.51.5/dialogboxes.c
|
||||||
|
--- newt-0.51.5/dialogboxes.c 2003-01-03 15:54:45.000000000 -0500
|
||||||
|
+++ mezzanine_patched_newt-0.51.5/dialogboxes.c 2004-08-20 20:13:20.000000000 -0400
|
||||||
|
@@ -18,15 +18,18 @@
|
||||||
|
|
||||||
|
static void addButtons(int height, int width, newtComponent form,
|
||||||
|
newtComponent * okay, newtComponent * cancel,
|
||||||
|
+ char * left,
|
||||||
|
+ char * right,
|
||||||
|
int flags) {
|
||||||
|
if (flags & FLAG_NOCANCEL) {
|
||||||
|
- *okay = makeButton((width - 8) / 2, height - buttonHeight - 1, "Ok");
|
||||||
|
+ *okay = makeButton(((width - 18) / 3) * 2 + 9,
|
||||||
|
+ height - buttonHeight - 1, right);
|
||||||
|
*cancel = NULL;
|
||||||
|
newtFormAddComponent(form, *okay);
|
||||||
|
} else {
|
||||||
|
- *okay = makeButton((width - 18) / 3, height - buttonHeight - 1, "Ok");
|
||||||
|
- *cancel = makeButton(((width - 18) / 3) * 2 + 9,
|
||||||
|
- height - buttonHeight - 1, "Cancel");
|
||||||
|
+ *cancel = makeButton((width - 18) / 3, height - buttonHeight - 1, left);
|
||||||
|
+ *okay = makeButton(((width - 18) / 3) * 2 + 9,
|
||||||
|
+ height - buttonHeight - 1, right);
|
||||||
|
newtFormAddComponents(form, *okay, *cancel, NULL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@@ -129,10 +132,11 @@
|
||||||
|
}
|
||||||
|
|
||||||
|
int inputBox(const char * text, int height, int width, poptContext optCon,
|
||||||
|
- int flags, const char ** result) {
|
||||||
|
+ char * left, char * right, int flags, const char ** result) {
|
||||||
|
newtComponent form, entry, okay, cancel, answer, tb;
|
||||||
|
const char * val;
|
||||||
|
int rc = DLG_OKAY;
|
||||||
|
+ int eFlag = (flags & (NEWT_FLAG_HIDDEN|NEWT_FLAG_PASSWORD));
|
||||||
|
int top;
|
||||||
|
|
||||||
|
val = poptGetArg(optCon);
|
||||||
|
@@ -141,11 +145,11 @@
|
||||||
|
|
||||||
|
form = newtForm(NULL, NULL, 0);
|
||||||
|
entry = newtEntry(1, top + 1, val, width - 2, &val,
|
||||||
|
- NEWT_FLAG_SCROLL | NEWT_FLAG_RETURNEXIT);
|
||||||
|
+ NEWT_FLAG_SCROLL | NEWT_FLAG_RETURNEXIT | eFlag);
|
||||||
|
|
||||||
|
newtFormAddComponents(form, tb, entry, NULL);
|
||||||
|
|
||||||
|
- addButtons(height, width, form, &okay, &cancel, flags);
|
||||||
|
+ addButtons(height, width, form, &okay, &cancel, left, right, flags);
|
||||||
|
|
||||||
|
answer = newtRunForm(form);
|
||||||
|
if (answer == cancel)
|
||||||
|
@@ -157,7 +161,7 @@
|
||||||
|
}
|
||||||
|
|
||||||
|
int listBox(const char * text, int height, int width, poptContext optCon,
|
||||||
|
- int flags, const char ** result) {
|
||||||
|
+ char * left, char * right, int flags, const char ** result) {
|
||||||
|
newtComponent form, okay, tb, answer, listBox;
|
||||||
|
newtComponent cancel = NULL;
|
||||||
|
const char * arg;
|
||||||
|
@@ -228,7 +232,7 @@
|
||||||
|
|
||||||
|
newtFormAddComponents(form, tb, listBox, NULL);
|
||||||
|
|
||||||
|
- addButtons(height, width, form, &okay, &cancel, flags);
|
||||||
|
+ addButtons(height, width, form, &okay, &cancel, left, right, flags);
|
||||||
|
|
||||||
|
answer = newtRunForm(form);
|
||||||
|
if (answer == cancel)
|
||||||
|
@@ -241,7 +245,8 @@
|
||||||
|
}
|
||||||
|
|
||||||
|
int checkList(const char * text, int height, int width, poptContext optCon,
|
||||||
|
- int useRadio, int flags, const char *** selections) {
|
||||||
|
+ int useRadio, char * left, char * right, int flags,
|
||||||
|
+ const char *** selections) {
|
||||||
|
newtComponent form, okay, tb, subform, answer;
|
||||||
|
newtComponent sb = NULL, cancel = NULL;
|
||||||
|
const char * arg;
|
||||||
|
@@ -329,7 +334,7 @@
|
||||||
|
|
||||||
|
newtFormAddComponents(form, tb, subform, NULL);
|
||||||
|
|
||||||
|
- addButtons(height, width, form, &okay, &cancel, flags);
|
||||||
|
+ addButtons(height, width, form, &okay, &cancel, left, right, flags);
|
||||||
|
|
||||||
|
answer = newtRunForm(form);
|
||||||
|
if (answer == cancel)
|
||||||
|
@@ -364,7 +369,8 @@
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
-int messageBox(const char * text, int height, int width, int type, int flags) {
|
||||||
|
+int messageBox(const char * text, int height, int width, char *left,
|
||||||
|
+ char *right, int type, int flags) {
|
||||||
|
newtComponent form, yes, tb, answer;
|
||||||
|
newtComponent no = NULL;
|
||||||
|
int tFlag = (flags & FLAG_SCROLL_TEXT) ? NEWT_FLAG_SCROLL : 0;
|
||||||
|
@@ -376,7 +382,17 @@
|
||||||
|
newtTextboxSetText(tb, text);
|
||||||
|
|
||||||
|
newtFormAddComponent(form, tb);
|
||||||
|
-
|
||||||
|
+
|
||||||
|
+ /* If left=Cancel and right=Ok, we probably didn't get any --left and
|
||||||
|
+ * --right arguments passed. Assume we want Yes and No instead. This has
|
||||||
|
+ * the side effect of not being able to pass in "Cancel" and "Ok" but
|
||||||
|
+ * I can live with that.
|
||||||
|
+ */
|
||||||
|
+ if (!strcmp(left,"Cancel") && !strcmp(right,"Ok")) {
|
||||||
|
+ left = "Yes";
|
||||||
|
+ right = "No";
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
switch ( type ) {
|
||||||
|
case MSGBOX_INFO:
|
||||||
|
break;
|
||||||
|
@@ -385,9 +401,9 @@
|
||||||
|
newtFormAddComponent(form, yes);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
- yes = makeButton((width - 16) / 3, height - 1 - buttonHeight, "Yes");
|
||||||
|
- no = makeButton(((width - 16) / 3) * 2 + 9, height - 1 - buttonHeight,
|
||||||
|
- "No");
|
||||||
|
+ yes = makeButton((width - 18) / 3, height - 1 - buttonHeight, left);
|
||||||
|
+ no = makeButton(((width - 18) / 3) * 2 + 9, height - 1 - buttonHeight,
|
||||||
|
+ right);
|
||||||
|
newtFormAddComponents(form, yes, no, NULL);
|
||||||
|
|
||||||
|
if (flags & FLAG_DEFAULT_NO)
|
||||||
|
diff -Nur -x '*.orig' -x '*.rej' newt-0.51.5/dialogboxes.h mezzanine_patched_newt-0.51.5/dialogboxes.h
|
||||||
|
--- newt-0.51.5/dialogboxes.h 2003-01-03 15:54:45.000000000 -0500
|
||||||
|
+++ mezzanine_patched_newt-0.51.5/dialogboxes.h 2004-08-20 20:13:12.000000000 -0400
|
||||||
|
@@ -16,13 +16,15 @@
|
||||||
|
#define DLG_OKAY 0
|
||||||
|
#define DLG_CANCEL 1
|
||||||
|
|
||||||
|
-int messageBox(const char * text, int height, int width, int type, int flags);
|
||||||
|
+int messageBox(const char * text, int height, int width, char *left,
|
||||||
|
+ char *right, int type, int flags);
|
||||||
|
int checkList(const char * text, int height, int width, poptContext optCon,
|
||||||
|
- int useRadio, int flags, const char *** selections);
|
||||||
|
+ int useRadio, char * left, char * right,
|
||||||
|
+ int flags, const char *** selections);
|
||||||
|
int listBox(const char * text, int height, int width, poptContext optCon,
|
||||||
|
- int flags, const char ** result);
|
||||||
|
+ char * left, char * right, int flags, const char ** result);
|
||||||
|
int inputBox(const char * text, int height, int width, poptContext optCon,
|
||||||
|
- int flags, const char ** result);
|
||||||
|
+ char * left, char * right, int flags, const char ** result);
|
||||||
|
int gauge(const char * text, int height, int width, poptContext optCon, int fd,
|
||||||
|
int flags);
|
||||||
|
void useFullButtons(int state);
|
||||||
|
diff -Nur -x '*.orig' -x '*.rej' newt-0.51.5/test.c mezzanine_patched_newt-0.51.5/test.c
|
||||||
|
--- newt-0.51.5/test.c 2003-01-04 14:15:25.000000000 -0500
|
||||||
|
+++ mezzanine_patched_newt-0.51.5/test.c 2004-08-20 20:11:39.000000000 -0400
|
||||||
|
@@ -33,13 +33,13 @@
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(void) {
|
||||||
|
- newtComponent b1, b2, r1, r2, r3, e2, e3, l1, l2, l3, scale;
|
||||||
|
+ newtComponent b1, b2, r1, r2, r3, e2, e3, e4, l1, l2, l3, l4, scale;
|
||||||
|
newtComponent lb, t, rsf, answer, timeLabel;
|
||||||
|
newtComponent cs[10];
|
||||||
|
newtComponent f, chklist, e1;
|
||||||
|
struct callbackInfo cbis[3];
|
||||||
|
char results[10];
|
||||||
|
- const char * enr2, * enr3, *scaleVal;
|
||||||
|
+ const char * enr2, * enr3, * scaleVal, * enr4;
|
||||||
|
void ** selectedList;
|
||||||
|
int i, numsel;
|
||||||
|
char buf[20];
|
||||||
|
@@ -81,10 +81,11 @@
|
||||||
|
l1 = newtLabel(3, 6, "Scale:");
|
||||||
|
l2 = newtLabel(3, 7, "Scrolls:");
|
||||||
|
l3 = newtLabel(3, 8, "Hidden:");
|
||||||
|
+ l4 = newtLabel(3, 9, "Password:");
|
||||||
|
e1 = newtEntry(12, 6, "", 20, &scaleVal, 0);
|
||||||
|
e2 = newtEntry(12, 7, "Default", 20, &enr2, NEWT_FLAG_SCROLL);
|
||||||
|
-/* e3 = newtEntry(12, 8, NULL, 20, &enr3, NEWT_FLAG_HIDDEN); */
|
||||||
|
- e3 = newtEntry(12, 8, NULL, 20, &enr3, NEWT_FLAG_PASSWORD);
|
||||||
|
+ e3 = newtEntry(12, 8, NULL, 20, &enr3, NEWT_FLAG_HIDDEN);
|
||||||
|
+ e4 = newtEntry(12, 9, NULL, 20, &enr4, NEWT_FLAG_PASSWORD);
|
||||||
|
|
||||||
|
cbis[0].state = &results[0];
|
||||||
|
cbis[0].en = e1;
|
||||||
|
@@ -94,7 +95,7 @@
|
||||||
|
|
||||||
|
newtFormSetHeight(chklist, 3);
|
||||||
|
|
||||||
|
- newtFormAddComponents(f, b1, b2, l1, l2, l3, e1, e2, e3, chklist, NULL);
|
||||||
|
+ newtFormAddComponents(f, b1, b2, l1, l2, l3, l4, e1, e2, e3, e4, chklist, NULL);
|
||||||
|
newtFormAddComponents(f, rsf, scale, NULL);
|
||||||
|
|
||||||
|
lb = newtListbox(45, 1, 6, NEWT_FLAG_MULTIPLE | NEWT_FLAG_BORDER |
|
||||||
|
@@ -141,6 +142,7 @@
|
||||||
|
scaleVal = strdup(scaleVal);
|
||||||
|
enr2 = strdup(enr2);
|
||||||
|
enr3 = strdup(enr3);
|
||||||
|
+ enr4 = strdup(enr4);
|
||||||
|
|
||||||
|
selectedList = newtListboxGetSelection(lb, &numsel);
|
||||||
|
|
||||||
|
@@ -153,6 +155,7 @@
|
||||||
|
printf("got string 1: %s\n", scaleVal);
|
||||||
|
printf("got string 2: %s\n", enr2);
|
||||||
|
printf("got string 3: %s\n", enr3);
|
||||||
|
+ printf("got string 4: %s\n", enr4);
|
||||||
|
|
||||||
|
printf("\nSelected listbox items (%d):\n", numsel);
|
||||||
|
if(selectedList) {
|
||||||
|
diff -Nur -x '*.orig' -x '*.rej' newt-0.51.5/whiptail.c mezzanine_patched_newt-0.51.5/whiptail.c
|
||||||
|
--- newt-0.51.5/whiptail.c 2003-01-03 15:54:45.000000000 -0500
|
||||||
|
+++ mezzanine_patched_newt-0.51.5/whiptail.c 2004-08-20 20:13:12.000000000 -0400
|
||||||
|
@@ -47,16 +47,22 @@
|
||||||
|
int rc = 1;
|
||||||
|
int flags = 0;
|
||||||
|
int defaultNo = 0;
|
||||||
|
+ int hidden = 0;
|
||||||
|
+ int password = 0;
|
||||||
|
int separateOutput = 0;
|
||||||
|
const char * result;
|
||||||
|
const char ** selections, ** next;
|
||||||
|
char * title = NULL;
|
||||||
|
char * backtitle = NULL;
|
||||||
|
+ char * left = "Cancel";
|
||||||
|
+ char * right = "Ok";
|
||||||
|
struct poptOption optionsTable[] = {
|
||||||
|
{ "backtitle", '\0', POPT_ARG_STRING, &backtitle, 0 },
|
||||||
|
{ "checklist", '\0', 0, 0, OPT_CHECKLIST },
|
||||||
|
{ "clear", '\0', 0, &clear, 0 },
|
||||||
|
{ "defaultno", '\0', 0, &defaultNo, 0 },
|
||||||
|
+ { "hidden", '\0', 0, &hidden, 0 },
|
||||||
|
+ { "password", '\0', 0, &password, 0 },
|
||||||
|
{ "inputbox", '\0', 0, 0, OPT_INPUTBOX },
|
||||||
|
{ "fb", '\0', 0, 0, OPT_FULLBUTTONS },
|
||||||
|
{ "fullbuttons", '\0', 0, 0, OPT_FULLBUTTONS },
|
||||||
|
@@ -70,6 +76,8 @@
|
||||||
|
{ "scrolltext", '\0', 0, &scrollText, 0 },
|
||||||
|
{ "separate-output", '\0', 0, &separateOutput, 0 },
|
||||||
|
{ "title", '\0', POPT_ARG_STRING, &title, 0 },
|
||||||
|
+ { "left", '\0', POPT_ARG_STRING, &left, 0 },
|
||||||
|
+ { "right", '\0', POPT_ARG_STRING, &right, 0 },
|
||||||
|
{ "yesno", '\0', 0, 0, OPT_YESNO },
|
||||||
|
{ 0, 0, 0, 0, 0 }
|
||||||
|
};
|
||||||
|
@@ -164,32 +172,35 @@
|
||||||
|
if (noItem) flags |= FLAG_NOITEM;
|
||||||
|
if (scrollText) flags |= FLAG_SCROLL_TEXT;
|
||||||
|
if (defaultNo) flags |= FLAG_DEFAULT_NO;
|
||||||
|
+ if (hidden) flags |= NEWT_FLAG_HIDDEN;
|
||||||
|
+ if (password) flags |= NEWT_FLAG_PASSWORD;
|
||||||
|
|
||||||
|
switch (mode) {
|
||||||
|
- case MODE_MSGBOX:
|
||||||
|
- rc = messageBox(text, height, width, MSGBOX_MSG, flags);
|
||||||
|
+ case MODE_MSGBOX:
|
||||||
|
+ rc = messageBox(text, height, width, left, right, MSGBOX_MSG, flags);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case MODE_INFOBOX:
|
||||||
|
- rc = messageBox(text, height, width, MSGBOX_INFO, flags);
|
||||||
|
+ rc = messageBox(text, height, width, left, right, MSGBOX_INFO, flags);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case MODE_YESNO:
|
||||||
|
- rc = messageBox(text, height, width, MSGBOX_YESNO, flags);
|
||||||
|
+ rc = messageBox(text, height, width, left, right, MSGBOX_YESNO, flags);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case MODE_INPUTBOX:
|
||||||
|
- rc = inputBox(text, height, width, optCon, flags, &result);
|
||||||
|
+ rc = inputBox(text, height, width, optCon, left, right, flags, &result);
|
||||||
|
if (!rc) fprintf(stderr, "%s", result);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case MODE_MENU:
|
||||||
|
- rc = listBox(text, height, width, optCon, flags, &result);
|
||||||
|
+ rc = listBox(text, height, width, optCon, left, right, flags, &result);
|
||||||
|
if (!rc) fprintf(stderr, "%s", result);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case MODE_RADIOLIST:
|
||||||
|
- rc = checkList(text, height, width, optCon, 1, flags, &selections);
|
||||||
|
+ rc = checkList(text, height, width, optCon, 1, left, right,
|
||||||
|
+ flags, &selections);
|
||||||
|
if (!rc) {
|
||||||
|
fprintf(stderr, "%s", selections[0]);
|
||||||
|
free(selections);
|
||||||
|
@@ -197,7 +208,8 @@
|
||||||
|
break;
|
||||||
|
|
||||||
|
case MODE_CHECKLIST:
|
||||||
|
- rc = checkList(text, height, width, optCon, 0, flags, &selections);
|
||||||
|
+ rc = checkList(text, height, width, optCon, 0, left, right, flags,
|
||||||
|
+ &selections);
|
||||||
|
|
||||||
|
if (!rc) {
|
||||||
|
for (next = selections; *next; next++) {
|
||||||
|
diff -Nur -x '*.orig' -x '*.rej' newt-0.51.5/whiptcl.c mezzanine_patched_newt-0.51.5/whiptcl.c
|
||||||
|
--- newt-0.51.5/whiptcl.c 2000-02-16 06:34:40.000000000 -0500
|
||||||
|
+++ mezzanine_patched_newt-0.51.5/whiptcl.c 2004-08-20 20:13:12.000000000 -0400
|
||||||
|
@@ -72,6 +72,8 @@
|
||||||
|
char * result;
|
||||||
|
char ** selections, ** next;
|
||||||
|
char * title = NULL;
|
||||||
|
+ char * right = "Ok";
|
||||||
|
+ char * left = "Cancel";
|
||||||
|
struct poptOption optionsTable[] = {
|
||||||
|
{ "checklist", '\0', 0, 0, OPT_CHECKLIST },
|
||||||
|
{ "defaultno", '\0', 0, &defaultNo, 0 },
|
||||||
|
@@ -83,6 +85,8 @@
|
||||||
|
{ "radiolist", '\0', 0, 0, OPT_RADIOLIST },
|
||||||
|
{ "scrolltext", '\0', 0, &scrollText, 0 },
|
||||||
|
{ "title", '\0', POPT_ARG_STRING, &title, 0 },
|
||||||
|
+ { "left", '\0', POPT_ARG_STRING, &left, 0 },
|
||||||
|
+ { "right", '\0', POPT_ARG_STRING, &right, 0 },
|
||||||
|
{ "yesno", '\0', 0, 0, OPT_YESNO },
|
||||||
|
{ 0, 0, 0, 0, 0 }
|
||||||
|
};
|
||||||
|
@@ -180,11 +184,11 @@
|
||||||
|
|
||||||
|
switch (mode) {
|
||||||
|
case MODE_MSGBOX:
|
||||||
|
- rc = messageBox(text, height, width, MSGBOX_MSG, flags);
|
||||||
|
+ rc = messageBox(text, height, width, left, right, MSGBOX_MSG, flags);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case MODE_YESNO:
|
||||||
|
- rc = messageBox(text, height, width, MSGBOX_YESNO, flags);
|
||||||
|
+ rc = messageBox(text, height, width, left, right, MSGBOX_YESNO, flags);
|
||||||
|
if (rc == DLG_OKAY)
|
||||||
|
interp->result = "yes";
|
||||||
|
else
|
||||||
|
@@ -193,7 +197,7 @@
|
||||||
|
break;
|
||||||
|
|
||||||
|
case MODE_INPUTBOX:
|
||||||
|
- rc = inputBox(text, height, width, optCon, flags, &result);
|
||||||
|
+ rc = inputBox(text, height, width, optCon, left, right, flags, &result);
|
||||||
|
if (!rc) {
|
||||||
|
interp->result = strdup(result);
|
||||||
|
interp->freeProc = TCL_DYNAMIC;
|
||||||
|
@@ -201,7 +205,7 @@
|
||||||
|
break;
|
||||||
|
|
||||||
|
case MODE_MENU:
|
||||||
|
- rc = listBox(text, height, width, optCon, flags, &result);
|
||||||
|
+ rc = listBox(text, height, width, optCon, left, right, flags, &result);
|
||||||
|
if (!rc) {
|
||||||
|
interp->result = strdup(result);
|
||||||
|
interp->freeProc = TCL_DYNAMIC;
|
||||||
|
@@ -209,7 +213,8 @@
|
||||||
|
break;
|
||||||
|
|
||||||
|
case MODE_RADIOLIST:
|
||||||
|
- rc = checkList(text, height, width, optCon, 1, flags, &selections);
|
||||||
|
+ rc = checkList(text, height, width, optCon, 1, left, right,
|
||||||
|
+ flags, &selections);
|
||||||
|
if (!rc) {
|
||||||
|
interp->result = strdup(selections[0]);
|
||||||
|
interp->freeProc = TCL_DYNAMIC;
|
||||||
|
@@ -217,7 +222,8 @@
|
||||||
|
break;
|
||||||
|
|
||||||
|
case MODE_CHECKLIST:
|
||||||
|
- rc = checkList(text, height, width, optCon, 0, flags, &selections);
|
||||||
|
+ rc = checkList(text, height, width, optCon, 0, left, right,
|
||||||
|
+ flags, &selections);
|
||||||
|
|
||||||
|
if (!rc) {
|
||||||
|
for (next = selections; *next; next++)
|
75
newt-0.51.5.patch.2006100300
Normal file
75
newt-0.51.5.patch.2006100300
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
Only in newt-0.51.5: config.h
|
||||||
|
Only in newt-0.51.5: config.log
|
||||||
|
Only in newt-0.51.5: config.status
|
||||||
|
diff -ru newt-0.51.5.orig/dialogboxes.c newt-0.51.5/dialogboxes.c
|
||||||
|
--- newt-0.51.5.orig/dialogboxes.c 2006-10-03 14:26:48.052081000 -0400
|
||||||
|
+++ newt-0.51.5/dialogboxes.c 2006-10-03 14:55:05.083400000 -0400
|
||||||
|
@@ -161,7 +161,7 @@
|
||||||
|
}
|
||||||
|
|
||||||
|
int listBox(const char * text, int height, int width, poptContext optCon,
|
||||||
|
- char * left, char * right, int flags, const char ** result) {
|
||||||
|
+ char * left, char * right, int flags, const char ** result, char * def) {
|
||||||
|
newtComponent form, okay, tb, answer, listBox;
|
||||||
|
newtComponent cancel = NULL;
|
||||||
|
const char * arg;
|
||||||
|
@@ -228,6 +228,10 @@
|
||||||
|
for (i = 0; i < numItems; i++) {
|
||||||
|
sprintf(buf, format, itemInfo[i].tag, itemInfo[i].text);
|
||||||
|
newtListboxAddEntry(listBox, buf, (void *) i);
|
||||||
|
+ if (!strcmp(def, itemInfo[i].tag))
|
||||||
|
+ {
|
||||||
|
+ newtListboxSetCurrent(listBox, i);
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
|
||||||
|
newtFormAddComponents(form, tb, listBox, NULL);
|
||||||
|
diff -ru newt-0.51.5.orig/dialogboxes.h newt-0.51.5/dialogboxes.h
|
||||||
|
--- newt-0.51.5.orig/dialogboxes.h 2006-10-03 14:26:48.062082000 -0400
|
||||||
|
+++ newt-0.51.5/dialogboxes.h 2006-10-03 14:54:35.302668000 -0400
|
||||||
|
@@ -22,7 +22,7 @@
|
||||||
|
int useRadio, char * left, char * right,
|
||||||
|
int flags, const char *** selections);
|
||||||
|
int listBox(const char * text, int height, int width, poptContext optCon,
|
||||||
|
- char * left, char * right, int flags, const char ** result);
|
||||||
|
+ char * left, char * right, int flags, const char ** result, char * def);
|
||||||
|
int inputBox(const char * text, int height, int width, poptContext optCon,
|
||||||
|
char * left, char * right, int flags, const char ** result);
|
||||||
|
int gauge(const char * text, int height, int width, poptContext optCon, int fd,
|
||||||
|
Only in newt-0.51.5: Makefile
|
||||||
|
Only in newt-0.51.5: shared
|
||||||
|
diff -ru newt-0.51.5.orig/whiptail.c newt-0.51.5/whiptail.c
|
||||||
|
--- newt-0.51.5.orig/whiptail.c 2006-10-03 14:26:48.082081000 -0400
|
||||||
|
+++ newt-0.51.5/whiptail.c 2006-10-03 14:59:14.911307000 -0400
|
||||||
|
@@ -56,8 +56,10 @@
|
||||||
|
char * backtitle = NULL;
|
||||||
|
char * left = "Cancel";
|
||||||
|
char * right = "Ok";
|
||||||
|
+ char * def_item = "";
|
||||||
|
struct poptOption optionsTable[] = {
|
||||||
|
{ "backtitle", '\0', POPT_ARG_STRING, &backtitle, 0 },
|
||||||
|
+ { "default-item", '\0', POPT_ARG_STRING, &def_item, 0 },
|
||||||
|
{ "checklist", '\0', 0, 0, OPT_CHECKLIST },
|
||||||
|
{ "clear", '\0', 0, &clear, 0 },
|
||||||
|
{ "defaultno", '\0', 0, &defaultNo, 0 },
|
||||||
|
@@ -194,7 +196,7 @@
|
||||||
|
break;
|
||||||
|
|
||||||
|
case MODE_MENU:
|
||||||
|
- rc = listBox(text, height, width, optCon, left, right, flags, &result);
|
||||||
|
+ rc = listBox(text, height, width, optCon, left, right, flags, &result, def_item);
|
||||||
|
if (!rc) fprintf(stderr, "%s", result);
|
||||||
|
break;
|
||||||
|
|
||||||
|
diff -ru newt-0.51.5.orig/whiptcl.c newt-0.51.5/whiptcl.c
|
||||||
|
--- newt-0.51.5.orig/whiptcl.c 2006-10-03 14:26:48.092082000 -0400
|
||||||
|
+++ newt-0.51.5/whiptcl.c 2006-10-03 14:53:44.961340000 -0400
|
||||||
|
@@ -205,7 +205,7 @@
|
||||||
|
break;
|
||||||
|
|
||||||
|
case MODE_MENU:
|
||||||
|
- rc = listBox(text, height, width, optCon, left, right, flags, &result);
|
||||||
|
+ rc = listBox(text, height, width, optCon, left, right, flags, &result, "");
|
||||||
|
if (!rc) {
|
||||||
|
interp->result = strdup(result);
|
||||||
|
interp->freeProc = TCL_DYNAMIC;
|
15
newt-0.51.5.patch.2006100301
Normal file
15
newt-0.51.5.patch.2006100301
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
diff -Nur -x '*.orig' -x '*.rej' newt-0.51.5/whiptail.c mezzanine_patched_newt-0.51.5/whiptail.c
|
||||||
|
--- newt-0.51.5/whiptail.c 2006-10-11 12:11:54.000000000 -0400
|
||||||
|
+++ mezzanine_patched_newt-0.51.5/whiptail.c 2006-10-11 12:10:25.000000000 -0400
|
||||||
|
@@ -79,7 +79,11 @@
|
||||||
|
{ "separate-output", '\0', 0, &separateOutput, 0 },
|
||||||
|
{ "title", '\0', POPT_ARG_STRING, &title, 0 },
|
||||||
|
{ "left", '\0', POPT_ARG_STRING, &left, 0 },
|
||||||
|
+ { "cancel-label", '\0', POPT_ARG_STRING, &left, 0 },
|
||||||
|
+ { "no-label", '\0', POPT_ARG_STRING, &left, 0 },
|
||||||
|
{ "right", '\0', POPT_ARG_STRING, &right, 0 },
|
||||||
|
+ { "ok-label", '\0', POPT_ARG_STRING, &right, 0 },
|
||||||
|
+ { "yes-label", '\0', POPT_ARG_STRING, &right, 0 },
|
||||||
|
{ "yesno", '\0', 0, 0, OPT_YESNO },
|
||||||
|
{ 0, 0, 0, 0, 0 }
|
||||||
|
};
|
BIN
whiptail-0.51.5.tar.gz
(Stored with Git LFS)
Normal file
BIN
whiptail-0.51.5.tar.gz
(Stored with Git LFS)
Normal file
Binary file not shown.
88
whiptail.spec
Normal file
88
whiptail.spec
Normal file
@ -0,0 +1,88 @@
|
|||||||
|
# $Id: whiptail.spec,v 1.1 2016/02/04 18:15:59 vip-ire Exp $
|
||||||
|
|
||||||
|
%define pythonver 2.2
|
||||||
|
|
||||||
|
Summary: A console dialog tool, for use by SME server console
|
||||||
|
Name: whiptail
|
||||||
|
%define version 0.51.5
|
||||||
|
Version: %{version}
|
||||||
|
Release: 9%{?dist}
|
||||||
|
License: LGPL
|
||||||
|
Group: System Environment/Libraries
|
||||||
|
Source: whiptail-%{version}.tar.gz
|
||||||
|
Patch100: newt-0.51.5.patch.2004082000
|
||||||
|
Patch101: newt-0.51.5.patch.2006100300
|
||||||
|
Patch102: newt-0.51.5.patch.2006100301
|
||||||
|
BuildRequires: newt-devel
|
||||||
|
BuildRequires: popt-devel
|
||||||
|
Requires: newt
|
||||||
|
BuildRoot: %{_tmppath}/%{name}-%{version}-root
|
||||||
|
|
||||||
|
%Description
|
||||||
|
whiptail is a /usr/bin/dialog replacement. This version contains
|
||||||
|
modifications for use by the SME server console program.
|
||||||
|
|
||||||
|
%prep
|
||||||
|
%setup -q
|
||||||
|
|
||||||
|
%build
|
||||||
|
D=
|
||||||
|
cc -O2 -Wall -I/usr/include/slang -D_GNU_SOURCE \
|
||||||
|
-c -o whiptail.o whiptail.c
|
||||||
|
cc -O2 -Wall -I/usr/include/slang -D_GNU_SOURCE \
|
||||||
|
$(if grep -q _newt_wstr %_libdir/libnewt.so; then echo -Dwstrlen=_newt_wstrlen; fi) \
|
||||||
|
-c -o dialogboxes.o dialogboxes.c
|
||||||
|
gcc -g -o whiptail whiptail.o dialogboxes.o \
|
||||||
|
-lnewt -lslang -lm -lpopt
|
||||||
|
|
||||||
|
%install
|
||||||
|
rm -rf $RPM_BUILD_ROOT
|
||||||
|
mkdir -p $RPM_BUILD_ROOT/sbin/e-smith
|
||||||
|
install -m 755 whiptail $RPM_BUILD_ROOT/sbin/e-smith
|
||||||
|
|
||||||
|
%clean
|
||||||
|
rm -rf $RPM_BUILD_ROOT
|
||||||
|
|
||||||
|
%files
|
||||||
|
%defattr (-,root,root)
|
||||||
|
%doc COPYING
|
||||||
|
/sbin/e-smith/whiptail
|
||||||
|
|
||||||
|
%changelog
|
||||||
|
* Fri Jul 14 2023 BogusDateBot
|
||||||
|
- Eliminated rpmbuild "bogus date" warnings due to inconsistent weekday,
|
||||||
|
by assuming the date is correct and changing the weekday.
|
||||||
|
|
||||||
|
* Sun Apr 29 2007 Shad L. Lords <slords@mail.com>
|
||||||
|
- Clean up spec so package can be built by koji/plague
|
||||||
|
|
||||||
|
* Sun Apr 29 2007 Shad L. Lords <slords@mail.com> 0.51.5-9
|
||||||
|
- Better fix for finding correct libdir
|
||||||
|
|
||||||
|
* Sat Apr 28 2007 Shad L. Lords <slords@mail.com> 0.51.5-8
|
||||||
|
- Change to dist for tagging release
|
||||||
|
- Use correct lib for 32/64 bit
|
||||||
|
|
||||||
|
* Thu Feb 1 2007 Charlie Brady <charlieb@e-smith.com> 0.51.5-7
|
||||||
|
- Autodetect need for -Dwstrlen=_newt_wstrlen.
|
||||||
|
|
||||||
|
* Thu Feb 1 2007 Charlie Brady <charlieb@e-smith.com> 0.51.5-6
|
||||||
|
- Fix for building under FC6/RHEL5
|
||||||
|
|
||||||
|
* Thu Feb 1 2007 Charlie Brady <charlieb@e-smith.com> 0.51.5-5
|
||||||
|
- Repackage so that build is done against the installed newt library.
|
||||||
|
(Patches are left included in SRPM for informational reasons).
|
||||||
|
|
||||||
|
* Thu Dec 07 2006 Shad L. Lords <slords@mail.com>
|
||||||
|
- Update to new release naming. No functional changes.
|
||||||
|
- Make Packager generic
|
||||||
|
|
||||||
|
* Tue Oct 03 2006 Charlie Brady <charlie_brady@mitel.com> 0.51.5-3es1
|
||||||
|
- Add --{ok,yes,cancel,no}-label aliases for --left and --right, for
|
||||||
|
compatibility with 'dialog'.
|
||||||
|
|
||||||
|
* Tue Oct 03 2006 Charlie Brady <charlie_brady@mitel.com> 0.51.5-2es1
|
||||||
|
- Add --default-item option for use in listBox. [SME: 1959]
|
||||||
|
|
||||||
|
* Wed Feb 16 2005 Charlie Brady <charlieb@e-smith.com> 0.51.5-1es1
|
||||||
|
- Initial - forked from newt-0.51.5-1es1
|
Loading…
Reference in New Issue
Block a user