Browse Source

made kiss dietlibc-able (tested on powerpc)

git-svn-id: http://www.rocklinux.org/svn/rock-linux/trunk@1107 c5f82cb5-29bc-0310-9cd0-bff59a50e3bc
rocklinux
Rene Rebe 21 years ago
parent
commit
b374a54153
5 changed files with 139 additions and 13 deletions
  1. +69
    -0
      package/base/dietlibc/pkg_patch/pkg_kiss.patch
  2. +33
    -0
      package/base/kiss/hotfix.patch
  3. +2
    -13
      package/base/kiss/kiss.conf
  4. +1
    -0
      package/base/kiss/kiss.desc
  5. +34
    -0
      package/base/kiss/posix-fixes.patch

+ 69
- 0
package/base/dietlibc/pkg_patch/pkg_kiss.patch

@ -0,0 +1,69 @@
The dietlibc getcwd function does not (yet) support the GNU extension to
allocate the string on-the-fly. So we use some sub-optimal aolution and
additional checks. WAIT_ANY should also be added to the dietlibc ...
Rene Rebe <rene@rocklinux.org>
diff -ur kiss-0.21/src/getprompt.c src.kiss.-1.25906.3396530713/kiss-0.21/src/getprompt.c
--- kiss-0.21/getprompt.c 1998-09-25 14:07:10.000000000 +0200
+++ kiss-0.21/getprompt.c 2003-08-18 02:12:51.000000000 +0200
@@ -3,14 +3,14 @@
char *getprompt ()
{
register char
- *prompt,
- *cwd;
+ *prompt;
static char
- buf [LINELEN];
+ buf [LINELEN],
+ cwd [LINELEN];
char
twobuf [2] = { 0, 0 };
- cwd = getcwd (NULL, 0);
+ getcwd (cwd, LINELEN);
if (! flags.noenviron)
addtoenv ("PWD", cwd);
@@ -33,22 +33,22 @@
strcat (buf, username);
break;
case 'p':
- strcat (buf, cwd);
+ if (cwd)
+ strcat (buf, cwd);
break;
default:
- twobuf [0] = *prompt;
- strcat (buf, twobuf);
+ strcat (buf, prompt);
}
}
else
{
- twobuf [0] = *prompt;
+ twobuf [0] = *prompt;
strcat (buf, twobuf);
}
prompt++;
}
- free (cwd);
+ /*free (cwd);*/
return (buf);
}
diff -ur kiss-0.21/src/waitforchild.c src.kiss.-1.25906.3396530713/kiss-0.21/src/waitforchild.c
--- kiss-0.21/waitforchild.c 1998-09-25 14:07:10.000000000 +0200
+++ kiss-0.21/waitforchild.c 2003-08-17 23:16:10.000000000 +0200
@@ -31,7 +31,7 @@
reportstatus (childname, status, background);
/* let's see how generic kids are doing */
- while ( (pid = waitpid (WAIT_ANY, &status, WNOHANG)) > 0 )
+ while ( (pid = waitpid (-1, &status, WNOHANG)) > 0 )
{
sprintf (buf, "pid %d", pid);
reportstatus (buf, status, 1);

+ 33
- 0
package/base/kiss/hotfix.patch

@ -0,0 +1,33 @@
# --- ROCK-COPYRIGHT-NOTE-BEGIN ---
#
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
# Please add additional copyright information _after_ the line containing
# the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
# the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
#
# ROCK Linux: rock-src/package/base/kiss/kiss.conf
# ROCK Linux is Copyright (C) 1998 - 2003 Clifford Wolf
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version. A copy of the GNU General Public
# License can be found at Documentation/COPYING.
#
# Many people helped and are helping developing ROCK Linux. Please
# have a look at http://www.rocklinux.org/ and the Documentation/TEAM
# file for details.
#
# --- ROCK-COPYRIGHT-NOTE-END ---
--- ./doprintenv.c.old Fri Oct 24 20:39:28 1997
+++ ./doprintenv.c Tue May 26 09:49:34 1998
@@ -1,5 +1,7 @@
#include "kiss.h"
+extern char ** environ;
+
int doprintenv (Stringstack s)
{
register int

+ 2
- 13
package/base/kiss/kiss.conf

@ -20,26 +20,14 @@
#
# --- ROCK-COPYRIGHT-NOTE-END ---
main_kiss() {
echo "Extracting double-compressed kiss-$ver.tar.gz.bz2 ... "
bunzip2 -dc $archdir/kiss-$ver.tar.gz.bz2 > $builddir/kiss-$ver.tar.gz
tar -xzf $builddir/kiss-$ver.tar.gz
cd kiss-$ver/src
patch << EOP
--- doprintenv.c.old Fri Oct 24 20:39:28 1997
+++ doprintenv.c Tue May 26 09:49:34 1998
@@ -1,5 +1,7 @@
#include "kiss.h"
apply_patchfiles
+extern char ** environ;
+
int doprintenv (Stringstack s)
{
register int
EOP
eval "$MAKE CC="$CC" STDLFLAGS='-s -static' bkiss"
cp bkiss $root/bin/kiss
@ -50,3 +38,4 @@ EOP
custmain="main_kiss"
autoextract=0

+ 1
- 0
package/base/kiss/kiss.desc

@ -39,6 +39,7 @@
[A] Sven Van Den Steene <kiss@skynet.be> {Maintainer}
[M] Clifford Wolf <clifford@clifford.at>
[F] DIETLIBC
[C] base/tool
[L] GPL

+ 34
- 0
package/base/kiss/posix-fixes.patch

@ -0,0 +1,34 @@
This is mainly needed when used with dietlibc - but also more portable
and more secure.
Rene Rebe <rene@rocklinux.org>
diff -ur kiss-0.21/src/doread.c src.kiss.-1.25906.3396530713/kiss-0.21/src/doread.c
--- kiss-0.21/doread.c 1998-09-25 14:07:09.000000000 +0200
+++ kiss-0.21/doread.c 2003-08-17 23:54:10.000000000 +0200
@@ -17,11 +17,11 @@
for (cp = s.str [1]; *cp; cp++)
if (! isupper (*cp))
return (warning ("variable must be in upper case"));
- gets (buf);
+ fgets (buf, FILENAMELEN, stdin);
addtoenv (s.str [1], buf);
}
else
- gets (buf);
+ fgets (buf, FILENAMELEN, stdin);
return (0);
}
diff -ur kiss-0.21/src/runcmd.c src.kiss.-1.25906.3396530713/kiss-0.21/src/runcmd.c
--- kiss-0.21/runcmd.c 1998-09-25 14:07:10.000000000 +0200
+++ kiss-0.21/runcmd.c 2003-08-17 23:11:35.000000000 +0200
@@ -1,5 +1,7 @@
#include "kiss.h"
+#include <getopt.h>
+
/* define DEBUG_ONE_CMD to get one shot at gdb'ing the child process */
/* then make a -g version of the command to see and set a trace in the code */

Loading…
Cancel
Save