aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--configure.ac20
-rw-r--r--debian/control2
-rw-r--r--etc/plptools.spec.in44
-rw-r--r--sisinstall/sisinstaller.cpp259
-rw-r--r--sisinstall/sisinstaller.h18
-rw-r--r--sisinstall/sismain.cpp70
6 files changed, 12 insertions, 401 deletions
diff --git a/configure.ac b/configure.ac
index 05aca67..fb401cc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -116,26 +116,6 @@ fi
LIBHISTORY=${ac_cv_libhistory}
AC_SUBST(LIBHISTORY)
-ac_enable_newt=yes
-ac_cv_libnewt=
-AC_ARG_ENABLE(newt,
- [ --disable-newt disable libnewt support [no]],
- if test "$enableval" = "no" ; then
- AC_MSG_RESULT([support for libnewt disabled])
- ac_enable_newt=no
- fi
-)
-if test "x$ac_enable_newt" = "xyes" ; then
- AC_CHECK_LIB(newt, newtInit,
- [
- AC_DEFINE_UNQUOTED(HAVE_LIBNEWT,1,
- [Define this, if you have libnewt])
- ac_cv_libnewt=-lnewt
- ])
-fi
-LIBNEWT=${ac_cv_libnewt}
-AC_SUBST(LIBNEWT)
-
dnl these three are for solaris
AC_CHECK_LIB(socket, socket)
AC_CHECK_LIB(nsl, gethostbyname)
diff --git a/debian/control b/debian/control
index 1e087c6..1e09049 100644
--- a/debian/control
+++ b/debian/control
@@ -1,5 +1,5 @@
Source: plptools
-Build-Depends: debhelper (>= 5), automake1.7, autoconf, libtool, gettext, libncurses5-dev, libreadline5-dev, libnewt-dev, kdoc, po-debconf
+Build-Depends: debhelper (>= 5), automake1.7, autoconf, libtool, gettext, libncurses5-dev, libreadline5-dev, kdoc, po-debconf
Section: otherosfs
Priority: optional
Maintainer: John Lines <john@paladin.demon.co.uk>
diff --git a/etc/plptools.spec.in b/etc/plptools.spec.in
index fbc6ba0..555c5e3 100644
--- a/etc/plptools.spec.in
+++ b/etc/plptools.spec.in
@@ -21,12 +21,7 @@
%define _qtdir ""
%if "%{isSUSE}" > "0"
%define REL %(grep VERSION %{srel} | sed -e 's/VERSION = //')
-%if "%{REL}" >= "8.0"
-# Bug in SuSE8.0's rpm setup: _initrddir has wrong value
%define _initrddir %{_sysconfdir}/init.d
-%else
-%define _initrddir %{_sysconfdir}/init.d
-%endif
%define distro SuSE%{REL}
%endif
%if "%{isRH}" > "1"
@@ -61,13 +56,9 @@ URL: http://plptools.sourceforge.net/
Source0: http://download.sourceforge.net/plptools/plptools-%{version}.tar.gz
Copyright: GPL
Group: Networking/Utilities
-Buildrequires: readline-devel newt-devel
+Buildrequires: readline-devel
%if "%{isSUSE}" > "0"
-%if "%{REL}" >= "8.0"
Requires: aaa_base >= 2002.3.27-0
-%else
-Requires: aaa_base >= 2001.10.19-1
-%endif
%endif
%if "%{isRH}" > "0"
Requires: chkconfig >= 0.9
@@ -214,34 +205,7 @@ test ! -d /mnt/psion && mkdir -p /mnt/psion
/sbin/chkconfig --add psion
%endif
%if "%{isSUSE}" > "0"
-%if "%{REL}" >= "8.0"
/sbin/chkconfig --add psion
-%else
-(
- grep -v START_PSION /etc/rc.config | \
- grep -v START_NCPD | grep -v NCPD_ARGS | \
- grep -v START_PLPNFSD | grep -v PLPNFSD_ARGS | \
- grep -v START_PLPPRINTD | grep -v PLPPRINTD_ARGS
- cat<<-EOF
- # Set START_PSION to yes to start Psion support
- START_PSION=yes
- # Set START_NCPD to yes to start ncpd
- START_NCPD=yes
- # Specify parameters for ncpd in NCPD_ARGS (if any)
- NCPD_ARGS=
- # Set START_PLPNFSD to yes to start plpnfsd
- START_PLPNFSD=no
- # Specify parameters for plpnfsd in PLPNFSD_ARGS (if any)
- PLPNFSD_ARGS=
- # Set START_PLPPRINTD to yes to start plpprintd
- START_PLPPRINTD=yes
- # Specify parameters for plpprintd in PLPPRINTD_ARGS (if any)
- PLPPRINTD_ARGS=
- EOF
-) > /etc/rc.config.$$
-cp /etc/rc.config /etc/rc.config.old && mv /etc/rc.config.$$ /etc/rc.config
-/sbin/insserv -d psion
-%endif
%endif
fi
@@ -251,11 +215,7 @@ if [ "$1" = 0 ]
then
%{_initrddir}/psion stop >/dev/null 2>&1
%if "%{isSUSE}" > "0"
-%if "%{REL}" >= "8.0"
/sbin/chkconfig --del psion
-%else
- /sbin/insserv -r -d psion
-%endif
%endif
%if "%{isRH}" > "0"
/sbin/chkconfig --del psion
@@ -274,10 +234,8 @@ fi
%{_datadir}/%{name}/*
%{_initrddir}/psion
%if "%{isSUSE}" > "0"
-%if "%{REL}" >= "8.0"
%config %{_sysconfdir}/sysconfig/psion
%endif
-%endif
%if "%{isRH}" > "0"
%config %{_sysconfdir}/sysconfig/psion
%endif
diff --git a/sisinstall/sisinstaller.cpp b/sisinstall/sisinstaller.cpp
index b9df146..d159496 100644
--- a/sisinstall/sisinstaller.cpp
+++ b/sisinstall/sisinstaller.cpp
@@ -69,9 +69,6 @@ SISInstaller::createDirs(char* filename)
if ((res != rfsv::E_PSI_GEN_NONE) &&
(res != rfsv::E_PSI_FILE_EXIST))
{
-#if HAVE_LIBNEWT
- if (!m_useNewt)
-#endif
fprintf(stderr, " -> Failed: %s\n", (const char*)res);
}
}
@@ -110,14 +107,6 @@ SISInstaller::copyFile(SISFileRecord* fileRecord)
sprintf(msgbuf,
"Copying %d bytes to %s\n",
fileRecord->m_fileLengths[m_fileNo], dest);
-#if HAVE_LIBNEWT
- if (m_useNewt)
- {
- newtPushHelpLine(msgbuf);
- newtRefresh();
- }
- else
-#endif
{
printf("%s\n", msgbuf);
}
@@ -126,13 +115,6 @@ SISInstaller::copyFile(SISFileRecord* fileRecord)
fileRecord->m_fileLengths[m_fileNo],
dest);
-#if HAVE_LIBNEWT
- if (m_useNewt)
- {
- newtPopHelpLine();
- newtRefresh();
- }
-#endif
}
void
@@ -144,9 +126,6 @@ SISInstaller::copyBuf(const uint8_t* buf, int len, char* name)
int fd = mkstemp(srcName);
if (-1 == fd)
{
-#if HAVE_LIBNEWT
- if (!m_useNewt)
-#endif
fprintf(stderr,
"Couldn't create temp file: %s\n", strerror(errno));
return;
@@ -165,12 +144,7 @@ SISInstaller::copyBuf(const uint8_t* buf, int len, char* name)
}
else
{
-#if HAVE_LIBNEWT
- if (!m_useNewt)
-#endif
- {
fprintf(stderr, " -> Fail: %s\n", (const char*)res);
- }
}
unlink(srcName);
}
@@ -186,80 +160,6 @@ SISInstaller::installFile(SISFileRecord* fileRecord)
break;
case 1:
-#if HAVE_LIBNEWT
- if (m_useNewt)
- {
- int len = fileRecord->m_fileLengths[m_fileNo];
- char* msgbuf = new char[len + 1];
- memcpy(msgbuf, fileRecord->getFilePtr(m_fileNo), len);
- msgbuf[len] = 0;
- int j = 0;
- for (int i = 0; i < len; ++i)
- {
- if (msgbuf[i] != '\r')
- msgbuf[j++] = msgbuf[i];
- }
- msgbuf[j] = 0;
- int cols = 0;
- int rows = 0;
- char* reflowedText =
- newtReflowText(msgbuf, 40, 20, 30, &cols, &rows);
- int flags = NEWT_FLAG_WRAP;
- if (rows > 15)
- {
- rows = 15;
- flags |= NEWT_FLAG_SCROLL;
- }
- newtComponent text = newtTextbox(0, 0, cols, rows, flags);
- newtTextboxSetText(text, reflowedText);
- newtOpenWindow(10, 5, cols + 2, rows + 5, "Info");
- newtComponent form = newtForm(NULL, NULL, 0);
- newtFormAddComponent(form, text);
- newtComponent button1;
- newtComponent button2 = 0;
- const char* b1;
- const char* b2;
- int rc = FILE_OK;
- switch (fileRecord->m_fileDetails)
- {
- case 0:
- b1 = _("Continue");
- button1 = newtButton((cols - strlen(b1)) / 2 - 1,
- rows + 1, b1);
- break;
- case 1:
- b1 = _("Yes");
- b2 = _("No");
- button1 = newtButton(cols / 3 - strlen(b1) / 2 - 1,
- rows + 1, b1);
- button2 = newtButton(cols / 3 * 2 - strlen(b2) / 2 - 1,
- rows + 1, b2);
- rc = FILE_SKIP;
- break;
- case 2:
- b1 = _("Yes");
- b2 = _("No");
- button1 = newtButton(cols / 3 - strlen(b1) / 2 - 1,
- rows + 1, b1);
- button2 = newtButton(cols / 3 * 2 - strlen(b2) / 2 - 1,
- rows + 1, b2);
- rc = FILE_ABORT;
- break;
- }
- newtFormAddComponent(form, button1);
- if (button2)
- newtFormAddComponent(form, button2);
- newtComponent ender = newtRunForm(form);
- if (ender == button1)
- rc = FILE_OK;
- newtFormDestroy(form);
- newtPopWindow();
- delete reflowedText;
- delete msgbuf;
- return rc;
- }
- else
-#endif
{
printf("Info:\n%.*s\n",
fileRecord->m_fileLengths[m_fileNo],
@@ -310,9 +210,6 @@ SISInstaller::installFile(SISFileRecord* fileRecord)
}
SISInstaller installer;
installer.setPsion(m_psion);
-#if HAVE_LIBNEWT
- installer.useNewt(m_useNewt);
-#endif
installer.setInstalled(m_installed);
rc = installer.run(&sisFile, buf2, len, m_file);
if (0 == m_drive)
@@ -354,13 +251,6 @@ SISInstaller::loadInstalled()
}
else
{
-#if HAVE_LIBNEWT
- if (m_useNewt)
- {
- newtPushHelpLine(_("Loading installed sis files."));
- newtRefresh();
- }
-#endif
while (!files.empty())
{
PlpDirent file = files[0];
@@ -371,13 +261,6 @@ SISInstaller::loadInstalled()
loadPsionSis(sisname);
files.pop_front();
}
-#if HAVE_LIBNEWT
- if (m_useNewt)
- {
- newtPopHelpLine();
- newtRefresh();
- }
-#endif
}
}
@@ -456,9 +339,6 @@ SISInstaller::run(SISFile* file, uint8_t* buf, off_t len, SISFile* parent)
long lang;
m_file = file;
m_buf = buf;
-#if HAVE_LIBNEWT
- newtComponent form, button, text, listbox;
-#endif
char msgbuf[1024];
if (parent == 0)
{
@@ -468,65 +348,15 @@ SISInstaller::run(SISFile* file, uint8_t* buf, off_t len, SISFile* parent)
sprintf(msgbuf,
_("You have only one language: %s"),
m_file->getLanguage(0)->m_name);
-#if HAVE_LIBNEWT
- if (m_useNewt)
- {
-# if 0
- text = newtTextboxReflowed(1, 1, msgbuf, 37, 5, 5, 0);
- int th = newtTextboxGetNumLines(text);
- const char* okText = _("Ok");
- button = newtButton(18 - strlen(okText) / 2, th + 2, okText);
- newtOpenWindow(10, 5, 40, th + 6, "Language");
- form = newtForm(NULL, NULL, 0);
- newtFormAddComponent(form, text);
- newtFormAddComponent(form, button);
- newtRunForm(form);
- newtFormDestroy(form);
- newtPopWindow();
-# endif
- }
- else
-#endif
- {
- printf("%s\n", msgbuf);
- }
+ printf("%s\n", msgbuf);
lang = 0;
}
else
{
-#if HAVE_LIBNEWT
- if (m_useNewt)
- {
- sprintf(msgbuf, _("Select a language."));
- text = newtTextboxReflowed(1, 1, msgbuf, 37, 5, 5, 0);
- int th = newtTextboxGetNumLines(text);
- listbox = newtListbox(1, th + 2, 6,
- NEWT_FLAG_SCROLL | NEWT_FLAG_RETURNEXIT);
- int boxwidth = 0;
- for (int i = 0; i < n; ++i)
- {
- const char* txt = m_file->getLanguage(i)->m_name;
- if (strlen(txt) > boxwidth)
- boxwidth = strlen(txt);
- newtListboxAppendEntry(listbox, txt, (void*) i);
- }
- newtOpenWindow(10, 5, 40, th + 8, "Language");
- form = newtForm(NULL, NULL, 0);
- newtFormAddComponent(form, text);
- newtFormAddComponent(form, listbox);
- newtRunForm(form);
- lang = (long)newtListboxGetCurrent(listbox);
- newtFormDestroy(form);
- newtPopWindow();
- }
- else
-#endif
- {
printf("Select a language (%d alternatives):\n", n);
for (int i = 0; i < n; ++i)
printf(" %d. %s\n", i, m_file->getLanguage(i)->m_name);
lang = 0;
- }
}
}
else
@@ -542,17 +372,7 @@ SISInstaller::run(SISFile* file, uint8_t* buf, off_t len, SISFile* parent)
m_file->setLanguage(lang);
uint8_t* compName = m_file->getName();
sprintf(msgbuf, _("Installing component: `%s'"), compName);
-#if HAVE_LIBNEWT
- if (m_useNewt)
- {
- newtPushHelpLine(msgbuf);
- newtRefresh();
- }
- else
-#endif
- {
- printf("%s\n", msgbuf);
- }
+ printf("%s\n", msgbuf);
// In order to check requisites and previous versions, we need to
// load all sis files from the c:/system/install directory.
@@ -625,25 +445,8 @@ SISInstaller::run(SISFile* file, uint8_t* buf, off_t len, SISFile* parent)
else
{
sprintf(msgbuf, _("Uninstalling the previous version first."));
-#if HAVE_LIBNEWT
- if (m_useNewt)
- {
- newtPushHelpLine(msgbuf);
- newtRefresh();
- }
- else
-#endif
- {
- printf("%s\n", msgbuf);
- }
+ printf("%s\n", msgbuf);
uninstall(oldFile);
-#if HAVE_LIBNEWT
- if (m_useNewt)
- {
- newtPopHelpLine();
- newtRefresh();
- }
-#endif
}
}
@@ -712,12 +515,6 @@ SISInstaller::run(SISFile* file, uint8_t* buf, off_t len, SISFile* parent)
if (logLevel >= 1)
fprintf(stderr, "Creating residual sis file %s\n", resname);
copyBuf(buf, m_file->getResidualEnd(), resname);
-#if HAVE_LIBNEWT
- if (m_useNewt)
- {
- newtPopHelpLine();
- }
-#endif
if (aborted)
return SIS_ABORTED;
return SIS_OK;
@@ -746,15 +543,10 @@ SISInstaller::selectDrive()
drivelist[ndrives] = 'A' + i;
space[ndrives] = plpdrive.getSpace();
size[ndrives] = plpdrive.getSize();
-#if HAVE_LIBNEWT
- if (!m_useNewt)
-#endif
- {
- printf("%c: %d bytes free, %d bytes total\n",
- 'A' + i,
- plpdrive.getSpace(),
- plpdrive.getSize());
- }
+ printf("%c: %d bytes free, %d bytes total\n",
+ 'A' + i,
+ plpdrive.getSpace(),
+ plpdrive.getSize());
++ndrives;
}
}
@@ -777,37 +569,6 @@ SISInstaller::selectDrive()
else
{
-#if HAVE_LIBNEWT
- if (m_useNewt)
- {
- char msgbuf[256];
- sprintf(msgbuf, _("Select a drive."));
- newtComponent text = newtTextboxReflowed(1, 1, msgbuf, 37, 5, 5, 0);
- int th = newtTextboxGetNumLines(text);
- newtComponent listbox =
- newtListbox(1, th + 2, 6,
- NEWT_FLAG_SCROLL | NEWT_FLAG_RETURNEXIT);
- int boxwidth = 0;
- for (int i = 0; i < ndrives; ++i)
- {
- char txt[256];
- sprintf(txt, "%c: %d kbytes free, %d kbytes total",
- drivelist[i], space[i] / 1024, size[i] / 1024);
- if (strlen(txt) > boxwidth)
- boxwidth = strlen(txt);
- newtListboxAppendEntry(listbox, txt, (void*) i);
- }
- newtOpenWindow(10, 5, boxwidth + 5, th + 8, "Drive");
- newtComponent form = newtForm(NULL, NULL, 0);
- newtFormAddComponent(form, text);
- newtFormAddComponent(form, listbox);
- newtRunForm(form);
- m_drive = 'A' + (long)newtListboxGetCurrent(listbox);
- newtFormDestroy(form);
- newtPopWindow();
- }
- else
-#endif
{
printf("Please select a drive\n");
char ch;
@@ -872,8 +633,7 @@ SISInstaller::uninstallFile(SISFileRecord* fileRecord)
#if 0
// This is messy... We can't remove the sis component unless
// we've stored the entire component in the residual sis
- // file no the target machine.
- //
+ // file on the target machine.
if (logLevel >= 1)
fprintf(stderr, "Recursive sis file...\n");
SISFile sisFile;
@@ -891,9 +651,6 @@ SISInstaller::uninstallFile(SISFileRecord* fileRecord)
}
SISInstaller installer;
installer.setPsion(m_psion);
-#if HAVE_LIBNEWT
- installer.useNewt(m_useNewt);
-#endif
installer.setInstalled(m_installed);
rc = installer.run(&sisFile, buf2, len, m_file);
if (0 == m_drive)
diff --git a/sisinstall/sisinstaller.h b/sisinstall/sisinstaller.h
index 493d839..28e110f 100644
--- a/sisinstall/sisinstaller.h
+++ b/sisinstall/sisinstaller.h
@@ -3,10 +3,6 @@
#include "sistypes.h"
-#if HAVE_LIBNEWT
-# include <newt.h>
-#endif
-
#include <sys/types.h>
class Psion;
@@ -50,16 +46,6 @@ public:
*/
void setPsion(Psion* psion);
-#if HAVE_LIBNEWT
- /**
- * Shall we do use feedback via newt?
- */
- void useNewt(bool usenewt)
- {
- m_useNewt = usenewt;
- }
-#endif
-
private:
char m_drive;
@@ -78,10 +64,6 @@ private:
bool m_ownInstalled;
-#if HAVE_LIBNEWT
- bool m_useNewt;
-#endif
-
enum {
FILE_OK,
FILE_SKIP,
diff --git a/sisinstall/sismain.cpp b/sisinstall/sismain.cpp
index c845408..479fbf8 100644
--- a/sisinstall/sismain.cpp
+++ b/sisinstall/sismain.cpp
@@ -13,28 +13,13 @@
#include <sys/types.h>
#include <sys/stat.h>
-#if HAVE_LIBNEWT
-# include <newt.h>
-#endif
-
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include <getopt.h>
-bool usenewt = false;
-
static void error(int line)
{
-#if HAVE_LIBNEWT
- if (usenewt)
- {
- newtPopHelpLine();
- newtPushHelpLine(_("Got an error, Press any key to exit."));
- newtWaitForKey();
- newtFinished();
- }
-#endif
fprintf(stderr, _("Error %d on line %d: %s\n"), errno, line,
strerror(errno));
exit(1);
@@ -45,9 +30,6 @@ static struct option opts[] = {
{ "version", no_argument, 0, 'V' },
{ "verbose", required_argument, 0, 'v' },
{ "dry-run", no_argument, 0, 'n' },
-#if HAVE_LIBNEWT
- { "newt", no_argument, 0, 'w' },
-#endif
{ NULL, 0, 0, 0 },
};
@@ -62,9 +44,6 @@ void printHelp()
" -V, --version Print version and exit.\n"
" -v, --verbose=LEVEL Set the verbosity level, by default 0.\n"
" -n, --dry-run Just parse the file.\n"
-#if HAVE_LIBNEWT
- " -w, --newt Use the Newt interface.\n"
-#endif
));
}
@@ -82,11 +61,7 @@ int main(int argc, char* argv[])
while (1)
{
option = getopt_long(argc, argv,
-#if HAVE_LIBNEWT
- "hnv:Vw"
-#else
"hnv:V"
-#endif
, opts, NULL);
if (option == -1)
break;
@@ -102,48 +77,19 @@ int main(int argc, char* argv[])
case 'n':
dryrun = true;
break;
-#if HAVE_LIBNEWT
- case 'w':
- usenewt = true;
- break;
-#endif
case 'V':
printf(_("sisinstall version 0.1\n"));
exit(0);
}
}
-#if HAVE_LIBNEWT
- if (usenewt)
- {
- newtInit();
- newtCls();
- }
-#endif
if (optind < argc)
{
filename = argv[optind];
-#if HAVE_LIBNEWT
- if (usenewt)
- {
- char helpline[256];
- sprintf(helpline,
- _("Installing sis file %s%s.\n"),
- filename,
- dryrun ? _(", not really") : "");
- newtPushHelpLine(helpline);
-// newtWaitForKey();
- }
- else
-#endif
- printf(_("Installing sis file %s%s.\n"), filename,
- dryrun ? _(", not really") : "");
+ printf(_("Installing sis file %s%s.\n"), filename,
+ dryrun ? _(", not really") : "");
}
else
{
-#if HAVE_LIBNEWT
- if (usenewt)
- newtFinished();
-#endif
fprintf(stderr, _("Missing SIS filename\n"));
exit(1);
}
@@ -180,9 +126,6 @@ int main(int argc, char* argv[])
{
SISInstaller installer;
installer.setPsion(psion);
-#if HAVE_LIBNEWT
- installer.useNewt(usenewt);
-#endif
installer.run(&sisFile, buf, len);
}
}
@@ -193,15 +136,6 @@ int main(int argc, char* argv[])
psion->disconnect();
}
-#if HAVE_LIBNEWT
- if (usenewt)
- {
- newtPopHelpLine();
- newtPushHelpLine(_("Installation complete. Press any key to exit."));
- newtWaitForKey();
- newtFinished();
- }
-#endif
return 0;
}