diff options
author | mrg <mrg@pkgsrc.org> | 2001-08-30 13:56:27 +0000 |
---|---|---|
committer | mrg <mrg@pkgsrc.org> | 2001-08-30 13:56:27 +0000 |
commit | 2e813f4a6fc8444f4508cab5e5ede4d6f795477f (patch) | |
tree | d02e78a7bed1b973679bf7443ac7d82587613f9c /shells | |
parent | 1c3e1f954cc2c8154317287377549417fec79e74 (diff) | |
download | pkgsrc-2e813f4a6fc8444f4508cab5e5ede4d6f795477f.tar.gz |
fix bash on sparc64; the patches are from Shin'ichiro TAYA <taya@ba2.so-net.ne.jp>,
tested by Martti Kuparinen <martti.kuparinen@iki.fi> and myself...
Diffstat (limited to 'shells')
-rw-r--r-- | shells/bash2/Makefile | 5 | ||||
-rw-r--r-- | shells/bash2/distinfo | 4 | ||||
-rw-r--r-- | shells/bash2/patches/patch-ac | 80 | ||||
-rw-r--r-- | shells/bash2/patches/patch-ad | 49 |
4 files changed, 135 insertions, 3 deletions
diff --git a/shells/bash2/Makefile b/shells/bash2/Makefile index 711c68d7c03..568b1062835 100644 --- a/shells/bash2/Makefile +++ b/shells/bash2/Makefile @@ -1,9 +1,10 @@ -# $NetBSD: Makefile,v 1.28 2001/08/04 06:58:23 jlam Exp $ +# $NetBSD: Makefile,v 1.29 2001/08/30 13:56:27 mrg Exp $ # V= 2.05 DV= 2.05 -DISTNAME= bash-${V} +DISTNAME= bash-${V} +PKGNAME= ${DISTNAME}nb1 CATEGORIES= shells MASTER_SITES= ${MASTER_SITE_GNU:=bash/} \ ftp://slc2.ins.cwru.edu/pub/dist/ diff --git a/shells/bash2/distinfo b/shells/bash2/distinfo index 19bb6d40d2d..c1d1eacfad1 100644 --- a/shells/bash2/distinfo +++ b/shells/bash2/distinfo @@ -1,8 +1,10 @@ -$NetBSD: distinfo,v 1.3 2001/08/04 06:58:23 jlam Exp $ +$NetBSD: distinfo,v 1.4 2001/08/30 13:56:27 mrg Exp $ SHA1 (bash-2.05.tar.gz) = 4418655ddc7bf6172f885bd3a54e7bfec77fec91 Size (bash-2.05.tar.gz) = 1792319 bytes SHA1 (bash-doc-2.05.tar.gz) = c07174e6f59730a925634a173541b4dbfcd5fdc1 Size (bash-doc-2.05.tar.gz) = 880715 bytes SHA1 (patch-ab) = ea7d1d5e063a839445cb4c7937ba79234a0596bf +SHA1 (patch-ac) = 41248ac10e116980aee59a790c73a71b91829e9e +SHA1 (patch-ad) = 5e3207818583a7c93a65ccebf6c77cfe5fd9be5a SHA1 (patch-ae) = f55a728f9f8ce8896a7097100de80db1d1cf752f diff --git a/shells/bash2/patches/patch-ac b/shells/bash2/patches/patch-ac new file mode 100644 index 00000000000..3818a702500 --- /dev/null +++ b/shells/bash2/patches/patch-ac @@ -0,0 +1,80 @@ +$NetBSD: patch-ac,v 1.5 2001/08/30 13:56:28 mrg Exp $ + +--- unwind_prot.c.orig Wed Feb 14 23:00:55 2001 ++++ unwind_prot.c Thu Aug 30 11:24:44 2001 +@@ -51,7 +51,7 @@ + points to this. */ + typedef struct { + int *variable; +- char *desired_setting; ++ UWP desired_setting; + int size; + } SAVED_VAR; + +@@ -280,8 +280,9 @@ + discard_saved_var (sv) + SAVED_VAR *sv; + { +- if (sv->size != sizeof (int)) +- free (sv->desired_setting); ++ if (sv->size != sizeof (int) && sv->size != sizeof (short) && ++ sv->size != sizeof (char *)) ++ free (sv->desired_setting.p); + free (sv); + } + +@@ -293,13 +294,16 @@ + restore_variable (sv) + SAVED_VAR *sv; + { +- if (sv->size != sizeof (int)) +- { +- FASTCOPY ((char *)sv->desired_setting, (char *)sv->variable, sv->size); +- free (sv->desired_setting); +- } +- else +- *(sv->variable) = (int)sv->desired_setting; ++ if (sv->size == sizeof (int)) ++ *(int *)(sv->variable) = sv->desired_setting.i; ++ else if (sv->size == sizeof (short)) ++ *(short *)(sv->variable) = sv->desired_setting.s; ++ else if (sv->size == sizeof (char *)) ++ *(char **)(sv->variable) = sv->desired_setting.p; ++ else { ++ FASTCOPY ((char *)sv->desired_setting.p, (char *)sv->variable, sv->size); ++ free (sv->desired_setting.p); ++ } + + free (sv); + } +@@ -312,19 +316,22 @@ + void + unwind_protect_var (var, value, size) + int *var; +- char *value; ++ UWP *value; + int size; + { + SAVED_VAR *s = (SAVED_VAR *)xmalloc (sizeof (SAVED_VAR)); + + s->variable = var; +- if (size != sizeof (int)) +- { +- s->desired_setting = (char *)xmalloc (size); +- FASTCOPY (value, (char *)s->desired_setting, size); +- } +- else +- s->desired_setting = value; ++ if (size == sizeof (int)) { ++ s->desired_setting.i = value->i; ++ } else if (size == sizeof (short)) { ++ s->desired_setting.s = value->s; ++ } else if (size == sizeof (char *)) { ++ s->desired_setting.p = value->p; ++ } else { ++ s->desired_setting.p = (char *)xmalloc (size); ++ FASTCOPY (value, (char *)s->desired_setting.p, size); ++ } + s->size = size; + add_unwind_protect ((Function *)restore_variable, (char *)s); + } diff --git a/shells/bash2/patches/patch-ad b/shells/bash2/patches/patch-ad new file mode 100644 index 00000000000..ea7dfad5d61 --- /dev/null +++ b/shells/bash2/patches/patch-ad @@ -0,0 +1,49 @@ +$NetBSD: patch-ad,v 1.1 2001/08/30 13:56:28 mrg Exp $ + +--- unwind_prot.h.orig Thu Feb 1 19:51:00 2001 ++++ unwind_prot.h Thu Aug 30 11:24:44 2001 +@@ -34,8 +34,9 @@ + /* Try to force correct alignment on machines where pointers and ints + differ in size. */ + typedef union { +- char *s; ++ char *p; + int i; ++ int s; + } UWP; + + /* Define for people who like their code to look a certain way. */ +@@ -47,18 +48,28 @@ + { \ + UWP u; \ + u.i = (X); \ +- unwind_protect_var (&(X), u.s, sizeof (int)); \ ++ unwind_protect_var (&(X), &u, sizeof (int)); \ + } \ + while (0) + + #define unwind_protect_short(X) \ +- unwind_protect_var ((int *)&(X), (char *)&(X), sizeof (short)) ++ do \ ++ { \ ++ UWP u; \ ++ u.i = (X); \ ++ unwind_protect_var (&(X), &u, sizeof (int)); \ ++ } \ ++ while (0) + + /* How to protect a pointer to a string. */ + #define unwind_protect_string(X) \ +- unwind_protect_var ((int *)&(X), \ +- ((sizeof (char *) == sizeof (int)) ? (char *) (X) : (char *) &(X)), \ +- sizeof (char *)) ++ do \ ++ { \ ++ UWP u; \ ++ u.p = (X); \ ++ unwind_protect_var (&(X), &u, sizeof (char *)); \ ++ } \ ++ while (0) + + /* How to protect any old pointer. */ + #define unwind_protect_pointer(X) unwind_protect_string (X) |